Home | History | Annotate | Download | only in Parse

Lines Matching refs:Declarator

32 ///         specifier-qualifier-list abstract-declarator[opt]
36 Declarator::TheContext Context,
47 // Parse the abstract-declarator, if present.
48 Declarator DeclaratorInfo(DS, Context);
956 /// 'Context' should be a Declarator::TheContext value. This returns the
1021 /// declaration-specifiers init-declarator-list[opt] ';'
1022 ///[C90/C++]init-declarator-list ';' [TODO]
1026 /// attribute-specifier-seq[opt] type-specifier-seq declarator
1048 // declaration-specifiers init-declarator-list[opt] ';'
1060 /// Returns true if this might be the start of a declarator, or a common typo
1061 /// for a declarator.
1081 return Context == Declarator::MemberContext && getLangOpts().CPlusPlus0x &&
1085 return Context == Declarator::MemberContext || getLangOpts().CPlusPlus;
1111 return Context == Declarator::MemberContext ||
1112 (getLangOpts().CPlusPlus && Context == Declarator::FileContext);
1195 // Parse the first declarator.
1196 ParsingDeclarator D(*this, DS, static_cast<Declarator::TheContext>(Context));
1199 // Bail out if the first declarator didn't seem well-formed.
1247 // C++0x [stmt.iter]p1: Check if we have a for-range-declarator. If so, we
1271 bool ExpectSemi = Context != Declarator::ForContext;
1280 // the start of a declarator. The comma was probably a typo for a
1288 // Parse the next declarator.
1292 // Accept attributes in an init-declarator. In the first declarator in a
1294 // declarators, they become part of the declarator itself, so that they
1297 // short var __attribute__((common)); -> declarator
1298 // short x, __attribute__((common)) var; -> declarator
1315 Context == Declarator::FileContext
1334 /// declarator. Returns true on an error.
1335 bool Parser::ParseAsmAttributesAfterDeclarator(Declarator &D) {
1354 /// declarator'. This method parses the remainder of the declaration
1358 /// init-declarator: [C99 6.7]
1359 /// declarator
1360 /// declarator '=' initializer
1361 /// [GNU] declarator simple-asm-expr[opt] attributes[opt]
1362 /// [GNU] declarator simple-asm-expr[opt] attributes[opt] '=' initializer
1363 /// [C++] declarator initializer[opt]
1375 Decl *Parser::ParseDeclarationAfterDeclarator(Declarator &D,
1383 Decl *Parser::ParseDeclarationAfterDeclaratorAndAttributes(Declarator &D,
1385 // Inform the current actions module that we just parsed this declarator.
1420 // Parse declarator '=' initializer.
1584 /// specified token is valid after the identifier in a declarator which
1587 /// int x [ 4]; // direct-declarator
1588 /// int x ( int y); // direct-declarator
1589 /// int(int x ) // direct-declarator
1591 /// int x = 17; // init-declarator-list
1592 /// int x , y; // init-declarator-list
1593 /// int x __asm__ ("foo"); // init-declarator-list
1594 /// int x : 4; // struct-declarator
1647 // identifier in the declarator.
1727 /// \brief Determine the declaration specifier context from the declarator
1730 /// \param Context the declarator context, which is one of the
1731 /// Declarator::TheContext enumerator values.
1734 if (Context == Declarator::MemberContext)
1736 if (Context == Declarator::FileContext)
1738 if (Context == Declarator::TrailingReturnContext)
2007 // looked at the declarator, and the user probably meant this
2515 /// specifier-qualifier-list struct-declarator-list
2518 /// struct-declarator-list:
2519 /// struct-declarator
2520 /// struct-declarator-list ',' struct-declarator
2521 /// [GNU] struct-declarator-list ',' attributes[opt] struct-declarator
2522 /// struct-declarator:
2523 /// declarator
2524 /// [GNU] declarator attributes[opt]
2525 /// declarator[opt] ':' constant-expression
2526 /// [GNU] declarator[opt] ':' constant-expression attributes[opt]
2560 /// struct-declarator: declarator
2561 /// struct-declarator: declarator[opt] ':' constant-expression
2577 // If attributes exist after the declarator, parse them.
2580 // We're done with this declarator; invoke the callback.
2654 // Install the declarator into the current TagDecl.
2801 // Skip the rest of this declarator, up until the comma or semicolon.
2813 // Skip the rest of this declarator, up until the comma or semicolon.
2932 // Skip the rest of this declarator, up until the comma or semicolon.
2953 // Skip the rest of this declarator, up until the comma or semicolon.
3512 // If this is not a constructor, we must be parsing a declarator,
3647 /// ParseDeclarator - Parse and verify a newly-initialized declarator.
3649 void Parser::ParseDeclarator(Declarator &D) {
3650 /// This implements the 'declarator' production in the C grammar, then checks
3666 /// ParseDeclaratorInternal - Parse a C or C++ declarator. The direct-declarator
3667 /// is parsed by the function passed to it. Pass null, and the direct-declarator
3675 /// declarator: [C99 6.7.5] [C++ 8p4, dcl.decl]
3676 /// [C] pointer[opt] direct-declarator
3677 /// [C++] direct-declarator
3678 /// [C++] ptr-operator declarator
3691 void Parser::ParseDeclaratorInternal(Declarator &D,
3702 bool EnteringContext = D.getContext() == Declarator::FileContext ||
3703 D.getContext() == Declarator::MemberContext;
3709 // The scope spec really belongs to the direct-declarator.
3756 // Recursively parse the declarator.
3777 // the declarator.
3799 // Recursively parse the declarator.
3815 // declarator: reference collapsing will take care of it.
3827 static void diagnoseMisplacedEllipsis(Parser &P, Declarator &D,
3841 /// direct-declarator: [C99 6.7.5]
3843 /// '(' declarator ')'
3844 /// [GNU] '(' attributes declarator ')'
3845 /// [C90] direct-declarator '[' constant-expression[opt] ']'
3846 /// [C99] direct-declarator '[' type-qual-list[opt] assignment-expr[opt] ']'
3847 /// [C99] direct-declarator '[' 'static' type-qual-list[opt] assign-expr ']'
3848 /// [C99] direct-declarator '[' type-qual-list 'static' assignment-expr ']'
3849 /// [C99] direct-declarator '[' type-qual-list[opt] '*' ']'
3850 /// [C++11] direct-declarator '[' constant-expression[opt] ']'
3852 /// direct-declarator '(' parameter-type-list ')'
3853 /// direct-declarator '(' identifier-list[opt] ')'
3854 /// [GNU] direct-declarator '(' parameter-forward-declarations
3856 /// [C++] direct-declarator '(' parameter-declaration-clause ')'
3858 /// [C++11] direct-declarator '(' parameter-declaration-clause ')'
3861 /// [C++] declarator-id
3862 /// [C++11] declarator-id attribute-specifier-seq[opt]
3864 /// declarator-id: [C++ 8]
3881 void Parser::ParseDirectDeclarator(Declarator &D) {
3887 bool EnteringContext = D.getContext() == Declarator::FileContext ||
3888 D.getContext() == Declarator::MemberContext;
3896 // is exited (and the declarator has been parsed).
3904 // abstract-declarator if the type of the parameter names a template
3908 !((D.getContext() == Declarator::PrototypeContext ||
3909 D.getContext() == Declarator::BlockLiteralContext) &&
3922 // The ellipsis can't be followed by a parenthesized declarator. We
3936 (D.getContext() == Declarator::FileContext ||
3937 (D.getContext() == Declarator::MemberContext &&
3940 AllowConstructorName = (D.getContext() == Declarator::MemberContext);
3951 // whole declarator bad.
3973 // direct-declarator: '(' declarator ')'
3974 // direct-declarator: '(' attributes declarator ')'
3978 // If the declarator was parenthesized, we entered the declarator
3979 // scope when parsing the parenthesized declarator, then exited
3982 // If there was an error parsing parenthesized declarator, declarator
3987 // is exited (and the declarator has been parsed).
3991 // This could be something simple like "int" (in which case the declarator
3992 // portion is empty), if an abstract-declarator is allowed.
3995 if (D.getContext() == Declarator::MemberContext)
4021 // In such a case, check if we actually have a function declarator; if it
4022 // is not, the declarator has been fully parsed.
4026 bool warnIfAmbiguous = D.getContext() != Declarator::FileContext;
4043 /// ParseParenDeclarator - We parsed the declarator D up to a paren. This is
4046 /// parameter parens in an abstract-declarator, we call ParseFunctionDeclarator.
4048 /// direct-declarator:
4049 /// '(' declarator ')'
4050 /// [GNU] '(' attributes declarator ')'
4051 /// direct-declarator '(' parameter-type-list ')'
4052 /// direct-declarator '(' identifier-list[opt] ')'
4053 /// [GNU] direct-declarator '(' parameter-forward-declarations
4056 void Parser::ParseParenDeclarator(Declarator &D) {
4063 // declarator paren. If this is a grouping paren, the attribute applies to
4093 // stored, if this is an abstract declarator), then this is probably just
4094 // grouping parens. However, if this could be an abstract-declarator, then
4099 // If this can't be an abstract-declarator, this *must* be a grouping
4116 // direct-declarator: '(' declarator ')'
4117 // direct-declarator: '(' attributes declarator ')'
4141 // argument list. Recognize that this declarator will never have an
4155 /// declarator D up to a paren, which indicates that we are parsing function
4173 void Parser::ParseFunctionDeclarator(Declarator &D,
4255 // and the end of the function-definition, member-declarator, or
4256 // declarator.
4259 (D.getContext() == Declarator::MemberContext ||
4260 (D.getContext() == Declarator::FileContext &&
4269 bool Delayed = (D.getContext() == Declarator::MemberContext &&
4339 // float y)", we don't want to start parsing the function declarator as
4340 // though it is a K&R style declarator just because intptr is an
4349 /// ParseFunctionDeclaratorIdentifierList - While parsing a function declarator
4359 Declarator &D,
4361 // If there was no identifier specified for the declarator, either we are in
4362 // an abstract-declarator, or we are in a parameter declarator which was found
4411 /// D is the declarator being parsed. If FirstArgAttrs is non-null, then the
4428 /// declaration-specifiers declarator
4429 /// [C++] declaration-specifiers declarator '=' assignment-expression
4431 /// [GNU] declaration-specifiers declarator attributes
4432 /// declaration-specifiers abstract-declarator[opt]
4433 /// [C++] declaration-specifiers abstract-declarator[opt]
4435 /// [GNU] declaration-specifiers abstract-declarator[opt] attributes
4439 Declarator &D,
4453 // Just use the ParsingDeclaration "scope" of the declarator.
4474 // Parse the declarator. This is "PrototypeContext", because we must
4475 // accept either 'declarator' or 'abstract-declarator' here.
4476 Declarator ParmDecl(DS, Declarator::PrototypeContext);
4499 // Inform the actions module about the parameter declarator, so it gets
4511 if (D.getContext() == Declarator::MemberContext) {
4589 /// [C90] direct-declarator '[' constant-expression[opt] ']'
4590 /// [C99] direct-declarator '[' type-qual-list[opt] assignment-expr[opt] ']'
4591 /// [C99] direct-declarator '[' 'static' type-qual-list[opt] assign-expr ']'
4592 /// [C99] direct-declarator '[' type-qual-list 'static' assignment-expr ']'
4593 /// [C99] direct-declarator '[' type-qual-list[opt] '*' ']'
4594 /// [C++11] direct-declarator '[' constant-expression[opt] ']'
4596 void Parser::ParseBracketDeclarator(Declarator &D) {
4651 // Handle "direct-declarator [ type-qual-list[opt] * ]".