|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.inxar.syntacs.grammar.context_free.CFNonTerminal
Standard NonTerminal
implementation.
Method Summary | |
boolean |
equals(Object other)
|
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 . |
IntArray |
getProductionItems()
Returns the set of Item ID's which mention this NonTerminal as an IntArray . |
IntArray |
getReductions()
Returns an IntArray of Productions
which have this NonTerminal as the left hand side. |
int |
hashCode()
Since we assume that nonTerminals have unique ID's, we base the hashCode solely upon this (also equals()). |
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). |
String |
toString()
|
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
public int getID()
GrammarSymbol
GrammarSymbol
.getID
in interface GrammarSymbol
public String getName()
GrammarSymbol
GrammarSymbol
.getName
in interface GrammarSymbol
public boolean isTerminal()
GrammarSymbol
true
if this GrammarSymbol
is
an instanceof Terminal
and may safely be cast to a
Terminal
(or vice versa).isTerminal
in interface GrammarSymbol
public IntArray getProductionItems()
NonTerminal
NonTerminal
as an IntArray
. This is
useful in the calculation of follow sets. Each member in the
array corresponds to the ID of an Item
[ a
dot b ] where a is equal to this
NonTerminal
.getProductionItems
in interface NonTerminal
public IntArray getReductions()
NonTerminal
IntArray
of Productions
which have this NonTerminal
as the left hand side.getReductions
in interface NonTerminal
public IntSet getFirstSet()
GrammarSymbol
IntSet
Of terminal
s that is
the first set for this GrammarSymbol
.getFirstSet
in interface GrammarSymbol
public boolean isNullable()
GrammarSymbol
true
if this item either is
Epsilon
(case of Terminal
) or derives
it (case of NonTerminal
).isNullable
in interface GrammarSymbol
public String toString()
toString
in class Object
public int hashCode()
hashCode
in class Object
public boolean equals(Object other)
equals
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |