[clang] fda3fa8 - [SyntaxTree][NFC] Append "get" to syntax Nodes accessor names
Eduardo Caldas via cfe-commits
cfe-commits at lists.llvm.org
Thu Aug 27 05:55:35 PDT 2020
Author: Eduardo Caldas
Date: 2020-08-27T12:55:23Z
New Revision: fda3fa822cb6812c8db63f7cee4a8387e71e66ff
URL: https://github.com/llvm/llvm-project/commit/fda3fa822cb6812c8db63f7cee4a8387e71e66ff
DIFF: https://github.com/llvm/llvm-project/commit/fda3fa822cb6812c8db63f7cee4a8387e71e66ff.diff
LOG: [SyntaxTree][NFC] Append "get" to syntax Nodes accessor names
Differential Revision: https://reviews.llvm.org/D86679
Added:
Modified:
clang/include/clang/Tooling/Syntax/Nodes.h
clang/lib/Tooling/Syntax/Nodes.cpp
Removed:
################################################################################
diff --git a/clang/include/clang/Tooling/Syntax/Nodes.h b/clang/include/clang/Tooling/Syntax/Nodes.h
index 4a483111aad3..a6505c8167ee 100644
--- a/clang/include/clang/Tooling/Syntax/Nodes.h
+++ b/clang/include/clang/Tooling/Syntax/Nodes.h
@@ -271,9 +271,9 @@ class NestedNameSpecifier final : public List {
static bool classof(const Node *N) {
return N->kind() <= NodeKind::NestedNameSpecifier;
}
- std::vector<NameSpecifier *> specifiers();
+ std::vector<NameSpecifier *> getSpecifiers();
std::vector<List::ElementAndDelimiter<syntax::NameSpecifier>>
- specifiersAndDoubleColons();
+ getSpecifiersAndDoubleColons();
};
/// Models an `unqualified-id`. C++ [expr.prim.id.unqual]
@@ -299,9 +299,9 @@ class IdExpression final : public Expression {
static bool classof(const Node *N) {
return N->kind() == NodeKind::IdExpression;
}
- NestedNameSpecifier *qualifier();
- Leaf *templateKeyword();
- UnqualifiedId *unqualifiedId();
+ NestedNameSpecifier *getQualifier();
+ Leaf *getTemplateKeyword();
+ UnqualifiedId *getUnqualifiedId();
};
/// An expression of an unknown kind, i.e. one not currently handled by the
@@ -321,7 +321,7 @@ class ThisExpression final : public Expression {
static bool classof(const Node *N) {
return N->kind() == NodeKind::ThisExpression;
}
- Leaf *thisKeyword();
+ Leaf *getThisKeyword();
};
/// Models arguments of a function call.
@@ -335,8 +335,8 @@ class CallArguments final : public List {
static bool classof(const Node *N) {
return N->kind() <= NodeKind::CallArguments;
}
- std::vector<Expression *> arguments();
- std::vector<List::ElementAndDelimiter<Expression>> argumentsAndCommas();
+ std::vector<Expression *> getArguments();
+ std::vector<List::ElementAndDelimiter<Expression>> getArgumentsAndCommas();
};
/// A function call. C++ [expr.call]
@@ -349,10 +349,10 @@ class CallExpression final : public Expression {
static bool classof(const Node *N) {
return N->kind() == NodeKind::CallExpression;
}
- Expression *callee();
- Leaf *openParen();
- CallArguments *arguments();
- Leaf *closeParen();
+ Expression *getCallee();
+ Leaf *getOpenParen();
+ CallArguments *getArguments();
+ Leaf *getCloseParen();
};
/// Models a parenthesized expression `(E)`. C++ [expr.prim.paren]
@@ -363,9 +363,9 @@ class ParenExpression final : public Expression {
static bool classof(const Node *N) {
return N->kind() == NodeKind::ParenExpression;
}
- Leaf *openParen();
- Expression *subExpression();
- Leaf *closeParen();
+ Leaf *getOpenParen();
+ Expression *getSubExpression();
+ Leaf *getCloseParen();
};
/// Models a class member access. C++ [expr.ref]
@@ -382,10 +382,10 @@ class MemberExpression final : public Expression {
static bool classof(const Node *N) {
return N->kind() == NodeKind::MemberExpression;
}
- Expression *object();
- Leaf *accessToken();
- Leaf *templateKeyword();
- IdExpression *member();
+ Expression *getObject();
+ Leaf *getAccessToken();
+ Leaf *getTemplateKeyword();
+ IdExpression *getMember();
};
/// Expression for literals. C++ [lex.literal]
@@ -404,7 +404,7 @@ class LiteralExpression : public Expression {
N->kind() == NodeKind::CharUserDefinedLiteralExpression ||
N->kind() == NodeKind::StringUserDefinedLiteralExpression;
}
- Leaf *literalToken();
+ Leaf *getLiteralToken();
};
/// Expression for integer literals. C++ [lex.icon]
@@ -539,8 +539,8 @@ class UnaryOperatorExpression : public Expression {
return N->kind() == NodeKind::PrefixUnaryOperatorExpression ||
N->kind() == NodeKind::PostfixUnaryOperatorExpression;
}
- Leaf *operatorToken();
- Expression *operand();
+ Leaf *getOperatorToken();
+ Expression *getOperand();
};
/// <operator> <operand>
@@ -588,9 +588,9 @@ class BinaryOperatorExpression final : public Expression {
static bool classof(const Node *N) {
return N->kind() == NodeKind::BinaryOperatorExpression;
}
- Expression *lhs();
- Leaf *operatorToken();
- Expression *rhs();
+ Expression *getLhs();
+ Leaf *getOperatorToken();
+ Expression *getRhs();
};
/// An abstract node for C++ statements, e.g. 'while', 'if', etc.
@@ -639,8 +639,8 @@ class SwitchStatement final : public Statement {
static bool classof(const Node *N) {
return N->kind() == NodeKind::SwitchStatement;
}
- Leaf *switchKeyword();
- Statement *body();
+ Leaf *getSwitchKeyword();
+ Statement *getBody();
};
/// case <value>: <body>
@@ -650,9 +650,9 @@ class CaseStatement final : public Statement {
static bool classof(const Node *N) {
return N->kind() == NodeKind::CaseStatement;
}
- Leaf *caseKeyword();
- Expression *caseValue();
- Statement *body();
+ Leaf *getCaseKeyword();
+ Expression *getCaseValue();
+ Statement *getBody();
};
/// default: <body>
@@ -662,8 +662,8 @@ class DefaultStatement final : public Statement {
static bool classof(const Node *N) {
return N->kind() == NodeKind::DefaultStatement;
}
- Leaf *defaultKeyword();
- Statement *body();
+ Leaf *getDefaultKeyword();
+ Statement *getBody();
};
/// if (cond) <then-statement> else <else-statement>
@@ -674,10 +674,10 @@ class IfStatement final : public Statement {
static bool classof(const Node *N) {
return N->kind() == NodeKind::IfStatement;
}
- Leaf *ifKeyword();
- Statement *thenStatement();
- Leaf *elseKeyword();
- Statement *elseStatement();
+ Leaf *getIfKeyword();
+ Statement *getThenStatement();
+ Leaf *getElseKeyword();
+ Statement *getElseStatement();
};
/// for (<init>; <cond>; <increment>) <body>
@@ -687,8 +687,8 @@ class ForStatement final : public Statement {
static bool classof(const Node *N) {
return N->kind() == NodeKind::ForStatement;
}
- Leaf *forKeyword();
- Statement *body();
+ Leaf *getForKeyword();
+ Statement *getBody();
};
/// while (<cond>) <body>
@@ -698,8 +698,8 @@ class WhileStatement final : public Statement {
static bool classof(const Node *N) {
return N->kind() == NodeKind::WhileStatement;
}
- Leaf *whileKeyword();
- Statement *body();
+ Leaf *getWhileKeyword();
+ Statement *getBody();
};
/// continue;
@@ -709,7 +709,7 @@ class ContinueStatement final : public Statement {
static bool classof(const Node *N) {
return N->kind() == NodeKind::ContinueStatement;
}
- Leaf *continueKeyword();
+ Leaf *getContinueKeyword();
};
/// break;
@@ -719,7 +719,7 @@ class BreakStatement final : public Statement {
static bool classof(const Node *N) {
return N->kind() == NodeKind::BreakStatement;
}
- Leaf *breakKeyword();
+ Leaf *getBreakKeyword();
};
/// return <expr>;
@@ -730,8 +730,8 @@ class ReturnStatement final : public Statement {
static bool classof(const Node *N) {
return N->kind() == NodeKind::ReturnStatement;
}
- Leaf *returnKeyword();
- Expression *returnValue();
+ Leaf *getReturnKeyword();
+ Expression *getReturnValue();
};
/// for (<decl> : <init>) <body>
@@ -741,8 +741,8 @@ class RangeBasedForStatement final : public Statement {
static bool classof(const Node *N) {
return N->kind() == NodeKind::RangeBasedForStatement;
}
- Leaf *forKeyword();
- Statement *body();
+ Leaf *getForKeyword();
+ Statement *getBody();
};
/// Expression in a statement position, e.g. functions calls inside compound
@@ -753,7 +753,7 @@ class ExpressionStatement final : public Statement {
static bool classof(const Node *N) {
return N->kind() == NodeKind::ExpressionStatement;
}
- Expression *expression();
+ Expression *getExpression();
};
/// { statement1; statement2; … }
@@ -763,10 +763,10 @@ class CompoundStatement final : public Statement {
static bool classof(const Node *N) {
return N->kind() == NodeKind::CompoundStatement;
}
- Leaf *lbrace();
+ Leaf *getLbrace();
/// FIXME: use custom iterator instead of 'vector'.
- std::vector<Statement *> statements();
- Leaf *rbrace();
+ std::vector<Statement *> getStatements();
+ Leaf *getRbrace();
};
/// A declaration that can appear at the top-level. Note that this does *not*
@@ -808,8 +808,8 @@ class StaticAssertDeclaration final : public Declaration {
static bool classof(const Node *N) {
return N->kind() == NodeKind::StaticAssertDeclaration;
}
- Expression *condition();
- Expression *message();
+ Expression *getCondition();
+ Expression *getMessage();
};
/// extern <string-literal> declaration
@@ -833,7 +833,7 @@ class SimpleDeclaration final : public Declaration {
return N->kind() == NodeKind::SimpleDeclaration;
}
/// FIXME: use custom iterator instead of 'vector'.
- std::vector<SimpleDeclarator *> declarators();
+ std::vector<SimpleDeclarator *> getDeclarators();
};
/// template <template-parameters> <declaration>
@@ -843,8 +843,8 @@ class TemplateDeclaration final : public Declaration {
static bool classof(const Node *N) {
return N->kind() == NodeKind::TemplateDeclaration;
}
- Leaf *templateKeyword();
- Declaration *declaration();
+ Leaf *getTemplateKeyword();
+ Declaration *getDeclaration();
};
/// template <declaration>
@@ -859,9 +859,9 @@ class ExplicitTemplateInstantiation final : public Declaration {
static bool classof(const Node *N) {
return N->kind() == NodeKind::ExplicitTemplateInstantiation;
}
- Leaf *templateKeyword();
- Leaf *externKeyword();
- Declaration *declaration();
+ Leaf *getTemplateKeyword();
+ Leaf *getExternKeyword();
+ Declaration *getDeclaration();
};
/// namespace <name> { <decls> }
@@ -951,8 +951,8 @@ class ParenDeclarator final : public Declarator {
static bool classof(const Node *N) {
return N->kind() == NodeKind::ParenDeclarator;
}
- Leaf *lparen();
- Leaf *rparen();
+ Leaf *getLparen();
+ Leaf *getRparen();
};
/// Array size specified inside a declarator.
@@ -966,9 +966,9 @@ class ArraySubscript final : public Tree {
return N->kind() == NodeKind::ArraySubscript;
}
// TODO: add an accessor for the "static" keyword.
- Leaf *lbracket();
- Expression *size();
- Leaf *rbracket();
+ Leaf *getLbracket();
+ Expression *getSize();
+ Leaf *getRbracket();
};
/// Trailing return type after the parameter list, including the arrow token.
@@ -980,10 +980,10 @@ class TrailingReturnType final : public Tree {
return N->kind() == NodeKind::TrailingReturnType;
}
// TODO: add accessors for specifiers.
- Leaf *arrowToken();
+ Leaf *getArrowToken();
// FIXME: This should be a `type-id` following the grammar. Fix this once we
// have a representation of `type-id`s.
- SimpleDeclarator *declarator();
+ SimpleDeclarator *getDeclarator();
};
/// Models a `parameter-declaration-list` which appears within
@@ -994,9 +994,9 @@ class ParameterDeclarationList final : public List {
static bool classof(const Node *N) {
return N->kind() == NodeKind::ParameterDeclarationList;
}
- std::vector<SimpleDeclaration *> parameterDeclarations();
+ std::vector<SimpleDeclaration *> getParameterDeclarations();
std::vector<List::ElementAndDelimiter<syntax::SimpleDeclaration>>
- parametersAndCommas();
+ getParametersAndCommas();
};
/// Parameter list for a function type and a trailing return type, if the
@@ -1016,10 +1016,10 @@ class ParametersAndQualifiers final : public Tree {
static bool classof(const Node *N) {
return N->kind() == NodeKind::ParametersAndQualifiers;
}
- Leaf *lparen();
- ParameterDeclarationList *parameters();
- Leaf *rparen();
- TrailingReturnType *trailingReturn();
+ Leaf *getLparen();
+ ParameterDeclarationList *getParameters();
+ Leaf *getRparen();
+ TrailingReturnType *getTrailingReturn();
};
/// Member pointer inside a declarator
diff --git a/clang/lib/Tooling/Syntax/Nodes.cpp b/clang/lib/Tooling/Syntax/Nodes.cpp
index 2e7668c3cdc0..6102c45a08e4 100644
--- a/clang/lib/Tooling/Syntax/Nodes.cpp
+++ b/clang/lib/Tooling/Syntax/Nodes.cpp
@@ -224,7 +224,8 @@ raw_ostream &syntax::operator<<(raw_ostream &OS, NodeRole R) {
// We could have an interator in list to not pay memory costs of temporary
// vector
-std::vector<syntax::NameSpecifier *> syntax::NestedNameSpecifier::specifiers() {
+std::vector<syntax::NameSpecifier *>
+syntax::NestedNameSpecifier::getSpecifiers() {
auto specifiersAsNodes = getElementsAsNodes();
std::vector<syntax::NameSpecifier *> Children;
for (const auto &element : specifiersAsNodes) {
@@ -234,7 +235,7 @@ std::vector<syntax::NameSpecifier *> syntax::NestedNameSpecifier::specifiers() {
}
std::vector<syntax::List::ElementAndDelimiter<syntax::NameSpecifier>>
-syntax::NestedNameSpecifier::specifiersAndDoubleColons() {
+syntax::NestedNameSpecifier::getSpecifiersAndDoubleColons() {
auto specifiersAsNodesAndDoubleColons = getElementsAsNodesAndDelimiters();
std::vector<syntax::List::ElementAndDelimiter<syntax::NameSpecifier>>
Children;
@@ -246,7 +247,7 @@ syntax::NestedNameSpecifier::specifiersAndDoubleColons() {
return Children;
}
-std::vector<syntax::Expression *> syntax::CallArguments::arguments() {
+std::vector<syntax::Expression *> syntax::CallArguments::getArguments() {
auto ArgumentsAsNodes = getElementsAsNodes();
std::vector<syntax::Expression *> Children;
for (const auto &ArgumentAsNode : ArgumentsAsNodes) {
@@ -256,7 +257,7 @@ std::vector<syntax::Expression *> syntax::CallArguments::arguments() {
}
std::vector<syntax::List::ElementAndDelimiter<syntax::Expression>>
-syntax::CallArguments::argumentsAndCommas() {
+syntax::CallArguments::getArgumentsAndCommas() {
auto ArgumentsAsNodesAndCommas = getElementsAsNodesAndDelimiters();
std::vector<syntax::List::ElementAndDelimiter<syntax::Expression>> Children;
for (const auto &ArgumentAsNodeAndComma : ArgumentsAsNodesAndCommas) {
@@ -268,7 +269,7 @@ syntax::CallArguments::argumentsAndCommas() {
}
std::vector<syntax::SimpleDeclaration *>
-syntax::ParameterDeclarationList::parameterDeclarations() {
+syntax::ParameterDeclarationList::getParameterDeclarations() {
auto ParametersAsNodes = getElementsAsNodes();
std::vector<syntax::SimpleDeclaration *> Children;
for (const auto &ParameterAsNode : ParametersAsNodes) {
@@ -278,7 +279,7 @@ syntax::ParameterDeclarationList::parameterDeclarations() {
}
std::vector<syntax::List::ElementAndDelimiter<syntax::SimpleDeclaration>>
-syntax::ParameterDeclarationList::parametersAndCommas() {
+syntax::ParameterDeclarationList::getParametersAndCommas() {
auto ParametersAsNodesAndCommas = getElementsAsNodesAndDelimiters();
std::vector<syntax::List::ElementAndDelimiter<syntax::SimpleDeclaration>>
Children;
@@ -290,215 +291,215 @@ syntax::ParameterDeclarationList::parametersAndCommas() {
return Children;
}
-syntax::Expression *syntax::MemberExpression::object() {
+syntax::Expression *syntax::MemberExpression::getObject() {
return cast_or_null<syntax::Expression>(findChild(syntax::NodeRole::Object));
}
-syntax::Leaf *syntax::MemberExpression::templateKeyword() {
+syntax::Leaf *syntax::MemberExpression::getTemplateKeyword() {
return llvm::cast_or_null<syntax::Leaf>(
findChild(syntax::NodeRole::TemplateKeyword));
}
-syntax::Leaf *syntax::MemberExpression::accessToken() {
+syntax::Leaf *syntax::MemberExpression::getAccessToken() {
return llvm::cast_or_null<syntax::Leaf>(
findChild(syntax::NodeRole::AccessToken));
}
-syntax::IdExpression *syntax::MemberExpression::member() {
+syntax::IdExpression *syntax::MemberExpression::getMember() {
return cast_or_null<syntax::IdExpression>(
findChild(syntax::NodeRole::Member));
}
-syntax::NestedNameSpecifier *syntax::IdExpression::qualifier() {
+syntax::NestedNameSpecifier *syntax::IdExpression::getQualifier() {
return cast_or_null<syntax::NestedNameSpecifier>(
findChild(syntax::NodeRole::Qualifier));
}
-syntax::Leaf *syntax::IdExpression::templateKeyword() {
+syntax::Leaf *syntax::IdExpression::getTemplateKeyword() {
return llvm::cast_or_null<syntax::Leaf>(
findChild(syntax::NodeRole::TemplateKeyword));
}
-syntax::UnqualifiedId *syntax::IdExpression::unqualifiedId() {
+syntax::UnqualifiedId *syntax::IdExpression::getUnqualifiedId() {
return cast_or_null<syntax::UnqualifiedId>(
findChild(syntax::NodeRole::UnqualifiedId));
}
-syntax::Leaf *syntax::ParenExpression::openParen() {
+syntax::Leaf *syntax::ParenExpression::getOpenParen() {
return cast_or_null<syntax::Leaf>(findChild(syntax::NodeRole::OpenParen));
}
-syntax::Expression *syntax::ParenExpression::subExpression() {
+syntax::Expression *syntax::ParenExpression::getSubExpression() {
return cast_or_null<syntax::Expression>(
findChild(syntax::NodeRole::SubExpression));
}
-syntax::Leaf *syntax::ParenExpression::closeParen() {
+syntax::Leaf *syntax::ParenExpression::getCloseParen() {
return cast_or_null<syntax::Leaf>(findChild(syntax::NodeRole::CloseParen));
}
-syntax::Leaf *syntax::ThisExpression::thisKeyword() {
+syntax::Leaf *syntax::ThisExpression::getThisKeyword() {
return cast_or_null<syntax::Leaf>(
findChild(syntax::NodeRole::IntroducerKeyword));
}
-syntax::Leaf *syntax::LiteralExpression::literalToken() {
+syntax::Leaf *syntax::LiteralExpression::getLiteralToken() {
return cast_or_null<syntax::Leaf>(findChild(syntax::NodeRole::LiteralToken));
}
-syntax::Expression *syntax::BinaryOperatorExpression::lhs() {
+syntax::Expression *syntax::BinaryOperatorExpression::getLhs() {
return cast_or_null<syntax::Expression>(
findChild(syntax::NodeRole::LeftHandSide));
}
-syntax::Leaf *syntax::UnaryOperatorExpression::operatorToken() {
+syntax::Leaf *syntax::UnaryOperatorExpression::getOperatorToken() {
return cast_or_null<syntax::Leaf>(findChild(syntax::NodeRole::OperatorToken));
}
-syntax::Expression *syntax::UnaryOperatorExpression::operand() {
+syntax::Expression *syntax::UnaryOperatorExpression::getOperand() {
return cast_or_null<syntax::Expression>(findChild(syntax::NodeRole::Operand));
}
-syntax::Leaf *syntax::BinaryOperatorExpression::operatorToken() {
+syntax::Leaf *syntax::BinaryOperatorExpression::getOperatorToken() {
return cast_or_null<syntax::Leaf>(findChild(syntax::NodeRole::OperatorToken));
}
-syntax::Expression *syntax::BinaryOperatorExpression::rhs() {
+syntax::Expression *syntax::BinaryOperatorExpression::getRhs() {
return cast_or_null<syntax::Expression>(
findChild(syntax::NodeRole::RightHandSide));
}
-syntax::Expression *syntax::CallExpression::callee() {
+syntax::Expression *syntax::CallExpression::getCallee() {
return cast_or_null<syntax::Expression>(findChild(syntax::NodeRole::Callee));
}
-syntax::Leaf *syntax::CallExpression::openParen() {
+syntax::Leaf *syntax::CallExpression::getOpenParen() {
return cast_or_null<syntax::Leaf>(findChild(syntax::NodeRole::OpenParen));
}
-syntax::CallArguments *syntax::CallExpression::arguments() {
+syntax::CallArguments *syntax::CallExpression::getArguments() {
return cast_or_null<syntax::CallArguments>(
findChild(syntax::NodeRole::Arguments));
}
-syntax::Leaf *syntax::CallExpression::closeParen() {
+syntax::Leaf *syntax::CallExpression::getCloseParen() {
return cast_or_null<syntax::Leaf>(findChild(syntax::NodeRole::CloseParen));
}
-syntax::Leaf *syntax::SwitchStatement::switchKeyword() {
+syntax::Leaf *syntax::SwitchStatement::getSwitchKeyword() {
return cast_or_null<syntax::Leaf>(
findChild(syntax::NodeRole::IntroducerKeyword));
}
-syntax::Statement *syntax::SwitchStatement::body() {
+syntax::Statement *syntax::SwitchStatement::getBody() {
return cast_or_null<syntax::Statement>(
findChild(syntax::NodeRole::BodyStatement));
}
-syntax::Leaf *syntax::CaseStatement::caseKeyword() {
+syntax::Leaf *syntax::CaseStatement::getCaseKeyword() {
return cast_or_null<syntax::Leaf>(
findChild(syntax::NodeRole::IntroducerKeyword));
}
-syntax::Expression *syntax::CaseStatement::caseValue() {
+syntax::Expression *syntax::CaseStatement::getCaseValue() {
return cast_or_null<syntax::Expression>(
findChild(syntax::NodeRole::CaseValue));
}
-syntax::Statement *syntax::CaseStatement::body() {
+syntax::Statement *syntax::CaseStatement::getBody() {
return cast_or_null<syntax::Statement>(
findChild(syntax::NodeRole::BodyStatement));
}
-syntax::Leaf *syntax::DefaultStatement::defaultKeyword() {
+syntax::Leaf *syntax::DefaultStatement::getDefaultKeyword() {
return cast_or_null<syntax::Leaf>(
findChild(syntax::NodeRole::IntroducerKeyword));
}
-syntax::Statement *syntax::DefaultStatement::body() {
+syntax::Statement *syntax::DefaultStatement::getBody() {
return cast_or_null<syntax::Statement>(
findChild(syntax::NodeRole::BodyStatement));
}
-syntax::Leaf *syntax::IfStatement::ifKeyword() {
+syntax::Leaf *syntax::IfStatement::getIfKeyword() {
return cast_or_null<syntax::Leaf>(
findChild(syntax::NodeRole::IntroducerKeyword));
}
-syntax::Statement *syntax::IfStatement::thenStatement() {
+syntax::Statement *syntax::IfStatement::getThenStatement() {
return cast_or_null<syntax::Statement>(
findChild(syntax::NodeRole::ThenStatement));
}
-syntax::Leaf *syntax::IfStatement::elseKeyword() {
+syntax::Leaf *syntax::IfStatement::getElseKeyword() {
return cast_or_null<syntax::Leaf>(findChild(syntax::NodeRole::ElseKeyword));
}
-syntax::Statement *syntax::IfStatement::elseStatement() {
+syntax::Statement *syntax::IfStatement::getElseStatement() {
return cast_or_null<syntax::Statement>(
findChild(syntax::NodeRole::ElseStatement));
}
-syntax::Leaf *syntax::ForStatement::forKeyword() {
+syntax::Leaf *syntax::ForStatement::getForKeyword() {
return cast_or_null<syntax::Leaf>(
findChild(syntax::NodeRole::IntroducerKeyword));
}
-syntax::Statement *syntax::ForStatement::body() {
+syntax::Statement *syntax::ForStatement::getBody() {
return cast_or_null<syntax::Statement>(
findChild(syntax::NodeRole::BodyStatement));
}
-syntax::Leaf *syntax::WhileStatement::whileKeyword() {
+syntax::Leaf *syntax::WhileStatement::getWhileKeyword() {
return cast_or_null<syntax::Leaf>(
findChild(syntax::NodeRole::IntroducerKeyword));
}
-syntax::Statement *syntax::WhileStatement::body() {
+syntax::Statement *syntax::WhileStatement::getBody() {
return cast_or_null<syntax::Statement>(
findChild(syntax::NodeRole::BodyStatement));
}
-syntax::Leaf *syntax::ContinueStatement::continueKeyword() {
+syntax::Leaf *syntax::ContinueStatement::getContinueKeyword() {
return cast_or_null<syntax::Leaf>(
findChild(syntax::NodeRole::IntroducerKeyword));
}
-syntax::Leaf *syntax::BreakStatement::breakKeyword() {
+syntax::Leaf *syntax::BreakStatement::getBreakKeyword() {
return cast_or_null<syntax::Leaf>(
findChild(syntax::NodeRole::IntroducerKeyword));
}
-syntax::Leaf *syntax::ReturnStatement::returnKeyword() {
+syntax::Leaf *syntax::ReturnStatement::getReturnKeyword() {
return cast_or_null<syntax::Leaf>(
findChild(syntax::NodeRole::IntroducerKeyword));
}
-syntax::Expression *syntax::ReturnStatement::returnValue() {
+syntax::Expression *syntax::ReturnStatement::getReturnValue() {
return cast_or_null<syntax::Expression>(
findChild(syntax::NodeRole::ReturnValue));
}
-syntax::Leaf *syntax::RangeBasedForStatement::forKeyword() {
+syntax::Leaf *syntax::RangeBasedForStatement::getForKeyword() {
return cast_or_null<syntax::Leaf>(
findChild(syntax::NodeRole::IntroducerKeyword));
}
-syntax::Statement *syntax::RangeBasedForStatement::body() {
+syntax::Statement *syntax::RangeBasedForStatement::getBody() {
return cast_or_null<syntax::Statement>(
findChild(syntax::NodeRole::BodyStatement));
}
-syntax::Expression *syntax::ExpressionStatement::expression() {
+syntax::Expression *syntax::ExpressionStatement::getExpression() {
return cast_or_null<syntax::Expression>(
findChild(syntax::NodeRole::Expression));
}
-syntax::Leaf *syntax::CompoundStatement::lbrace() {
+syntax::Leaf *syntax::CompoundStatement::getLbrace() {
return cast_or_null<syntax::Leaf>(findChild(syntax::NodeRole::OpenParen));
}
-std::vector<syntax::Statement *> syntax::CompoundStatement::statements() {
+std::vector<syntax::Statement *> syntax::CompoundStatement::getStatements() {
std::vector<syntax::Statement *> Children;
for (auto *C = firstChild(); C; C = C->nextSibling()) {
assert(C->role() == syntax::NodeRole::Statement);
@@ -507,21 +508,21 @@ std::vector<syntax::Statement *> syntax::CompoundStatement::statements() {
return Children;
}
-syntax::Leaf *syntax::CompoundStatement::rbrace() {
+syntax::Leaf *syntax::CompoundStatement::getRbrace() {
return cast_or_null<syntax::Leaf>(findChild(syntax::NodeRole::CloseParen));
}
-syntax::Expression *syntax::StaticAssertDeclaration::condition() {
+syntax::Expression *syntax::StaticAssertDeclaration::getCondition() {
return cast_or_null<syntax::Expression>(
findChild(syntax::NodeRole::Condition));
}
-syntax::Expression *syntax::StaticAssertDeclaration::message() {
+syntax::Expression *syntax::StaticAssertDeclaration::getMessage() {
return cast_or_null<syntax::Expression>(findChild(syntax::NodeRole::Message));
}
std::vector<syntax::SimpleDeclarator *>
-syntax::SimpleDeclaration::declarators() {
+syntax::SimpleDeclaration::getDeclarators() {
std::vector<syntax::SimpleDeclarator *> Children;
for (auto *C = firstChild(); C; C = C->nextSibling()) {
if (C->role() == syntax::NodeRole::Declarator)
@@ -530,74 +531,75 @@ syntax::SimpleDeclaration::declarators() {
return Children;
}
-syntax::Leaf *syntax::TemplateDeclaration::templateKeyword() {
+syntax::Leaf *syntax::TemplateDeclaration::getTemplateKeyword() {
return cast_or_null<syntax::Leaf>(
findChild(syntax::NodeRole::IntroducerKeyword));
}
-syntax::Declaration *syntax::TemplateDeclaration::declaration() {
+syntax::Declaration *syntax::TemplateDeclaration::getDeclaration() {
return cast_or_null<syntax::Declaration>(
findChild(syntax::NodeRole::Declaration));
}
-syntax::Leaf *syntax::ExplicitTemplateInstantiation::templateKeyword() {
+syntax::Leaf *syntax::ExplicitTemplateInstantiation::getTemplateKeyword() {
return cast_or_null<syntax::Leaf>(
findChild(syntax::NodeRole::IntroducerKeyword));
}
-syntax::Leaf *syntax::ExplicitTemplateInstantiation::externKeyword() {
+syntax::Leaf *syntax::ExplicitTemplateInstantiation::getExternKeyword() {
return cast_or_null<syntax::Leaf>(findChild(syntax::NodeRole::ExternKeyword));
}
-syntax::Declaration *syntax::ExplicitTemplateInstantiation::declaration() {
+syntax::Declaration *syntax::ExplicitTemplateInstantiation::getDeclaration() {
return cast_or_null<syntax::Declaration>(
findChild(syntax::NodeRole::Declaration));
}
-syntax::Leaf *syntax::ParenDeclarator::lparen() {
+syntax::Leaf *syntax::ParenDeclarator::getLparen() {
return cast_or_null<syntax::Leaf>(findChild(syntax::NodeRole::OpenParen));
}
-syntax::Leaf *syntax::ParenDeclarator::rparen() {
+syntax::Leaf *syntax::ParenDeclarator::getRparen() {
return cast_or_null<syntax::Leaf>(findChild(syntax::NodeRole::CloseParen));
}
-syntax::Leaf *syntax::ArraySubscript::lbracket() {
+syntax::Leaf *syntax::ArraySubscript::getLbracket() {
return cast_or_null<syntax::Leaf>(findChild(syntax::NodeRole::OpenParen));
}
-syntax::Expression *syntax::ArraySubscript::size() {
+syntax::Expression *syntax::ArraySubscript::getSize() {
return cast_or_null<syntax::Expression>(findChild(syntax::NodeRole::Size));
}
-syntax::Leaf *syntax::ArraySubscript::rbracket() {
+syntax::Leaf *syntax::ArraySubscript::getRbracket() {
return cast_or_null<syntax::Leaf>(findChild(syntax::NodeRole::CloseParen));
}
-syntax::Leaf *syntax::TrailingReturnType::arrowToken() {
+syntax::Leaf *syntax::TrailingReturnType::getArrowToken() {
return cast_or_null<syntax::Leaf>(findChild(syntax::NodeRole::ArrowToken));
}
-syntax::SimpleDeclarator *syntax::TrailingReturnType::declarator() {
+syntax::SimpleDeclarator *syntax::TrailingReturnType::getDeclarator() {
return cast_or_null<syntax::SimpleDeclarator>(
findChild(syntax::NodeRole::Declarator));
}
-syntax::Leaf *syntax::ParametersAndQualifiers::lparen() {
+syntax::Leaf *syntax::ParametersAndQualifiers::getLparen() {
return cast_or_null<syntax::Leaf>(findChild(syntax::NodeRole::OpenParen));
}
syntax::ParameterDeclarationList *
-syntax::ParametersAndQualifiers::parameters() {
+syntax::ParametersAndQualifiers::getParameters() {
return cast_or_null<syntax::ParameterDeclarationList>(
findChild(syntax::NodeRole::Parameters));
}
-syntax::Leaf *syntax::ParametersAndQualifiers::rparen() {
+syntax::Leaf *syntax::ParametersAndQualifiers::getRparen() {
return cast_or_null<syntax::Leaf>(findChild(syntax::NodeRole::CloseParen));
}
-syntax::TrailingReturnType *syntax::ParametersAndQualifiers::trailingReturn() {
+syntax::TrailingReturnType *
+syntax::ParametersAndQualifiers::getTrailingReturn() {
return cast_or_null<syntax::TrailingReturnType>(
findChild(syntax::NodeRole::TrailingReturn));
}
More information about the cfe-commits
mailing list