Subversion Repositories QNX 8.QNX8 LLVM/Clang compiler suite

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
14 pmbaty 1
/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
2
|*                                                                            *|
3
|* Syntax tree node list                                                      *|
4
|*                                                                            *|
5
|* Automatically generated file, do not edit!                                 *|
6
|*                                                                            *|
7
\*===----------------------------------------------------------------------===*/
8
 
9
 
10
// Forward-declare node types so we don't have to carefully sequence definitions.
11
class Node;
12
class Leaf;
13
class Tree;
14
class ArraySubscript;
15
class Declaration;
16
class EmptyDeclaration;
17
class ExplicitTemplateInstantiation;
18
class LinkageSpecificationDeclaration;
19
class NamespaceAliasDefinition;
20
class NamespaceDefinition;
21
class SimpleDeclaration;
22
class StaticAssertDeclaration;
23
class TemplateDeclaration;
24
class TypeAliasDeclaration;
25
class UnknownDeclaration;
26
class UsingDeclaration;
27
class UsingNamespaceDirective;
28
class Declarator;
29
class ParenDeclarator;
30
class SimpleDeclarator;
31
class Expression;
32
class BinaryOperatorExpression;
33
class CallExpression;
34
class IdExpression;
35
class LiteralExpression;
36
class BoolLiteralExpression;
37
class CharacterLiteralExpression;
38
class CxxNullPtrExpression;
39
class FloatingLiteralExpression;
40
class IntegerLiteralExpression;
41
class StringLiteralExpression;
42
class UserDefinedLiteralExpression;
43
class CharUserDefinedLiteralExpression;
44
class FloatUserDefinedLiteralExpression;
45
class IntegerUserDefinedLiteralExpression;
46
class StringUserDefinedLiteralExpression;
47
class MemberExpression;
48
class ParenExpression;
49
class ThisExpression;
50
class UnknownExpression;
51
class List;
52
class CallArguments;
53
class DeclaratorList;
54
class NestedNameSpecifier;
55
class ParameterDeclarationList;
56
class MemberPointer;
57
class NameSpecifier;
58
class DecltypeNameSpecifier;
59
class GlobalNameSpecifier;
60
class IdentifierNameSpecifier;
61
class SimpleTemplateNameSpecifier;
62
class ParametersAndQualifiers;
63
class Statement;
64
class BreakStatement;
65
class CaseStatement;
66
class CompoundStatement;
67
class ContinueStatement;
68
class DeclarationStatement;
69
class DefaultStatement;
70
class EmptyStatement;
71
class ExpressionStatement;
72
class ForStatement;
73
class IfStatement;
74
class RangeBasedForStatement;
75
class ReturnStatement;
76
class SwitchStatement;
77
class UnknownStatement;
78
class WhileStatement;
79
class TrailingReturnType;
80
class TranslationUnit;
81
class UnaryOperatorExpression;
82
class PostfixUnaryOperatorExpression;
83
class PrefixUnaryOperatorExpression;
84
class UnqualifiedId;
85
 
86
// Node definitions
87
 
88
/// A base class for all expressions. Note that expressions are not statements,
89
/// even though they are in clang.
90
class Expression : public Tree {
91
protected:
92
  Expression(NodeKind K) : Tree(K) {}
93
public:
94
  static bool classof(const Node *N);
95
};
96
 
