aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Frontend/StmtXML.def
blob: 2f0da9e7b117fe60e5b7baab3f35de80b8f3069e (plain) (blame)
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
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
//===-- StmtXML.def - Metadata about Stmt XML nodes ------------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
//  This file defines the XML statement database structure as written in
//  <TranslationUnit> sub-nodes of the XML document.
//  The semantics of the attributes and enums are mostly self-documenting
//  by looking at the appropriate internally used functions and values.
//  The following macros are used:
//
//  NODE_XML( CLASS, NAME ) - A node of name NAME denotes a concrete
//  statement of class CLASS where CLASS is a class name used internally by clang.
//  After a NODE_XML the definition of all (optional) attributes of that statement
//  node and possible sub-nodes follows.
//
//  END_NODE_XML - Closes the attribute definition of the current node.
//
//  ID_ATTRIBUTE_XML - Some statement nodes have an "id" attribute containing a
//  string, which value uniquely identify that statement. Other nodes may refer
//  by reference attributes to this value (currently used only for Label).
//
//  TYPE_ATTRIBUTE_XML( FN ) - Type nodes refer to the result type id of an
//  expression by a "type" attribute. FN is internally used by clang.
//
//  ATTRIBUTE_XML( FN, NAME ) - An attribute named NAME. FN is internally
//  used by clang. A boolean attribute have the values "0" or "1".
//
//  ATTRIBUTE_SPECIAL_XML( FN, NAME ) - An attribute named NAME which deserves
//  a special handling. See the appropriate documentations.
//
//  ATTRIBUTE_FILE_LOCATION_XML - A bunch of attributes denoting the location of
//  a statement in the source file(s).
//
//  ATTRIBUTE_OPT_XML( FN, NAME ) - An optional attribute named NAME.
//  Optional attributes are omitted for boolean types, if the value is false,
//  for integral types, if the value is null and for strings,
//  if the value is the empty string. FN is internally used by clang.
//
//  ATTRIBUTE_ENUM[_OPT]_XML( FN, NAME ) - An attribute named NAME. The value
//  is an enumeration defined with ENUM_XML macros immediately following after
//  that macro. An optional attribute is ommited, if the particular enum is the
//  empty string. FN is internally used by clang.
//
//  ENUM_XML( VALUE, NAME ) - An enumeration element named NAME. VALUE is
//  internally used by clang.
//
//  END_ENUM_XML - Closes the enumeration definition of the current attribute.
//
//  SUB_NODE_XML( CLASS ) - A mandatory sub-node of class CLASS or its sub-classes.
//
//  SUB_NODE_OPT_XML( CLASS ) - An optional sub-node of class CLASS or its sub-classes.
//
//  SUB_NODE_SEQUENCE_XML( CLASS ) - Zero or more sub-nodes of class CLASS or
//  its sub-classes.
//
//===----------------------------------------------------------------------===//

#ifndef ATTRIBUTE_FILE_LOCATION_XML
#  define ATTRIBUTE_FILE_LOCATION_XML             \
     ATTRIBUTE_XML(getFilename(), "file")         \
     ATTRIBUTE_XML(getLine(), "line")             \
     ATTRIBUTE_XML(getColumn(), "col")            \
     ATTRIBUTE_OPT_XML(getFilename(), "endfile")  \
     ATTRIBUTE_OPT_XML(getLine(), "endline")      \
     ATTRIBUTE_OPT_XML(getColumn(), "endcol")
#endif

#ifndef TYPE_ATTRIBUTE_XML
#  define TYPE_ATTRIBUTE_XML( FN )     ATTRIBUTE_XML(FN, "type")
#endif

#ifndef CONTEXT_ATTRIBUTE_XML
#  define CONTEXT_ATTRIBUTE_XML( FN )  ATTRIBUTE_XML(FN, "context")
#endif

NODE_XML(Stmt, "Stmt_Unsupported")                    // fallback for unsupproted statements
  ATTRIBUTE_FILE_LOCATION_XML
END_NODE_XML

NODE_XML(NullStmt, "NullStmt")
  ATTRIBUTE_FILE_LOCATION_XML
END_NODE_XML

NODE_XML(CompoundStmt, "CompoundStmt")
  ATTRIBUTE_FILE_LOCATION_XML
  ATTRIBUTE_XML(size(), "num_stmts")
  SUB_NODE_SEQUENCE_XML(Stmt)
END_NODE_XML

NODE_XML(CaseStmt, "CaseStmt")                        // case expr: body;
  ATTRIBUTE_FILE_LOCATION_XML
  SUB_NODE_XML(Stmt)                                  // body
  SUB_NODE_XML(Expr)                                  // expr
  SUB_NODE_XML(Expr)                                  // rhs expr in gc extension: case expr .. expr: body;
END_NODE_XML

NODE_XML(DefaultStmt, "DefaultStmt")                  // default: body;
  ATTRIBUTE_FILE_LOCATION_XML
  SUB_NODE_XML(Stmt)                                  // body
END_NODE_XML

NODE_XML(LabelStmt, "LabelStmt")                      // Label: body;
  ID_ATTRIBUTE_XML
  ATTRIBUTE_FILE_LOCATION_XML
  ATTRIBUTE_XML(getName(), "name")                    // string
  SUB_NODE_XML(Stmt)                                  // body
END_NODE_XML

NODE_XML(IfStmt, "IfStmt")                            // if (cond) stmt1; else stmt2;
  ATTRIBUTE_FILE_LOCATION_XML
  SUB_NODE_XML(Expr)                                  // cond
  SUB_NODE_XML(Stmt)                                  // stmt1
  SUB_NODE_XML(Stmt)                                  // stmt2
END_NODE_XML

NODE_XML(SwitchStmt, "SwitchStmt")                    // switch (cond) body;
  ATTRIBUTE_FILE_LOCATION_XML
  SUB_NODE_XML(Expr)                                  // cond
  SUB_NODE_XML(Stmt)                                  // body
END_NODE_XML

NODE_XML(WhileStmt, "WhileStmt")                      // while (cond) body;
  ATTRIBUTE_FILE_LOCATION_XML
  SUB_NODE_XML(Expr)                                  // cond
  SUB_NODE_XML(Stmt)                                  // body
END_NODE_XML

NODE_XML(DoStmt, "DoStmt")                            // do body while (cond);
  ATTRIBUTE_FILE_LOCATION_XML
  SUB_NODE_XML(Expr)                                  // cond
  SUB_NODE_XML(Stmt)                                  // body
END_NODE_XML

NODE_XML(ForStmt, "ForStmt")                          // for (init; cond; inc) body;
  ATTRIBUTE_FILE_LOCATION_XML
  SUB_NODE_XML(Stmt)                                  // init
  SUB_NODE_XML(Expr)                                  // cond
  SUB_NODE_XML(Expr)                                  // inc
  SUB_NODE_XML(Stmt)                                  // body
END_NODE_XML

NODE_XML(GotoStmt, "GotoStmt")                        // goto label;
  ATTRIBUTE_FILE_LOCATION_XML
  ATTRIBUTE_XML(getLabel()->getName(), "name")        // informal string
  ATTRIBUTE_XML(getLabel(), "ref")                    // id string
END_NODE_XML

NODE_XML(IndirectGotoStmt, "IndirectGotoStmt")        // goto expr;
  ATTRIBUTE_FILE_LOCATION_XML
  SUB_NODE_XML(Expr)                                  // expr
END_NODE_XML

NODE_XML(ContinueStmt, "ContinueStmt")                // continue
  ATTRIBUTE_FILE_LOCATION_XML
END_NODE_XML

NODE_XML(BreakStmt, "BreakStmt")                      // break
  ATTRIBUTE_FILE_LOCATION_XML
END_NODE_XML

NODE_XML(ReturnStmt, "ReturnStmt")                    // return expr;
  ATTRIBUTE_FILE_LOCATION_XML
  SUB_NODE_XML(Expr)                                  // expr
