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. |
|
Definition at line 62 of file Parser.cpp. |
|
Definition at line 67 of file Parser.cpp. References ParserSharedInputState. |
|
Definition at line 72 of file Parser.cpp. |
|
|
|
Definition at line 110 of file parser.cpp. References d, m_maxProblems, and objcp. |
|
|
|
|
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(), LA(), and BitSet::member(). |
|
Consume tokens until one matches the given token.
Definition at line 77 of file Parser.cpp. |
|
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. References inputState. Referenced by match(), matchNot(), reportError(), and reportWarning(). |
|
Definition at line 123 of file Parser.hpp. References ParserSharedInputState. |
|
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. References inputState. |
|
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(), getFilename(), getNumTokens(), getTokenNames(), LA(), LT(), 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(), getFilename(), getNumTokens(), getTokenNames(), LA(), LT(), and traceIndent(). |
|
Definition at line 140 of file Parser.cpp. References consume(), getFilename(), getNumTokens(), getTokenNames(), LA(), and LT(). |
|
|
|
|
|
Definition at line 151 of file Parser.cpp. References ANTLR_USE_NAMESPACE. |
|
Definition at line 1259 of file parser.cpp. References ADVANCE, Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseExceptionSpecification(), parseParameterDeclarationClause(), parsePtrOperator(), reportError(), Lexer::setIndex(), skipCommaExpression(), Token_identifier, and UPDATE_POS. Referenced by parseParameterDeclaration(), and parseTypeId(). |
|
Definition at line 1854 of file parser.cpp. References Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), Token_private, Token_protected, Token_public, and UPDATE_POS. Referenced by parseBaseSpecifier(), and parseMemberSpecification(). |
|
Definition at line 3536 of file parser.cpp. References lex, Lexer::lookAhead(), Lexer::nextToken(), and parseMultiplicativeExpression(). Referenced by parseShiftExpression(). |
|
Definition at line 3605 of file parser.cpp. References lex, Lexer::lookAhead(), Lexer::nextToken(), and parseEqualityExpression(). Referenced by parseExclusiveOrExpression(). |
|
Definition at line 855 of file parser.cpp. References ADVANCE, parseCvQualify(), skip(), and Token_asm. Referenced by parseBlockDeclaration(), and parseDeclaration(). |
|
Definition at line 3719 of file parser.cpp. References Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseConditionalExpression(), parseThrowExpression(), Token_assign, Token_throw, and UPDATE_POS. Referenced by parseCommaExpression(), parseConditionalExpression(), parseInitializerClause(), and parseThrowExpression(). |
|
Definition at line 2097 of file parser.cpp. References Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseBaseSpecifier(), reportError(), and UPDATE_POS. Referenced by parseClassSpecifier(). |
|
Definition at line 2221 of file parser.cpp. References AST_FROM_TOKEN, Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseAccessSpecifier(), parseName(), reportError(), and UPDATE_POS. Referenced by parseBaseClause(). |
|
Definition at line 2776 of file parser.cpp. References Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseAsmDefinition(), parseCvQualify(), parseInitDeclaratorList(), parseNamespaceAliasDefinition(), parseStorageClassSpecifier(), parseTypedef(), parseTypeSpecifierOrClassSpec(), parseUsing(), Lexer::setIndex(), Token_asm, Token_namespace, Token_typedef, Token_using, and UPDATE_POS. Referenced by parseDeclarationStatement(). |
|
Definition at line 3476 of file parser.cpp. References Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseTypeId(), parseUnaryExpression(), and Lexer::setIndex(). Referenced by parseDeleteExpression(), parsePmExpression(), and parseUnaryExpression(). |
|
Definition at line 1781 of file parser.cpp. References ADVANCE, Lexer::index(), Token::isNull(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseBaseClause(), parseMemberSpecification(), parseName(), parseWinDeclSpec(), reportError(), Lexer::setIndex(), skipUntil(), skipUntilDeclaration(), Token_class, Token_identifier, Token_struct, and UPDATE_POS. Referenced by parseDeclaration(), parseMemberSpecification(), and parseTypeSpecifierOrClassSpec(). |
|
Definition at line 3770 of file parser.cpp. References Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseAssignmentExpression(), and UPDATE_POS. Referenced by 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(), parseStatement(), reportError(), skipUntilStatement(), and UPDATE_POS. Referenced by parseStatement(), parseSwitchStatement(), and parseTryBlockStatement(). |
|
Definition at line 2464 of file parser.cpp. References Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseDeclarator(), parseTypeSpecifier(), Lexer::setIndex(), skipCommaExpression(), skipExpression(), and UPDATE_POS. Referenced by parseForStatement(), parseIfStatement(), parseSwitchStatement(), parseTryBlockStatement(), and parseWhileStatement(). |
|
Definition at line 3697 of file parser.cpp. References CHECK, lex, Lexer::lookAhead(), Lexer::nextToken(), parseAssignmentExpression(), parseExpression(), and parseLogicalOrExpression(). Referenced by parseAssignmentExpression(), and parseConstantExpression(). |
|
Definition at line 3742 of file parser.cpp. References Lexer::index(), lex, parseConditionalExpression(), and UPDATE_POS. Referenced by parseDeclarator(), parseEnumerator(), and parseLabeledStatement(). |
|
Definition at line 1955 of file parser.cpp. References lex, Lexer::lookAhead(), Lexer::nextToken(), parseMemInitializerList(), and reportError(). Referenced by parseDeclarationInternal(). |
|
Definition at line 975 of file parser.cpp. References Lexer::index(), Token::isNull(), lex, Lexer::lookAhead(), Lexer::nextToken(), Token_const, and UPDATE_POS. Referenced by parseAsmDefinition(), parseBlockDeclaration(), parseDeclaration(), parseDeclarationInternal(), parseMemberSpecification(), parseOperatorFunctionId(), parsePtrOperator(), and parseTypeSpecifier(). |
|
|
|
Definition at line 2848 of file parser.cpp. References Lexer::index(), lex, parseBlockDeclaration(), and UPDATE_POS. Referenced by parseForInitStatement(), and parseStatement(). |
|
Definition at line 1133 of file parser.cpp. References ADVANCE, Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseCommaExpression(), parseConstantExpression(), parseDeclaratorId(), parseExceptionSpecification(), parseParameterDeclarationClause(), parsePtrOperator(), reportError(), Lexer::setIndex(), Token_identifier, and UPDATE_POS. Referenced by parseCondition(), parseInitDeclarator(), and parseParameterDeclaration(). |
|
Definition at line 2006 of file parser.cpp. References parseName(). Referenced by parseDeclarator(). |
|
Definition at line 3459 of file parser.cpp. References CHECK, lex, Lexer::lookAhead(), Lexer::nextToken(), parseCastExpression(), Token_delete, and Token_scope. Referenced by parseUnaryExpression(). |
|
Definition at line 2535 of file parser.cpp. References ADVANCE, ADVANCE_NR, Lexer::index(), lex, parseStatement(), reportError(), skipCommaExpression(), Token_do, Token_while, and UPDATE_POS. Referenced by parseStatement(). |
|
Definition at line 1972 of file parser.cpp. References Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseName(), Lexer::setIndex(), Token_class, Token_enum, Token_struct, Token_union, and UPDATE_POS. Referenced by parseTypeSpecifier(). |
|
Definition at line 2039 of file parser.cpp. References Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseConstantExpression(), reportError(), and UPDATE_POS. Referenced by parseEnumSpecifier(). |
|
Definition at line 1357 of file parser.cpp. References Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseEnumerator(), parseName(), reportError(), Lexer::setIndex(), and UPDATE_POS. Referenced by parseDeclaration(), parseMemberSpecification(), and parseTypeSpecifierOrClassSpec(). |
|
Definition at line 3588 of file parser.cpp. References lex, Lexer::lookAhead(), Lexer::nextToken(), parseRelationalExpression(), and Token_eq. Referenced by parseAndExpression(). |
|
Definition at line 2012 of file parser.cpp. References ADVANCE, AST_FROM_TOKEN, Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseTypeIdList(), and UPDATE_POS. Referenced by parseAbstractDeclarator(), and parseDeclarator(). |
|
Definition at line 3622 of file parser.cpp. References lex, Lexer::lookAhead(), Lexer::nextToken(), and parseAndExpression(). Referenced by parseInclusiveOrExpression(). |
|
Definition at line 3755 of file parser.cpp. References Lexer::index(), lex, parseCommaExpression(), and UPDATE_POS. Referenced by parseConditionalExpression(), parseNewDeclarator(), and parsePrimaryExpression(). |
|
Definition at line 2606 of file parser.cpp. References parseDeclarationStatement(), and skipExpressionStatement(). Referenced by parseForStatement(). |
|
Definition at line 2569 of file parser.cpp. References ADVANCE, Lexer::index(), lex, parseCondition(), parseForInitStatement(), parseStatement(), reportError(), skipCommaExpression(), Token_for, and UPDATE_POS. Referenced by parseStatement(). |
|
Definition at line 3071 of file parser.cpp. References Lexer::index(), Token::isNull(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseStatement(), reportError(), skipUntilStatement(), and UPDATE_POS. Referenced by parseDeclarationInternal(). |
|
Definition at line 1583 of file parser.cpp. References Lexer::index(), Token::isNull(), lex, Lexer::lookAhead(), Lexer::nextToken(), Token_inline, Token_virtual, and UPDATE_POS. Referenced by parseDeclarationInternal(). |
|
Definition at line 3996 of file parser.cpp. References lex, Lexer::lookAhead(), Lexer::nextToken(), and Token_identifier. |
|
Definition at line 3968 of file parser.cpp. References ADVANCE, AST_FROM_TOKEN, Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), Token_identifier, and UPDATE_POS. Referenced by parseObjcAliasDecl(), parseObjcClassDecl(), parseObjcProtocolDecl(), and parseWinDeclSpec(). |
|
Definition at line 2655 of file parser.cpp. References ADVANCE, Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseCondition(), parseStatement(), reportError(), Token_if, and UPDATE_POS. Referenced by parseStatement(). |
|
Definition at line 3639 of file parser.cpp. References lex, Lexer::lookAhead(), Lexer::nextToken(), and parseExclusiveOrExpression(). Referenced by parseLogicalAndExpression(). |
|
Definition at line 2072 of file parser.cpp. References Lexer::index(), lex, parseDeclarator(), parseInitializer(), and UPDATE_POS. Referenced by parseDeclarationInternal(), and parseInitDeclaratorList(). |
|
Definition at line 1634 of file parser.cpp. References Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseInitDeclarator(), syntaxError(), and UPDATE_POS. Referenced by parseBlockDeclaration(), parseDeclaration(), parseDeclarationInternal(), parseMemberSpecification(), and parseTypedef(). |
|
Definition at line 2131 of file parser.cpp. References ADVANCE, lex, Lexer::lookAhead(), Lexer::nextToken(), parseInitializerClause(), reportError(), and skipCommaExpression(). Referenced by parseInitDeclarator(). |
|
Definition at line 2260 of file parser.cpp. References lex, Lexer::lookAhead(), Lexer::nextToken(), parseAssignmentExpression(), reportError(), and skip(). Referenced by parseInitializer(). |
|
Definition at line 3818 of file parser.cpp. |
|
Definition at line 3830 of file parser.cpp. |
|
Definition at line 3806 of file parser.cpp. |
|
Definition at line 3812 of file parser.cpp. |
|
Definition at line 3824 of file parser.cpp. |
|
Definition at line 3896 of file parser.cpp. |
|
Definition at line 3890 of file parser.cpp. |
|
Definition at line 3860 of file parser.cpp. |
|
Definition at line 3884 of file parser.cpp. |
|
Definition at line 3944 of file parser.cpp. |
|
Definition at line 3938 of file parser.cpp. |
|
Definition at line 3848 of file parser.cpp. |
|
Definition at line 2729 of file parser.cpp. References ADVANCE, lex, Lexer::lookAhead(), Lexer::nextToken(), parseConstantExpression(), parseStatement(), reportError(), Token_case, Token_default, and Token_identifier. Referenced by parseStatement(). |
|
Definition at line 579 of file parser.cpp. References Lexer::index(), Token::isNull(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseDeclaration(), reportError(), skipUntilDeclaration(), and UPDATE_POS. Referenced by parseLinkageSpecification(), and parseNamespace(). |
|
Definition at line 538 of file parser.cpp. References Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseDeclaration(), parseLinkageBody(), reportError(), and UPDATE_POS. Referenced by parseDeclaration(). |
|
Definition at line 3656 of file parser.cpp. References lex, Lexer::lookAhead(), Lexer::nextToken(), and parseInclusiveOrExpression(). Referenced by parseLogicalOrExpression(). |
|
Definition at line 3674 of file parser.cpp. References Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseLogicalAndExpression(), and UPDATE_POS. Referenced by parseConditionalExpression(), parseParameterDeclaration(), and parseTemplateArgument(). |
|
Definition at line 1875 of file parser.cpp. References ADVANCE, Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseAccessSpecifier(), parseClassSpecifier(), parseCvQualify(), parseDeclarationInternal(), parseEnumSpecifier(), parseInitDeclaratorList(), parseStorageClassSpecifier(), parseTemplateDeclaration(), parseTypedef(), parseUsing(), Lexer::setIndex(), Token_k_dcop, Token_Q_OBJECT, Token_signals, and UPDATE_POS. Referenced by parseClassSpecifier(). |
|
Definition at line 2175 of file parser.cpp. References ADVANCE, parseMemInitializerId(), reportError(), and skipCommaExpression(). Referenced by parseMemInitializerList(). |
|
Definition at line 2278 of file parser.cpp. References parseName(). Referenced by parseMemInitializer(). |
|
Definition at line 2154 of file parser.cpp. References lex, Lexer::lookAhead(), Lexer::nextToken(), and parseMemInitializer(). Referenced by parseCtorInitializer(). |
|
Definition at line 3878 of file parser.cpp. |
|
Definition at line 3836 of file parser.cpp. |
|
Definition at line 3518 of file parser.cpp. References lex, Lexer::lookAhead(), Lexer::nextToken(), and parsePmExpression(). Referenced by parseAdditiveExpression(). |
|
Definition at line 3914 of file parser.cpp. |
|
Definition at line 3908 of file parser.cpp. |
|
skip optional template ####
Definition at line 389 of file parser.cpp. References Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseUnqualifiedName(), parseWinDeclSpec(), and UPDATE_POS. Referenced by parseBaseSpecifier(), parseClassSpecifier(), parseDeclarationInternal(), parseDeclaratorId(), parseElaboratedTypeSpecifier(), parseEnumSpecifier(), parseMemInitializerId(), 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(), parseLinkageBody(), parseName(), reportError(), and UPDATE_POS. Referenced by parseDeclaration(). |
|
Definition at line 2827 of file parser.cpp. References ADVANCE, lex, Lexer::lookAhead(), Lexer::nextToken(), parseName(), reportError(), and Token_identifier. Referenced by parseBlockDeclaration(). |
|
Definition at line 3422 of file parser.cpp. References ADVANCE, lex, Lexer::lookAhead(), Lexer::nextToken(), parseExpression(), and parsePtrOperator(). Referenced by parseNewTypeId(). |
|
Definition at line 3379 of file parser.cpp. References CHECK, lex, Lexer::lookAhead(), Lexer::nextToken(), parseCommaExpression(), parseNewInitializer(), parseNewTypeId(), parseTypeId(), Token_new, and Token_scope. Referenced by parseUnaryExpression(). |
|
Definition at line 3445 of file parser.cpp. References CHECK, lex, Lexer::lookAhead(), Lexer::nextToken(), and parseCommaExpression(). Referenced by parseNewExpression(). |
|
Definition at line 3409 of file parser.cpp. References parseNewDeclarator(), and parseTypeSpecifier(). Referenced by parseNewExpression(). |
|
Definition at line 4065 of file parser.cpp. References ADVANCE, OBJC_ALIAS, and parseIdentifierList(). |
|
Definition at line 4039 of file parser.cpp. References ADVANCE, OBJC_CLASS, and parseIdentifierList(). |
|
Definition at line 4033 of file parser.cpp. |
|
Definition at line 4021 of file parser.cpp. |
|
Definition at line 4027 of file parser.cpp. Referenced by parseDeclaration(). |
|
Definition at line 3950 of file parser.cpp. |
|
Definition at line 3872 of file parser.cpp. |
|
Definition at line 4084 of file parser.cpp. |
|
Definition at line 4015 of file parser.cpp. |
|
Definition at line 4052 of file parser.cpp. References ADVANCE, OBJC_PROTOCOL, and parseIdentifierList(). |
|
Definition at line 4078 of file parser.cpp. |
|
Definition at line 4009 of file parser.cpp. |
|
Definition at line 3926 of file parser.cpp. |
|
Definition at line 3956 of file parser.cpp. |
|
Definition at line 915 of file parser.cpp. References lex, Lexer::lookAhead(), Lexer::nextToken(), 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 parseOperatorFunctionId(). |
|
Definition at line 745 of file parser.cpp. References Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseCvQualify(), parseOperator(), parsePtrOperator(), parseSimpleTypeSpecifier(), syntaxError(), and UPDATE_POS. Referenced by parseUnqualifiedName(). |
|
Definition at line 3920 of file parser.cpp. |
|
Definition at line 1738 of file parser.cpp. References Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseAbstractDeclarator(), parseDeclarator(), parseLogicalOrExpression(), parseTypeSpecifier(), Lexer::setIndex(), and UPDATE_POS. Referenced by parseParameterDeclarationList(), and parseTemplateParameter(). |
|
Definition at line 1665 of file parser.cpp. References AST_FROM_TOKEN, Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseParameterDeclarationList(), Token_ellipsis, and UPDATE_POS. Referenced by parseAbstractDeclarator(), and parseDeclarator(). |
|
Definition at line 1704 of file parser.cpp. References Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseParameterDeclaration(), Lexer::setIndex(), and UPDATE_POS. Referenced by parseParameterDeclarationClause(). |
|
Definition at line 3501 of file parser.cpp. References lex, Lexer::lookAhead(), Lexer::nextToken(), and parseCastExpression(). Referenced by parseMultiplicativeExpression(). |
|
Definition at line 3259 of file parser.cpp. References CHECK, lex, Lexer::lookAhead(), Lexer::nextToken(), parseCommaExpression(), parseName(), parsePrimaryExpression(), Token_arrow, Token_decr, Token_incr, and Token_typename. Referenced by parseUnaryExpression(). |
|
Definition at line 3172 of file parser.cpp. References CHECK, Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseCommaExpression(), parseExpression(), parseName(), 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(). |
|
Definition at line 3962 of file parser.cpp. |
|
Definition at line 1065 of file parser.cpp. References Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseCvQualify(), parsePtrToMember(), Lexer::setIndex(), and UPDATE_POS. Referenced by parseAbstractDeclarator(), parseDeclarator(), parseNewDeclarator(), and parseOperatorFunctionId(). |
|
Definition at line 2285 of file parser.cpp. References lex, Lexer::lookAhead(), Lexer::nextToken(), and Token_scope. Referenced by parsePtrOperator(). |
|
Definition at line 3866 of file parser.cpp. |
|
Definition at line 3570 of file parser.cpp. References lex, Lexer::lookAhead(), Lexer::nextToken(), parseShiftExpression(), and Token_leq. Referenced by parseEqualityExpression(). |
|
Definition at line 3902 of file parser.cpp. |
|
Definition at line 3854 of file parser.cpp. |
|
Definition at line 3932 of file parser.cpp. |
|
Definition at line 3553 of file parser.cpp. References lex, Lexer::lookAhead(), Lexer::nextToken(), and parseAdditiveExpression(). Referenced by parseRelationalExpression(). |
|
Definition at line 1008 of file parser.cpp. References Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseName(), 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(), and parseTypeSpecifier(). |
|
|
Definition at line 1554 of file parser.cpp. References Lexer::index(), Token::isNull(), lex, Lexer::lookAhead(), Lexer::nextToken(), Token_auto, Token_extern, Token_friend, Token_register, Token_static, and UPDATE_POS. Referenced by parseBlockDeclaration(), parseDeclaration(), parseDeclarationInternal(), and parseMemberSpecification(). |
|
Definition at line 2365 of file parser.cpp. References Token::isNull(), lex, Lexer::lookAhead(), Lexer::nextToken(), Token::text(), and Token_identifier. Referenced by parsePrimaryExpression(). |
|
Definition at line 2699 of file parser.cpp. References ADVANCE, Lexer::index(), lex, parseCompoundStatement(), parseCondition(), reportError(), syntaxError(), Token_switch, and UPDATE_POS. Referenced by parseStatement(). |
|
Definition at line 1095 of file parser.cpp. References Lexer::index(), lex, Lexer::lookAhead(), parseLogicalOrExpression(), parseTypeId(), and Lexer::setIndex(). Referenced by parseTemplateArgumentList(). |
|
Definition at line 789 of file parser.cpp. References Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseTemplateArgument(), syntaxError(), and UPDATE_POS. Referenced by parseUnqualifiedName(). |
|
Definition at line 871 of file parser.cpp. References ADVANCE, Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseDeclaration(), parseTemplateParameterList(), reportError(), and UPDATE_POS. Referenced by parseDeclaration(), and parseMemberSpecification(). |
|
Definition at line 1439 of file parser.cpp. References Lexer::index(), lex, Lexer::lookAhead(), parseParameterDeclaration(), parseTypeParameter(), Token_class, Token_typename, and UPDATE_POS. Referenced by parseTemplateParameterList(). |
|
Definition at line 1408 of file parser.cpp. References Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseTemplateParameter(), syntaxError(), and UPDATE_POS. Referenced by parseTemplateDeclaration(), and parseTypeParameter(). |
|
Definition at line 3792 of file parser.cpp. References CHECK, lex, Lexer::lookAhead(), parseAssignmentExpression(), and Token_throw. Referenced by parseAssignmentExpression(). |
|
Definition at line 3131 of file parser.cpp. References ADVANCE, lex, Lexer::lookAhead(), Lexer::nextToken(), parseCompoundStatement(), parseCondition(), reportError(), and syntaxError(). Referenced by parseStatement(). |
|
Definition at line 821 of file parser.cpp. References ADVANCE, Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseInitDeclaratorList(), parseTypeSpecifierOrClassSpec(), reportError(), and UPDATE_POS. Referenced by parseBlockDeclaration(), parseDeclaration(), and parseMemberSpecification(). |
|
Definition at line 1612 of file parser.cpp. References Lexer::index(), lex, parseAbstractDeclarator(), parseTypeSpecifier(), and UPDATE_POS. Referenced by parseCastExpression(), parseNewExpression(), parsePrimaryExpression(), parseTemplateArgument(), parseTypeIdList(), parseTypeParameter(), and parseUnaryExpression(). |
|
Definition at line 2192 of file parser.cpp. References Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseTypeId(), reportError(), and UPDATE_POS. Referenced by parseExceptionSpecification(). |
|
Definition at line 1467 of file parser.cpp. References ADVANCE, AST_FROM_TOKEN, Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseName(), parseTemplateParameterList(), parseTypeId(), syntaxError(), Token_class, Token_template, Token_typename, and UPDATE_POS. Referenced by parseTemplateParameter(). |
|
Definition at line 1113 of file parser.cpp. References parseCvQualify(), parseElaboratedTypeSpecifier(), and parseSimpleTypeSpecifier(). Referenced by parseCondition(), parseDeclarationInternal(), parseNewTypeId(), parseParameterDeclaration(), parseTypeId(), parseTypeSpecifierOrClassSpec(), and CppCodeCompletion::typeName(). |
|
Definition at line 3119 of file parser.cpp. References parseClassSpecifier(), parseEnumSpecifier(), and parseTypeSpecifier(). Referenced by parseBlockDeclaration(), and parseTypedef(). |
|
Definition at line 3333 of file parser.cpp. References Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseCastExpression(), parseDeleteExpression(), parseNewExpression(), parsePostfixExpression(), parseTypeId(), Lexer::setIndex(), Token_decr, Token_delete, Token_incr, Token_new, and Token_sizeof. Referenced by parseCastExpression(). |
|
Definition at line 3842 of file parser.cpp. |
|
Definition at line 2307 of file parser.cpp. References Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseOperatorFunctionId(), parseTemplateArgumentList(), Lexer::setIndex(), and UPDATE_POS. Referenced by parseName(). |
|
Definition at line 674 of file parser.cpp. References ADVANCE, Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseName(), parseUsingDirective(), and UPDATE_POS. Referenced by parseBlockDeclaration(), parseDeclaration(), and parseMemberSpecification(). |
|
Definition at line 717 of file parser.cpp. References ADVANCE, Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseName(), reportError(), and UPDATE_POS. Referenced by parseUsing(). |
|
Definition at line 2505 of file parser.cpp. References ADVANCE, Lexer::index(), lex, parseCondition(), parseStatement(), reportError(), Token_while, and UPDATE_POS. Referenced by parseStatement(). |
|
Definition at line 4090 of file parser.cpp. References ADVANCE, Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), parseIdentifierList(), Token::text(), Token_identifier, and UPDATE_POS. Referenced by parseClassSpecifier(), parseDeclarationInternal(), and parseName(). |
|
Definition at line 146 of file parser.cpp. References Driver::addProblem(), Driver::currentFileName(), Lexer::getTokenPosition(), lex, Lexer::lookAhead(), m_driver, and m_problems. |
|
Definition at line 126 of file parser.cpp. References Driver::addProblem(), Driver::currentFileName(), Lexer::getTokenPosition(), lex, Lexer::lookAhead(), m_driver, m_problems, 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, and getFilename(). |
|
Parser error-reporting function can be overridden in subclass.
Definition at line 158 of file Parser.cpp. References ANTLR_USE_NAMESPACE, 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(), skipCommaExpression(), and syntaxError(). |
|
Parser warning-reporting function can be overridden in subclass.
Definition at line 173 of file Parser.cpp. References ANTLR_USE_NAMESPACE, and getFilename(). |
|
rewind to a previously marked position
Definition at line 155 of file Parser.hpp. References inputState. |
|
Specify the factory to be used during tree building. (Compulsory) Setting the factory is nowadays compulsory. Definition at line 90 of file Parser.hpp. References astFactory. |
|
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. References astFactory. |
|
Set the filename of the input file (used for error reporting).
Definition at line 114 of file Parser.hpp. References inputState. |
|
Definition at line 119 of file Parser.hpp. References inputState, and ParserSharedInputState. |
|
Definition at line 282 of file parser.cpp. References Token::isNull(), lex, Lexer::lookAhead(), and Lexer::nextToken(). Referenced by parseAsmDefinition(), parseInitializerClause(), and skipExpression(). |
|
Definition at line 304 of file parser.cpp. References Lexer::index(), lex, Lexer::lookAhead(), Lexer::nextToken(), reportError(), skipExpression(), and UPDATE_POS. Referenced by parseAbstractDeclarator(), parseCondition(), parseDoStatement(), parseForStatement(), parseInitializer(), parseMemInitializer(), parseStatement(), and skipExpressionStatement(). |
|
Definition at line 330 of file parser.cpp. References Lexer::index(), Token::isNull(), lex, Lexer::lookAhead(), Lexer::nextToken(), skip(), 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(), and skipCommaExpression(). |
|
Definition at line 2381 of file parser.cpp. References ADVANCE, Lexer::index(), lex, skipCommaExpression(), and UPDATE_POS. Referenced by parseForInitStatement(), and parseStatement(). |
|
Definition at line 166 of file parser.cpp. References Token::isNull(), lex, Lexer::lookAhead(), and Lexer::nextToken(). Referenced by parseClassSpecifier(). |
|
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(), and Lexer::tokenAt(). Referenced by parseDeclarationInternal(). |
|
Reimplemented in LLkParser. Definition at line 190 of file Parser.cpp. References ANTLR_USE_NAMESPACE, inputState, LT(), and traceDepth. Referenced by Parser::Tracer::Tracer(). |
|
Set or change the input token buffer.
Definition at line 184 of file Parser.cpp. References ANTLR_USE_NAMESPACE. Referenced by match(), and LLkParser::trace(). |
|
Reimplemented in LLkParser. Definition at line 203 of file Parser.cpp. References ANTLR_USE_NAMESPACE, inputState, and LT(). Referenced by Parser::Tracer::~Tracer(). |
Member Data Documentation
|
|
|
AST support code; parser and treeparser delegate to this object.
Definition at line 194 of file Parser.hpp. Referenced by setASTFactory(), and setASTNodeFactory(). |
|
Definition at line 207 of file parser.h. Referenced by Parser(). |
|
Definition at line 188 of file Parser.hpp. Referenced by getFilename(), mark(), rewind(), setFilename(), setInputState(), 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(). |
|
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(). |
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