AnnotationParser Class Reference
Public Member Functions | |
| AnnotationParser (const std::list< Token * > &tokens) | |
Protected Member Functions | |
| virtual Token * | nextToken () |
Called within parse() to provide the next token for parsing. | |
| virtual void | expandParseTree (const int productionID, const std::vector< Parser::ParserSymbol * > &reductionBody) |
| virtual ParserAction * | action (const int state, const int realSymbolID) const |
| Action-Table for this parser. | |
| virtual ProductionStub * | findProduction (const int productionID) const |
| Returns a ProductionStub which is consists of the ID of the head symbol and the IDs of the symbol from the body. | |
| virtual int | gotoState (const int state, const int symbol) const |
| Goto-Table for this parser. | |
| virtual std::string | symbolID2String (const int symbolID) const |
| Returns the corresponding lexeme for the symbol with the given ID if such a symbol exists. | |
Detailed Description
Definition at line 39 of file annotationparser.h.
Member Function Documentation
| ParserAction * action | ( | const int | state, | |
| const int | symbol | |||
| ) | const [protected, virtual] |
Action-Table for this parser.
The caller has to delete the returned object using C++ delete-operator.
Implements Parser.
Definition at line 163 of file annotationparser.cpp.
| ProductionStub * findProduction | ( | const int | productionID | ) | const [protected, virtual] |
Returns a ProductionStub which is consists of the ID of the head symbol and the IDs of the symbol from the body.
The production stub is used to check integrity while reducing the states-stack.
This method is called by Parser::reduce() and calls expandParseTree() itself.
Implements Parser.
Definition at line 689 of file annotationparser.cpp.
| int gotoState | ( | const int | state, | |
| const int | symbol | |||
| ) | const [protected, virtual] |
Goto-Table for this parser.
Determines the transition for the parser's state according to the given state and the symbol (the symbol ID to be more precise).
Implements Parser.
Definition at line 592 of file annotationparser.cpp.
| Token * nextToken | ( | ) | [protected, virtual] |
Called within parse() to provide the next token for parsing.
The default implementation takes the next token from the lexer. If the returned token is NULL, the parser will stop parsing after it has performed all possible reductions left.
Reimplemented from Parser.
Definition at line 53 of file annotationparser.cpp.
| std::string symbolID2String | ( | const int | symbolID | ) | const [protected, virtual] |
Returns the corresponding lexeme for the symbol with the given ID if such a symbol exists.
Otherwise the returned string is empty.
Implements Parser.
Definition at line 786 of file annotationparser.cpp.