END_NODE_XML

NODE_XML(AsmStmt, "AsmStmt")                          // GNU inline-assembly statement extension
  ATTRIBUTE_FILE_LOCATION_XML
  // FIXME
END_NODE_XML

NODE_XML(DeclStmt, "DeclStmt")                        // a declaration statement
  ATTRIBUTE_FILE_LOCATION_XML
  SUB_NODE_SEQUENCE_XML(Decl)
END_NODE_XML

// C++ statements
NODE_XML(CXXTryStmt, "CXXTryStmt")                    // try CompoundStmt CXXCatchStmt1 CXXCatchStmt2 ..
  ATTRIBUTE_FILE_LOCATION_XML
  ATTRIBUTE_XML(getNumHandlers(), "num_handlers")
  SUB_NODE_XML(CompoundStmt)
  SUB_NODE_SEQUENCE_XML(CXXCatchStmt)
END_NODE_XML

NODE_XML(CXXCatchStmt, "CXXCatchStmt")                // catch (decl) Stmt
  ATTRIBUTE_FILE_LOCATION_XML
  SUB_NODE_XML(VarDecl)
  SUB_NODE_XML(Stmt)
END_NODE_XML

// Expressions
NODE_XML(PredefinedExpr, "PredefinedExpr")
  ATTRIBUTE_FILE_LOCATION_XML
  TYPE_ATTRIBUTE_XML(getType())
  ATTRIBUTE_ENUM_XML(getIdentType(), "kind")
	  ENUM_XML(PredefinedExpr::Func, "__func__")
	  ENUM_XML(PredefinedExpr::Function, "__FUNCTION__")
	  ENUM_XML(PredefinedExpr::PrettyFunction, "__PRETTY_FUNCTION__")
  END_ENUM_XML
END_NODE_XML

NODE_XML(DeclRefExpr, "DeclRefExpr")                  // an expression referring to a declared entity
  ATTRIBUTE_FILE_LOCATION_XML
  TYPE_ATTRIBUTE_XML(getType())
  ATTRIBUTE_XML(getDecl(), "ref")                     // id string of the declaration
  ATTRIBUTE_XML(getDecl()->getNameAsString(), "name") // informal
  //ATTRIBUTE_ENUM_XML(getDecl()->getKind(), "kind")  // really needed here?
END_NODE_XML

NODE_XML(IntegerLiteral, "IntegerLiteral")
  ATTRIBUTE_FILE_LOCATION_XML
  TYPE_ATTRIBUTE_XML(getType())
  ATTRIBUTE_XML(getValue(), "value")                  // (signed) integer
END_NODE_XML

NODE_XML(CharacterLiteral, "CharacterLiteral")
  ATTRIBUTE_FILE_LOCATION_XML
  TYPE_ATTRIBUTE_XML(getType())
  ATTRIBUTE_XML(getValue(), "value")                  // unsigned
END_NODE_XML

NODE_XML(FloatingLiteral, "FloatingLiteral")
  ATTRIBUTE_FILE_LOCATION_XML
  TYPE_ATTRIBUTE_XML(getType())
  // FIXME: output float as written in source (no approximation or the like)
  //ATTRIBUTE_XML(getValueAsApproximateDouble(), "value")   // float
END_NODE_XML

NODE_XML(StringLiteral, "StringLiteral")
  ATTRIBUTE_FILE_LOCATION_XML
  TYPE_ATTRIBUTE_XML(getType())
  ATTRIBUTE_SPECIAL_XML(getStrData(), "value")          // string, special handling for escaping needed
  ATTRIBUTE_OPT_XML(isWide(), "is_wide")                // boolean
END_NODE_XML

