|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Responsibilities of (bottom-up) parser tables, that must provide:
Field Summary | |
static java.lang.Integer |
ACCEPT
Special symbol occuring in a parser table, 0, means: syntax was correct when coming to that cell. |
static java.lang.Integer |
ERROR
Special symbol occuring in a parser table, -1, means: error when coming to that cell. |
static java.lang.Integer |
SHIFT
Special symbol occuring in a parser table, -2, means: read next token. |
Method Summary | |
void |
dump(java.io.PrintStream out)
Dumps rules, GOTO-table, PARSE-ACTION-table, FIRST and FOLLOW sets, ... |
java.util.Map |
getExpected(java.lang.Integer state)
The keySet of returned Map contains all expected terminals for the current state. |
java.lang.Integer |
getGotoState(java.lang.Integer currentState,
java.lang.String symbol)
Returns the next state from the GOTO-table, for a given state and a received terminal or nonterminal. |
java.lang.Integer |
getParseAction(java.lang.Integer currentState,
java.lang.String terminal)
Returns the action from the PARSE-ACTION-table, for a given state and received terminal. |
Syntax |
getSyntax()
Returns the input syntax. |
java.util.List |
getTerminals()
Returns the List of treminals, without EPSILON. |
Field Detail |
public static final java.lang.Integer ACCEPT
public static final java.lang.Integer ERROR
public static final java.lang.Integer SHIFT
Method Detail |
public java.lang.Integer getGotoState(java.lang.Integer currentState, java.lang.String symbol)
currentState
- the current parser statesymbol
- recently received terminal or nonterminal
public java.lang.Integer getParseAction(java.lang.Integer currentState, java.lang.String terminal)
currentState
- the current parser stateterminal
- recently received terminal
public java.util.List getTerminals()
public Syntax getSyntax()
public void dump(java.io.PrintStream out)
public java.util.Map getExpected(java.lang.Integer state)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |