diff --git a/clang/include/clang/Tooling/Syntax/Nodes.h b/clang/include/clang/Tooling/Syntax/Nodes.h --- a/clang/include/clang/Tooling/Syntax/Nodes.h +++ b/clang/include/clang/Tooling/Syntax/Nodes.h @@ -99,10 +99,14 @@ ParametersAndQualifiers, MemberPointer, UnqualifiedId, + + // Lists + DeclaratorList, ParameterDeclarationList, CallArguments, - // Nested Name Specifiers. NestedNameSpecifier, + + // Name Specifiers. GlobalNameSpecifier, DecltypeNameSpecifier, IdentifierNameSpecifier, @@ -179,6 +183,7 @@ Member, Callee, Arguments, + Declarators }; /// For debugging purposes. raw_ostream &operator<<(raw_ostream &OS, NodeRole R); @@ -823,6 +828,17 @@ } }; +class DeclaratorList final : public List { +public: + DeclaratorList() : List(NodeKind::DeclaratorList) {} + static bool classof(const Node *N) { + return N->getKind() == NodeKind::DeclaratorList; + } + std::vector getDeclarators(); + std::vector> + getDeclaratorsAndCommas(); +}; + /// Groups multiple declarators (e.g. variables, typedefs, etc.) together. All /// grouped declarators share the same declaration specifiers (e.g. 'int' or /// 'typedef'). diff --git a/clang/lib/Tooling/Syntax/BuildTree.cpp b/clang/lib/Tooling/Syntax/BuildTree.cpp --- a/clang/lib/Tooling/Syntax/BuildTree.cpp +++ b/clang/lib/Tooling/Syntax/BuildTree.cpp @@ -397,6 +397,17 @@ Mapping.add(From, New); } + /// Populate children for \p New list, assuming it covers tokens from a + /// subrange of \p SuperRange. + void foldList(ArrayRef SuperRange, syntax::List *New, + ASTPtr From) { + assert(New); + auto ListRange = Pending.shrinkToFitList(SuperRange); + Pending.foldChildren(Arena, ListRange, New); + if (From) + Mapping.add(From, New); + } + /// Notifies that we should not consume trailing semicolon when computing /// token range of \p D. void noticeDeclWithoutSemicolon(Decl *D); @@ -579,6 +590,35 @@ It->second->setRole(Role); } + /// Shrink \p Range to a subrange that only contains tokens of a list. + /// List elements and delimiters should already have correct roles. + ArrayRef shrinkToFitList(ArrayRef Range) { + auto BeginChildren = Trees.lower_bound(Range.begin()); + assert((BeginChildren == Trees.end() || + BeginChildren->first == Range.begin()) && + "Range crosses boundaries of existing subtrees"); + + auto EndChildren = Trees.lower_bound(Range.end()); + assert( + (EndChildren == Trees.end() || EndChildren->first == Range.end()) && + "Range crosses boundaries of existing subtrees"); + + auto BelongsToList = [](decltype(Trees)::value_type KV) { + auto Role = KV.second->getRole(); + return Role == syntax::NodeRole::ListElement || + Role == syntax::NodeRole::ListDelimiter; + }; + + auto BeginListChildren = + std::find_if(BeginChildren, EndChildren, BelongsToList); + + auto EndListChildren = + std::find_if_not(BeginListChildren, EndChildren, BelongsToList); + + return ArrayRef(BeginListChildren->first, + EndListChildren->first); + } + /// Add \p Node to the forest and attach child nodes based on \p Tokens. void foldChildren(const syntax::Arena &A, ArrayRef Tokens, syntax::Tree *Node) { @@ -1513,14 +1553,31 @@ // There doesn't have to be a declarator (e.g. `void foo(int)` only has // declaration, but no declarator). - if (Range.getBegin().isValid()) { - auto *N = new (allocator()) syntax::SimpleDeclarator; - Builder.foldNode(Builder.getRange(Range), N, nullptr); - Builder.markChild(N, syntax::NodeRole::Declarator); + if (!Range.getBegin().isValid()) { + Builder.markChild(new (allocator()) syntax::DeclaratorList, + syntax::NodeRole::Declarators); + Builder.foldNode(Builder.getDeclarationRange(D), + new (allocator()) syntax::SimpleDeclaration, D); + return true; } - if (Builder.isResponsibleForCreatingDeclaration(D)) { - Builder.foldNode(Builder.getDeclarationRange(D), + auto *N = new (allocator()) syntax::SimpleDeclarator; + Builder.foldNode(Builder.getRange(Range), N, nullptr); + Builder.markChild(N, syntax::NodeRole::ListElement); + + if (!Builder.isResponsibleForCreatingDeclaration(D)) { + // If this is not the last declarator in the declaration we expect a + // delimiter after it. + const auto *DelimiterToken = std::next(Builder.findToken(Range.getEnd())); + if (DelimiterToken->kind() == clang::tok::TokenKind::comma) + Builder.markChildToken(DelimiterToken, syntax::NodeRole::ListDelimiter); + } else { + auto *DL = new (allocator()) syntax::DeclaratorList; + auto DeclarationRange = Builder.getDeclarationRange(D); + Builder.foldList(DeclarationRange, DL, nullptr); + + Builder.markChild(DL, syntax::NodeRole::Declarators); + Builder.foldNode(DeclarationRange, new (allocator()) syntax::SimpleDeclaration, D); } return true; diff --git a/clang/lib/Tooling/Syntax/Nodes.cpp b/clang/lib/Tooling/Syntax/Nodes.cpp --- a/clang/lib/Tooling/Syntax/Nodes.cpp +++ b/clang/lib/Tooling/Syntax/Nodes.cpp @@ -136,6 +136,8 @@ return OS << "CallArguments"; case NodeKind::ParameterDeclarationList: return OS << "ParameterDeclarationList"; + case NodeKind::DeclaratorList: + return OS << "DeclaratorList"; } llvm_unreachable("unknown node kind"); } @@ -218,6 +220,8 @@ return OS << "Callee"; case syntax::NodeRole::Arguments: return OS << "Arguments"; + case syntax::NodeRole::Declarators: + return OS << "Declarators"; } llvm_unreachable("invalid role"); } @@ -291,6 +295,29 @@ return Children; } +std::vector +syntax::DeclaratorList::getDeclarators() { + auto DeclaratorsAsNodes = getElementsAsNodes(); + std::vector Children; + for (const auto &DeclaratorAsNode : DeclaratorsAsNodes) { + Children.push_back(llvm::cast(DeclaratorAsNode)); + } + return Children; +} + +std::vector> +syntax::DeclaratorList::getDeclaratorsAndCommas() { + auto DeclaratorsAsNodesAndCommas = getElementsAsNodesAndDelimiters(); + std::vector> + Children; + for (const auto &DeclaratorAsNodeAndComma : DeclaratorsAsNodesAndCommas) { + Children.push_back( + {llvm::cast(DeclaratorAsNodeAndComma.element), + DeclaratorAsNodeAndComma.delimiter}); + } + return Children; +} + syntax::Expression *syntax::MemberExpression::getObject() { return cast_or_null(findChild(syntax::NodeRole::Object)); } diff --git a/clang/lib/Tooling/Syntax/Synthesis.cpp b/clang/lib/Tooling/Syntax/Synthesis.cpp --- a/clang/lib/Tooling/Syntax/Synthesis.cpp +++ b/clang/lib/Tooling/Syntax/Synthesis.cpp @@ -183,6 +183,8 @@ return new (A.getAllocator()) syntax::CallArguments; case syntax::NodeKind::ParameterDeclarationList: return new (A.getAllocator()) syntax::ParameterDeclarationList; + case syntax::NodeKind::DeclaratorList: + return new (A.getAllocator()) syntax::DeclaratorList; } llvm_unreachable("unknown node kind"); } diff --git a/clang/unittests/Tooling/Syntax/BuildTreeTest.cpp b/clang/unittests/Tooling/Syntax/BuildTreeTest.cpp --- a/clang/unittests/Tooling/Syntax/BuildTreeTest.cpp +++ b/clang/unittests/Tooling/Syntax/BuildTreeTest.cpp @@ -92,21 +92,23 @@ TranslationUnit Detached |-SimpleDeclaration | |-'int' -| |-SimpleDeclarator Declarator -| | |-'main' -| | `-ParametersAndQualifiers -| | |-'(' OpenParen -| | `-')' CloseParen +| |-DeclaratorList Declarators +| | `-SimpleDeclarator ListElement +| | |-'main' +| | `-ParametersAndQualifiers +| | |-'(' OpenParen +| | `-')' CloseParen | `-CompoundStatement | |-'{' OpenParen | `-'}' CloseParen `-SimpleDeclaration |-'void' - |-SimpleDeclarator Declarator - | |-'foo' - | `-ParametersAndQualifiers - | |-'(' OpenParen - | `-')' CloseParen + |-DeclaratorList Declarators + | `-SimpleDeclarator ListElement + | |-'foo' + | `-ParametersAndQualifiers + | |-'(' OpenParen + | `-')' CloseParen `-CompoundStatement |-'{' OpenParen `-'}' CloseParen @@ -123,16 +125,18 @@ TranslationUnit Detached |-SimpleDeclaration | |-'int' -| |-SimpleDeclarator Declarator -| | `-'a' +| |-DeclaratorList Declarators +| | `-SimpleDeclarator ListElement +| | `-'a' | `-';' `-SimpleDeclaration |-'int' - |-SimpleDeclarator Declarator - | |-'b' - | |-'=' - | `-IntegerLiteralExpression - | `-'42' LiteralToken + |-DeclaratorList Declarators + | `-SimpleDeclarator ListElement + | |-'b' + | |-'=' + | `-IntegerLiteralExpression + | `-'42' LiteralToken `-';' )txt")); } @@ -146,21 +150,24 @@ TranslationUnit Detached `-SimpleDeclaration |-'void' - |-SimpleDeclarator Declarator - | |-'foo' - | `-ParametersAndQualifiers - | |-'(' OpenParen - | |-ParameterDeclarationList Parameters - | | |-SimpleDeclaration ListElement - | | | |-'int' - | | | `-SimpleDeclarator Declarator - | | | `-'a' - | | |-',' ListDelimiter - | | `-SimpleDeclaration ListElement - | | |-'int' - | | `-SimpleDeclarator Declarator - | | `-'b' - | `-')' CloseParen + |-DeclaratorList Declarators + | `-SimpleDeclarator ListElement + | |-'foo' + | `-ParametersAndQualifiers + | |-'(' OpenParen + | |-ParameterDeclarationList Parameters + | | |-SimpleDeclaration ListElement + | | | |-'int' + | | | `-DeclaratorList Declarators + | | | `-SimpleDeclarator ListElement + | | | `-'a' + | | |-',' ListDelimiter + | | `-SimpleDeclaration ListElement + | | |-'int' + | | `-DeclaratorList Declarators + | | `-SimpleDeclarator ListElement + | | `-'b' + | `-')' CloseParen `-CompoundStatement |-'{' OpenParen `-'}' CloseParen @@ -178,8 +185,9 @@ `-SimpleDeclaration |-'in\ t' - |-SimpleDeclarator Declarator - | `-'a' + |-DeclaratorList Declarators + | `-SimpleDeclarator ListElement + | `-'a' `-';' )txt")); } @@ -264,8 +272,9 @@ |-'(' |-SimpleDeclaration | |-'int' -| |-SimpleDeclarator Declarator -| | `-'x' +| |-DeclaratorList Declarators +| | `-SimpleDeclarator ListElement +| | `-'x' | `-':' |-IdExpression | `-UnqualifiedId UnqualifiedId @@ -287,11 +296,12 @@ DeclarationStatement Statement |-SimpleDeclaration | |-'int' -| `-SimpleDeclarator Declarator -| |-'a' -| |-'=' -| `-IntegerLiteralExpression -| `-'10' LiteralToken +| `-DeclaratorList Declarators +| `-SimpleDeclarator ListElement +| |-'a' +| |-'=' +| `-IntegerLiteralExpression +| `-'10' LiteralToken `-';' )txt"})); } @@ -391,11 +401,12 @@ TranslationUnit Detached `-SimpleDeclaration |-'void' - |-SimpleDeclarator Declarator - | |-'test' - | `-ParametersAndQualifiers - | |-'(' OpenParen - | `-')' CloseParen + |-DeclaratorList Declarators + | `-SimpleDeclarator ListElement + | |-'test' + | `-ParametersAndQualifiers + | |-'(' OpenParen + | `-')' CloseParen `-CompoundStatement |-'{' OpenParen |-ExpressionStatement Statement @@ -642,8 +653,9 @@ | | `-'n' | `-'::' ListDelimiter |-'S' -`-SimpleDeclarator Declarator - `-'s1' +`-DeclaratorList Declarators + `-SimpleDeclarator ListElement + `-'s1' )txt", R"txt( SimpleDeclaration @@ -652,8 +664,9 @@ | | `-'n' | `-'::' ListDelimiter |-'S' -`-SimpleDeclarator Declarator - `-'s2' +`-DeclaratorList Declarators + `-SimpleDeclarator ListElement + `-'s2' )txt"})); } @@ -684,8 +697,9 @@ | | `-'>' | `-'::' ListDelimiter |-'S' -`-SimpleDeclarator Declarator - `-'s1' +`-DeclaratorList Declarators + `-SimpleDeclarator ListElement + `-'s1' )txt", R"txt( SimpleDeclaration @@ -698,8 +712,9 @@ | | `-'>' | `-'::' ListDelimiter |-'S' -`-SimpleDeclarator Declarator - `-'s2' +`-DeclaratorList Declarators + `-SimpleDeclarator ListElement + `-'s2' )txt"})); } @@ -1363,11 +1378,12 @@ "TranslationUnit Detached\n" "`-SimpleDeclaration\n" " |-'void'\n" - " |-SimpleDeclarator Declarator\n" - " | |-'test'\n" - " | `-ParametersAndQualifiers\n" - " | |-'(' OpenParen\n" - " | `-')' CloseParen\n" + " |-DeclaratorList Declarators\n" + " | `-SimpleDeclarator ListElement\n" + " | |-'test'\n" + " | `-ParametersAndQualifiers\n" + " | |-'(' OpenParen\n" + " | `-')' CloseParen\n" " `-CompoundStatement\n" " |-'{' OpenParen\n" " |-ExpressionStatement Statement\n" @@ -2875,21 +2891,23 @@ TranslationUnit Detached |-SimpleDeclaration | |-'int' -| |-SimpleDeclarator Declarator -| | |-'*' -| | `-'a' -| |-',' -| |-SimpleDeclarator Declarator -| | `-'b' +| |-DeclaratorList Declarators +| | |-SimpleDeclarator ListElement +| | | |-'*' +| | | `-'a' +| | |-',' ListDelimiter +| | `-SimpleDeclarator ListElement +| | `-'b' | `-';' `-SimpleDeclaration |-'int' - |-SimpleDeclarator Declarator - | |-'*' - | `-'c' - |-',' - |-SimpleDeclarator Declarator - | `-'d' + |-DeclaratorList Declarators + | |-SimpleDeclarator ListElement + | | |-'*' + | | `-'c' + | |-',' ListDelimiter + | `-SimpleDeclarator ListElement + | `-'d' `-';' )txt")); } @@ -2904,12 +2922,13 @@ `-SimpleDeclaration |-'typedef' |-'int' - |-SimpleDeclarator Declarator - | |-'*' - | `-'a' - |-',' - |-SimpleDeclarator Declarator - | `-'b' + |-DeclaratorList Declarators + | |-SimpleDeclarator ListElement + | | |-'*' + | | `-'a' + | |-',' ListDelimiter + | `-SimpleDeclarator ListElement + | `-'b' `-';' )txt")); } @@ -2926,33 +2945,36 @@ TranslationUnit Detached `-SimpleDeclaration |-'void' - |-SimpleDeclarator Declarator - | |-'foo' - | `-ParametersAndQualifiers - | |-'(' OpenParen - | `-')' CloseParen + |-DeclaratorList Declarators + | `-SimpleDeclarator ListElement + | |-'foo' + | `-ParametersAndQualifiers + | |-'(' OpenParen + | `-')' CloseParen `-CompoundStatement |-'{' OpenParen |-DeclarationStatement Statement | |-SimpleDeclaration | | |-'int' - | | |-SimpleDeclarator Declarator - | | | |-'*' - | | | `-'a' - | | |-',' - | | `-SimpleDeclarator Declarator - | | `-'b' + | | `-DeclaratorList Declarators + | | |-SimpleDeclarator ListElement + | | | |-'*' + | | | `-'a' + | | |-',' ListDelimiter + | | `-SimpleDeclarator ListElement + | | `-'b' | `-';' |-DeclarationStatement Statement | |-SimpleDeclaration | | |-'typedef' | | |-'int' - | | |-SimpleDeclarator Declarator - | | | |-'*' - | | | `-'ta' - | | |-',' - | | `-SimpleDeclarator Declarator - | | `-'tb' + | | `-DeclaratorList Declarators + | | |-SimpleDeclarator ListElement + | | | |-'*' + | | | `-'ta' + | | |-',' ListDelimiter + | | `-SimpleDeclarator ListElement + | | `-'tb' | `-';' `-'}' CloseParen )txt")); @@ -2979,8 +3001,9 @@ | |-'*' | `-')' |-')' - |-SimpleDeclarator Declarator - | `-'size_t' + |-DeclaratorList Declarators + | `-SimpleDeclarator ListElement + | `-'size_t' `-';' )txt")); } @@ -3174,9 +3197,10 @@ SimpleDeclaration |-'struct' |-'Y' -|-SimpleDeclarator Declarator -| |-'*' -| `-'y1' +|-DeclaratorList Declarators +| `-SimpleDeclarator ListElement +| |-'*' +| `-'y1' `-';' )txt"})); } @@ -3202,9 +3226,10 @@ |-'Y' |-'{' |-'}' -|-SimpleDeclarator Declarator -| |-'*' -| `-'y2' +|-DeclaratorList Declarators +| `-SimpleDeclarator ListElement +| |-'*' +| `-'y2' `-';' )txt", R"txt( @@ -3212,9 +3237,10 @@ |-'struct' |-'{' |-'}' -|-SimpleDeclarator Declarator -| |-'*' -| `-'a1' +|-DeclaratorList Declarators +| `-SimpleDeclarator ListElement +| |-'*' +| `-'a1' `-';' )txt"})); } @@ -3233,11 +3259,12 @@ SimpleDeclaration |-'static' |-'void' -|-SimpleDeclarator Declarator -| |-'f' -| `-ParametersAndQualifiers -| |-'(' OpenParen -| `-')' CloseParen +|-DeclaratorList Declarators +| `-SimpleDeclarator ListElement +| |-'f' +| `-ParametersAndQualifiers +| |-'(' OpenParen +| `-')' CloseParen `-CompoundStatement |-'{' OpenParen `-'}' CloseParen @@ -3258,15 +3285,16 @@ {R"txt( SimpleDeclaration |-'void' -|-SimpleDeclarator Declarator -| |-NestedNameSpecifier -| | |-IdentifierNameSpecifier ListElement -| | | `-'S' -| | `-'::' ListDelimiter -| |-'f' -| `-ParametersAndQualifiers -| |-'(' OpenParen -| `-')' CloseParen +|-DeclaratorList Declarators +| `-SimpleDeclarator ListElement +| |-NestedNameSpecifier +| | |-IdentifierNameSpecifier ListElement +| | | `-'S' +| | `-'::' ListDelimiter +| |-'f' +| `-ParametersAndQualifiers +| |-'(' OpenParen +| `-')' CloseParen `-CompoundStatement |-'{' OpenParen `-'}' CloseParen @@ -3285,12 +3313,13 @@ )cpp", {R"txt( SimpleDeclaration -|-SimpleDeclarator Declarator -| |-'operator' -| |-'int' -| `-ParametersAndQualifiers -| |-'(' OpenParen -| `-')' CloseParen +|-DeclaratorList Declarators +| `-SimpleDeclarator ListElement +| |-'operator' +| |-'int' +| `-ParametersAndQualifiers +| |-'(' OpenParen +| `-')' CloseParen `-';' )txt"})); } @@ -3307,16 +3336,17 @@ TranslationUnit Detached `-SimpleDeclaration |-'unsigned' - |-SimpleDeclarator Declarator - | |-'operator' - | |-'""' - | |-'_c' - | `-ParametersAndQualifiers - | |-'(' OpenParen - | |-ParameterDeclarationList Parameters - | | `-SimpleDeclaration ListElement - | | `-'char' - | `-')' CloseParen + |-DeclaratorList Declarators + | `-SimpleDeclarator ListElement + | |-'operator' + | |-'""' + | |-'_c' + | `-ParametersAndQualifiers + | |-'(' OpenParen + | |-ParameterDeclarationList Parameters + | | `-SimpleDeclaration ListElement + | | `-'char' + | `-')' CloseParen `-';' )txt")); } @@ -3341,13 +3371,14 @@ |-'>' `-SimpleDeclaration |-'unsigned' - |-SimpleDeclarator Declarator - | |-'operator' - | |-'""' - | |-'_t' - | `-ParametersAndQualifiers - | |-'(' OpenParen - | `-')' CloseParen + |-DeclaratorList Declarators + | `-SimpleDeclarator ListElement + | |-'operator' + | |-'""' + | |-'_t' + | `-ParametersAndQualifiers + | |-'(' OpenParen + | `-')' CloseParen `-';' )txt")); } @@ -3365,19 +3396,21 @@ {R"txt( SimpleDeclaration |-'X' -|-SimpleDeclarator Declarator -| |-'&' -| |-'operator' -| |-'=' -| `-ParametersAndQualifiers -| |-'(' OpenParen -| |-ParameterDeclarationList Parameters -| | `-SimpleDeclaration ListElement -| | |-'const' -| | |-'X' -| | `-SimpleDeclarator Declarator -| | `-'&' -| `-')' CloseParen +|-DeclaratorList Declarators +| `-SimpleDeclarator ListElement +| |-'&' +| |-'operator' +| |-'=' +| `-ParametersAndQualifiers +| |-'(' OpenParen +| |-ParameterDeclarationList Parameters +| | `-SimpleDeclaration ListElement +| | |-'const' +| | |-'X' +| | `-DeclaratorList Declarators +| | `-SimpleDeclarator ListElement +| | `-'&' +| `-')' CloseParen `-';' )txt"})); } @@ -3397,21 +3430,23 @@ `-SimpleDeclaration |-'friend' |-'X' - |-SimpleDeclarator Declarator - | |-'operator' - | |-'+' - | `-ParametersAndQualifiers - | |-'(' OpenParen - | |-ParameterDeclarationList Parameters - | | |-SimpleDeclaration ListElement - | | | `-'X' - | | |-',' ListDelimiter - | | `-SimpleDeclaration ListElement - | | |-'const' - | | |-'X' - | | `-SimpleDeclarator Declarator - | | `-'&' - | `-')' CloseParen + |-DeclaratorList Declarators + | `-SimpleDeclarator ListElement + | |-'operator' + | |-'+' + | `-ParametersAndQualifiers + | |-'(' OpenParen + | |-ParameterDeclarationList Parameters + | | |-SimpleDeclaration ListElement + | | | `-'X' + | | |-',' ListDelimiter + | | `-SimpleDeclaration ListElement + | | |-'const' + | | |-'X' + | | `-DeclaratorList Declarators + | | `-SimpleDeclarator ListElement + | | `-'&' + | `-')' CloseParen `-';' )txt"})); } @@ -3463,11 +3498,12 @@ |-'>' `-SimpleDeclaration |-'T' - |-SimpleDeclarator Declarator - | |-'f' - | `-ParametersAndQualifiers - | |-'(' OpenParen - | `-')' CloseParen + |-DeclaratorList Declarators + | `-SimpleDeclarator ListElement + | |-'f' + | `-ParametersAndQualifiers + | |-'(' OpenParen + | `-')' CloseParen `-';' )txt")); } @@ -3491,11 +3527,12 @@ |-'>' `-SimpleDeclaration |-'T' - |-SimpleDeclarator Declarator - | |-'var' - | |-'=' - | `-IntegerLiteralExpression - | `-'10' LiteralToken + |-DeclaratorList Declarators + | `-SimpleDeclarator ListElement + | |-'var' + | |-'=' + | `-IntegerLiteralExpression + | `-'10' LiteralToken `-';' )txt")); } @@ -3522,11 +3559,12 @@ `-SimpleDeclaration |-'static' |-'U' - |-SimpleDeclarator Declarator - | |-'f' - | `-ParametersAndQualifiers - | |-'(' OpenParen - | `-')' CloseParen + |-DeclaratorList Declarators + | `-SimpleDeclarator ListElement + | |-'f' + | `-ParametersAndQualifiers + | |-'(' OpenParen + | `-')' CloseParen `-';' )txt"})); } @@ -3565,11 +3603,12 @@ | |-'>' | `-SimpleDeclaration | |-'U' - | |-SimpleDeclarator Declarator - | | |-'foo' - | | `-ParametersAndQualifiers - | | |-'(' OpenParen - | | `-')' CloseParen + | |-DeclaratorList Declarators + | | `-SimpleDeclarator ListElement + | | |-'foo' + | | `-ParametersAndQualifiers + | | |-'(' OpenParen + | | `-')' CloseParen | `-';' |-'}' `-';' @@ -3617,11 +3656,12 @@ | | `-SimpleDeclaration | | |-'static' | | |-'U' - | | |-SimpleDeclarator Declarator - | | | |-'f' - | | | `-ParametersAndQualifiers - | | | |-'(' OpenParen - | | | `-')' CloseParen + | | |-DeclaratorList Declarators + | | | `-SimpleDeclarator ListElement + | | | |-'f' + | | | `-ParametersAndQualifiers + | | | |-'(' OpenParen + | | | `-')' CloseParen | | `-';' | |-'}' | `-';' @@ -3834,8 +3874,9 @@ | |-'"C"' | `-SimpleDeclaration | |-'int' -| |-SimpleDeclarator Declarator -| | `-'a' +| |-DeclaratorList Declarators +| | `-SimpleDeclarator ListElement +| | `-'a' | `-';' `-LinkageSpecificationDeclaration |-'extern' @@ -3843,13 +3884,15 @@ |-'{' |-SimpleDeclaration | |-'int' - | |-SimpleDeclarator Declarator - | | `-'b' + | |-DeclaratorList Declarators + | | `-SimpleDeclarator ListElement + | | `-'b' | `-';' |-SimpleDeclaration | |-'int' - | |-SimpleDeclarator Declarator - | | `-'c' + | |-DeclaratorList Declarators + | | `-SimpleDeclarator ListElement + | | `-'c' | `-';' `-'}' )txt")); @@ -3876,11 +3919,12 @@ TranslationUnit Detached `-SimpleDeclaration |-'void' - |-SimpleDeclarator Declarator - | |-'test' - | `-ParametersAndQualifiers - | |-'(' OpenParen - | `-')' CloseParen + |-DeclaratorList Declarators + | `-SimpleDeclarator ListElement + | |-'test' + | `-ParametersAndQualifiers + | |-'(' OpenParen + | `-')' CloseParen `-CompoundStatement |-'{' OpenParen |-CompoundStatement Statement @@ -3913,11 +3957,12 @@ TranslationUnit Detached `-SimpleDeclaration |-'void' - |-SimpleDeclarator Declarator - | |-'test' - | `-ParametersAndQualifiers - | |-'(' OpenParen - | `-')' CloseParen + |-DeclaratorList Declarators + | `-SimpleDeclarator ListElement + | |-'test' + | `-ParametersAndQualifiers + | |-'(' OpenParen + | `-')' CloseParen `-CompoundStatement |-'{' OpenParen unmodifiable `-'}' CloseParen unmodifiable @@ -3936,11 +3981,12 @@ TranslationUnit Detached `-SimpleDeclaration |-'void' - |-SimpleDeclarator Declarator - | |-'test' - | `-ParametersAndQualifiers - | |-'(' OpenParen - | `-')' CloseParen + |-DeclaratorList Declarators + | `-SimpleDeclarator ListElement + | |-'test' + | `-ParametersAndQualifiers + | |-'(' OpenParen + | `-')' CloseParen `-CompoundStatement |-'{' OpenParen |-IfStatement Statement @@ -3980,11 +4026,12 @@ TranslationUnit Detached `-SimpleDeclaration |-'void' - |-SimpleDeclarator Declarator - | |-'test' - | `-ParametersAndQualifiers - | |-'(' OpenParen - | `-')' CloseParen + |-DeclaratorList Declarators + | `-SimpleDeclarator ListElement + | |-'test' + | `-ParametersAndQualifiers + | |-'(' OpenParen + | `-')' CloseParen `-CompoundStatement |-'{' OpenParen |-ExpressionStatement Statement @@ -4018,11 +4065,12 @@ TranslationUnit Detached `-SimpleDeclaration |-'void' - |-SimpleDeclarator Declarator - | |-'test' - | `-ParametersAndQualifiers - | |-'(' OpenParen - | `-')' CloseParen + |-DeclaratorList Declarators + | `-SimpleDeclarator ListElement + | |-'test' + | `-ParametersAndQualifiers + | |-'(' OpenParen + | `-')' CloseParen `-CompoundStatement |-'{' OpenParen |-IfStatement Statement @@ -4104,11 +4152,12 @@ {R"txt( SimpleDeclaration |-'S' -`-SimpleDeclarator Declarator - |-'s' - |-'=' - `-IntegerLiteralExpression - `-'1' LiteralToken +`-DeclaratorList Declarators + `-SimpleDeclarator ListElement + |-'s' + |-'=' + `-IntegerLiteralExpression + `-'1' LiteralToken )txt"})); } @@ -4133,36 +4182,39 @@ {R"txt( SimpleDeclaration |-'S' -`-SimpleDeclarator Declarator - `-UnknownExpression - |-'s0' - |-'{' - `-'}' +`-DeclaratorList Declarators + `-SimpleDeclarator ListElement + `-UnknownExpression + |-'s0' + |-'{' + `-'}' )txt", R"txt( SimpleDeclaration |-'S' -`-SimpleDeclarator Declarator - `-UnknownExpression - |-'s1' - |-'{' - |-IntegerLiteralExpression - | `-'1' LiteralToken - `-'}' +`-DeclaratorList Declarators + `-SimpleDeclarator ListElement + `-UnknownExpression + |-'s1' + |-'{' + |-IntegerLiteralExpression + | `-'1' LiteralToken + `-'}' )txt", R"txt( SimpleDeclaration |-'S' -`-SimpleDeclarator Declarator - `-UnknownExpression - |-'s2' - |-'{' - |-IntegerLiteralExpression - | `-'1' LiteralToken - |-',' - |-FloatingLiteralExpression - | `-'2.' LiteralToken - `-'}' +`-DeclaratorList Declarators + `-SimpleDeclarator ListElement + `-UnknownExpression + |-'s2' + |-'{' + |-IntegerLiteralExpression + | `-'1' LiteralToken + |-',' + |-FloatingLiteralExpression + | `-'2.' LiteralToken + `-'}' )txt"})); } @@ -4187,39 +4239,42 @@ {R"txt( SimpleDeclaration |-'S' -`-SimpleDeclarator Declarator - |-'s0' - |-'=' - `-UnknownExpression - |-'{' - `-'}' +`-DeclaratorList Declarators + `-SimpleDeclarator ListElement + |-'s0' + |-'=' + `-UnknownExpression + |-'{' + `-'}' )txt", R"txt( SimpleDeclaration |-'S' -`-SimpleDeclarator Declarator - |-'s1' - |-'=' - `-UnknownExpression - |-'{' - |-IntegerLiteralExpression - | `-'1' LiteralToken - `-'}' +`-DeclaratorList Declarators + `-SimpleDeclarator ListElement + |-'s1' + |-'=' + `-UnknownExpression + |-'{' + |-IntegerLiteralExpression + | `-'1' LiteralToken + `-'}' )txt", R"txt( SimpleDeclaration |-'S' -`-SimpleDeclarator Declarator - |-'s2' - |-'=' - `-UnknownExpression - |-'{' - |-IntegerLiteralExpression - | `-'1' LiteralToken - |-',' - |-FloatingLiteralExpression - | `-'2.' LiteralToken - `-'}' +`-DeclaratorList Declarators + `-SimpleDeclarator ListElement + |-'s2' + |-'=' + `-UnknownExpression + |-'{' + |-IntegerLiteralExpression + | `-'1' LiteralToken + |-',' + |-FloatingLiteralExpression + | `-'2.' LiteralToken + `-'}' )txt"})); } @@ -4240,28 +4295,30 @@ {R"txt( SimpleDeclaration |-'S' -|-SimpleDeclarator Declarator -| `-UnknownExpression -| |-'s1' -| |-'(' -| |-IntegerLiteralExpression -| | `-'1' LiteralToken -| `-')' +|-DeclaratorList Declarators +| `-SimpleDeclarator ListElement +| `-UnknownExpression +| |-'s1' +| |-'(' +| |-IntegerLiteralExpression +| | `-'1' LiteralToken +| `-')' `-';' )txt", R"txt( SimpleDeclaration |-'S' -|-SimpleDeclarator Declarator -| `-UnknownExpression -| |-'s2' -| |-'(' -| |-IntegerLiteralExpression -| | `-'1' LiteralToken -| |-',' -| |-FloatingLiteralExpression -| | `-'2.' LiteralToken -| `-')' +|-DeclaratorList Declarators +| `-SimpleDeclarator ListElement +| `-UnknownExpression +| |-'s2' +| |-'(' +| |-IntegerLiteralExpression +| | `-'1' LiteralToken +| |-',' +| |-FloatingLiteralExpression +| | `-'2.' LiteralToken +| `-')' `-';' )txt"})); } @@ -4283,35 +4340,38 @@ {R"txt( SimpleDeclaration |-'S' -|-SimpleDeclarator Declarator -| `-'s0' +|-DeclaratorList Declarators +| `-SimpleDeclarator ListElement +| `-'s0' `-';' )txt", R"txt( SimpleDeclaration |-'S' -|-SimpleDeclarator Declarator -| `-UnknownExpression -| |-'s1' -| |-'(' -| |-IntegerLiteralExpression -| | `-'1' LiteralToken -| `-')' +|-DeclaratorList Declarators +| `-SimpleDeclarator ListElement +| `-UnknownExpression +| |-'s1' +| |-'(' +| |-IntegerLiteralExpression +| | `-'1' LiteralToken +| `-')' `-';' )txt", R"txt( SimpleDeclaration |-'S' -|-SimpleDeclarator Declarator -| `-UnknownExpression -| |-'s2' -| |-'(' -| |-IntegerLiteralExpression -| | `-'1' LiteralToken -| |-',' -| |-FloatingLiteralExpression -| | `-'2.' LiteralToken -| `-')' +|-DeclaratorList Declarators +| `-SimpleDeclarator ListElement +| `-UnknownExpression +| |-'s2' +| |-'(' +| |-IntegerLiteralExpression +| | `-'1' LiteralToken +| |-',' +| |-FloatingLiteralExpression +| | `-'2.' LiteralToken +| `-')' `-';' )txt"})); } @@ -4518,13 +4578,14 @@ TranslationUnit Detached `-SimpleDeclaration |-'int' - |-SimpleDeclarator Declarator - | |-'a' - | `-ArraySubscript - | |-'[' OpenParen - | |-IntegerLiteralExpression Size - | | `-'10' LiteralToken - | `-']' CloseParen + |-DeclaratorList Declarators + | `-SimpleDeclarator ListElement + | |-'a' + | `-ArraySubscript + | |-'[' OpenParen + | |-IntegerLiteralExpression Size + | | `-'10' LiteralToken + | `-']' CloseParen `-';' )txt")); } @@ -4538,23 +4599,24 @@ TranslationUnit Detached `-SimpleDeclaration |-'int' - |-SimpleDeclarator Declarator - | |-'b' - | |-ArraySubscript - | | |-'[' OpenParen - | | |-IntegerLiteralExpression Size - | | | `-'1' LiteralToken - | | `-']' CloseParen - | |-ArraySubscript - | | |-'[' OpenParen - | | |-IntegerLiteralExpression Size - | | | `-'2' LiteralToken - | | `-']' CloseParen - | `-ArraySubscript - | |-'[' OpenParen - | |-IntegerLiteralExpression Size - | | `-'3' LiteralToken - | `-']' CloseParen + |-DeclaratorList Declarators + | `-SimpleDeclarator ListElement + | |-'b' + | |-ArraySubscript + | | |-'[' OpenParen + | | |-IntegerLiteralExpression Size + | | | `-'1' LiteralToken + | | `-']' CloseParen + | |-ArraySubscript + | | |-'[' OpenParen + | | |-IntegerLiteralExpression Size + | | | `-'2' LiteralToken + | | `-']' CloseParen + | `-ArraySubscript + | |-'[' OpenParen + | |-IntegerLiteralExpression Size + | | `-'3' LiteralToken + | `-']' CloseParen `-';' )txt")); } @@ -4568,24 +4630,25 @@ TranslationUnit Detached `-SimpleDeclaration |-'int' - |-SimpleDeclarator Declarator - | |-'c' - | |-ArraySubscript - | | |-'[' OpenParen - | | `-']' CloseParen - | |-'=' - | `-UnknownExpression + |-DeclaratorList Declarators + | `-SimpleDeclarator ListElement + | |-'c' + | |-ArraySubscript + | | |-'[' OpenParen + | | `-']' CloseParen + | |-'=' | `-UnknownExpression - | |-'{' - | |-IntegerLiteralExpression - | | `-'1' LiteralToken - | |-',' - | |-IntegerLiteralExpression - | | `-'2' LiteralToken - | |-',' - | |-IntegerLiteralExpression - | | `-'3' LiteralToken - | `-'}' + | `-UnknownExpression + | |-'{' + | |-IntegerLiteralExpression + | | `-'1' LiteralToken + | |-',' + | |-IntegerLiteralExpression + | | `-'2' LiteralToken + | |-',' + | |-IntegerLiteralExpression + | | `-'3' LiteralToken + | `-'}' `-';' )txt")); } @@ -4602,22 +4665,24 @@ TranslationUnit Detached `-SimpleDeclaration |-'void' - |-SimpleDeclarator Declarator - | |-'f' - | `-ParametersAndQualifiers - | |-'(' OpenParen - | |-ParameterDeclarationList Parameters - | | `-SimpleDeclaration ListElement - | | |-'int' - | | `-SimpleDeclarator Declarator - | | |-'xs' - | | `-ArraySubscript - | | |-'[' OpenParen - | | |-'static' - | | |-IntegerLiteralExpression Size - | | | `-'10' LiteralToken - | | `-']' CloseParen - | `-')' CloseParen + |-DeclaratorList Declarators + | `-SimpleDeclarator ListElement + | |-'f' + | `-ParametersAndQualifiers + | |-'(' OpenParen + | |-ParameterDeclarationList Parameters + | | `-SimpleDeclaration ListElement + | | |-'int' + | | `-DeclaratorList Declarators + | | `-SimpleDeclarator ListElement + | | |-'xs' + | | `-ArraySubscript + | | |-'[' OpenParen + | | |-'static' + | | |-IntegerLiteralExpression Size + | | | `-'10' LiteralToken + | | `-']' CloseParen + | `-')' CloseParen `-';' )txt")); } @@ -4631,11 +4696,12 @@ TranslationUnit Detached `-SimpleDeclaration |-'int' - |-SimpleDeclarator Declarator - | |-'func' - | `-ParametersAndQualifiers - | |-'(' OpenParen - | `-')' CloseParen + |-DeclaratorList Declarators + | `-SimpleDeclarator ListElement + | |-'func' + | `-ParametersAndQualifiers + | |-'(' OpenParen + | `-')' CloseParen `-';' )txt")); } @@ -4651,48 +4717,55 @@ TranslationUnit Detached |-SimpleDeclaration | |-'int' -| |-SimpleDeclarator Declarator -| | |-'func1' -| | `-ParametersAndQualifiers -| | |-'(' OpenParen -| | |-ParameterDeclarationList Parameters -| | | `-SimpleDeclaration ListElement -| | | |-'int' -| | | `-SimpleDeclarator Declarator -| | | `-'a' -| | `-')' CloseParen +| |-DeclaratorList Declarators +| | `-SimpleDeclarator ListElement +| | |-'func1' +| | `-ParametersAndQualifiers +| | |-'(' OpenParen +| | |-ParameterDeclarationList Parameters +| | | `-SimpleDeclaration ListElement +| | | |-'int' +| | | `-DeclaratorList Declarators +| | | `-SimpleDeclarator ListElement +| | | `-'a' +| | `-')' CloseParen | `-';' |-SimpleDeclaration | |-'int' -| |-SimpleDeclarator Declarator -| | |-'func2' -| | `-ParametersAndQualifiers -| | |-'(' OpenParen -| | |-ParameterDeclarationList Parameters -| | | `-SimpleDeclaration ListElement -| | | |-'int' -| | | `-SimpleDeclarator Declarator -| | | |-'*' -| | | `-'ap' -| | `-')' CloseParen +| |-DeclaratorList Declarators +| | `-SimpleDeclarator ListElement +| | |-'func2' +| | `-ParametersAndQualifiers +| | |-'(' OpenParen +| | |-ParameterDeclarationList Parameters +| | | `-SimpleDeclaration ListElement +| | | |-'int' +| | | `-DeclaratorList Declarators +| | | `-SimpleDeclarator ListElement +| | | |-'*' +| | | `-'ap' +| | `-')' CloseParen | `-';' `-SimpleDeclaration |-'int' - |-SimpleDeclarator Declarator - | |-'func3' - | `-ParametersAndQualifiers - | |-'(' OpenParen - | |-ParameterDeclarationList Parameters - | | |-SimpleDeclaration ListElement - | | | |-'int' - | | | `-SimpleDeclarator Declarator - | | | `-'a' - | | |-',' ListDelimiter - | | `-SimpleDeclaration ListElement - | | |-'float' - | | `-SimpleDeclarator Declarator - | | `-'b' - | `-')' CloseParen + |-DeclaratorList Declarators + | `-SimpleDeclarator ListElement + | |-'func3' + | `-ParametersAndQualifiers + | |-'(' OpenParen + | |-ParameterDeclarationList Parameters + | | |-SimpleDeclaration ListElement + | | | |-'int' + | | | `-DeclaratorList Declarators + | | | `-SimpleDeclarator ListElement + | | | `-'a' + | | |-',' ListDelimiter + | | `-SimpleDeclaration ListElement + | | |-'float' + | | `-DeclaratorList Declarators + | | `-SimpleDeclarator ListElement + | | `-'b' + | `-')' CloseParen `-';' )txt")); } @@ -4708,41 +4781,45 @@ TranslationUnit Detached |-SimpleDeclaration | |-'int' -| |-SimpleDeclarator Declarator -| | |-'func1' -| | `-ParametersAndQualifiers -| | |-'(' OpenParen -| | |-ParameterDeclarationList Parameters -| | | `-SimpleDeclaration ListElement -| | | `-'int' -| | `-')' CloseParen +| |-DeclaratorList Declarators +| | `-SimpleDeclarator ListElement +| | |-'func1' +| | `-ParametersAndQualifiers +| | |-'(' OpenParen +| | |-ParameterDeclarationList Parameters +| | | `-SimpleDeclaration ListElement +| | | `-'int' +| | `-')' CloseParen | `-';' |-SimpleDeclaration | |-'int' -| |-SimpleDeclarator Declarator -| | |-'func2' -| | `-ParametersAndQualifiers -| | |-'(' OpenParen -| | |-ParameterDeclarationList Parameters -| | | `-SimpleDeclaration ListElement -| | | |-'int' -| | | `-SimpleDeclarator Declarator -| | | `-'*' -| | `-')' CloseParen +| |-DeclaratorList Declarators +| | `-SimpleDeclarator ListElement +| | |-'func2' +| | `-ParametersAndQualifiers +| | |-'(' OpenParen +| | |-ParameterDeclarationList Parameters +| | | `-SimpleDeclaration ListElement +| | | |-'int' +| | | `-DeclaratorList Declarators +| | | `-SimpleDeclarator ListElement +| | | `-'*' +| | `-')' CloseParen | `-';' `-SimpleDeclaration |-'int' - |-SimpleDeclarator Declarator - | |-'func3' - | `-ParametersAndQualifiers - | |-'(' OpenParen - | |-ParameterDeclarationList Parameters - | | |-SimpleDeclaration ListElement - | | | `-'int' - | | |-',' ListDelimiter - | | `-SimpleDeclaration ListElement - | | `-'float' - | `-')' CloseParen + |-DeclaratorList Declarators + | `-SimpleDeclarator ListElement + | |-'func3' + | `-ParametersAndQualifiers + | |-'(' OpenParen + | |-ParameterDeclarationList Parameters + | | |-SimpleDeclaration ListElement + | | | `-'int' + | | |-',' ListDelimiter + | | `-SimpleDeclaration ListElement + | | `-'float' + | `-')' CloseParen `-';' )txt")); } @@ -4760,11 +4837,12 @@ ParameterDeclarationList Parameters `-SimpleDeclaration ListElement |-'int' - `-SimpleDeclarator Declarator - |-'a' - |-'=' - `-IntegerLiteralExpression - `-'1' LiteralToken + `-DeclaratorList Declarators + `-SimpleDeclarator ListElement + |-'a' + |-'=' + `-IntegerLiteralExpression + `-'1' LiteralToken )txt"})); } @@ -4781,25 +4859,28 @@ ParameterDeclarationList Parameters |-SimpleDeclaration ListElement | |-'int' -| `-SimpleDeclarator Declarator -| |-'*' -| `-'ap' +| `-DeclaratorList Declarators +| `-SimpleDeclarator ListElement +| |-'*' +| `-'ap' |-',' ListDelimiter |-SimpleDeclaration ListElement | |-'int' -| `-SimpleDeclarator Declarator -| |-'a' -| |-'=' -| `-IntegerLiteralExpression -| `-'1' LiteralToken +| `-DeclaratorList Declarators +| `-SimpleDeclarator ListElement +| |-'a' +| |-'=' +| `-IntegerLiteralExpression +| `-'1' LiteralToken |-',' ListDelimiter `-SimpleDeclaration ListElement |-'char' - `-SimpleDeclarator Declarator - |-'c' - |-'=' - `-CharacterLiteralExpression - `-''2'' LiteralToken + `-DeclaratorList Declarators + `-SimpleDeclarator ListElement + |-'c' + |-'=' + `-CharacterLiteralExpression + `-''2'' LiteralToken )txt"})); } @@ -4816,18 +4897,19 @@ {R"txt( SimpleDeclaration |-'void' -|-SimpleDeclarator Declarator -| |-'test' -| `-ParametersAndQualifiers -| |-'(' OpenParen -| |-ParameterDeclarationList Parameters -| | |-SimpleDeclaration ListElement -| | | `-'T' -| | |-',' ListDelimiter -| | `-SimpleDeclaration ListElement -| | |-'Args' -| | `-'...' -| `-')' CloseParen +|-DeclaratorList Declarators +| `-SimpleDeclarator ListElement +| |-'test' +| `-ParametersAndQualifiers +| |-'(' OpenParen +| |-ParameterDeclarationList Parameters +| | |-SimpleDeclaration ListElement +| | | `-'T' +| | |-',' ListDelimiter +| | `-SimpleDeclaration ListElement +| | |-'Args' +| | `-'...' +| `-')' CloseParen `-';' )txt"})); } @@ -4845,22 +4927,25 @@ {R"txt( SimpleDeclaration |-'void' -|-SimpleDeclarator Declarator -| |-'test' -| `-ParametersAndQualifiers -| |-'(' OpenParen -| |-ParameterDeclarationList Parameters -| | |-SimpleDeclaration ListElement -| | | |-'T' -| | | `-SimpleDeclarator Declarator -| | | `-'t' -| | |-',' ListDelimiter -| | `-SimpleDeclaration ListElement -| | |-'Args' -| | |-'...' -| | `-SimpleDeclarator Declarator -| | `-'args' -| `-')' CloseParen +|-DeclaratorList Declarators +| `-SimpleDeclarator ListElement +| |-'test' +| `-ParametersAndQualifiers +| |-'(' OpenParen +| |-ParameterDeclarationList Parameters +| | |-SimpleDeclaration ListElement +| | | |-'T' +| | | `-DeclaratorList Declarators +| | | `-SimpleDeclarator ListElement +| | | `-'t' +| | |-',' ListDelimiter +| | `-SimpleDeclaration ListElement +| | |-'Args' +| | |-'...' +| | `-DeclaratorList Declarators +| | `-SimpleDeclarator ListElement +| | `-'args' +| `-')' CloseParen `-';' )txt"})); } @@ -4878,18 +4963,19 @@ TranslationUnit Detached `-SimpleDeclaration |-'void' - |-SimpleDeclarator Declarator - | |-'test' - | `-ParametersAndQualifiers - | |-'(' OpenParen - | |-ParameterDeclarationList Parameters - | | |-SimpleDeclaration ListElement - | | | `-'int' - | | |-',' ListDelimiter - | | `-SimpleDeclaration ListElement - | | `-'char' - | |-'...' - | `-')' CloseParen + |-DeclaratorList Declarators + | `-SimpleDeclarator ListElement + | |-'test' + | `-ParametersAndQualifiers + | |-'(' OpenParen + | |-ParameterDeclarationList Parameters + | | |-SimpleDeclaration ListElement + | | | `-'int' + | | |-',' ListDelimiter + | | `-SimpleDeclaration ListElement + | | `-'char' + | |-'...' + | `-')' CloseParen `-';' )txt")); } @@ -4907,30 +4993,34 @@ TranslationUnit Detached `-SimpleDeclaration |-'int' - |-SimpleDeclarator Declarator - | |-'func' - | `-ParametersAndQualifiers - | |-'(' OpenParen - | |-ParameterDeclarationList Parameters - | | |-SimpleDeclaration ListElement - | | | |-'const' - | | | |-'int' - | | | `-SimpleDeclarator Declarator - | | | `-'a' - | | |-',' ListDelimiter - | | |-SimpleDeclaration ListElement - | | | |-'volatile' - | | | |-'int' - | | | `-SimpleDeclarator Declarator - | | | `-'b' - | | |-',' ListDelimiter - | | `-SimpleDeclaration ListElement - | | |-'const' - | | |-'volatile' - | | |-'int' - | | `-SimpleDeclarator Declarator - | | `-'c' - | `-')' CloseParen + |-DeclaratorList Declarators + | `-SimpleDeclarator ListElement + | |-'func' + | `-ParametersAndQualifiers + | |-'(' OpenParen + | |-ParameterDeclarationList Parameters + | | |-SimpleDeclaration ListElement + | | | |-'const' + | | | |-'int' + | | | `-DeclaratorList Declarators + | | | `-SimpleDeclarator ListElement + | | | `-'a' + | | |-',' ListDelimiter + | | |-SimpleDeclaration ListElement + | | | |-'volatile' + | | | |-'int' + | | | `-DeclaratorList Declarators + | | | `-SimpleDeclarator ListElement + | | | `-'b' + | | |-',' ListDelimiter + | | `-SimpleDeclaration ListElement + | | |-'const' + | | |-'volatile' + | | |-'int' + | | `-DeclaratorList Declarators + | | `-SimpleDeclarator ListElement + | | `-'c' + | `-')' CloseParen `-';' )txt")); } @@ -4947,17 +5037,19 @@ TranslationUnit Detached `-SimpleDeclaration |-'int' - |-SimpleDeclarator Declarator - | |-'func' - | `-ParametersAndQualifiers - | |-'(' OpenParen - | |-ParameterDeclarationList Parameters - | | `-SimpleDeclaration ListElement - | | |-'int' - | | `-SimpleDeclarator Declarator - | | |-'&' - | | `-'a' - | `-')' CloseParen + |-DeclaratorList Declarators + | `-SimpleDeclarator ListElement + | |-'func' + | `-ParametersAndQualifiers + | |-'(' OpenParen + | |-ParameterDeclarationList Parameters + | | `-SimpleDeclaration ListElement + | | |-'int' + | | `-DeclaratorList Declarators + | | `-SimpleDeclarator ListElement + | | |-'&' + | | `-'a' + | `-')' CloseParen `-';' )txt")); } @@ -4975,17 +5067,19 @@ TranslationUnit Detached `-SimpleDeclaration |-'int' - |-SimpleDeclarator Declarator - | |-'func' - | `-ParametersAndQualifiers - | |-'(' OpenParen - | |-ParameterDeclarationList Parameters - | | `-SimpleDeclaration ListElement - | | |-'int' - | | `-SimpleDeclarator Declarator - | | |-'&&' - | | `-'a' - | `-')' CloseParen + |-DeclaratorList Declarators + | `-SimpleDeclarator ListElement + | |-'func' + | `-ParametersAndQualifiers + | |-'(' OpenParen + | |-ParameterDeclarationList Parameters + | | `-SimpleDeclaration ListElement + | | |-'int' + | | `-DeclaratorList Declarators + | | `-SimpleDeclarator ListElement + | | |-'&&' + | | `-'a' + | `-')' CloseParen `-';' )txt")); } @@ -5008,11 +5102,12 @@ |-'{' |-SimpleDeclaration | |-'int' - | |-SimpleDeclarator Declarator - | | |-'a' - | | `-ParametersAndQualifiers - | | |-'(' OpenParen - | | `-')' CloseParen + | |-DeclaratorList Declarators + | | `-SimpleDeclarator ListElement + | | |-'a' + | | `-ParametersAndQualifiers + | | |-'(' OpenParen + | | `-')' CloseParen | `-';' |-'}' `-';' @@ -5035,35 +5130,38 @@ {R"txt( SimpleDeclaration |-'int' -|-SimpleDeclarator Declarator -| |-'b' -| `-ParametersAndQualifiers -| |-'(' OpenParen -| |-')' CloseParen -| `-'const' +|-DeclaratorList Declarators +| `-SimpleDeclarator ListElement +| |-'b' +| `-ParametersAndQualifiers +| |-'(' OpenParen +| |-')' CloseParen +| `-'const' `-';' )txt", R"txt( SimpleDeclaration |-'int' -|-SimpleDeclarator Declarator -| |-'c' -| `-ParametersAndQualifiers -| |-'(' OpenParen -| |-')' CloseParen -| `-'volatile' +|-DeclaratorList Declarators +| `-SimpleDeclarator ListElement +| |-'c' +| `-ParametersAndQualifiers +| |-'(' OpenParen +| |-')' CloseParen +| `-'volatile' `-';' )txt", R"txt( SimpleDeclaration |-'int' -|-SimpleDeclarator Declarator -| |-'d' -| `-ParametersAndQualifiers -| |-'(' OpenParen -| |-')' CloseParen -| |-'const' -| `-'volatile' +|-DeclaratorList Declarators +| `-SimpleDeclarator ListElement +| |-'d' +| `-ParametersAndQualifiers +| |-'(' OpenParen +| |-')' CloseParen +| |-'const' +| `-'volatile' `-';' )txt"})); } @@ -5081,12 +5179,13 @@ {R"txt( SimpleDeclaration |-'int' -|-SimpleDeclarator Declarator -| |-'e' -| `-ParametersAndQualifiers -| |-'(' OpenParen -| |-')' CloseParen -| `-'&' +|-DeclaratorList Declarators +| `-SimpleDeclarator ListElement +| |-'e' +| `-ParametersAndQualifiers +| |-'(' OpenParen +| |-')' CloseParen +| `-'&' `-';' )txt"})); } @@ -5104,12 +5203,13 @@ {R"txt( SimpleDeclaration |-'int' -|-SimpleDeclarator Declarator -| |-'f' -| `-ParametersAndQualifiers -| |-'(' OpenParen -| |-')' CloseParen -| `-'&&' +|-DeclaratorList Declarators +| `-SimpleDeclarator ListElement +| |-'f' +| `-ParametersAndQualifiers +| |-'(' OpenParen +| |-')' CloseParen +| `-'&&' `-';' )txt"})); } @@ -5126,14 +5226,15 @@ TranslationUnit Detached `-SimpleDeclaration |-'auto' - |-SimpleDeclarator Declarator - | |-'foo' - | `-ParametersAndQualifiers - | |-'(' OpenParen - | |-')' CloseParen - | `-TrailingReturnType TrailingReturn - | |-'->' ArrowToken - | `-'int' + |-DeclaratorList Declarators + | `-SimpleDeclarator ListElement + | |-'foo' + | `-ParametersAndQualifiers + | |-'(' OpenParen + | |-')' CloseParen + | `-TrailingReturnType TrailingReturn + | |-'->' ArrowToken + | `-'int' `-';' )txt")); } @@ -5154,58 +5255,62 @@ {R"txt( SimpleDeclaration |-'int' -|-SimpleDeclarator Declarator -| |-'a' -| `-ParametersAndQualifiers -| |-'(' OpenParen -| |-')' CloseParen -| |-'throw' -| |-'(' -| `-')' +|-DeclaratorList Declarators +| `-SimpleDeclarator ListElement +| |-'a' +| `-ParametersAndQualifiers +| |-'(' OpenParen +| |-')' CloseParen +| |-'throw' +| |-'(' +| `-')' `-';' )txt", R"txt( SimpleDeclaration |-'int' -|-SimpleDeclarator Declarator -| |-'b' -| `-ParametersAndQualifiers -| |-'(' OpenParen -| |-')' CloseParen -| |-'throw' -| |-'(' -| |-'...' -| `-')' +|-DeclaratorList Declarators +| `-SimpleDeclarator ListElement +| |-'b' +| `-ParametersAndQualifiers +| |-'(' OpenParen +| |-')' CloseParen +| |-'throw' +| |-'(' +| |-'...' +| `-')' `-';' )txt", R"txt( SimpleDeclaration |-'int' -|-SimpleDeclarator Declarator -| |-'c' -| `-ParametersAndQualifiers -| |-'(' OpenParen -| |-')' CloseParen -| |-'throw' -| |-'(' -| |-'MyException1' -| `-')' +|-DeclaratorList Declarators +| `-SimpleDeclarator ListElement +| |-'c' +| `-ParametersAndQualifiers +| |-'(' OpenParen +| |-')' CloseParen +| |-'throw' +| |-'(' +| |-'MyException1' +| `-')' `-';' )txt", R"txt( SimpleDeclaration |-'int' -|-SimpleDeclarator Declarator -| |-'d' -| `-ParametersAndQualifiers -| |-'(' OpenParen -| |-')' CloseParen -| |-'throw' -| |-'(' -| |-'MyException1' -| |-',' -| |-'MyException2' -| `-')' +|-DeclaratorList Declarators +| `-SimpleDeclarator ListElement +| |-'d' +| `-ParametersAndQualifiers +| |-'(' OpenParen +| |-')' CloseParen +| |-'throw' +| |-'(' +| |-'MyException1' +| |-',' +| |-'MyException2' +| `-')' `-';' )txt"})); } @@ -5223,25 +5328,27 @@ TranslationUnit Detached |-SimpleDeclaration | |-'int' -| |-SimpleDeclarator Declarator -| | |-'a' -| | `-ParametersAndQualifiers -| | |-'(' OpenParen -| | |-')' CloseParen -| | `-'noexcept' +| |-DeclaratorList Declarators +| | `-SimpleDeclarator ListElement +| | |-'a' +| | `-ParametersAndQualifiers +| | |-'(' OpenParen +| | |-')' CloseParen +| | `-'noexcept' | `-';' `-SimpleDeclaration |-'int' - |-SimpleDeclarator Declarator - | |-'b' - | `-ParametersAndQualifiers - | |-'(' OpenParen - | |-')' CloseParen - | |-'noexcept' - | |-'(' - | |-BoolLiteralExpression - | | `-'true' LiteralToken - | `-')' + |-DeclaratorList Declarators + | `-SimpleDeclarator ListElement + | |-'b' + | `-ParametersAndQualifiers + | |-'(' OpenParen + | |-')' CloseParen + | |-'noexcept' + | |-'(' + | |-BoolLiteralExpression + | | `-'true' LiteralToken + | `-')' `-';' )txt")); } @@ -5258,50 +5365,54 @@ TranslationUnit Detached |-SimpleDeclaration | |-'int' -| |-SimpleDeclarator Declarator -| | `-ParenDeclarator -| | |-'(' OpenParen -| | |-'a' -| | `-')' CloseParen +| |-DeclaratorList Declarators +| | `-SimpleDeclarator ListElement +| | `-ParenDeclarator +| | |-'(' OpenParen +| | |-'a' +| | `-')' CloseParen | `-';' |-SimpleDeclaration | |-'int' -| |-SimpleDeclarator Declarator -| | |-'*' -| | `-ParenDeclarator -| | |-'(' OpenParen -| | |-'b' -| | `-')' CloseParen +| |-DeclaratorList Declarators +| | `-SimpleDeclarator ListElement +| | |-'*' +| | `-ParenDeclarator +| | |-'(' OpenParen +| | |-'b' +| | `-')' CloseParen | `-';' |-SimpleDeclaration | |-'int' -| |-SimpleDeclarator Declarator -| | |-ParenDeclarator -| | | |-'(' OpenParen -| | | |-'*' -| | | |-'c' -| | | `-')' CloseParen -| | `-ParametersAndQualifiers -| | |-'(' OpenParen -| | |-ParameterDeclarationList Parameters -| | | `-SimpleDeclaration ListElement -| | | `-'int' -| | `-')' CloseParen +| |-DeclaratorList Declarators +| | `-SimpleDeclarator ListElement +| | |-ParenDeclarator +| | | |-'(' OpenParen +| | | |-'*' +| | | |-'c' +| | | `-')' CloseParen +| | `-ParametersAndQualifiers +| | |-'(' OpenParen +| | |-ParameterDeclarationList Parameters +| | | `-SimpleDeclaration ListElement +| | | `-'int' +| | `-')' CloseParen | `-';' `-SimpleDeclaration |-'int' - |-SimpleDeclarator Declarator - | |-'*' - | |-ParenDeclarator - | | |-'(' OpenParen - | | |-'d' - | | `-')' CloseParen - | `-ParametersAndQualifiers - | |-'(' OpenParen - | |-ParameterDeclarationList Parameters - | | `-SimpleDeclaration ListElement - | | `-'int' - | `-')' CloseParen + |-DeclaratorList Declarators + | `-SimpleDeclarator ListElement + | |-'*' + | |-ParenDeclarator + | | |-'(' OpenParen + | | |-'d' + | | `-')' CloseParen + | `-ParametersAndQualifiers + | |-'(' OpenParen + | |-ParameterDeclarationList Parameters + | | `-SimpleDeclaration ListElement + | | `-'int' + | `-')' CloseParen `-';' )txt")); } @@ -5317,22 +5428,24 @@ |-SimpleDeclaration | |-'const' | |-'int' -| |-SimpleDeclarator Declarator -| | |-'west' -| | |-'=' -| | `-PrefixUnaryOperatorExpression -| | |-'-' OperatorToken -| | `-IntegerLiteralExpression Operand -| | `-'1' LiteralToken +| |-DeclaratorList Declarators +| | `-SimpleDeclarator ListElement +| | |-'west' +| | |-'=' +| | `-PrefixUnaryOperatorExpression +| | |-'-' OperatorToken +| | `-IntegerLiteralExpression Operand +| | `-'1' LiteralToken | `-';' `-SimpleDeclaration |-'int' |-'const' - |-SimpleDeclarator Declarator - | |-'east' - | |-'=' - | `-IntegerLiteralExpression - | `-'1' LiteralToken + |-DeclaratorList Declarators + | `-SimpleDeclarator ListElement + | |-'east' + | |-'=' + | `-IntegerLiteralExpression + | `-'1' LiteralToken `-';' )txt")); } @@ -5348,11 +5461,12 @@ |-'const' |-'int' |-'const' - |-SimpleDeclarator Declarator - | |-'universal' - | |-'=' - | `-IntegerLiteralExpression - | `-'0' LiteralToken + |-DeclaratorList Declarators + | `-SimpleDeclarator ListElement + | |-'universal' + | |-'=' + | `-IntegerLiteralExpression + | `-'0' LiteralToken `-';' )txt")); } @@ -5369,12 +5483,13 @@ |-'const' |-'int' |-'const' - |-SimpleDeclarator Declarator - | |-'*' - | |-'const' - | |-'*' - | |-'volatile' - | `-'b' + |-DeclaratorList Declarators + | `-SimpleDeclarator ListElement + | |-'*' + | |-'const' + | |-'*' + | |-'volatile' + | `-'b' `-';' )txt")); } @@ -5391,30 +5506,31 @@ TranslationUnit Detached `-SimpleDeclaration |-'auto' - |-SimpleDeclarator Declarator - | |-'foo' - | `-ParametersAndQualifiers - | |-'(' OpenParen - | |-')' CloseParen - | `-TrailingReturnType TrailingReturn - | |-'->' ArrowToken - | |-'auto' - | `-SimpleDeclarator Declarator - | |-ParenDeclarator - | | |-'(' OpenParen - | | |-'*' - | | `-')' CloseParen - | `-ParametersAndQualifiers - | |-'(' OpenParen - | |-ParameterDeclarationList Parameters - | | `-SimpleDeclaration ListElement - | | `-'int' - | |-')' CloseParen - | `-TrailingReturnType TrailingReturn - | |-'->' ArrowToken - | |-'double' - | `-SimpleDeclarator Declarator - | `-'*' + |-DeclaratorList Declarators + | `-SimpleDeclarator ListElement + | |-'foo' + | `-ParametersAndQualifiers + | |-'(' OpenParen + | |-')' CloseParen + | `-TrailingReturnType TrailingReturn + | |-'->' ArrowToken + | |-'auto' + | `-SimpleDeclarator Declarator + | |-ParenDeclarator + | | |-'(' OpenParen + | | |-'*' + | | `-')' CloseParen + | `-ParametersAndQualifiers + | |-'(' OpenParen + | |-ParameterDeclarationList Parameters + | | `-SimpleDeclaration ListElement + | | `-'int' + | |-')' CloseParen + | `-TrailingReturnType TrailingReturn + | |-'->' ArrowToken + | |-'double' + | `-SimpleDeclarator Declarator + | `-'*' `-';' )txt")); } @@ -5432,24 +5548,26 @@ {R"txt( SimpleDeclaration |-'int' -|-SimpleDeclarator Declarator -| |-MemberPointer -| | |-'X' -| | |-'::' -| | `-'*' -| `-'a' +|-DeclaratorList Declarators +| `-SimpleDeclarator ListElement +| |-MemberPointer +| | |-'X' +| | |-'::' +| | `-'*' +| `-'a' `-';' )txt", R"txt( SimpleDeclaration |-'const' |-'int' -|-SimpleDeclarator Declarator -| |-MemberPointer -| | |-'X' -| | |-'::' -| | `-'*' -| `-'b' +|-DeclaratorList Declarators +| `-SimpleDeclarator ListElement +| |-MemberPointer +| | |-'X' +| | |-'::' +| | `-'*' +| `-'b' `-';' )txt"})); } @@ -5472,70 +5590,75 @@ {R"txt( SimpleDeclaration |-'void' -|-SimpleDeclarator Declarator -| |-ParenDeclarator -| | |-'(' OpenParen -| | |-MemberPointer -| | | |-'X' -| | | |-'::' -| | | `-'*' -| | |-'xp' -| | `-')' CloseParen -| `-ParametersAndQualifiers -| |-'(' OpenParen -| `-')' CloseParen +|-DeclaratorList Declarators +| `-SimpleDeclarator ListElement +| |-ParenDeclarator +| | |-'(' OpenParen +| | |-MemberPointer +| | | |-'X' +| | | |-'::' +| | | `-'*' +| | |-'xp' +| | `-')' CloseParen +| `-ParametersAndQualifiers +| |-'(' OpenParen +| `-')' CloseParen `-';' )txt", R"txt( SimpleDeclaration |-'void' -|-SimpleDeclarator Declarator -| |-ParenDeclarator -| | |-'(' OpenParen -| | |-MemberPointer -| | | |-'X' -| | | |-'::' -| | | `-'*' -| | |-'*' -| | |-'xpp' -| | `-')' CloseParen -| `-ParametersAndQualifiers -| |-'(' OpenParen -| |-ParameterDeclarationList Parameters -| | `-SimpleDeclaration ListElement -| | |-'const' -| | |-'int' -| | `-SimpleDeclarator Declarator -| | `-'*' -| `-')' CloseParen +|-DeclaratorList Declarators +| `-SimpleDeclarator ListElement +| |-ParenDeclarator +| | |-'(' OpenParen +| | |-MemberPointer +| | | |-'X' +| | | |-'::' +| | | `-'*' +| | |-'*' +| | |-'xpp' +| | `-')' CloseParen +| `-ParametersAndQualifiers +| |-'(' OpenParen +| |-ParameterDeclarationList Parameters +| | `-SimpleDeclaration ListElement +| | |-'const' +| | |-'int' +| | `-DeclaratorList Declarators +| | `-SimpleDeclarator ListElement +| | `-'*' +| `-')' CloseParen `-';' )txt", R"txt( SimpleDeclaration |-'void' -|-SimpleDeclarator Declarator -| |-ParenDeclarator -| | |-'(' OpenParen -| | |-'X' -| | |-'::' -| | |-MemberPointer -| | | |-'Y' -| | | |-'::' -| | | `-'*' -| | |-'xyp' -| | `-')' CloseParen -| `-ParametersAndQualifiers -| |-'(' OpenParen -| |-ParameterDeclarationList Parameters -| | |-SimpleDeclaration ListElement -| | | |-'const' -| | | |-'int' -| | | `-SimpleDeclarator Declarator -| | | `-'*' -| | |-',' ListDelimiter -| | `-SimpleDeclaration ListElement -| | `-'char' -| `-')' CloseParen +|-DeclaratorList Declarators +| `-SimpleDeclarator ListElement +| |-ParenDeclarator +| | |-'(' OpenParen +| | |-'X' +| | |-'::' +| | |-MemberPointer +| | | |-'Y' +| | | |-'::' +| | | `-'*' +| | |-'xyp' +| | `-')' CloseParen +| `-ParametersAndQualifiers +| |-'(' OpenParen +| |-ParameterDeclarationList Parameters +| | |-SimpleDeclaration ListElement +| | | |-'const' +| | | |-'int' +| | | `-DeclaratorList Declarators +| | | `-SimpleDeclarator ListElement +| | | `-'*' +| | |-',' ListDelimiter +| | `-SimpleDeclaration ListElement +| | `-'char' +| `-')' CloseParen `-';' )txt"})); } @@ -5549,31 +5672,34 @@ TranslationUnit Detached `-SimpleDeclaration |-'void' - |-SimpleDeclarator Declarator - | |-'x' - | `-ParametersAndQualifiers - | |-'(' OpenParen - | |-ParameterDeclarationList Parameters - | | |-SimpleDeclaration ListElement - | | | |-'char' - | | | `-SimpleDeclarator Declarator - | | | `-'a' - | | |-',' ListDelimiter - | | `-SimpleDeclaration ListElement - | | |-'short' - | | `-SimpleDeclarator Declarator - | | |-ParenDeclarator - | | | |-'(' OpenParen - | | | |-'*' - | | | |-'b' - | | | `-')' CloseParen - | | `-ParametersAndQualifiers - | | |-'(' OpenParen - | | |-ParameterDeclarationList Parameters - | | | `-SimpleDeclaration ListElement - | | | `-'int' - | | `-')' CloseParen - | `-')' CloseParen + |-DeclaratorList Declarators + | `-SimpleDeclarator ListElement + | |-'x' + | `-ParametersAndQualifiers + | |-'(' OpenParen + | |-ParameterDeclarationList Parameters + | | |-SimpleDeclaration ListElement + | | | |-'char' + | | | `-DeclaratorList Declarators + | | | `-SimpleDeclarator ListElement + | | | `-'a' + | | |-',' ListDelimiter + | | `-SimpleDeclaration ListElement + | | |-'short' + | | `-DeclaratorList Declarators + | | `-SimpleDeclarator ListElement + | | |-ParenDeclarator + | | | |-'(' OpenParen + | | | |-'*' + | | | |-'b' + | | | `-')' CloseParen + | | `-ParametersAndQualifiers + | | |-'(' OpenParen + | | |-ParameterDeclarationList Parameters + | | | `-SimpleDeclaration ListElement + | | | `-'int' + | | `-')' CloseParen + | `-')' CloseParen `-';' )txt")); } @@ -5587,48 +5713,52 @@ TranslationUnit Detached `-SimpleDeclaration |-'void' - |-SimpleDeclarator Declarator - | |-'x' - | `-ParametersAndQualifiers - | |-'(' OpenParen - | |-ParameterDeclarationList Parameters - | | |-SimpleDeclaration ListElement - | | | |-'char' - | | | `-SimpleDeclarator Declarator - | | | `-'a' - | | |-',' ListDelimiter - | | |-SimpleDeclaration ListElement - | | | |-'short' - | | | `-SimpleDeclarator Declarator - | | | |-ParenDeclarator - | | | | |-'(' OpenParen - | | | | |-'*' - | | | | |-'b' - | | | | `-')' CloseParen - | | | `-ParametersAndQualifiers - | | | |-'(' OpenParen - | | | |-ParameterDeclarationList Parameters - | | | | `-SimpleDeclaration ListElement - | | | | `-'int' - | | | `-')' CloseParen - | | |-',' ListDelimiter - | | `-SimpleDeclaration ListElement - | | |-'long' - | | `-SimpleDeclarator Declarator - | | |-ParenDeclarator - | | | |-'(' OpenParen - | | | |-'*' - | | | |-'*' - | | | |-'c' - | | | `-')' CloseParen - | | `-ParametersAndQualifiers - | | |-'(' OpenParen - | | |-ParameterDeclarationList Parameters - | | | `-SimpleDeclaration ListElement - | | | |-'long' - | | | `-'long' - | | `-')' CloseParen - | `-')' CloseParen + |-DeclaratorList Declarators + | `-SimpleDeclarator ListElement + | |-'x' + | `-ParametersAndQualifiers + | |-'(' OpenParen + | |-ParameterDeclarationList Parameters + | | |-SimpleDeclaration ListElement + | | | |-'char' + | | | `-DeclaratorList Declarators + | | | `-SimpleDeclarator ListElement + | | | `-'a' + | | |-',' ListDelimiter + | | |-SimpleDeclaration ListElement + | | | |-'short' + | | | `-DeclaratorList Declarators + | | | `-SimpleDeclarator ListElement + | | | |-ParenDeclarator + | | | | |-'(' OpenParen + | | | | |-'*' + | | | | |-'b' + | | | | `-')' CloseParen + | | | `-ParametersAndQualifiers + | | | |-'(' OpenParen + | | | |-ParameterDeclarationList Parameters + | | | | `-SimpleDeclaration ListElement + | | | | `-'int' + | | | `-')' CloseParen + | | |-',' ListDelimiter + | | `-SimpleDeclaration ListElement + | | |-'long' + | | `-DeclaratorList Declarators + | | `-SimpleDeclarator ListElement + | | |-ParenDeclarator + | | | |-'(' OpenParen + | | | |-'*' + | | | |-'*' + | | | |-'c' + | | | `-')' CloseParen + | | `-ParametersAndQualifiers + | | |-'(' OpenParen + | | |-ParameterDeclarationList Parameters + | | | `-SimpleDeclaration ListElement + | | | |-'long' + | | | `-'long' + | | `-')' CloseParen + | `-')' CloseParen `-';' )txt")); } diff --git a/clang/unittests/Tooling/Syntax/SynthesisTest.cpp b/clang/unittests/Tooling/Syntax/SynthesisTest.cpp --- a/clang/unittests/Tooling/Syntax/SynthesisTest.cpp +++ b/clang/unittests/Tooling/Syntax/SynthesisTest.cpp @@ -188,8 +188,9 @@ TranslationUnit Detached synthesized `-SimpleDeclaration synthesized |-'int' synthesized - |-SimpleDeclarator Declarator synthesized - | `-'a' synthesized + |-DeclaratorList Declarators synthesized + | `-SimpleDeclarator ListElement synthesized + | `-'a' synthesized `-';' synthesized )txt")); } @@ -201,8 +202,9 @@ EXPECT_TRUE(treeDumpEqual(Copy, R"txt( SimpleDeclaration Detached synthesized |-'int' synthesized -|-SimpleDeclarator Declarator synthesized -| `-'a' synthesized +|-DeclaratorList Declarators synthesized +| `-SimpleDeclarator ListElement synthesized +| `-'a' synthesized `-';' synthesized )txt")); } @@ -225,11 +227,12 @@ TranslationUnit Detached synthesized `-SimpleDeclaration synthesized |-'void' synthesized - |-SimpleDeclarator Declarator synthesized - | |-'test' synthesized - | `-ParametersAndQualifiers synthesized - | |-'(' OpenParen synthesized - | `-')' CloseParen synthesized + |-DeclaratorList Declarators synthesized + | `-SimpleDeclarator ListElement synthesized + | |-'test' synthesized + | `-ParametersAndQualifiers synthesized + | |-'(' OpenParen synthesized + | `-')' CloseParen synthesized `-CompoundStatement synthesized |-'{' OpenParen synthesized |-IfStatement Statement synthesized