NODE_XML(UnaryOperator, "UnaryOperator")                // op(expr) or (expr)op
  ATTRIBUTE_FILE_LOCATION_XML
  TYPE_ATTRIBUTE_XML(getType())
  ATTRIBUTE_ENUM_XML(getOpcode(), "kind")
    ENUM_XML(UnaryOperator::PostInc, "postinc")
    ENUM_XML(UnaryOperator::PostDec, "postdec")
    ENUM_XML(UnaryOperator::PreInc,  "preinc")
    ENUM_XML(UnaryOperator::PreDec,  "predec")
    ENUM_XML(UnaryOperator::AddrOf,  "addrof")
    ENUM_XML(UnaryOperator::Deref,   "deref")
    ENUM_XML(UnaryOperator::Plus,    "plus")
    ENUM_XML(UnaryOperator::Minus,   "minus")
    ENUM_XML(UnaryOperator::Not,     "not")             // bitwise not
    ENUM_XML(UnaryOperator::LNot,    "lnot")            // boolean not
    ENUM_XML(UnaryOperator::Real,    "__real")
    ENUM_XML(UnaryOperator::Imag,    "__imag")
    ENUM_XML(UnaryOperator::Extension, "__extension__")
    ENUM_XML(UnaryOperator::OffsetOf,  "__builtin_offsetof")
  END_ENUM_XML
  SUB_NODE_XML(Expr)                                    // expr
END_NODE_XML

NODE_XML(BinaryOperator, "BinaryOperator")              // (expr1) op (expr2)
  ATTRIBUTE_FILE_LOCATION_XML
  TYPE_ATTRIBUTE_XML(getType())
  ATTRIBUTE_ENUM_XML(getOpcode(), "kind")
    ENUM_XML(BinaryOperator::PtrMemD  , "ptrmemd")
    ENUM_XML(BinaryOperator::PtrMemI  , "ptrmemi")
    ENUM_XML(BinaryOperator::Mul      , "mul")
    ENUM_XML(BinaryOperator::Div      , "div")
    ENUM_XML(BinaryOperator::Rem      , "rem")
    ENUM_XML(BinaryOperator::Add      , "add")
    ENUM_XML(BinaryOperator::Sub      , "sub")
    ENUM_XML(BinaryOperator::Shl      , "shl")
    ENUM_XML(BinaryOperator::Shr      , "shr")
    ENUM_XML(BinaryOperator::LT       , "lt")
    ENUM_XML(BinaryOperator::GT       , "gt")
    ENUM_XML(BinaryOperator::LE       , "le")
    ENUM_XML(BinaryOperator::GE       , "ge")
    ENUM_XML(BinaryOperator::EQ       , "eq")
    ENUM_XML(BinaryOperator::NE       , "ne")
    ENUM_XML(BinaryOperator::And      , "and")          // bitwise and
    ENUM_XML(BinaryOperator::Xor      , "xor")
    ENUM_XML(BinaryOperator::Or       , "or")           // bitwise or
    ENUM_XML(BinaryOperator::LAnd     , "land")         // boolean and
    ENUM_XML(BinaryOperator::LOr      , "lor")          // boolean or
    ENUM_XML(BinaryOperator::Assign   , "assign")
    ENUM_XML(BinaryOperator::MulAssign, "mulassign")
    ENUM_XML(BinaryOperator::DivAssign, "divassign")
    ENUM_XML(BinaryOperator::RemAssign, "remassign")
    ENUM_XML(BinaryOperator::AddAssign, "addassign")
    ENUM_XML(BinaryOperator::SubAssign, "subassign")
    ENUM_XML(BinaryOperator::ShlAssign, "shlassign")
    ENUM_XML(BinaryOperator::ShrAssign, "shrassign")
    ENUM_XML(BinaryOperator::AndAssign, "andassign")
    ENUM_XML(BinaryOperator::XorAssign, "xorassign")
    ENUM_XML(BinaryOperator::OrAssign , "orassign")
    ENUM_XML(BinaryOperator::Comma    , "comma")
  END_ENUM_XML
  SUB_NODE_XML(Expr)                                    // expr1
  SUB_NODE_XML(Expr)                                    // expr2
END_NODE_XML

// FIXME: is there a special class needed or is BinaryOperator sufficient?
//NODE_XML(CompoundAssignOperator, "CompoundAssignOperator")

