TreeParser Class Reference
#include <TreeParser.hpp>
Inheritance diagram for TreeParser:


Public Member Functions | |
TreeParser () | |
TreeParser (const TreeParserSharedInputState &state) | |
virtual | ~TreeParser () |
RefAST | getAST () const |
Get the AST return value squirreled away in the parser. | |
virtual void | match (RefAST t, const BitSet &b) |
Make sure current lookahead symbol matches the given set Throw an exception upon mismatch, which is catch by either the error handler or by the syntactic predicate. | |
virtual void | setASTFactory (ASTFactory *factory) |
Specify the AST factory to be used during tree building. | |
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 |
virtual void | reportError (const RecognitionException &ex) |
Parser error-reporting function can be overridden in subclass. | |
virtual void | reportError (const std::string &s) |
Parser error-reporting function can be overridden in subclass. | |
virtual void | reportWarning (const 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) |
TreeParser () | |
virtual | ~TreeParser () |
virtual void | parseTranslationUnit (TranslationUnitAST *) |
virtual void | parseDeclaration (DeclarationAST *) |
virtual void | parseLinkageSpecification (LinkageSpecificationAST *) |
virtual void | parseNamespace (NamespaceAST *) |
virtual void | parseNamespaceAlias (NamespaceAliasAST *) |
virtual void | parseUsing (UsingAST *) |
virtual void | parseUsingDirective (UsingDirectiveAST *) |
virtual void | parseTypedef (TypedefAST *) |
virtual void | parseTemplateDeclaration (TemplateDeclarationAST *) |
virtual void | parseSimpleDeclaration (SimpleDeclarationAST *) |
virtual void | parseFunctionDefinition (FunctionDefinitionAST *) |
virtual void | parseLinkageBody (LinkageBodyAST *) |
virtual void | parseAccessDeclaration (AccessDeclarationAST *) |
virtual void | parseTypeSpecifier (TypeSpecifierAST *) |
virtual void | parseClassSpecifier (ClassSpecifierAST *) |
virtual void | parseEnumSpecifier (EnumSpecifierAST *) |
virtual void | parseElaboratedTypeSpecifier (ElaboratedTypeSpecifierAST *) |
Static Public Member Functions | |
void | panic () |
Give panic message and exit the program. can be overridden in subclass. | |
Static Public Attributes | |
RefAST | ASTNULL |
The AST Null object; the parsing cursor is set to this when it is found to be null. | |
Protected Member Functions | |
virtual void | match (RefAST t, int ttype) |
Get the AST return value squirreled away in the parser. | |
virtual void | matchNot (RefAST t, int ttype) |
Protected Attributes | |
RefAST | _retTree |
Where did this rule leave off parsing; avoids a return parameter. | |
RefAST | returnAST |
AST return value for a rule is squirreled away here. | |
ASTFactory * | astFactory |
AST support code; parser and treeparser delegate to this object. | |
TreeParserSharedInputState | inputState |
The input state of this tree parser. | |
int | traceDepth |
Used to keep track of indent depth with -traceTreeParser. | |
Private Member Functions | |
TreeParser (const TreeParser &other) | |
TreeParser & | operator= (const TreeParser &other) |
TreeParser (const TreeParser &source) | |
void | operator= (const TreeParser &source) |
Constructor & Destructor Documentation
|
Definition at line 20 of file TreeParser.cpp. |
|
Definition at line 25 of file TreeParser.cpp. References TreeParserSharedInputState. |
|
Definition at line 30 of file TreeParser.cpp. |
|
|
|
|
|
|
|
|
Member Function Documentation
|
Get the AST return value squirreled away in the parser.
Definition at line 29 of file TreeParser.hpp. References RefAST. |
|
Return pointer to ASTFactory.
Definition at line 51 of file TreeParser.hpp. |
|
|
|
Get the name for token 'num'.
|
|
Get the AST return value squirreled away in the parser.
Definition at line 46 of file TreeParser.cpp. |
|
Make sure current lookahead symbol matches the given set Throw an exception upon mismatch, which is catch by either the error handler or by the syntactic predicate.
Definition at line 56 of file TreeParser.cpp. References ASTNULL, BitSet::member(), and RefAST. |
|
Definition at line 63 of file TreeParser.cpp. |
|
|
|
|
|
Give panic message and exit the program. can be overridden in subclass.
Definition at line 71 of file TreeParser.cpp. References ANTLR_USE_NAMESPACE. |
|
Reimplemented in StoreWalker, and TagCreator. Definition at line 202 of file tree_parser.cpp. Referenced by parseDeclaration(). |
|
Reimplemented in StoreWalker, and TagCreator. Definition at line 181 of file tree_parser.cpp. References ClassSpecifierAST::declarationList(), and parseDeclaration(). Referenced by TagCreator::parseClassSpecifier(), StoreWalker::parseClassSpecifier(), ComputeRecoveryPoints::parseClassSpecifier(), and parseTypeSpecifier(). |
|
|
Reimplemented in StoreWalker, and TagCreator. Definition at line 196 of file tree_parser.cpp. Referenced by TagCreator::parseElaboratedTypeSpecifier(), StoreWalker::parseElaboratedTypeSpecifier(), and parseTypeSpecifier(). |
|
Reimplemented in StoreWalker, and TagCreator. Definition at line 190 of file tree_parser.cpp. Referenced by TagCreator::parseEnumSpecifier(), and parseTypeSpecifier(). |
|
Reimplemented in StoreWalker, and TagCreator. Definition at line 147 of file tree_parser.cpp. Referenced by parseDeclaration(). |
|
Reimplemented in StoreWalker, and TagCreator. Definition at line 153 of file tree_parser.cpp. References LinkageBodyAST::declarationList(), and parseDeclaration(). Referenced by StoreWalker::parseLinkageBody(), parseLinkageSpecification(), and parseNamespace(). |
|
Reimplemented in StoreWalker. Definition at line 94 of file tree_parser.cpp. References LinkageSpecificationAST::declaration(), LinkageSpecificationAST::linkageBody(), parseDeclaration(), and parseLinkageBody(). Referenced by parseDeclaration(), and StoreWalker::parseLinkageSpecification(). |
|
Reimplemented in StoreWalker, and TagCreator. Definition at line 103 of file tree_parser.cpp. References NamespaceAST::linkageBody(), and parseLinkageBody(). Referenced by parseDeclaration(), TagCreator::parseNamespace(), StoreWalker::parseNamespace(), and ComputeRecoveryPoints::parseNamespace(). |
|
Reimplemented in StoreWalker. Definition at line 110 of file tree_parser.cpp. Referenced by parseDeclaration(), and StoreWalker::parseNamespaceAlias(). |
|
Reimplemented in StoreWalker, and TagCreator. Definition at line 141 of file tree_parser.cpp. Referenced by parseDeclaration(), and ComputeRecoveryPoints::parseSimpleDeclaration(). |
|
Reimplemented in StoreWalker, and TagCreator. Definition at line 135 of file tree_parser.cpp. Referenced by parseDeclaration(), TagCreator::parseTemplateDeclaration(), and StoreWalker::parseTemplateDeclaration(). |
|
Reimplemented in StoreWalker, and TagCreator. Definition at line 31 of file tree_parser.cpp. References TranslationUnitAST::declarationList(), and parseDeclaration(). Referenced by TagCreator::parseTranslationUnit(), StoreWalker::parseTranslationUnit(), and ComputeRecoveryPoints::parseTranslationUnit(). |
|
Reimplemented in StoreWalker, and TagCreator. Definition at line 128 of file tree_parser.cpp. References parseTypeSpecifier(), and TypedefAST::typeSpec(). Referenced by parseDeclaration(), and StoreWalker::parseTypedef(). |
|
Reimplemented in StoreWalker. Definition at line 162 of file tree_parser.cpp. References AST::nodeType(), NodeType_ClassSpecifier, NodeType_ElaboratedTypeSpecifier, NodeType_EnumSpecifier, parseClassSpecifier(), parseElaboratedTypeSpecifier(), and parseEnumSpecifier(). Referenced by TagCreator::parseSimpleDeclaration(), parseTypedef(), and StoreWalker::parseTypeSpecifier(). |
|
Reimplemented in StoreWalker. Definition at line 116 of file tree_parser.cpp. Referenced by parseDeclaration(), and StoreWalker::parseUsing(). |
|
Reimplemented in StoreWalker, and TagCreator. Definition at line 122 of file tree_parser.cpp. Referenced by parseDeclaration(). |
|
Parser error-reporting function can be overridden in subclass.
Definition at line 84 of file TreeParser.cpp. References ANTLR_USE_NAMESPACE. |
|
Parser error-reporting function can be overridden in subclass.
Definition at line 78 of file TreeParser.cpp. References ANTLR_USE_NAMESPACE, and RecognitionException::toString(). |
|
Parser warning-reporting function can be overridden in subclass.
Definition at line 90 of file TreeParser.cpp. References ANTLR_USE_NAMESPACE. |
|
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 46 of file TreeParser.hpp. References astFactory. |
|
Definition at line 102 of file TreeParser.cpp. References ANTLR_USE_NAMESPACE, inputState, RefAST, traceDepth, and traceIndent(). Referenced by TreeParser::Tracer::Tracer(). |
|
These are used during when traceTreeParser commandline option is passed.
Definition at line 96 of file TreeParser.cpp. References ANTLR_USE_NAMESPACE. Referenced by traceIn(), and traceOut(). |
|
Definition at line 113 of file TreeParser.cpp. References ANTLR_USE_NAMESPACE, inputState, RefAST, traceDepth, and traceIndent(). Referenced by TreeParser::Tracer::~Tracer(). |
Member Data Documentation
|
Where did this rule leave off parsing; avoids a return parameter.
Definition at line 85 of file TreeParser.hpp. |
|
AST support code; parser and treeparser delegate to this object.
Definition at line 89 of file TreeParser.hpp. Referenced by setASTFactory(). |
|
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. Referenced by match(), and matchNot(). |
|
The input state of this tree parser.
Definition at line 92 of file TreeParser.hpp. Referenced by traceIn(), and traceOut(). |
|
AST return value for a rule is squirreled away here.
Definition at line 87 of file TreeParser.hpp. |
|
Used to keep track of indent depth with -traceTreeParser.
Definition at line 95 of file TreeParser.hpp. Referenced by traceIn(), and traceOut(). |
The documentation for this class was generated from the following files:
- lib/antlr/antlr/TreeParser.hpp
- lib/cppparser/tree_parser.h
- lib/antlr/src/TreeParser.cpp
- lib/cppparser/tree_parser.cpp