org.antlr.analysis
Class Transition

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

public class Transition
extends java.lang.Object
implements java.lang.Comparable

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 Summary
 Label label
          What label must be consumed to transition to target
 State target
          The target of this transition
 
Constructor Summary
Transition(int label, State target)
           
Transition(Label label, State target)
           
 
Method Summary
 int compareTo(java.lang.Object o)
           
 boolean equals(java.lang.Object o)
           
 int hashCode()
           
 boolean isEpsilon()
           
 boolean isSemanticPredicate()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

label

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


target

public State target
The target of this transition

Constructor Detail

Transition

public Transition(Label label,
                  State target)

Transition

public Transition(int label,
                  State target)
Method Detail

isEpsilon

public boolean isEpsilon()

isSemanticPredicate

public boolean isSemanticPredicate()

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

compareTo

public int compareTo(java.lang.Object o)
Specified by:
compareTo in interface java.lang.Comparable

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object