NODE_XML(ConditionalOperator, "ConditionalOperator")    // expr1 ? expr2 : expr3
  ATTRIBUTE_FILE_LOCATION_XML
  TYPE_ATTRIBUTE_XML(getType())
  SUB_NODE_XML(Expr)                                    // expr1
  SUB_NODE_XML(Expr)                                    // expr2
  SUB_NODE_XML(Expr)                                    // expr3
END_NODE_XML

NODE_XML(SizeOfAlignOfExpr, "SizeOfAlignOfExpr")        // sizeof(expr) or alignof(expr)
  ATTRIBUTE_FILE_LOCATION_XML
  TYPE_ATTRIBUTE_XML(getType())
  ATTRIBUTE_XML(isSizeOf(), "is_sizeof")
  ATTRIBUTE_XML(isArgumentType(), "is_type")            // "1" if expr denotes a type
  ATTRIBUTE_SPECIAL_XML(getArgumentType(), "type_ref")  // optional, denotes the type of expr, if is_type=="1", special handling needed since getArgumentType() could assert
  SUB_NODE_OPT_XML(Expr)                                // expr, if is_type=="0"
END_NODE_XML

NODE_XML(ArraySubscriptExpr, "ArraySubscriptExpr")      // expr1[expr2]
  ATTRIBUTE_FILE_LOCATION_XML
  TYPE_ATTRIBUTE_XML(getType())
  SUB_NODE_XML(Expr)                                    // expr1
  SUB_NODE_XML(Expr)                                    // expr2
END_NODE_XML

NODE_XML(CallExpr, "CallExpr")                          // fnexpr(arg1, arg2, ...)
  ATTRIBUTE_FILE_LOCATION_XML
  TYPE_ATTRIBUTE_XML(getType())
  ATTRIBUTE_XML(getNumArgs(), "num_args")               // unsigned
  SUB_NODE_XML(Expr)                                    // fnexpr
  SUB_NODE_SEQUENCE_XML(Expr)                           // arg1..argN
END_NODE_XML

NODE_XML(MemberExpr, "MemberExpr")                      // expr->F or expr.F
  ATTRIBUTE_FILE_LOCATION_XML
  TYPE_ATTRIBUTE_XML(getType())
  ATTRIBUTE_XML(isArrow(), "is_deref")
  ATTRIBUTE_XML(getMemberDecl(), "ref")                 // refers to F
  ATTRIBUTE_XML(getMemberDecl()->getNameAsString(), "name") // informal
  SUB_NODE_XML(Expr)                                    // expr
END_NODE_XML

NODE_XML(CStyleCastExpr, "CStyleCastExpr")              // (type)expr
  ATTRIBUTE_FILE_LOCATION_XML
  TYPE_ATTRIBUTE_XML(getType())
  ATTRIBUTE_XML(getTypeAsWritten(), "type_ref")         // denotes the type as written in the source code
  SUB_NODE_XML(Expr)                                    // expr
END_NODE_XML

NODE_XML(ImplicitCastExpr, "ImplicitCastExpr")
  ATTRIBUTE_FILE_LOCATION_XML
  TYPE_ATTRIBUTE_XML(getType())
  SUB_NODE_XML(Expr)
END_NODE_XML

NODE_XML(CompoundLiteralExpr, "CompoundLiteralExpr")    // [C99 6.5.2.5]
  SUB_NODE_XML(Expr)                                    // init
END_NODE_XML

NODE_XML(ExtVectorElementExpr, "ExtVectorElementExpr")
  SUB_NODE_XML(Expr)                                    // base
END_NODE_XML

NODE_XML(InitListExpr, "InitListExpr")                  // struct foo x = { expr1, { expr2, expr3 } };
  ATTRIBUTE_FILE_LOCATION_XML
  TYPE_ATTRIBUTE_XML(getType())
  ATTRIBUTE_OPT_XML(getInitializedFieldInUnion(), "field_ref")  // if a union is initialized, this refers to the initialized union field id
  ATTRIBUTE_XML(getNumInits(), "num_inits")             // unsigned
  SUB_NODE_SEQUENCE_XML(Expr)                           // expr1..exprN
END_NODE_XML

NODE_XML(DesignatedInitExpr, "DesignatedInitExpr")
  ATTRIBUTE_FILE_LOCATION_XML
  TYPE_ATTRIBUTE_XML(getType())
END_NODE_XML

NODE_XML(ImplicitValueInitExpr, "ImplicitValueInitExpr")  //  Implicit value initializations occur within InitListExpr
  ATTRIBUTE_FILE_LOCATION_XML
  TYPE_ATTRIBUTE_XML(getType())
END_NODE_XML

NODE_XML(VAArgExpr, "VAArgExpr")                        // used for the builtin function __builtin_va_start(expr)
  ATTRIBUTE_FILE_LOCATION_XML
  TYPE_ATTRIBUTE_XML(getType())
  SUB_NODE_XML(Expr)                                    // expr
END_NODE_XML

NODE_XML(ParenExpr, "ParenExpr")                        // this represents a parethesized expression "(expr)". Only formed if full location information is requested.
  ATTRIBUTE_FILE_LOCATION_XML
  TYPE_ATTRIBUTE_XML(getType())
  SUB_NODE_XML(Expr)                                    // expr
END_NODE_XML

// GNU Extensions
NODE_XML(AddrLabelExpr, "AddrLabelExpr")                // the GNU address of label extension, representing &&label.
  ATTRIBUTE_FILE_LOCATION_XML
  TYPE_ATTRIBUTE_XML(getType())
  ATTRIBUTE_XML(getLabel(), "ref")                      // id string
  SUB_NODE_XML(LabelStmt)                               // expr
END_NODE_XML

NODE_XML(StmtExpr, "StmtExpr")                          // StmtExpr contains a single CompoundStmt node, which it evaluates and takes the value of the last subexpression.
  ATTRIBUTE_FILE_LOCATION_XML
  TYPE_ATTRIBUTE_XML(getType())
  SUB_NODE_XML(CompoundStmt)
END_NODE_XML

NODE_XML(TypesCompatibleExpr, "TypesCompatibleExpr")    // GNU builtin-in function __builtin_types_compatible_p
  ATTRIBUTE_FILE_LOCATION_XML
  TYPE_ATTRIBUTE_XML(getType())
  ATTRIBUTE_XML(getArgType1(), "type1_ref")             // id of type1
  ATTRIBUTE_XML(getArgType2(), "type2_ref")             // id of type2
END_NODE_XML

NODE_XML(ChooseExpr, "ChooseExpr")                      // GNU builtin-in function __builtin_choose_expr(expr1, expr2, expr3)
  ATTRIBUTE_FILE_LOCATION_XML
  TYPE_ATTRIBUTE_XML(getType())
  SUB_NODE_XML(Expr)                                    // expr1
  SUB_NODE_XML(Expr)                                    // expr2
  SUB_NODE_XML(Expr)                                    // expr3
END_NODE_XML

NODE_XML(GNUNullExpr, "GNUNullExpr")                    // GNU __null extension
  ATTRIBUTE_FILE_LOCATION_XML
  TYPE_ATTRIBUTE_XML(getType())
END_NODE_XML

// C++ Expressions
NODE_XML(CXXOperatorCallExpr, "CXXOperatorCallExpr")    // fnexpr(arg1, arg2, ...)
  ATTRIBUTE_FILE_LOCATION_XML
  TYPE_ATTRIBUTE_XML(getType())
  ATTRIBUTE_XML(getNumArgs(), "num_args")               // unsigned
  SUB_NODE_XML(Expr)                                    // fnexpr
  SUB_NODE_SEQUENCE_XML(Expr)                           // arg1..argN
END_NODE_XML

