#include <TreeParser.hpp>
Public Member Functions | |
TreeParser () | |
TreeParser (const TreeParserSharedInputState &state) | |
virtual | ~TreeParser () |
virtual RefAST | getAST ()=0 |
Get the AST return value squirreled away in the parser. | |
virtual void | match (RefAST t, const BitSet &b) |
virtual void | setASTFactory (ASTFactory *factory) |
virtual ASTFactory * | getASTFactory () const |
Return pointer to ASTFactory. | |
virtual const char * | getTokenName (int num) const =0 |
Get the name for token 'num'. | |
virtual int | getNumTokens () const =0 |
Return the number of tokens defined. | |
virtual const char *const * | getTokenNames () const =0 |
Return an array of getNumTokens() token names. | |
virtual void | reportError (const RecognitionException &ex) |
Parser error-reporting function can be overridden in subclass. | |
virtual void | reportError (const ANTLR_USE_NAMESPACE(std) string &s) |
Parser error-reporting function can be overridden in subclass. | |
virtual void | reportWarning (const ANTLR_USE_NAMESPACE(std) string &s) |
Parser warning-reporting function can be overridden in subclass. | |
virtual void | traceIndent () |
These are used during when traceTreeParser commandline option is passed. | |
virtual void | traceIn (const char *rname, RefAST t) |
virtual void | traceOut (const char *rname, RefAST t) |
Static Public Attributes | |
static RefAST | ASTNULL |
Protected Member Functions | |
virtual void | match (RefAST t, int ttype) |
virtual void | matchNot (RefAST t, int ttype) |
Protected Attributes | |
ASTFactory * | astFactory |
TreeParserSharedInputState | inputState |
The input state of this tree parser. | |
int | traceDepth |
Private Member Functions | |
TreeParser (const TreeParser &other) | |
TreeParser & | operator= (const TreeParser &other) |
Data Structures | |
class | Tracer |
Definition at line 23 of file TreeParser.hpp.
TreeParser::TreeParser | ( | ) | [inline] |
Definition at line 25 of file TreeParser.hpp.
TreeParser::TreeParser | ( | const TreeParserSharedInputState & | state | ) | [inline] |
Definition at line 32 of file TreeParser.hpp.
virtual TreeParser::~TreeParser | ( | ) | [inline, virtual] |
Definition at line 39 of file TreeParser.hpp.
TreeParser::TreeParser | ( | const TreeParser & | other | ) | [private] |
virtual RefAST TreeParser::getAST | ( | ) | [pure virtual] |
Get the AST return value squirreled away in the parser.
Make sure current lookahead symbol matches the given set Throw an exception upon mismatch, which is caught by either the error handler or by a syntactic predicate.
Definition at line 50 of file TreeParser.hpp.
References BitSet::member().
virtual void TreeParser::setASTFactory | ( | ASTFactory * | factory | ) | [inline, virtual] |
Specify the AST factory to be used during tree building. (Compulsory) Setting the factory is compulsory (if you intend to modify the tree in the treeparser). The AST Factory is shared between parser (who builds the initial AST) and treeparser.
Definition at line 63 of file TreeParser.hpp.
virtual ASTFactory* TreeParser::getASTFactory | ( | ) | const [inline, virtual] |
virtual const char* TreeParser::getTokenName | ( | int | num | ) | const [pure virtual] |
Get the name for token 'num'.
virtual int TreeParser::getNumTokens | ( | ) | const [pure virtual] |
Return the number of tokens defined.
virtual const char* const* TreeParser::getTokenNames | ( | ) | const [pure virtual] |
Return an array of getNumTokens() token names.
virtual void TreeParser::reportError | ( | const RecognitionException & | ex | ) | [virtual] |
Parser error-reporting function can be overridden in subclass.
virtual void TreeParser::reportError | ( | const ANTLR_USE_NAMESPACE(std) string & | s | ) | [virtual] |
Parser error-reporting function can be overridden in subclass.
virtual void TreeParser::reportWarning | ( | const ANTLR_USE_NAMESPACE(std) string & | s | ) | [virtual] |
Parser warning-reporting function can be overridden in subclass.
virtual void TreeParser::traceIndent | ( | ) | [virtual] |
These are used during when traceTreeParser commandline option is passed.
virtual void TreeParser::traceIn | ( | const char * | rname, | |
RefAST | t | |||
) | [virtual] |
virtual void TreeParser::traceOut | ( | const char * | rname, | |
RefAST | t | |||
) | [virtual] |
virtual void TreeParser::match | ( | RefAST | t, | |
int | ttype | |||
) | [inline, protected, virtual] |
Definition at line 99 of file TreeParser.hpp.
virtual void TreeParser::matchNot | ( | RefAST | t, | |
int | ttype | |||
) | [inline, protected, virtual] |
Definition at line 106 of file TreeParser.hpp.
TreeParser& TreeParser::operator= | ( | const TreeParser & | other | ) | [private] |
RefAST TreeParser::ASTNULL [static] |
The AST Null object; the parsing cursor is set to this when it is found to be null. This way, we can test the token type of a node without having to have tests for 0 everywhere.
Definition at line 96 of file TreeParser.hpp.
ASTFactory* TreeParser::astFactory [protected] |
AST support code; parser and treeparser delegate to this object
Definition at line 114 of file TreeParser.hpp.
TreeParserSharedInputState TreeParser::inputState [protected] |
int TreeParser::traceDepth [protected] |
Used to keep track of indent depth with -traceTreeParser
Definition at line 120 of file TreeParser.hpp.