21#ifndef LLVM_CLANG_TOOLING_SYNTAX_NODES_H
22#define LLVM_CLANG_TOOLING_SYNTAX_NODES_H
33#define CONCRETE_NODE(Kind, Base) Kind,
34#include "clang/Tooling/Syntax/Nodes.inc"
112#include "clang/Tooling/Syntax/NodeClasses.inc"
121 std::vector<List::ElementAndDelimiter<syntax::NameSpecifier>>
398 std::vector<List::ElementAndDelimiter<syntax::SimpleDeclarator>>
545 std::vector<List::ElementAndDelimiter<syntax::SimpleDeclaration>>
578#define CONCRETE_NODE(Kind, Base) \
579 inline bool Kind::classof(const Node *N) { \
580 return N->getKind() == NodeKind::Kind; \
582#define ABSTRACT_NODE(Kind, Base, First, Last) \
583 inline bool Kind::classof(const Node *N) { \
584 return N->getKind() >= NodeKind::First && N->getKind() <= NodeKind::Last; \
586#include "clang/Tooling/Syntax/Nodes.inc"
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
Array size specified inside a declarator.
static bool classof(const Node *N)
BinaryOperatorExpression()
Leaf * getOperatorToken()
static bool classof(const Node *N)
static bool classof(const Node *N)
Models arguments of a function call.
static bool classof(const Node *N)
std::vector< List::ElementAndDelimiter< Expression > > getArgumentsAndCommas()
std::vector< Expression * > getArguments()
Expression * getCaseValue()
static bool classof(const Node *N)
{ statement1; statement2; … }
static bool classof(const Node *N)
std::vector< Statement * > getStatements()
FIXME: use custom iterator instead of 'vector'.
static bool classof(const Node *N)
Leaf * getContinueKeyword()
static bool classof(const Node *N)
A declaration that can appear at the top-level.
static bool classof(const Node *N)
static bool classof(const Node *N)
std::vector< SimpleDeclarator * > getDeclarators()
std::vector< List::ElementAndDelimiter< syntax::SimpleDeclarator > > getDeclaratorsAndCommas()
Covers a name, an initializer and a part of the type outside declaration specifiers.
static bool classof(const Node *N)
Leaf * getDefaultKeyword()
static bool classof(const Node *N)
A semicolon in the top-level context. Does not declare anything.
static bool classof(const Node *N)
The no-op statement, i.e. ';'.
static bool classof(const Node *N)
template <declaration> Examples: template struct X<int> template void foo<int>() template int var<dou...
Leaf * getExternKeyword()
ExplicitTemplateInstantiation()
static bool classof(const Node *N)
Leaf * getTemplateKeyword()
Declaration * getDeclaration()
Expression in a statement position, e.g.
static bool classof(const Node *N)
Expression * getExpression()
for (<init>; <cond>; <increment>) <body>
static bool classof(const Node *N)
if (cond) <then-statement> else <else-statement> FIXME: add condition that models 'expression or vari...
static bool classof(const Node *N)
Statement * getThenStatement()
Statement * getElseStatement()
A leaf node points to a single token.
extern <string-literal> declaration extern <string-literal> { <decls> }
LinkageSpecificationDeclaration()
static bool classof(const Node *N)
A list of Elements separated or terminated by a fixed token.
Member pointer inside a declarator E.g.
static bool classof(const Node *N)
namespace <name> = <namespace-reference>
static bool classof(const Node *N)
NamespaceAliasDefinition()
namespace <name> { <decls> }
static bool classof(const Node *N)
Models a nested-name-specifier.
std::vector< NameSpecifier * > getSpecifiers()
std::vector< List::ElementAndDelimiter< syntax::NameSpecifier > > getSpecifiersAndDoubleColons()
static bool classof(const Node *N)
Models a parameter-declaration-list which appears within parameters-and-qualifiers.
std::vector< List::ElementAndDelimiter< syntax::SimpleDeclaration > > getParametersAndCommas()
static bool classof(const Node *N)
ParameterDeclarationList()
std::vector< SimpleDeclaration * > getParameterDeclarations()
Parameter list for a function type and a trailing return type, if the function has one.
ParameterDeclarationList * getParameters()
ParametersAndQualifiers()
TrailingReturnType * getTrailingReturn()
static bool classof(const Node *N)
Declarator inside parentheses.
static bool classof(const Node *N)
static bool classof(const Node *N)
PostfixUnaryOperatorExpression()
static bool classof(const Node *N)
PrefixUnaryOperatorExpression()
for (<decl> : <init>) <body>
static bool classof(const Node *N)
Leaf * getReturnKeyword()
static bool classof(const Node *N)
Expression * getReturnValue()
Groups multiple declarators (e.g.
std::vector< SimpleDeclarator * > getDeclarators()
FIXME: use custom iterator instead of 'vector'.
static bool classof(const Node *N)
A top-level declarator without parentheses.
static bool classof(const Node *N)
An abstract node for C++ statements, e.g.
static bool classof(const Node *N)
static_assert(<condition>, <message>) static_assert(<condition>)
Expression * getMessage()
Expression * getCondition()
StaticAssertDeclaration()
static bool classof(const Node *N)
static bool classof(const Node *N)
Leaf * getSwitchKeyword()
template <template-parameters> <declaration>
Leaf * getTemplateKeyword()
Declaration * getDeclaration()
static bool classof(const Node *N)
Trailing return type after the parameter list, including the arrow token.
SimpleDeclarator * getDeclarator()
static bool classof(const Node *N)
A node that has children and represents a syntactic language construct.
static bool classof(const Node *N)
An abstract class for prefix and postfix unary operators.
static bool classof(const Node *N)
Expression * getOperand()
UnaryOperatorExpression(NodeKind K)
Leaf * getOperatorToken()
Declaration of an unknown kind, e.g. not yet supported in syntax trees.
static bool classof(const Node *N)
An expression of an unknown kind, i.e.
static bool classof(const Node *N)
A statement of an unknown kind, i.e.
static bool classof(const Node *N)
Models an unqualified-id.
static bool classof(const Node *N)
using <scope>::<name> using typename <scope>::<name>
static bool classof(const Node *N)
UsingNamespaceDirective()
static bool classof(const Node *N)
static bool classof(const Node *N)
NodeRole
A relation between a parent and child node, e.g.
@ ListElement
List API roles.
@ LiteralToken
A token that represents a literal, e.g. 'nullptr', '1', 'true', etc.
@ Detached
A node without a parent.
@ CloseParen
A closing parenthesis in argument lists and blocks, e.g. '}', ')', etc.
@ IntroducerKeyword
A keywords that introduces some grammar construct, e.g. 'if', 'try', etc.
@ Unknown
Children of an unknown semantic nature, e.g. skipped tokens, comments.
@ BodyStatement
An inner statement for those that have only a single child of kind statement, e.g.
@ OpenParen
An opening parenthesis in argument lists and blocks, e.g. '{', '(', etc.
@ ArrowToken
Tokens or Keywords.
NodeKind
A kind of a syntax node, used for implementing casts.
raw_ostream & operator<<(raw_ostream &OS, NodeKind K)
For debugging purposes.
The JSON file list parser is used to communicate input to InstallAPI.