Parser Class Reference
A generic ANTLR parser (LL(k) for k>=1) containing a bunch of utility routines useful at any lookahead depth. More...
#include <Parser.hpp>
Inheritance diagram for Parser:

Detailed Description
A generic ANTLR parser (LL(k) for k>=1) containing a bunch of utility routines useful at any lookahead depth.We distinguish between the LL(1) and LL(k) parsers because of efficiency. This may not be necessary in the near future.
Each parser object contains the state of the parse including a lookahead cache (the form of which is determined by the subclass), whether or not the parser is in guess mode, where tokens come from, etc...
During guess mode, the current lookahead token(s) and token type(s) cache must be saved because the token stream may not have been informed to save the token (via mark
) before the try
block. Guessing is started by:
- saving the lookahead cache.
- marking the current position in the TokenBuffer.
- increasing the guessing level.
After guessing, the parser state is restored by:
- restoring the lookahead cache.
- rewinding the TokenBuffer.
- decreasing the guessing level.
- See also:
- antlr.Token
antlr.TokenBuffer
antlr.TokenStream
antlr.LL1Parser
- Todo:
- add constructors with ASTFactory.
Definition at line 61 of file Parser.hpp.
Constructor & Destructor Documentation
|
Definition at line 57 of file Parser.cpp. Referenced by Parser(). |
|
Definition at line 62 of file Parser.cpp. References Parser(). |
|
Definition at line 67 of file Parser.cpp. References Parser(). |
|
Definition at line 72 of file Parser.cpp. |
|
|
|
Definition at line 110 of file parser.cpp. References d, m_maxProblems, objcp, and Parser(). |
|
|
|
|
Member Function Documentation
|
Get another token object from the token stream.
Implemented in LLkParser. Referenced by consumeUntil(), match(), and matchNot(). |
|
Consume tokens until one matches the given token set.
Definition at line 84 of file Parser.cpp. References consume(), consumeUntil(), LA(), and BitSet::member(). |
|
Consume tokens until one matches the given token.
Definition at line 77 of file Parser.cpp. References consume(), consumeUntil(), and LA(). Referenced by consumeUntil(). |
|
Get the root AST node of the generated AST.
Definition at line 103 of file Parser.hpp. References RefAST. |
|
Return a pointer to the ASTFactory used. So you might use it in subsequent treewalkers or to reload AST's from disk. Definition at line 98 of file Parser.hpp. |
|
Return the filename of the input file.
Definition at line 109 of file Parser.hpp. Referenced by match(), matchNot(), reportError(), and reportWarning(). |
|
Definition at line 123 of file Parser.hpp. |
|
get the max token number This one should be overridden in subclasses.
Referenced by match(), and matchNot(). |
|
get the token name for the token number 'num'
|
|
get a vector with all token names
Referenced by match(), and matchNot(). |
|
Return the token type of the ith token of lookahead where i=1 is the current token being examined by the parser (i.e., it has not been matched yet).
Implemented in LLkParser. Referenced by consumeUntil(), match(), and matchNot(). |
|
Return the i-th token of lookahead.
Implemented in LLkParser. Referenced by match(), matchNot(), traceIn(), and traceOut(). |
|
Mark a spot in the input and return the position. Forwarded to TokenBuffer. Definition at line 150 of file Parser.hpp. |
|
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 118 of file Parser.cpp. References ANTLR_USE_NAMESPACE, consume(), DEBUG_PARSER, endl(), getFilename(), getNumTokens(), getTokenNames(), LA(), LT(), match(), BitSet::member(), and traceIndent(). |
|
Make sure current lookahead symbol matches token type Throw an exception upon mismatch, which is catch by either the error handler or by the syntactic predicate. Definition at line 94 of file Parser.cpp. References ANTLR_USE_NAMESPACE, consume(), DEBUG_PARSER, endl(), getFilename(), getNumTokens(), getTokenNames(), LA(), LT(), match(), and traceIndent(). Referenced by match(). |
|
Definition at line 140 of file Parser.cpp. References consume(), getFilename(), getNumTokens(), getTokenNames(), LA(), LT(), and matchNot(). Referenced by matchNot(). |
|
|
|
|
|
Definition at line 151 of file Parser.cpp. References ANTLR_USE_NAMESPACE, and endl(). |
|
Definition at line 1259 of file parser.cpp. References ADVANCE, Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseAbstractDeclarator(), parseExceptionSpecification(), parseParameterDeclarationClause(), parsePtrOperator(), reportError(), Lexer::setIndex(), skipCommaExpression(), Token_const, Token_identifier, and UPDATE_POS. Referenced by parseAbstractDeclarator(), parseParameterDeclaration(), and parseTypeId(). |
|
Definition at line 1854 of file parser.cpp. References Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseAccessSpecifier(), Token_private, Token_protected, Token_public, and UPDATE_POS. Referenced by parseAccessSpecifier(), parseBaseSpecifier(), and parseMemberSpecification(). |
|
Definition at line 3536 of file parser.cpp. References lex, Lexer::lookAhead(), Lexer::nextToken(), parseAdditiveExpression(), and parseMultiplicativeExpression(). Referenced by parseAdditiveExpression(), and parseShiftExpression(). |
|
Definition at line 3605 of file parser.cpp. References lex, Lexer::lookAhead(), Lexer::nextToken(), parseAndExpression(), and parseEqualityExpression(). Referenced by parseAndExpression(), and parseExclusiveOrExpression(). |
|
Definition at line 855 of file parser.cpp. References ADVANCE, parseAsmDefinition(), parseCvQualify(), skip(), and Token_asm. Referenced by parseAsmDefinition(), parseBlockDeclaration(), and parseDeclaration(). |
|
Definition at line 3719 of file parser.cpp. References Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseAssignmentExpression(), parseConditionalExpression(), parseThrowExpression(), Token_assign, Token_throw, and UPDATE_POS. Referenced by parseAssignmentExpression(), parseCommaExpression(), parseConditionalExpression(), parseInitializerClause(), and parseThrowExpression(). |
|
Definition at line 2097 of file parser.cpp. References Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), BaseSpecifierAST::Node, parseBaseClause(), parseBaseSpecifier(), reportError(), and UPDATE_POS. Referenced by parseBaseClause(), and parseClassSpecifier(). |
|
Definition at line 2221 of file parser.cpp. References AST_FROM_TOKEN, Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseAccessSpecifier(), parseBaseSpecifier(), parseName(), reportError(), Token_virtual, and UPDATE_POS. Referenced by parseBaseClause(), and parseBaseSpecifier(). |
|
Definition at line 2776 of file parser.cpp. References Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseAsmDefinition(), parseBlockDeclaration(), parseCvQualify(), parseInitDeclaratorList(), parseNamespaceAliasDefinition(), parseStorageClassSpecifier(), parseTypedef(), parseTypeSpecifierOrClassSpec(), parseUsing(), Lexer::setIndex(), Token_asm, Token_namespace, Token_typedef, Token_using, and UPDATE_POS. Referenced by parseBlockDeclaration(), and parseDeclarationStatement(). |
|
Definition at line 3476 of file parser.cpp. References Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseCastExpression(), parseTypeId(), parseUnaryExpression(), and Lexer::setIndex(). Referenced by parseCastExpression(), parseDeleteExpression(), parsePmExpression(), and parseUnaryExpression(). |
|
Definition at line 1781 of file parser.cpp. References ADVANCE, Lexer::index(), Token::isNull(), lex, Lexer::lookAhead(), Lexer::nextToken(), ClassSpecifierAST::Node, BaseClauseAST::Node, parseBaseClause(), parseClassSpecifier(), parseMemberSpecification(), parseName(), parseWinDeclSpec(), reportError(), Lexer::setIndex(), skipUntil(), skipUntilDeclaration(), Token_class, Token_identifier, Token_struct, Token_union, and UPDATE_POS. Referenced by parseClassSpecifier(), parseDeclaration(), parseMemberSpecification(), and parseTypeSpecifierOrClassSpec(). |
|
Definition at line 3770 of file parser.cpp. References Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseAssignmentExpression(), parseCommaExpression(), and UPDATE_POS. Referenced by parseCommaExpression(), parseDeclarator(), parseExpression(), parseNewExpression(), parseNewInitializer(), parsePostfixExpression(), and parsePrimaryExpression(). |
|
Definition at line 2616 of file parser.cpp. References Lexer::index(), Token::isNull(), lex, Lexer::lookAhead(), Lexer::nextToken(), StatementListAST::Node, parseCompoundStatement(), parseStatement(), reportError(), skipUntilStatement(), and UPDATE_POS. Referenced by parseCompoundStatement(), parseStatement(), parseSwitchStatement(), and parseTryBlockStatement(). |
|
Definition at line 2464 of file parser.cpp. References Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), ConditionAST::Node, parseCondition(), parseDeclarator(), parseTypeSpecifier(), Lexer::setIndex(), skipCommaExpression(), skipExpression(), and UPDATE_POS. Referenced by parseCondition(), parseForStatement(), parseIfStatement(), parseSwitchStatement(), parseTryBlockStatement(), and parseWhileStatement(). |
|
Definition at line 3697 of file parser.cpp. References CHECK, lex, Lexer::lookAhead(), Lexer::nextToken(), parseAssignmentExpression(), parseConditionalExpression(), parseExpression(), and parseLogicalOrExpression(). Referenced by parseAssignmentExpression(), parseConditionalExpression(), and parseConstantExpression(). |
|
Definition at line 3742 of file parser.cpp. References Lexer::index(), lex, parseConditionalExpression(), parseConstantExpression(), and UPDATE_POS. Referenced by parseConstantExpression(), parseDeclarator(), parseEnumerator(), and parseLabeledStatement(). |
|
Definition at line 1955 of file parser.cpp. References lex, Lexer::lookAhead(), Lexer::nextToken(), parseCtorInitializer(), parseMemInitializerList(), and reportError(). Referenced by parseCtorInitializer(), and parseDeclarationInternal(). |
|
Definition at line 975 of file parser.cpp. References Lexer::index(), Token::isNull(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseCvQualify(), Token_const, Token_volatile, and UPDATE_POS. Referenced by parseAsmDefinition(), parseBlockDeclaration(), parseCvQualify(), parseDeclaration(), parseDeclarationInternal(), parseMemberSpecification(), parseOperatorFunctionId(), parsePtrOperator(), and parseTypeSpecifier(). |
|
|
|
Definition at line 2848 of file parser.cpp. References Lexer::index(), lex, DeclarationStatementAST::Node, parseBlockDeclaration(), parseDeclarationStatement(), and UPDATE_POS. Referenced by parseDeclarationStatement(), parseForInitStatement(), and parseStatement(). |
|
|
Definition at line 2006 of file parser.cpp. References parseDeclaratorId(), and parseName(). Referenced by parseDeclarator(), and parseDeclaratorId(). |
|
Definition at line 3459 of file parser.cpp. References CHECK, lex, Lexer::lookAhead(), Lexer::nextToken(), parseCastExpression(), parseDeleteExpression(), Token_delete, and Token_scope. Referenced by parseDeleteExpression(), and parseUnaryExpression(). |
|
Definition at line 2535 of file parser.cpp. References ADVANCE, ADVANCE_NR, Lexer::index(), lex, DoStatementAST::Node, parseDoStatement(), parseStatement(), reportError(), skipCommaExpression(), Token_do, Token_while, and UPDATE_POS. Referenced by parseDoStatement(), and parseStatement(). |
|
Definition at line 1972 of file parser.cpp. References Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), ElaboratedTypeSpecifierAST::Node, parseElaboratedTypeSpecifier(), parseName(), Lexer::setIndex(), Token_class, Token_enum, Token_struct, Token_typename, Token_union, and UPDATE_POS. Referenced by parseElaboratedTypeSpecifier(), and parseTypeSpecifier(). |
|
Definition at line 2039 of file parser.cpp. References Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseConstantExpression(), parseEnumerator(), reportError(), Token_identifier, and UPDATE_POS. Referenced by parseEnumerator(), and parseEnumSpecifier(). |
|
Definition at line 1357 of file parser.cpp. References Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), EnumeratorAST::Node, EnumSpecifierAST::Node, parseEnumerator(), parseEnumSpecifier(), parseName(), reportError(), Lexer::setIndex(), Token_enum, and UPDATE_POS. Referenced by parseDeclaration(), parseEnumSpecifier(), parseMemberSpecification(), and parseTypeSpecifierOrClassSpec(). |
|
Definition at line 3588 of file parser.cpp. References lex, Lexer::lookAhead(), Lexer::nextToken(), parseEqualityExpression(), parseRelationalExpression(), Token_eq, and Token_not_eq. Referenced by parseAndExpression(), and parseEqualityExpression(). |
|
Definition at line 2012 of file parser.cpp. References ADVANCE, AST_FROM_TOKEN, Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseExceptionSpecification(), parseTypeIdList(), Token_ellipsis, Token_throw, and UPDATE_POS. Referenced by parseAbstractDeclarator(), parseDeclarator(), and parseExceptionSpecification(). |
|
Definition at line 3622 of file parser.cpp. References lex, Lexer::lookAhead(), Lexer::nextToken(), parseAndExpression(), and parseExclusiveOrExpression(). Referenced by parseExclusiveOrExpression(), and parseInclusiveOrExpression(). |
|
Definition at line 3755 of file parser.cpp. References Lexer::index(), lex, parseCommaExpression(), parseExpression(), and UPDATE_POS. Referenced by parseConditionalExpression(), parseExpression(), parseNewDeclarator(), and parsePrimaryExpression(). |
|
Definition at line 2606 of file parser.cpp. References parseDeclarationStatement(), parseForInitStatement(), and skipExpressionStatement(). Referenced by parseForInitStatement(), and parseForStatement(). |
|
Definition at line 2569 of file parser.cpp. References ADVANCE, Lexer::index(), lex, ForStatementAST::Node, parseCondition(), parseForInitStatement(), parseForStatement(), parseStatement(), reportError(), skipCommaExpression(), Token_for, and UPDATE_POS. Referenced by parseForStatement(), and parseStatement(). |
|
Definition at line 3071 of file parser.cpp. References Lexer::index(), Token::isNull(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseFunctionBody(), parseStatement(), reportError(), skipUntilStatement(), and UPDATE_POS. Referenced by parseDeclarationInternal(), and parseFunctionBody(). |
|
Definition at line 1583 of file parser.cpp. References Lexer::index(), Token::isNull(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseFunctionSpecifier(), Token_explicit, Token_inline, Token_virtual, and UPDATE_POS. Referenced by parseDeclarationInternal(), and parseFunctionSpecifier(). |
|
Definition at line 3996 of file parser.cpp. References lex, Lexer::lookAhead(), Lexer::nextToken(), parseIdentifierColon(), and Token_identifier. Referenced by parseIdentifierColon(). |
|
Definition at line 3968 of file parser.cpp. References ADVANCE, AST_FROM_TOKEN, Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseIdentifierList(), Token_identifier, and UPDATE_POS. Referenced by parseIdentifierList(), parseObjcAliasDecl(), parseObjcClassDecl(), parseObjcProtocolDecl(), and parseWinDeclSpec(). |
|
Definition at line 2655 of file parser.cpp. References ADVANCE, Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), IfStatementAST::Node, parseCondition(), parseIfStatement(), parseStatement(), reportError(), Token_else, Token_if, and UPDATE_POS. Referenced by parseIfStatement(), and parseStatement(). |
|
Definition at line 3639 of file parser.cpp. References lex, Lexer::lookAhead(), Lexer::nextToken(), parseExclusiveOrExpression(), and parseInclusiveOrExpression(). Referenced by parseInclusiveOrExpression(), and parseLogicalAndExpression(). |
|
Definition at line 2072 of file parser.cpp. References Lexer::index(), lex, parseDeclarator(), parseInitDeclarator(), parseInitializer(), and UPDATE_POS. Referenced by parseDeclarationInternal(), parseInitDeclarator(), and parseInitDeclaratorList(). |
|
Definition at line 1634 of file parser.cpp. References Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), InitDeclaratorAST::Node, parseInitDeclarator(), parseInitDeclaratorList(), syntaxError(), and UPDATE_POS. Referenced by parseBlockDeclaration(), parseDeclaration(), parseDeclarationInternal(), parseInitDeclaratorList(), parseMemberSpecification(), and parseTypedef(). |
|
Definition at line 2131 of file parser.cpp. References ADVANCE, lex, Lexer::lookAhead(), Lexer::nextToken(), parseInitializer(), parseInitializerClause(), reportError(), and skipCommaExpression(). Referenced by parseInitDeclarator(), and parseInitializer(). |
|
Definition at line 2260 of file parser.cpp. References lex, Lexer::lookAhead(), Lexer::nextToken(), parseAssignmentExpression(), parseInitializerClause(), reportError(), and skip(). Referenced by parseInitializer(), and parseInitializerClause(). |
|
Definition at line 3818 of file parser.cpp. References parseIvarDecl(). Referenced by parseIvarDecl(). |
|
Definition at line 3830 of file parser.cpp. References parseIvarDeclarator(). Referenced by parseIvarDeclarator(). |
|
Definition at line 3806 of file parser.cpp. References parseIvarDeclList(). Referenced by parseIvarDeclList(). |
|
Definition at line 3812 of file parser.cpp. References parseIvarDecls(). Referenced by parseIvarDecls(). |
|
Definition at line 3824 of file parser.cpp. References parseIvars(). Referenced by parseIvars(). |
|
Definition at line 3896 of file parser.cpp. References parseKeywordArg(). Referenced by parseKeywordArg(). |
|
Definition at line 3890 of file parser.cpp. References parseKeywordArgList(). Referenced by parseKeywordArgList(). |
|
Definition at line 3860 of file parser.cpp. References parseKeywordDecl(). Referenced by parseKeywordDecl(). |
|
Definition at line 3884 of file parser.cpp. References parseKeywordExpr(). Referenced by parseKeywordExpr(). |
|
Definition at line 3944 of file parser.cpp. References parseKeywordName(). Referenced by parseKeywordName(). |
|
Definition at line 3938 of file parser.cpp. References parseKeywordNameList(). Referenced by parseKeywordNameList(). |
|
Definition at line 3848 of file parser.cpp. References parseKeywordSelector(). Referenced by parseKeywordSelector(). |
|
Definition at line 2729 of file parser.cpp. References ADVANCE, lex, Lexer::lookAhead(), Lexer::nextToken(), parseConstantExpression(), parseLabeledStatement(), parseStatement(), reportError(), Token_case, Token_default, Token_ellipsis, and Token_identifier. Referenced by parseLabeledStatement(), and parseStatement(). |
|
Definition at line 579 of file parser.cpp. References Lexer::index(), Token::isNull(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseDeclaration(), parseLinkageBody(), reportError(), skipUntilDeclaration(), and UPDATE_POS. Referenced by parseLinkageBody(), parseLinkageSpecification(), and parseNamespace(). |
|
Definition at line 538 of file parser.cpp. References Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), LinkageBodyAST::Node, LinkageSpecificationAST::Node, parseDeclaration(), parseLinkageBody(), parseLinkageSpecification(), reportError(), Token_extern, Token_string_literal, and UPDATE_POS. Referenced by parseDeclaration(), and parseLinkageSpecification(). |
|
Definition at line 3656 of file parser.cpp. References lex, Lexer::lookAhead(), Lexer::nextToken(), parseInclusiveOrExpression(), parseLogicalAndExpression(), and Token_and. Referenced by parseLogicalAndExpression(), and parseLogicalOrExpression(). |
|
Definition at line 3674 of file parser.cpp. References Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseLogicalAndExpression(), parseLogicalOrExpression(), Token_or, and UPDATE_POS. Referenced by parseConditionalExpression(), parseLogicalOrExpression(), parseParameterDeclaration(), and parseTemplateArgument(). |
|
|
Definition at line 2175 of file parser.cpp. References ADVANCE, parseMemInitializer(), parseMemInitializerId(), reportError(), and skipCommaExpression(). Referenced by parseMemInitializer(), and parseMemInitializerList(). |
|
Definition at line 2278 of file parser.cpp. References parseMemInitializerId(), and parseName(). Referenced by parseMemInitializer(), and parseMemInitializerId(). |
|
Definition at line 2154 of file parser.cpp. References lex, Lexer::lookAhead(), Lexer::nextToken(), parseMemInitializer(), and parseMemInitializerList(). Referenced by parseCtorInitializer(), and parseMemInitializerList(). |
|
Definition at line 3878 of file parser.cpp. References parseMessageArgs(). Referenced by parseMessageArgs(). |
|
Definition at line 3836 of file parser.cpp. References parseMethodDecl(). Referenced by parseMethodDecl(). |
|
Definition at line 3518 of file parser.cpp. References lex, Lexer::lookAhead(), Lexer::nextToken(), parseMultiplicativeExpression(), and parsePmExpression(). Referenced by parseAdditiveExpression(), and parseMultiplicativeExpression(). |
|
Definition at line 3914 of file parser.cpp. References parseMyParm(). Referenced by parseMyParm(). |
|
Definition at line 3908 of file parser.cpp. References parseMyParms(). Referenced by parseMyParms(). |
|
skip optional template ####
Definition at line 389 of file parser.cpp. References Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), ClassOrNamespaceNameAST::Node, GroupAST::Node, NameAST::Node, parseName(), parseUnqualifiedName(), parseWinDeclSpec(), Token_scope, Token_template, and UPDATE_POS. Referenced by parseBaseSpecifier(), parseClassSpecifier(), parseDeclarationInternal(), parseDeclaratorId(), parseElaboratedTypeSpecifier(), parseEnumSpecifier(), parseMemInitializerId(), parseName(), parseNamespace(), parseNamespaceAliasDefinition(), parsePostfixExpression(), parsePrimaryExpression(), parseSimpleTypeSpecifier(), parseTypeParameter(), parseUsing(), and parseUsingDirective(). |
|
Definition at line 620 of file parser.cpp. References ADVANCE, Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), NamespaceAST::Node, NamespaceAliasAST::Node, parseLinkageBody(), parseName(), parseNamespace(), reportError(), Token_identifier, Token_namespace, and UPDATE_POS. Referenced by parseDeclaration(), and parseNamespace(). |
|
Definition at line 2827 of file parser.cpp. References ADVANCE, lex, Lexer::lookAhead(), Lexer::nextToken(), parseName(), parseNamespaceAliasDefinition(), reportError(), Token_identifier, and Token_namespace. Referenced by parseBlockDeclaration(), and parseNamespaceAliasDefinition(). |
|
Definition at line 3422 of file parser.cpp. References ADVANCE, lex, Lexer::lookAhead(), Lexer::nextToken(), parseExpression(), parseNewDeclarator(), and parsePtrOperator(). Referenced by parseNewDeclarator(), and parseNewTypeId(). |
|
Definition at line 3379 of file parser.cpp. References CHECK, lex, Lexer::lookAhead(), Lexer::nextToken(), parseCommaExpression(), parseNewExpression(), parseNewInitializer(), parseNewTypeId(), parseTypeId(), Token_new, and Token_scope. Referenced by parseNewExpression(), and parseUnaryExpression(). |
|
Definition at line 3445 of file parser.cpp. References CHECK, lex, Lexer::lookAhead(), Lexer::nextToken(), parseCommaExpression(), and parseNewInitializer(). Referenced by parseNewExpression(), and parseNewInitializer(). |
|
Definition at line 3409 of file parser.cpp. References parseNewDeclarator(), parseNewTypeId(), and parseTypeSpecifier(). Referenced by parseNewExpression(), and parseNewTypeId(). |
|
Definition at line 4065 of file parser.cpp. References ADVANCE, OBJC_ALIAS, parseIdentifierList(), and parseObjcAliasDecl(). Referenced by parseObjcAliasDecl(). |
|
Definition at line 4039 of file parser.cpp. References ADVANCE, OBJC_CLASS, parseIdentifierList(), and parseObjcClassDecl(). Referenced by parseObjcClassDecl(). |
|
Definition at line 4033 of file parser.cpp. References parseObjcClassDef(). Referenced by parseObjcClassDef(). |
|
Definition at line 4021 of file parser.cpp. References parseObjcCloseBracket(). Referenced by parseObjcCloseBracket(). |
|
Definition at line 4027 of file parser.cpp. References parseObjcDef(). Referenced by parseDeclaration(), and parseObjcDef(). |
|
Definition at line 3950 of file parser.cpp. References parseObjcEncodeExpr(). Referenced by parseObjcEncodeExpr(). |
|
Definition at line 3872 of file parser.cpp. References parseObjcMessageExpr(). Referenced by parseObjcMessageExpr(). |
|
Definition at line 4084 of file parser.cpp. References parseObjcMethodDef(). Referenced by parseObjcMethodDef(). |
|
Definition at line 4015 of file parser.cpp. References parseObjcOpenBracketExpr(). Referenced by parseObjcOpenBracketExpr(). |
|
Definition at line 4052 of file parser.cpp. References ADVANCE, OBJC_PROTOCOL, parseIdentifierList(), and parseObjcProtocolDecl(). Referenced by parseObjcProtocolDecl(). |
|
Definition at line 4078 of file parser.cpp. References parseObjcProtocolDef(). Referenced by parseObjcProtocolDef(). |
|
Definition at line 4009 of file parser.cpp. References parseObjcProtocolExpr(). Referenced by parseObjcProtocolExpr(). |
|
Definition at line 3926 of file parser.cpp. References parseObjcSelectorExpr(). Referenced by parseObjcSelectorExpr(). |
|
Definition at line 3956 of file parser.cpp. References parseObjcString(). Referenced by parseObjcString(). |
|
Definition at line 915 of file parser.cpp. References lex, Lexer::lookAhead(), Lexer::nextToken(), parseOperator(), Token::text(), text(), Token_and, Token_arrow, Token_assign, Token_decr, Token_delete, Token_eq, Token_geq, Token_incr, Token_leq, Token_new, Token_not_eq, Token_or, Token_ptrmem, and Token_shift. Referenced by parseOperator(), and parseOperatorFunctionId(). |
|
Definition at line 745 of file parser.cpp. References Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseCvQualify(), parseOperator(), parseOperatorFunctionId(), parsePtrOperator(), parseSimpleTypeSpecifier(), syntaxError(), Token_operator, and UPDATE_POS. Referenced by parseOperatorFunctionId(), and parseUnqualifiedName(). |
|
Definition at line 3920 of file parser.cpp. References parseOptParmList(). Referenced by parseOptParmList(). |
|
Definition at line 1738 of file parser.cpp. References Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseAbstractDeclarator(), parseDeclarator(), parseLogicalOrExpression(), parseParameterDeclaration(), parseTypeSpecifier(), Lexer::setIndex(), and UPDATE_POS. Referenced by parseParameterDeclaration(), parseParameterDeclarationList(), and parseTemplateParameter(). |
|
Definition at line 1665 of file parser.cpp. References AST_FROM_TOKEN, Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), ParameterDeclarationListAST::Node, parseParameterDeclarationClause(), parseParameterDeclarationList(), Token_ellipsis, and UPDATE_POS. Referenced by parseAbstractDeclarator(), parseDeclarator(), and parseParameterDeclarationClause(). |
|
Definition at line 1704 of file parser.cpp. References Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseParameterDeclaration(), parseParameterDeclarationList(), Lexer::setIndex(), Token_ellipsis, and UPDATE_POS. Referenced by parseParameterDeclarationClause(), and parseParameterDeclarationList(). |
|
Definition at line 3501 of file parser.cpp. References lex, Lexer::lookAhead(), Lexer::nextToken(), parseCastExpression(), parsePmExpression(), and Token_ptrmem. Referenced by parseMultiplicativeExpression(), and parsePmExpression(). |
|
Definition at line 3259 of file parser.cpp. References CHECK, lex, Lexer::lookAhead(), Lexer::nextToken(), parseCommaExpression(), parseName(), parsePostfixExpression(), parsePrimaryExpression(), Token_arrow, Token_decr, Token_incr, Token_template, and Token_typename. Referenced by parsePostfixExpression(), and parseUnaryExpression(). |
|
Definition at line 3172 of file parser.cpp. References CHECK, Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseCommaExpression(), parseExpression(), parseName(), parsePrimaryExpression(), parseSimpleTypeSpecifier(), parseStringLiteral(), parseTypeId(), Lexer::setIndex(), Token_char_literal, Token_const_cast, Token_dynamic_cast, Token_false, Token_number_literal, Token_reinterpret_cast, Token_static_cast, Token_string_literal, Token_this, Token_true, and Token_typeid. Referenced by parsePostfixExpression(), and parsePrimaryExpression(). |
|
Definition at line 3962 of file parser.cpp. References parseProtocolRefs(). Referenced by parseProtocolRefs(). |
|
Definition at line 1065 of file parser.cpp. References Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseCvQualify(), parsePtrOperator(), parsePtrToMember(), Lexer::setIndex(), and UPDATE_POS. Referenced by parseAbstractDeclarator(), parseDeclarator(), parseNewDeclarator(), parseOperatorFunctionId(), and parsePtrOperator(). |
|
Definition at line 2285 of file parser.cpp. References lex, Lexer::lookAhead(), Lexer::nextToken(), parsePtrToMember(), Token_identifier, and Token_scope. Referenced by parsePtrOperator(), and parsePtrToMember(). |
|
Definition at line 3866 of file parser.cpp. References parseReceiver(). Referenced by parseReceiver(). |
|
Definition at line 3570 of file parser.cpp. References lex, Lexer::lookAhead(), Lexer::nextToken(), parseRelationalExpression(), parseShiftExpression(), Token_geq, and Token_leq. Referenced by parseEqualityExpression(), and parseRelationalExpression(). |
|
Definition at line 3902 of file parser.cpp. References parseReservedWord(). Referenced by parseReservedWord(). |
|
Definition at line 3854 of file parser.cpp. References parseSelector(). Referenced by parseSelector(). |
|
Definition at line 3932 of file parser.cpp. References parseSelectorArg(). Referenced by parseSelectorArg(). |
|
Definition at line 3553 of file parser.cpp. References lex, Lexer::lookAhead(), Lexer::nextToken(), parseAdditiveExpression(), parseShiftExpression(), and Token_shift. Referenced by parseRelationalExpression(), and parseShiftExpression(). |
|
Definition at line 1008 of file parser.cpp. References Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseName(), parseSimpleTypeSpecifier(), Lexer::setIndex(), Token_bool, Token_char, Token_double, Token_float, Token_int, Token_long, Token_short, Token_signed, Token_unsigned, Token_void, Token_wchar_t, and UPDATE_POS. Referenced by parseOperatorFunctionId(), parsePrimaryExpression(), parseSimpleTypeSpecifier(), and parseTypeSpecifier(). |
|
|
Definition at line 1554 of file parser.cpp. References Lexer::index(), Token::isNull(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseStorageClassSpecifier(), Token_auto, Token_extern, Token_friend, Token_mutable, Token_register, Token_static, and UPDATE_POS. Referenced by parseBlockDeclaration(), parseDeclaration(), parseDeclarationInternal(), parseMemberSpecification(), and parseStorageClassSpecifier(). |
|
Definition at line 2365 of file parser.cpp. References Token::isNull(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseStringLiteral(), Token::text(), Token_identifier, and Token_string_literal. Referenced by parsePrimaryExpression(), and parseStringLiteral(). |
|
Definition at line 2699 of file parser.cpp. References ADVANCE, Lexer::index(), lex, SwitchStatementAST::Node, parseCompoundStatement(), parseCondition(), parseSwitchStatement(), reportError(), syntaxError(), Token_switch, and UPDATE_POS. Referenced by parseStatement(), and parseSwitchStatement(). |
|
Definition at line 1095 of file parser.cpp. References Lexer::index(), lex, Lexer::lookAhead(), parseLogicalOrExpression(), parseTemplateArgument(), parseTypeId(), and Lexer::setIndex(). Referenced by parseTemplateArgument(), and parseTemplateArgumentList(). |
|
Definition at line 789 of file parser.cpp. References Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), TemplateArgumentListAST::Node, parseTemplateArgument(), parseTemplateArgumentList(), syntaxError(), and UPDATE_POS. Referenced by parseTemplateArgumentList(), and parseUnqualifiedName(). |
|
Definition at line 871 of file parser.cpp. References ADVANCE, Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), TemplateDeclarationAST::Node, TemplateParameterListAST::Node, parseDeclaration(), parseTemplateDeclaration(), parseTemplateParameterList(), reportError(), Token_export, Token_template, and UPDATE_POS. Referenced by parseDeclaration(), parseMemberSpecification(), and parseTemplateDeclaration(). |
|
Definition at line 1439 of file parser.cpp. References Lexer::index(), lex, Lexer::lookAhead(), ParameterDeclarationAST::Node, TypeParameterAST::Node, parseParameterDeclaration(), parseTemplateParameter(), parseTypeParameter(), Token_class, Token_template, Token_typename, and UPDATE_POS. Referenced by parseTemplateParameter(), and parseTemplateParameterList(). |
|
Definition at line 1408 of file parser.cpp. References Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), TemplateParameterAST::Node, parseTemplateParameter(), parseTemplateParameterList(), syntaxError(), and UPDATE_POS. Referenced by parseTemplateDeclaration(), parseTemplateParameterList(), and parseTypeParameter(). |
|
Definition at line 3792 of file parser.cpp. References CHECK, lex, Lexer::lookAhead(), parseAssignmentExpression(), parseThrowExpression(), and Token_throw. Referenced by parseAssignmentExpression(), and parseThrowExpression(). |
|
Definition at line 3131 of file parser.cpp. References ADVANCE, lex, Lexer::lookAhead(), Lexer::nextToken(), parseCompoundStatement(), parseCondition(), parseTryBlockStatement(), reportError(), syntaxError(), Token_catch, and Token_try. Referenced by parseStatement(), and parseTryBlockStatement(). |
|
Definition at line 821 of file parser.cpp. References ADVANCE, Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), TypedefAST::Node, parseInitDeclaratorList(), parseTypedef(), parseTypeSpecifierOrClassSpec(), reportError(), Token_typedef, and UPDATE_POS. Referenced by parseBlockDeclaration(), parseDeclaration(), parseMemberSpecification(), and parseTypedef(). |
|
Definition at line 1612 of file parser.cpp. References Lexer::index(), lex, parseAbstractDeclarator(), parseTypeId(), parseTypeSpecifier(), and UPDATE_POS. Referenced by parseCastExpression(), parseNewExpression(), parsePrimaryExpression(), parseTemplateArgument(), parseTypeId(), parseTypeIdList(), parseTypeParameter(), and parseUnaryExpression(). |
|
Definition at line 2192 of file parser.cpp. References Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseTypeId(), parseTypeIdList(), reportError(), and UPDATE_POS. Referenced by parseExceptionSpecification(), and parseTypeIdList(). |
|
Definition at line 1467 of file parser.cpp. References ADVANCE, AST_FROM_TOKEN, Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseName(), parseTemplateParameterList(), parseTypeId(), parseTypeParameter(), syntaxError(), Token_class, Token_template, Token_typename, and UPDATE_POS. Referenced by parseTemplateParameter(), and parseTypeParameter(). |
|
Definition at line 1113 of file parser.cpp. References parseCvQualify(), parseElaboratedTypeSpecifier(), parseSimpleTypeSpecifier(), and parseTypeSpecifier(). Referenced by parseCondition(), parseDeclarationInternal(), parseNewTypeId(), parseParameterDeclaration(), parseTypeId(), parseTypeSpecifier(), parseTypeSpecifierOrClassSpec(), and CppCodeCompletion::typeName(). |
|
Definition at line 3119 of file parser.cpp. References parseClassSpecifier(), parseEnumSpecifier(), parseTypeSpecifier(), and parseTypeSpecifierOrClassSpec(). Referenced by parseBlockDeclaration(), parseTypedef(), and parseTypeSpecifierOrClassSpec(). |
|
Definition at line 3333 of file parser.cpp. References Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseCastExpression(), parseDeleteExpression(), parseNewExpression(), parsePostfixExpression(), parseTypeId(), parseUnaryExpression(), Lexer::setIndex(), Token_decr, Token_delete, Token_incr, Token_new, and Token_sizeof. Referenced by parseCastExpression(), and parseUnaryExpression(). |
|
Definition at line 3842 of file parser.cpp. References parseUnarySelector(). Referenced by parseUnarySelector(). |
|
Definition at line 2307 of file parser.cpp. References Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseOperatorFunctionId(), parseTemplateArgumentList(), parseUnqualifiedName(), Lexer::setIndex(), Token_identifier, Token_operator, and UPDATE_POS. Referenced by parseName(), and parseUnqualifiedName(). |
|
Definition at line 674 of file parser.cpp. References ADVANCE, Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), UsingAST::Node, parseName(), parseUsing(), parseUsingDirective(), Token_namespace, Token_typename, Token_using, and UPDATE_POS. Referenced by parseBlockDeclaration(), parseDeclaration(), parseMemberSpecification(), and parseUsing(). |
|
Definition at line 717 of file parser.cpp. References ADVANCE, Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), UsingDirectiveAST::Node, parseName(), parseUsingDirective(), reportError(), Token_namespace, and UPDATE_POS. Referenced by parseUsing(), and parseUsingDirective(). |
|
Definition at line 2505 of file parser.cpp. References ADVANCE, Lexer::index(), lex, WhileStatementAST::Node, parseCondition(), parseStatement(), parseWhileStatement(), reportError(), Token_while, and UPDATE_POS. Referenced by parseStatement(), and parseWhileStatement(). |
|
Definition at line 4090 of file parser.cpp. References ADVANCE, Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseIdentifierList(), parseWinDeclSpec(), Token::text(), Token_identifier, and UPDATE_POS. Referenced by parseClassSpecifier(), parseDeclarationInternal(), parseName(), and parseWinDeclSpec(). |
|
Definition at line 146 of file parser.cpp. References Driver::addProblem(), Driver::currentFileName(), Lexer::getTokenPosition(), lex, Lexer::lookAhead(), m_driver, m_maxProblems, m_problems, and reportError(). |
|
Definition at line 126 of file parser.cpp. References Driver::addProblem(), Driver::currentFileName(), Lexer::getTokenPosition(), lex, Lexer::lookAhead(), m_driver, m_maxProblems, m_problems, reportError(), Error::text, and Token::text(). |
|
Parser error-reporting function can be overridden in subclass.
Definition at line 164 of file Parser.cpp. References ANTLR_USE_NAMESPACE, endl(), getFilename(), and reportError(). |
|
Parser error-reporting function can be overridden in subclass.
Definition at line 158 of file Parser.cpp. References ANTLR_USE_NAMESPACE, endl(), reportError(), and RecognitionException::toString(). Referenced by parseAbstractDeclarator(), parseBaseClause(), parseBaseSpecifier(), parseClassSpecifier(), parseCompoundStatement(), parseCtorInitializer(), parseDeclarator(), parseDoStatement(), parseEnumerator(), parseEnumSpecifier(), parseForStatement(), parseFunctionBody(), parseIfStatement(), parseInitializer(), parseInitializerClause(), parseLabeledStatement(), parseLinkageBody(), parseLinkageSpecification(), parseMemInitializer(), parseNamespace(), parseNamespaceAliasDefinition(), parseSwitchStatement(), parseTemplateDeclaration(), parseTryBlockStatement(), parseTypedef(), parseTypeIdList(), parseUsingDirective(), parseWhileStatement(), reportError(), skipCommaExpression(), and syntaxError(). |
|
Parser warning-reporting function can be overridden in subclass.
Definition at line 173 of file Parser.cpp. References ANTLR_USE_NAMESPACE, endl(), getFilename(), and reportWarning(). Referenced by reportWarning(). |
|
rewind to a previously marked position
Definition at line 155 of file Parser.hpp. |
|
Specify the factory to be used during tree building. (Compulsory) Setting the factory is nowadays compulsory. Definition at line 90 of file Parser.hpp. |
|
DEPRECATED! Specify the factory to be used during tree building. (Compulsory) Setting the factory is nowadays compulsory.
Definition at line 83 of file Parser.hpp. |
|
Set the filename of the input file (used for error reporting).
Definition at line 114 of file Parser.hpp. |
|
Definition at line 119 of file Parser.hpp. |
|
Definition at line 282 of file parser.cpp. References Token::isNull(), lex, Lexer::lookAhead(), Lexer::nextToken(), and skip(). Referenced by parseAsmDefinition(), parseInitializerClause(), skip(), and skipExpression(). |
|
Definition at line 304 of file parser.cpp. References Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), AST::Node, reportError(), skipCommaExpression(), skipExpression(), and UPDATE_POS. Referenced by parseAbstractDeclarator(), parseCondition(), parseDoStatement(), parseForStatement(), parseInitializer(), parseMemInitializer(), parseStatement(), skipCommaExpression(), and skipExpressionStatement(). |
|
Definition at line 330 of file parser.cpp. References Lexer::index(), Token::isNull(), lex, Lexer::lookAhead(), Lexer::nextToken(), skip(), skipExpression(), Token_break, Token_case, Token_continue, Token_default, Token_do, Token_for, Token_goto, Token_identifier, Token_if, Token_return, Token_while, and UPDATE_POS. Referenced by parseCondition(), skipCommaExpression(), and skipExpression(). |
|
Definition at line 2381 of file parser.cpp. References ADVANCE, Lexer::index(), lex, ExpressionStatementAST::Node, StatementAST::Node, skipCommaExpression(), skipExpressionStatement(), and UPDATE_POS. Referenced by parseForInitStatement(), parseStatement(), and skipExpressionStatement(). |
|
Definition at line 166 of file parser.cpp. References Token::isNull(), lex, Lexer::lookAhead(), Lexer::nextToken(), and skipUntil(). Referenced by parseClassSpecifier(), and skipUntil(). |
|
Definition at line 179 of file parser.cpp. References Token::isNull(), lex, Lexer::lookAhead(), Lexer::nextToken(), Token_asm, Token_bool, Token_char, Token_const, Token_double, Token_export, Token_extern, Token_float, Token_identifier, Token_int, Token_long, Token_namespace, Token_operator, Token_private, Token_protected, Token_public, Token_scope, Token_short, Token_signals, Token_signed, Token_slots, Token_template, Token_typedef, Token_unsigned, Token_using, Token_void, Token_volatile, and Token_wchar_t. Referenced by parseClassSpecifier(), and parseLinkageBody(). |
|
Definition at line 228 of file parser.cpp. References Token::isNull(), lex, Lexer::lookAhead(), Lexer::nextToken(), Token_bool, Token_break, Token_case, Token_catch, Token_char, Token_class, Token_const, Token_continue, Token_default, Token_do, Token_double, Token_enum, Token_float, Token_for, Token_goto, Token_identifier, Token_if, Token_int, Token_long, Token_return, Token_scope, Token_short, Token_signed, Token_struct, Token_switch, Token_template, Token_throw, Token_try, Token_union, Token_unsigned, Token_using, Token_void, Token_volatile, Token_wchar_t, and Token_while. Referenced by parseCompoundStatement(), and parseFunctionBody(). |
|
Definition at line 161 of file parser.cpp. References reportError(). Referenced by parseDeclarationInternal(), parseInitDeclaratorList(), parseOperatorFunctionId(), parseSwitchStatement(), parseTemplateArgumentList(), parseTemplateParameterList(), parseTryBlockStatement(), and parseTypeParameter(). |
|
Definition at line 3108 of file parser.cpp. References lex, Token::text(), Lexer::tokenAt(), and toString(). Referenced by parseDeclarationInternal(), and toString(). |
|
Reimplemented in LLkParser. Definition at line 190 of file Parser.cpp. References ANTLR_USE_NAMESPACE, endl(), inputState, LT(), traceDepth, and traceIn(). Referenced by traceIn(), and Parser::Tracer::Tracer(). |
|
Set or change the input token buffer.
Definition at line 184 of file Parser.cpp. References ANTLR_USE_NAMESPACE, and traceDepth. Referenced by match(), and LLkParser::trace(). |
|
Reimplemented in LLkParser. Definition at line 203 of file Parser.cpp. References ANTLR_USE_NAMESPACE, endl(), inputState, LT(), traceDepth, and traceOut(). Referenced by traceOut(), and Parser::Tracer::~Tracer(). |
Member Data Documentation
|
|
|
AST support code; parser and treeparser delegate to this object.
Definition at line 194 of file Parser.hpp. |
|
Definition at line 207 of file parser.h. Referenced by Parser(). |
|
Definition at line 188 of file Parser.hpp. Referenced by traceIn(), and traceOut(). |
|
|
Definition at line 208 of file parser.h. Referenced by reportError(). |
|
Definition at line 211 of file parser.h. Referenced by Parser(), and reportError(). |
|
Definition at line 210 of file parser.h. Referenced by reportError(). |
|
Definition at line 212 of file parser.h. Referenced by parseDeclaration(), and Parser(). |
|
AST return value for a rule is squirreled away here.
Definition at line 191 of file Parser.hpp. |
|
Definition at line 197 of file Parser.hpp. Referenced by traceIn(), traceIndent(), and traceOut(). |
The documentation for this class was generated from the following files:
- lib/antlr/antlr/Parser.hpp
- lib/cppparser/parser.h
- lib/antlr/src/Parser.cpp
- lib/cppparser/parser.cpp