public class State
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static State |
L0 |
int |
position |
RightHandSide |
rhs |
Rule |
rule |
NonterminalSymbol |
symbol |
Modifier and Type | Method and Description |
---|---|
State |
advance()
Get a new state with the position advanced by one
|
boolean |
completed()
Are we finished with this symbol?
|
boolean |
equals(java.lang.Object obj) |
Descriptor |
getDescriptor(int k,
int i) |
java.util.Set<Symbol> |
getFirst(ParserGrammar grammar) |
int |
getPosition()
Get the current position in this state
|
RightHandSide |
getRhs()
Get the list of symbols that define this state's nonterminal symbol.
|
Rule |
getRule()
Get the rule that originated this state.
|
NonterminalSymbol |
getSymbol()
Get the nonterminal associated with this state
|
int |
hashCode() |
Symbol |
nextSymbol()
Get the next symbol
|
Symbol |
prevSymbol() |
java.lang.String |
toString() |
public static final State L0
public final Rule rule
public final NonterminalSymbol symbol
public final int position
public final RightHandSide rhs
public Symbol nextSymbol()
If the state has more symbols, return the symbol that occurs after the current position.
public Symbol prevSymbol()
public Descriptor getDescriptor(int k, int i)
public NonterminalSymbol getSymbol()
public Rule getRule()
public RightHandSide getRhs()
public int getPosition()
public State advance()
ParseException
- if an attempt is made to advance a completed statepublic boolean completed()
public java.util.Set<Symbol> getFirst(ParserGrammar grammar)
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object