97
/// A function call. C++ [expr.call]
98
/// call-expression:
99
///   expression '(' call-arguments ')'
100
/// e.g `f(1, '2')` or `this->Base::f()`
101
class CallExpression final : public Expression {
102
public:
103
  CallExpression() : Expression(NodeKind::CallExpression) {}
104
  Expression *getCallee()  {
105
    return llvm::cast_or_null<Expression>(findChild(NodeRole::Callee));
106
  }
107
  const Expression *getCallee() const  {
108
    return llvm::cast_or_null<Expression>(findChild(NodeRole::Callee));
109
  }
110
  Leaf *getOpenParen()  {
111
    return llvm::cast_or_null<Leaf>(findChild(NodeRole::OpenParen));
112
  }
113
  const Leaf *getOpenParen() const  {
114
    return llvm::cast_or_null<Leaf>(findChild(NodeRole::OpenParen));
115
  }
116
  CallArguments *getArguments()  {
117
    return llvm::cast_or_null<CallArguments>(findChild(NodeRole::Arguments));
118
  }
119
  const CallArguments *getArguments() const  {
120
    return llvm::cast_or_null<CallArguments>(findChild(NodeRole::Arguments));
121
  }
122
  Leaf *getCloseParen()  {
123
    return llvm::cast_or_null<Leaf>(findChild(NodeRole::CloseParen));
124
  }
125
  const Leaf *getCloseParen() const  {
126
    return llvm::cast_or_null<Leaf>(findChild(NodeRole::CloseParen));
127
  }
128
  static bool classof(const Node *N);
129
};
130
 
131
/// Models an `id-expression`, e.g. `std::vector<int>::size`.
132
/// C++ [expr.prim.id]
133
/// id-expression:
134
///   unqualified-id
135
///   qualified-id
136
/// qualified-id:
137
///   nested-name-specifier template_opt unqualified-id
138
class IdExpression final : public Expression {
139
public:
140
  IdExpression() : Expression(NodeKind::IdExpression) {}
141
  NestedNameSpecifier *getQualifier()  {
142
    return llvm::cast_or_null<NestedNameSpecifier>(findChild(NodeRole::Qualifier));
143
  }
144
  const NestedNameSpecifier *getQualifier() const  {
145
    return llvm::cast_or_null<NestedNameSpecifier>(findChild(NodeRole::Qualifier));
146
  }
147
  Leaf *getTemplateKeyword()  {
148
    return llvm::cast_or_null<Leaf>(findChild(NodeRole::TemplateKeyword));
149
  }
150
  const Leaf *getTemplateKeyword() const  {
151
    return llvm::cast_or_null<Leaf>(findChild(NodeRole::TemplateKeyword));
152
  }
153
  UnqualifiedId *getUnqualifiedId()  {
154
    return llvm::cast_or_null<UnqualifiedId>(findChild(NodeRole::UnqualifiedId));
155
  }
156
  const UnqualifiedId *getUnqualifiedId() const  {
157
    return llvm::cast_or_null<UnqualifiedId>(findChild(NodeRole::UnqualifiedId));
158
  }
159
  static bool classof(const Node *N);
160
};
161
 
162
/// Expression for literals. C++ [lex.literal]
163
class LiteralExpression : public Expression {
164
protected:
165
  LiteralExpression(NodeKind K) : Expression(K) {}
166
public:
167
  static bool classof(const Node *N);
168
};
169
 
170
/// Expression for boolean literals. C++ [lex.bool]
171
class BoolLiteralExpression final : public LiteralExpression {
172
public:
173
  BoolLiteralExpression() : LiteralExpression(NodeKind::BoolLiteralExpression) {}
174
  Leaf *getLiteralToken()  {
175
    return llvm::cast_or_null<Leaf>(findChild(NodeRole::LiteralToken));
176
  }
177
  const Leaf *getLiteralToken() const  {
178
    return llvm::cast_or_null<Leaf>(findChild(NodeRole::LiteralToken));
179
  }
180
  static bool classof(const Node *N);
181
};
182
 
183
/// Expression for character literals. C++ [lex.ccon]
184
class CharacterLiteralExpression final : public LiteralExpression {
185
public:
186
  CharacterLiteralExpression() : LiteralExpression(NodeKind::CharacterLiteralExpression) {}
187
  Leaf *getLiteralToken()  {
188
    return llvm::cast_or_null<Leaf>(findChild(NodeRole::LiteralToken));
189
  }
190
  const Leaf *getLiteralToken() const  {
191
    return llvm::cast_or_null<Leaf>(findChild(NodeRole::LiteralToken));
192
  }
193
  static bool classof(const Node *N);
194
};
195
 
