Class Transition

java.lang.Object
org.antlr.analysis.Transition
All Implemented Interfaces:
Comparable<Transition>
Direct Known Subclasses:
RuleClosureTransition

public class Transition extends Object implements Comparable<Transition>
A generic transition between any two state machine states. It defines some special labels that indicate things like epsilon transitions and that the label is actually a set of labels or a semantic predicate. This is a one way link. It emanates from a state (usually via a list of transitions) and has a label/target pair. I have abstracted the notion of a Label to handle the various kinds of things it can be.
  • Field Details

    • label

      public Label label
      What label must be consumed to transition to target
    • target

      public State target
      The target of this transition
  • Constructor Details

    • Transition

      public Transition(Label label, State target)
    • Transition

      public Transition(int label, State target)
  • Method Details

    • isEpsilon

      public boolean isEpsilon()
    • isAction

      public boolean isAction()
    • isSemanticPredicate

      public boolean isSemanticPredicate()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • compareTo

      public int compareTo(Transition other)
      Specified by:
      compareTo in interface Comparable<Transition>
    • toString

      public String toString()
      Overrides:
      toString in class Object