NODE_XML(CXXNamedCastExpr, "CXXNamedCastExpr")          // xxx_cast<type>(expr)
  ATTRIBUTE_FILE_LOCATION_XML
  TYPE_ATTRIBUTE_XML(getType())
  ATTRIBUTE_ENUM_XML(getStmtClass(), "kind")
	  ENUM_XML(Stmt::CXXStaticCastExprClass, "static_cast")
	  ENUM_XML(Stmt::CXXDynamicCastExprClass, "dynamic_cast")
	  ENUM_XML(Stmt::CXXReinterpretCastExprClass, "reinterpret_cast")
	  ENUM_XML(Stmt::CXXConstCastExprClass, "const_cast")
  END_ENUM_XML
  ATTRIBUTE_XML(getTypeAsWritten(), "type_ref")         // denotes the type as written in the source code
  SUB_NODE_XML(Expr)                                    // expr
END_NODE_XML

NODE_XML(CXXMemberCallExpr, "CXXMemberCallExpr")        // fnexpr(arg1, arg2, ...)
  ATTRIBUTE_FILE_LOCATION_XML
  TYPE_ATTRIBUTE_XML(getType())
  ATTRIBUTE_XML(getNumArgs(), "num_args")               // unsigned
  SUB_NODE_XML(Expr)                                    // fnexpr
  SUB_NODE_SEQUENCE_XML(Expr)                           // arg1..argN
END_NODE_XML

NODE_XML(CXXBoolLiteralExpr, "CXXBoolLiteralExpr")
  ATTRIBUTE_FILE_LOCATION_XML
  TYPE_ATTRIBUTE_XML(getType())
  ATTRIBUTE_XML(getValue(), "value")                    // boolean
END_NODE_XML

NODE_XML(CXXNullPtrLiteralExpr, "CXXNullPtrLiteralExpr")  // [C++0x 2.14.7] C++ Pointer Literal
  ATTRIBUTE_FILE_LOCATION_XML
  TYPE_ATTRIBUTE_XML(getType())
END_NODE_XML

NODE_XML(CXXTypeidExpr, "CXXTypeidExpr")                // typeid(expr)
  ATTRIBUTE_FILE_LOCATION_XML
  TYPE_ATTRIBUTE_XML(getType())
  ATTRIBUTE_XML(isTypeOperand(), "is_type")             // "1" if expr denotes a type
  ATTRIBUTE_SPECIAL_XML(getTypeOperand(), "type_ref")   // optional, denotes the type of expr, if is_type=="1", special handling needed since getTypeOperand() could assert
  SUB_NODE_OPT_XML(Expr)                                // expr, if is_type=="0"
END_NODE_XML

NODE_XML(CXXThisExpr, "CXXThisExpr")                    // this
  ATTRIBUTE_FILE_LOCATION_XML
  TYPE_ATTRIBUTE_XML(getType())
END_NODE_XML

NODE_XML(CXXThrowExpr, "CXXThrowExpr")                  // throw (expr);
  ATTRIBUTE_FILE_LOCATION_XML
  TYPE_ATTRIBUTE_XML(getType())
  SUB_NODE_XML(Expr)                                    // NULL in case of "throw;"
END_NODE_XML

NODE_XML(CXXDefaultArgExpr, "CXXDefaultArgExpr")
  ATTRIBUTE_FILE_LOCATION_XML
  TYPE_ATTRIBUTE_XML(getType())
  ATTRIBUTE_XML(getParam(), "ref")                      // id of the parameter declaration (the expression is a subnode of the declaration)
END_NODE_XML

//===----------------------------------------------------------------------===//
#undef NODE_XML
#undef ID_ATTRIBUTE_XML
#undef TYPE_ATTRIBUTE_XML
#undef ATTRIBUTE_XML
#undef ATTRIBUTE_SPECIAL_XML
#undef ATTRIBUTE_OPT_XML
#undef ATTRIBUTE_ENUM_XML
#undef ATTRIBUTE_ENUM_OPT_XML
#undef ATTRIBUTE_FILE_LOCATION_XML
#undef ENUM_XML
#undef END_ENUM_XML
#undef END_NODE_XML
#undef SUB_NODE_XML
#undef SUB_NODE_SEQUENCE_XML
#undef SUB_NODE_OPT_XML