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.
static bool classof(const Node *N)
BinaryOperatorExpression()
Leaf * getOperatorToken()
static bool classof(const Node *N)
static bool classof(const Node *N)
static bool classof(const Node *N)
std::vector< List::ElementAndDelimiter< Expression > > getArgumentsAndCommas()
std::vector< Expression * > getArguments()
Expression * getCaseValue()
static bool classof(const Node *N)
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)
static bool classof(const Node *N)
static bool classof(const Node *N)
Leaf * getExternKeyword()
ExplicitTemplateInstantiation()
static bool classof(const Node *N)
Leaf * getTemplateKeyword()
Declaration * getDeclaration()
static bool classof(const Node *N)
Expression * getExpression()
static bool classof(const Node *N)
static bool classof(const Node *N)
Statement * getThenStatement()
Statement * getElseStatement()
A leaf node points to a single token.
LinkageSpecificationDeclaration()
static bool classof(const Node *N)
A list of Elements separated or terminated by a fixed token.
static bool classof(const Node *N)
static bool classof(const Node *N)
NamespaceAliasDefinition()
static bool classof(const Node *N)
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()
ParameterDeclarationList * getParameters()
ParametersAndQualifiers()
TrailingReturnType * getTrailingReturn()
static bool classof(const Node *N)
static bool classof(const Node *N)
static bool classof(const Node *N)
PostfixUnaryOperatorExpression()
static bool classof(const Node *N)
PrefixUnaryOperatorExpression()
static bool classof(const Node *N)
Leaf * getReturnKeyword()
static bool classof(const Node *N)
Expression * getReturnValue()
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)
Expression * getMessage()
Expression * getCondition()
StaticAssertDeclaration()
static bool classof(const Node *N)
static bool classof(const Node *N)
Leaf * getSwitchKeyword()
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.
Node(NodeKind Kind)
Newly created nodes are detached from a tree, parent and sibling links are set when the node is added...
static bool classof(const Node *N)
static bool classof(const Node *N)
Expression * getOperand()
UnaryOperatorExpression(NodeKind K)
Leaf * getOperatorToken()
static bool classof(const Node *N)
static bool classof(const Node *N)
static bool classof(const Node *N)
Models an unqualified-id.
static bool classof(const Node *N)
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.