Class PredicateTransition


public final class PredicateTransition extends AbstractPredicateTransition
TODO: this is old comment: A tree of semantic predicates from the grammar AST if label==SEMPRED. In the ATN, labels will always be exactly one predicate, but the DFA may have to combine a bunch of them as it collects predicates from multiple ATN configurations into a single DFA state.
  • Field Details

    • ruleIndex

      public final int ruleIndex
    • predIndex

      public final int predIndex
    • isCtxDependent

      public final boolean isCtxDependent
  • Constructor Details

    • PredicateTransition

      public PredicateTransition(ATNState target, int ruleIndex, int predIndex, boolean isCtxDependent)
  • Method Details

    • getSerializationType

      public int getSerializationType()
      Specified by:
      getSerializationType in class Transition
    • isEpsilon

      public boolean isEpsilon()
      Description copied from class: Transition
      Determines if the transition is an "epsilon" transition.

      The default implementation returns false.

      Overrides:
      isEpsilon in class Transition
      Returns:
      true if traversing this transition in the ATN does not consume an input symbol; otherwise, false if traversing this transition consumes (matches) an input symbol.
    • matches

      public boolean matches(int symbol, int minVocabSymbol, int maxVocabSymbol)
      Specified by:
      matches in class Transition
    • getPredicate

      public SemanticContext.Predicate getPredicate()
    • toString

      public String toString()
      Overrides:
      toString in class Object