-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnode_type.h
217 lines (148 loc) · 4.46 KB
/
node_type.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
//////
// Declaration Kinds
#ifndef COMPILER_LAB_NODE_TYPE_H
#define COMPILER_LAB_NODE_TYPE_H
enum _node_type{
// A declaration whose specific kind is not exposed via this interface
//
// A C or C++ struct
STRUCT_DECL = 2,
// A C or C++ union
UNION_DECL = 3,
// An enumeration
ENUM_DECL = 5,
// A field in C, or non-static data member in C++, in a struct, union, or C++
// class
FIELD_DECL = 6,
// An enumerator constant
ENUM_CONSTANT_DECL = 7,
// A function
FUNCTION_DECL = 8,
// A variable
VAR_DECL = 9,
// A function or method parameter
PARM_DECL = 10,
// A typedef
TYPEDEF_DECL = 20,
// A Type alias decl
TYPE_ALIAS_DECL = 36,
// A reference to a member of a struct, union, or class that occurs in
// some non-expression context, eg, a designated initializer
MEMBER_REF = 47,
// A reference to a labeled statement
LABEL_REF = 48,
// A reference to a set of overloaded functions or function templates
// that has not yet been resolved to a specific function or function template
OVERLOADED_DECL_REF = 49,
// A reference to a variable that occurs in some non-expression
// context, eg, a C++ lambda capture list
VARIABLE_REF = 50,
//////
// Invalid/Error Kinds
INVALID_FILE = 70,
NO_DECL_FOUND = 71,
NOT_IMPLEMENTED = 72,
INVALID_CODE = 73,
//////
// Expression Kinds
// An expression whose specific kind is not exposed via this interface
//
// Unexposed expressions have the same operations as any other kind of
// expression; one can extract their location information, spelling, children,
// etc However, the specific kind of the expression is not reported
UNEXPOSED_EXPR = 100,
// An expression that refers to some value declaration, such as a function,
// variable, or enumerator
DECL_REF_EXPR = 101,
// An expression that refers to a member of a struct, union, class, Objective-C
// class, etc
MEMBER_REF_EXPR = 102,
// An expression that calls a function
CALL_EXPR = 103,
// An expression that represents a block literal
BLOCK_EXPR = 105,
// An integer literal
INTEGER_LITERAL = 106,
// A floating point number literal
FLOATING_LITERAL = 107,
// An imaginary number literal
IMAGINARY_LITERAL = 108,
// A string literal
STRING_LITERAL = 109,
// A character literal
CHARACTER_LITERAL = 110,
// A parenthesized expression, eg "1,"
//
// This AST node is only formed if full location information is requested
PAREN_EXPR = 111,
// This represents the unary-expression's except sizeof and
// alignof,
UNARY_OPERATOR = 112,
// [C99 6521] Array Subscripting
ARRAY_SUBSCRIPT_EXPR = 113,
// A builtin binary operation expression such as "x + y" or
// "x <= y"
BINARY_OPERATOR = 114,
// Compound assignment such as "+="
COMPOUND_ASSIGNMENT_OPERATOR = 115,
// The ?: ternary operator
CONDITIONAL_OPERATOR = 116,
// An explicit cast in C C99 654, or a C-style cast in C++
// C++ [exprcast],, which uses the syntax Type,expr
//
// For example: int,f
CSTYLE_CAST_EXPR = 117,
// [C99 6525]
COMPOUND_LITERAL_EXPR = 118,
// Describes an C or C++ initializer list
INIT_LIST_EXPR = 119,
// The GNU address of label extension, representing &&label
ADDR_LABEL_EXPR = 120,
// A statement whose specific kind is not exposed via this interface
//
// Unexposed statements have the same operations as any other kind of statement;
// one can extract their location information, spelling, children, etc However,
// the specific kind of the statement is not reported
UNEXPOSED_STMT = 200,
// A labelled statement in a function
LABEL_STMT = 201,
// A compound statement
COMPOUND_STMT = 202,
// A case statement
CASE_STMT = 203,
// A default statement
DEFAULT_STMT = 204,
// An if statement
IF_STMT = 205,
// A switch statement
SWITCH_STMT = 206,
// A while statement
WHILE_STMT = 207,
// A do statement
DO_STMT = 208,
// A for statement
FOR_STMT = 209,
// A goto statement
GOTO_STMT = 210,
// An indirect goto statement
INDIRECT_GOTO_STMT = 211,
// A continue statement
CONTINUE_STMT = 212,
// A break statement
BREAK_STMT = 213,
// A return statement
RETURN_STMT = 214,
// The null statement
NULL_STMT = 230,
// Adaptor class for mixing declarations with statements and expressions
DECL_STMT = 231,
//////
// Other Kinds
// Cursor that represents the translation unit itself
//
// The translation unit cursor exists primarily to act as the root cursor for
// traversing the contents of a translation unit
TRANSLATION_UNIT = 300,
};
typedef enum _node_type node_type;
#endif