196
/// Expression for the `nullptr` literal. C++ [lex.nullptr]
197
class CxxNullPtrExpression final : public LiteralExpression {
198
public:
199
  CxxNullPtrExpression() : LiteralExpression(NodeKind::CxxNullPtrExpression) {}
200
  Leaf *getLiteralToken()  {
201
    return llvm::cast_or_null<Leaf>(findChild(NodeRole::LiteralToken));
202
  }
203
  const Leaf *getLiteralToken() const  {
204
    return llvm::cast_or_null<Leaf>(findChild(NodeRole::LiteralToken));
205
  }
206
  static bool classof(const Node *N);
207
};
208
 
209
/// Expression for floating-point literals. C++ [lex.fcon]
210
class FloatingLiteralExpression final : public LiteralExpression {
211
public:
212
  FloatingLiteralExpression() : LiteralExpression(NodeKind::FloatingLiteralExpression) {}
213
  Leaf *getLiteralToken()  {
214
    return llvm::cast_or_null<Leaf>(findChild(NodeRole::LiteralToken));
215
  }
216
  const Leaf *getLiteralToken() const  {
217
    return llvm::cast_or_null<Leaf>(findChild(NodeRole::LiteralToken));
218
  }
219
  static bool classof(const Node *N);
220
};
221
 
222
/// Expression for integer literals. C++ [lex.icon]
223
class IntegerLiteralExpression final : public LiteralExpression {
224
public:
225
  IntegerLiteralExpression() : LiteralExpression(NodeKind::IntegerLiteralExpression) {}
226
  Leaf *getLiteralToken()  {
227
    return llvm::cast_or_null<Leaf>(findChild(NodeRole::LiteralToken));
228
  }
229
  const Leaf *getLiteralToken() const  {
230
    return llvm::cast_or_null<Leaf>(findChild(NodeRole::LiteralToken));
231
  }
232
  static bool classof(const Node *N);
233
};
234
 
235
/// Expression for string-literals. C++ [lex.string]
236
class StringLiteralExpression final : public LiteralExpression {
237
public:
238
  StringLiteralExpression() : LiteralExpression(NodeKind::StringLiteralExpression) {}
239
  Leaf *getLiteralToken()  {
240
    return llvm::cast_or_null<Leaf>(findChild(NodeRole::LiteralToken));
241
  }
242
  const Leaf *getLiteralToken() const  {
243
    return llvm::cast_or_null<Leaf>(findChild(NodeRole::LiteralToken));
244
  }
245
  static bool classof(const Node *N);
246
};
247
 
248
/// Expression for user-defined literal. C++ [lex.ext]
249
/// user-defined-literal:
250
///   user-defined-integer-literal
251
///   user-defined-floating-point-literal
252
///   user-defined-string-literal
253
///   user-defined-character-literal
254
class UserDefinedLiteralExpression : public LiteralExpression {
255
protected:
256
  UserDefinedLiteralExpression(NodeKind K) : LiteralExpression(K) {}
257
public:
258
  static bool classof(const Node *N);
259
};
260
 
261
/// Expression for user-defined-character-literal. C++ [lex.ext]
262
class CharUserDefinedLiteralExpression final : public UserDefinedLiteralExpression {
263
public:
264
  CharUserDefinedLiteralExpression() : UserDefinedLiteralExpression(NodeKind::CharUserDefinedLiteralExpression) {}
265
  Leaf *getLiteralToken()  {
266
    return llvm::cast_or_null<Leaf>(findChild(NodeRole::LiteralToken));
267
  }
268
  const Leaf *getLiteralToken() const  {
269
    return llvm::cast_or_null<Leaf>(findChild(NodeRole::LiteralToken));
270
  }
271
  static bool classof(const Node *N);
272
};
273
 
