|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.antlr.analysis.Label
public class Label
A state machine transition label. A label can be either a simple label such as a token or character. A label can be a set of char or tokens. It can be an epsilon transition. It can be a semantic predicate (which assumes an epsilon transition) or a tree of predicates (in a DFA).
Field Summary | |
---|---|
static int |
ACTION
|
static int |
DOWN
|
static int |
EOF
|
static int |
EOR_TOKEN_TYPE
End of rule token type; imaginary token type used only for local, partial FOLLOW sets to indicate that the local FOLLOW hit the end of rule. |
static int |
EOT
End of Token is like EOF for lexer rules. |
static int |
EPSILON
|
static java.lang.String |
EPSILON_STR
|
static int |
INVALID
|
protected int |
label
The token type or character value; or, signifies special label. |
protected IntSet |
labelSet
A set of token types or character codes if label==SET |
static int |
MAX_CHAR_VALUE
|
static int |
MIN_ATOM_VALUE
Anything at this value or larger can be considered a simple atom int for easy comparison during analysis only; faux labels are not used during parse time for real token types or char values. |
static int |
MIN_CHAR_VALUE
|
static int |
MIN_TOKEN_TYPE
tokens and char range overlap; tokens are MIN_TOKEN_TYPE..n |
static int |
NUM_FAUX_LABELS
We have labels like EPSILON that are below 0; it's hard to store them in an array with negative index so use this constant as an index shift when accessing arrays based upon token type. |
static int |
SEMPRED
label is a semantic predicate; implies label is epsilon also |
static int |
SET
label is a set of tokens or char |
static int |
UP
|
Constructor Summary | |
---|---|
Label(int label)
|
|
Label(IntSet labelSet)
Make a set label |
Method Summary | |
---|---|
void |
add(Label a)
|
java.lang.Object |
clone()
|
int |
compareTo(java.lang.Object o)
|
boolean |
equals(java.lang.Object o)
|
int |
getAtom()
return the single atom label or INVALID if not a single atom |
SemanticContext |
getSemanticContext()
|
IntSet |
getSet()
|
int |
hashCode()
|
static boolean |
intersect(Label label,
Label edgeLabel)
|
boolean |
isAction()
|
boolean |
isAtom()
|
boolean |
isEpsilon()
|
boolean |
isSemanticPredicate()
|
boolean |
isSet()
|
boolean |
matches(int atom)
|
boolean |
matches(IntSet set)
|
boolean |
matches(Label other)
|
void |
setSet(IntSet set)
|
java.lang.String |
toString()
Predicates are lists of AST nodes from the NFA created from the grammar, but the same predicate could be cut/paste into multiple places in the grammar. |
java.lang.String |
toString(Grammar g)
|
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int INVALID
public static final int ACTION
public static final int EPSILON
public static final java.lang.String EPSILON_STR
public static final int SEMPRED
public static final int SET
public static final int EOT
public static final int EOF
public static final int NUM_FAUX_LABELS
public static final int MIN_ATOM_VALUE
public static final int MIN_CHAR_VALUE
public static final int MAX_CHAR_VALUE
public static final int EOR_TOKEN_TYPE
public static final int DOWN
public static final int UP
public static final int MIN_TOKEN_TYPE
protected int label
protected IntSet labelSet
Constructor Detail |
---|
public Label(int label)
public Label(IntSet labelSet)
Method Detail |
---|
public java.lang.Object clone()
clone
in class java.lang.Object
public void add(Label a)
public boolean isAtom()
public boolean isEpsilon()
public boolean isSemanticPredicate()
public boolean isAction()
public boolean isSet()
public int getAtom()
public IntSet getSet()
public void setSet(IntSet set)
public SemanticContext getSemanticContext()
public boolean matches(int atom)
public boolean matches(IntSet set)
public boolean matches(Label other)
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(Grammar g)
public static boolean intersect(Label label, Label edgeLabel)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |