|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
GrammarSymbol
is the base interface for
Terminal
s and NonTerminal
s. Each
GrammarSymbol
has a name and is capable of determining
its first set and its nullable
status. The
isTerminal()
method is provided as an alternative for
the instanceof
operator. This is syntactically more
readable (my opinion) and empirically faster.
Method Summary | |
IntSet |
getFirstSet()
Computes the IntSet Of terminal s that is
the first set for this GrammarSymbol . |
int |
getID()
The globally assigned integer identifier for this GrammarSymbol . |
String |
getName()
The common name of the GrammarSymbol . |
boolean |
isNullable()
Returns true if this item either is
Epsilon (case of Terminal ) or derives
it (case of NonTerminal ). |
boolean |
isTerminal()
Returns true if this GrammarSymbol is
an instanceof Terminal and may safely be cast to a
Terminal (or vice versa). |
Method Detail |
public int getID()
GrammarSymbol
.public String getName()
GrammarSymbol
.public boolean isNullable()
true
if this item either is
Epsilon
(case of Terminal
) or derives
it (case of NonTerminal
).public boolean isTerminal()
true
if this GrammarSymbol
is
an instanceof Terminal
and may safely be cast to a
Terminal
(or vice versa).public IntSet getFirstSet()
IntSet
Of terminal
s that is
the first set for this GrammarSymbol
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |