| fri.patterns.interpreter.parsergenerator.ParserTables
All known Subclasses: fri.patterns.interpreter.parsergenerator.parsertables.AbstractParserTables,
ParserTables | public interface ParserTables (Code) | | Responsibilities of (bottom-up) parser tables, that must provide:
- all terminals, without EPSILON (for the Lexer)
- the syntax
- the follow-state from the GOTO-table
- the follow action from the PARSE-ACTION-table
- a list of expected terminals
author: (c) 2000, Fritz Ritzberger |
Field Summary | |
final public static Integer | ACCEPT Special symbol occuring in a parser table, 0, means: syntax was correct when coming to that cell. | final public static Integer | ERROR Special symbol occuring in a parser table, -1, means: error when coming to that cell. | final public static Integer | SHIFT Special symbol occuring in a parser table, -2, means: read next token. |
Method Summary | |
public void | dump(PrintStream out) Dumps rules, GOTO-table, PARSE-ACTION-table, FIRST and FOLLOW sets, ... | public Map | getExpected(Integer state) The keySet of returned Map contains all expected terminals for the current state. | public Integer | getGotoState(Integer currentState, String symbol) Returns the next state from the GOTO-table, for a given state and a received terminal or nonterminal. | public Integer | getParseAction(Integer currentState, String terminal) Returns the action from the PARSE-ACTION-table, for a given state and received terminal. | public Syntax | getSyntax() Returns the input syntax. | public List | getTerminals() Returns the List of treminals, without EPSILON. |
ACCEPT | final public static Integer ACCEPT(Code) | | Special symbol occuring in a parser table, 0, means: syntax was correct when coming to that cell.
|
ERROR | final public static Integer ERROR(Code) | | Special symbol occuring in a parser table, -1, means: error when coming to that cell.
|
SHIFT | final public static Integer SHIFT(Code) | | Special symbol occuring in a parser table, -2, means: read next token.
|
dump | public void dump(PrintStream out)(Code) | | Dumps rules, GOTO-table, PARSE-ACTION-table, FIRST and FOLLOW sets, ...
|
getExpected | public Map getExpected(Integer state)(Code) | | The keySet of returned Map contains all expected terminals for the current state.
These can be used as Lexer hints.
|
getGotoState | public Integer getGotoState(Integer currentState, String symbol)(Code) | | Returns the next state from the GOTO-table, for a given state and a received terminal or nonterminal.
Parameters: currentState - the current parser state Parameters: symbol - recently received terminal or nonterminal new parser state |
getParseAction | public Integer getParseAction(Integer currentState, String terminal)(Code) | | Returns the action from the PARSE-ACTION-table, for a given state and received terminal.
fuer einen gegebenen Zustand und ein Terminal.
Parameters: currentState - the current parser state Parameters: terminal - recently received terminal new action to proceed, SHIFT, ACCEPT, ERROR, or anything above zero, meaning REDUCE. |
getSyntax | public Syntax getSyntax()(Code) | | Returns the input syntax.
|
getTerminals | public List getTerminals()(Code) | | Returns the List of treminals, without EPSILON.
|
|
|