Class StackPrinter.FollowSet

Enclosing class:
StackPrinter

protected static class StackPrinter.FollowSet extends SinglePhase_rt
Single-use tool to find all sub-expressions of the current content model which are allowed to enter as next input in the current parsing situation. Operates for a certain State_singleton, which represents an element definition and its contents model. The total parsing state is realized by the stack frames "above" this State_singleton: (a) by index positions in a State_sequ, (b) by the "check list" in a State_perm. The collected set is used for highlighting in error message stack frame prints. It can be used to show the correct alternatives to some erroneous input.
  • Field Details

    • result

      protected Set<Expression> result
      The result to return.
    • epsilonRefence

      public static final Reference epsilonRefence
      Pseudo-reference to mark empty content.
    • empty

      public static final Set<Expression> empty
      Empty result set
  • Constructor Details

    • FollowSet

      protected FollowSet()
  • Method Details

    • calculate

      public Set<Expression> calculate(State state)
      Central service method: calculate the result.
    • action

      public void action(State_rep state)
      Add the allowed input for this parsing state to the result set.
      Overrides:
      action in class SinglePhase_rt
    • action

      public void action(State_sequ state)
      Extract all first-tags of the suffix of the sequence, starting after the current position.
      Overrides:
      action in class SinglePhase_rt
    • action

      public void action(State_perm permstate)
      Extract all first-tags of all sub-expresions, which have not been used yet.
      Overrides:
      action in class SinglePhase_rt