274
/// Expression for user-defined-floating-point-literal. C++ [lex.ext]
275
class FloatUserDefinedLiteralExpression final : public UserDefinedLiteralExpression {
276
public:
277
  FloatUserDefinedLiteralExpression() : UserDefinedLiteralExpression(NodeKind::FloatUserDefinedLiteralExpression) {}
278
  Leaf *getLiteralToken()  {
279
    return llvm::cast_or_null<Leaf>(findChild(NodeRole::LiteralToken));
280
  }
281
  const Leaf *getLiteralToken() const  {
282
    return llvm::cast_or_null<Leaf>(findChild(NodeRole::LiteralToken));
283
  }
284
  static bool classof(const Node *N);
285
};
286
 
287
/// Expression for user-defined-integer-literal. C++ [lex.ext]
288
class IntegerUserDefinedLiteralExpression final : public UserDefinedLiteralExpression {
289
public:
290
  IntegerUserDefinedLiteralExpression() : UserDefinedLiteralExpression(NodeKind::IntegerUserDefinedLiteralExpression) {}
291
  Leaf *getLiteralToken()  {
292
    return llvm::cast_or_null<Leaf>(findChild(NodeRole::LiteralToken));
293
  }
294
  const Leaf *getLiteralToken() const  {
295
    return llvm::cast_or_null<Leaf>(findChild(NodeRole::LiteralToken));
296
  }
297
  static bool classof(const Node *N);
298
};
299
 
300
/// Expression for user-defined-string-literal. C++ [lex.ext]
301
class StringUserDefinedLiteralExpression final : public UserDefinedLiteralExpression {
302
public:
303
  StringUserDefinedLiteralExpression() : UserDefinedLiteralExpression(NodeKind::StringUserDefinedLiteralExpression) {}
304
  Leaf *getLiteralToken()  {
305
    return llvm::cast_or_null<Leaf>(findChild(NodeRole::LiteralToken));
306
  }
307
  const Leaf *getLiteralToken() const  {
308
    return llvm::cast_or_null<Leaf>(findChild(NodeRole::LiteralToken));
309
  }
310
  static bool classof(const Node *N);
311
};
312
 
313
/// Models a class member access. C++ [expr.ref]
314
/// member-expression:
315
///   expression -> template_opt id-expression
316
///   expression .  template_opt id-expression
317
/// e.g. `x.a`, `xp->a`
318
/// 
319
/// Note: An implicit member access inside a class, i.e. `a` instead of
320
/// `this->a`, is an `id-expression`.
321
class MemberExpression final : public Expression {
322
public:
323
  MemberExpression() : Expression(NodeKind::MemberExpression) {}
324
  Expression *getObject()  {
325
    return llvm::cast_or_null<Expression>(findChild(NodeRole::Object));
326
  }
327
  const Expression *getObject() const  {
328
    return llvm::cast_or_null<Expression>(findChild(NodeRole::Object));
329
  }
330
  Leaf *getAccessToken()  {
331
    return llvm::cast_or_null<Leaf>(findChild(NodeRole::AccessToken));
332
  }
333
  const Leaf *getAccessToken() const  {
334
    return llvm::cast_or_null<Leaf>(findChild(NodeRole::AccessToken));
335
  }
336
  Leaf *getTemplateKeyword()  {
337
    return llvm::cast_or_null<Leaf>(findChild(NodeRole::TemplateKeyword));
338
  }
339
  const Leaf *getTemplateKeyword() const  {
340
    return llvm::cast_or_null<Leaf>(findChild(NodeRole::TemplateKeyword));
341
  }
342
  IdExpression *getMember()  {
343
    return llvm::cast_or_null<IdExpression>(findChild(NodeRole::Member));
344
  }
345
  const IdExpression *getMember() const  {
346
    return llvm::cast_or_null<IdExpression>(findChild(NodeRole::Member));
347
  }
348
  static bool classof(const Node *N);
349
};
350
 
351
/// Models a parenthesized expression `(E)`. C++ [expr.prim.paren]
352
/// e.g. `(3 + 2)` in `a = 1 + (3 + 2);`
353
class ParenExpression final : public Expression {
354
public:
355
  ParenExpression() : Expression(NodeKind::ParenExpression) {}
356
  Leaf *getOpenParen()  {
357
    return llvm::cast_or_null<Leaf>(findChild(NodeRole::OpenParen));
358
  }
359
  const Leaf *getOpenParen() const  {
360
    return llvm::cast_or_null<Leaf>(findChild(NodeRole::OpenParen));
361
  }
362
  Expression *getSubExpression()  {
363
    return llvm::cast_or_null<Expression>(findChild(NodeRole::SubExpression));
364
  }
365
  const Expression *getSubExpression() const  {
366
    return llvm::cast_or_null<Expression>(findChild(NodeRole::SubExpression));
367
  }
368
  Leaf *getCloseParen()  {
369
    return llvm::cast_or_null<Leaf>(findChild(NodeRole::CloseParen));
370
  }
371
  const Leaf *getCloseParen() const  {
372
    return llvm::cast_or_null<Leaf>(findChild(NodeRole::CloseParen));
373
  }
374
  static bool classof(const Node *N);
375
};
376
 
377
/// Models a this expression `this`. C++ [expr.prim.this]
378
class ThisExpression final : public Expression {
379
public:
380
  ThisExpression() : Expression(NodeKind::ThisExpression) {}
381
  Leaf *getIntroducerKeyword()  {
382
    return llvm::cast_or_null<Leaf>(findChild(NodeRole::IntroducerKeyword));
383
  }
384
  const Leaf *getIntroducerKeyword() const  {
385
    return llvm::cast_or_null<Leaf>(findChild(NodeRole::IntroducerKeyword));
386
  }
387
  static bool classof(const Node *N);
388
};
389
 
390
/// A sequence of these specifiers make a `nested-name-specifier`.
391
/// e.g. the `std` or `vector<int>` in `std::vector<int>::size`.
392
class NameSpecifier : public Tree {
393
protected:
394
  NameSpecifier(NodeKind K) : Tree(K) {}
395
public:
396
  static bool classof(const Node *N);
397
};
398
 
399
/// A name specifier holding a decltype, of the form: `decltype ( expression ) `
400
/// e.g. the `decltype(s)` in `decltype(s)::size`.
401
class DecltypeNameSpecifier final : public NameSpecifier {
402
public:
403
  DecltypeNameSpecifier() : NameSpecifier(NodeKind::DecltypeNameSpecifier) {}
404
  static bool classof(const Node *N);
405
};
406
 
407
/// The global namespace name specifier, this specifier doesn't correspond to a
408
/// token instead an absence of tokens before a `::` characterizes it, in
409
/// `::std::vector<int>` it would be characterized by the absence of a token
410
/// before the first `::`
411
class GlobalNameSpecifier final : public NameSpecifier {
412
public:
413
  GlobalNameSpecifier() : NameSpecifier(NodeKind::GlobalNameSpecifier) {}
414
  static bool classof(const Node *N);
415
};
416
 
417
/// A identifier name specifier, of the form `identifier`
418
/// e.g. the `std` in `std::vector<int>::size`.
419
class IdentifierNameSpecifier final : public NameSpecifier {
420
public:
421
  IdentifierNameSpecifier() : NameSpecifier(NodeKind::IdentifierNameSpecifier) {}
422
  static bool classof(const Node *N);
423
};
424
 
425
/// A name specifier with a simple-template-id, of the form `template_opt
426
/// identifier < template-args >` e.g. the `vector<int>` in
427
/// `std::vector<int>::size`.
428
class SimpleTemplateNameSpecifier final : public NameSpecifier {
429
public:
430
  SimpleTemplateNameSpecifier() : NameSpecifier(NodeKind::SimpleTemplateNameSpecifier) {}
431
  static bool classof(const Node *N);
432
};
433
 
434
/// A root node for a translation unit. Parent is always null.
435
class TranslationUnit final : public Tree {
436
public:
437
  TranslationUnit() : Tree(NodeKind::TranslationUnit) {}
438
  static bool classof(const Node *N);
439
};
440