cast 0.0.1 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 8d28ed8c2a4e614f19a15b7a11f03248e113460a1696aee87f297f13b5f2accd
4
+ data.tar.gz: 05f1e875efc4c582d266716c75947d678763acae895550d97840dd60f8d4f4d3
5
+ SHA512:
6
+ metadata.gz: 153f75a811886c45e1babfb2ba5b3f797bbe3abb7d8b9cfedd328ea6a0027d7790d8ed586c9a8875acfb926d3dec9005c0d3db4b737dd79047085e848eb3072d
7
+ data.tar.gz: 3c6c578a7b8fb2dda38b5428b82eaadd2fc399747047b5100153e560cd3c4da41b8baad145cd0ecc65ddbf30ce6c8516339fd1e98b0fa14526b66deac06e93f4
@@ -0,0 +1,10 @@
1
+ /*.gem
2
+ /Gemfile.lock
3
+ /ext/Makefile
4
+ /ext/*.bundle
5
+ /ext/*.o
6
+ /ext/*.so
7
+ /ext/yylex.c
8
+ /lib/cast/cast.so
9
+ /lib/cast/c.tab.rb
10
+ /lib/cast/cast.bundle
@@ -0,0 +1,63 @@
1
+ == 0.3.1 2020-07-15
2
+
3
+ * Support struct/union member declarations with no declarators. [Brice Videau]
4
+
5
+ == 0.3.0 2016-03-21
6
+
7
+ * Fix popping & shifting from an empty NodeList.
8
+ * Add FloatLiteral#exponent and require exponent for hex floats.
9
+
10
+ == 0.2.1 2012-12-19
11
+
12
+ * Parse adjacent string literals correctly.
13
+
14
+ == 0.2.0 2012-05-14
15
+
16
+ * Works with Ruby 1.8.6, 1.8.7, 1.9.2, 1.9.3.
17
+ * MIT License.
18
+ * Friendlier changelog.
19
+ * Added C::Preprocessor, which wraps Config::CONFIG['CPP']. Assumes
20
+ POSIX-style -D and -I options.
21
+ * IntLiteral suffixes are parsed correctly for things like 2e-2.
22
+ * Newlines are allowed in StringLiterals and CharLiterals.
23
+ * Added StringLiteral and CharLiteral #prefix. #wide? and #wide are
24
+ now methods, not fields.
25
+ * IntLiteral and FloatLiteral #format is now the first field.
26
+ * More meaningful parse error messages.
27
+ * Printing (#to_s):
28
+ * FunctionDef#no_prototype? is now honored.
29
+ * ':' is now printed for labels.
30
+ * Consecutive unary operators no longer conflict with other
31
+ operators (e.g. "+ +" instead of "++").
32
+ * Sizeof is printed with parentheses (not mandated by C99, but
33
+ conventional).
34
+ * Signedness qualifier is always printed for char.
35
+ * Longness is printed correctly for Bool, Complex, Imaginary.
36
+ * Nested Conditionals are handled correctly.
37
+ * MemberInit#member is printed correctly.
38
+ * Parsing (#parse):
39
+ * Member now works.
40
+ * Expression now supports CompoundLiterals without types (as
41
+ allowed in declarators only).
42
+ * Declarator allows specification of #num_bits.
43
+
44
+ == 0.1.0 2006-04-25
45
+
46
+ * Faster lexer (written in C).
47
+ * Renamed Node#to_debug to Node#inspect.
48
+ * Allow type names in Call#args. (Not C99, but useful for macros.)
49
+ * Added node fields:
50
+ * StringLiteral#wide?
51
+ * CharLiteral#wide?
52
+ * IntLiteral#suffix
53
+ * FloatLiteral#format
54
+ * FloatLiteral#suffix
55
+ * Fixed CompoundLiteral#to_s.
56
+ * Fixed AssignmentExpression#to_s when #lval is a Comma.
57
+ * Fixed Parameter#to_s when #type is nil.
58
+ * Cleaned up load path.
59
+ * Install with rake task.
60
+
61
+ == 0.0.1 2005-02-21
62
+
63
+ * Hi.
data/Gemfile ADDED
@@ -0,0 +1,9 @@
1
+ source 'https://rubygems.org/'
2
+
3
+ gem 'minitest'
4
+ gem 'minitest-focus'
5
+ gem 'pry'
6
+ gem 'racc'
7
+ gem 'ritual'
8
+
9
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ The MIT License
2
+
3
+ Copyright (c) George Ogata
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,1924 @@
1
+ # CAST
2
+
3
+ C parser and abstract syntax tree for Ruby.
4
+
5
+ ## Example
6
+
7
+ require 'cast'
8
+
9
+ source = File.read('file.c')
10
+ ast = C.parse(source)
11
+ ast.entities.each do |declaration|
12
+ declaration.declarator.each do |declarator|
13
+ puts "#{declarator.name}: declarator.type"
14
+ end
15
+ end
16
+
17
+ Or in irb:
18
+
19
+ irb> ast = C.parse('int main(void) { return 0; }')
20
+ => TranslationUnit
21
+ entities:
22
+ - FunctionDef
23
+ type: Function
24
+ type: Int
25
+ params: []
26
+ name: "main"
27
+ def: Block
28
+ stmts:
29
+ - Return
30
+ expr: IntLiteral
31
+ val: 0
32
+
33
+ irb> puts ast
34
+ int main(void) {
35
+ return 0;
36
+ }
37
+ => nil
38
+
39
+ ## Nodes
40
+
41
+ `C.parse` returns a tree of `Node` objects. Here's the class hierarchy:
42
+
43
+ * **Node**
44
+ * TranslationUnit
45
+ * Comment
46
+ * Declaration
47
+ * Declarator
48
+ * FunctionDef
49
+ * Parameter
50
+ * Enumerator
51
+ * MemberInit
52
+ * Member
53
+ * **Statement**
54
+ * Block
55
+ * If
56
+ * Switch
57
+ * While
58
+ * For
59
+ * Goto
60
+ * Continue
61
+ * Break
62
+ * Return
63
+ * ExpressionStatement
64
+ * **Label**
65
+ * PlainLabel
66
+ * Default
67
+ * Case
68
+ * **Type**
69
+ * **IndirectType**
70
+ * Pointer
71
+ * Array
72
+ * Function
73
+ * **DirectType**
74
+ * Struct
75
+ * Union
76
+ * Enum
77
+ * CustomType
78
+ * **PrimitiveType**
79
+ * Void
80
+ * Int
81
+ * Float
82
+ * Char
83
+ * Bool
84
+ * Complex
85
+ * Imaginary
86
+ * **Expression**
87
+ * Comma
88
+ * Conditional
89
+ * Variable
90
+ * **UnaryExpression**
91
+ * **PostfixExpression**
92
+ * Index
93
+ * Call
94
+ * Dot
95
+ * Arrow
96
+ * PostInc
97
+ * PostDec
98
+ * **PrefixExpression**
99
+ * Cast
100
+ * Address
101
+ * Dereference
102
+ * Sizeof
103
+ * Plus
104
+ * Minus
105
+ * PreInc
106
+ * PreDec
107
+ * BitNot
108
+ * Not
109
+ * **BinaryExpression**
110
+ * Add
111
+ * Subtract
112
+ * Multiply
113
+ * Divide
114
+ * Mod
115
+ * Equal
116
+ * NotEqual
117
+ * Less
118
+ * More
119
+ * LessOrEqual
120
+ * MoreOrEqual
121
+ * BitAnd
122
+ * BitOr
123
+ * BitXor
124
+ * ShiftLeft
125
+ * ShiftRight
126
+ * And
127
+ * Or
128
+ * **AssignmentExpression**
129
+ * Assign
130
+ * MultiplyAssign
131
+ * DivideAssign
132
+ * ModAssign
133
+ * AddAssign
134
+ * SubtractAssign
135
+ * ShiftLeftAssign
136
+ * ShiftRightAssign
137
+ * BitAndAssign
138
+ * BitXorAssign
139
+ * BitOrAssign
140
+ * **Literal**
141
+ * StringLiteral
142
+ * CharLiteral
143
+ * CompoundLiteral
144
+ * IntLiteral
145
+ * FloatLiteral
146
+ * **NodeList**
147
+ * NodeArray
148
+ * NodeChain
149
+
150
+ The **bold** ones are abstract.
151
+
152
+ The last 2 (`NodeList`s) represent lists of `Node`s. They quack like
153
+ standard ruby `Arrays`. `NodeChain` is a doubly linked list;
154
+ `NodeArray` is an array.
155
+
156
+ ### Node Methods
157
+
158
+ * `parent`: return the parent in the tree (a `Node` or nil).
159
+ * `pos`, `pos=`: the position in the source file (a `Node::Pos`).
160
+ * `to_s`: return the code for the tree (a `String`).
161
+ * `inspect`: return a pretty string for inspection, makes irb fun.
162
+ * `match?(str)`, `=~(str)`: return true iff str parses as a `Node`
163
+ equal to this one.
164
+ * `detach`: remove this node from the tree (parent becomes nil) and
165
+ return it.
166
+ * `detached?`, `attached?`: return true if parent is nil or non-nil
167
+ respectively.
168
+ * `replace_with(node)`: replace this node with node in the tree.
169
+ * `swap_with(node)`: exchange this node with node in their trees.
170
+ * `insert_prev(*nodes)`, `insert_next(*nodes)`: insert nodes before
171
+ this node in the parent list. Parent must be a `NodeList`! Useful
172
+ for adding statements before a node in a block, for example.
173
+ * `Foo?`: (where `Foo` is a module name) return `self.is_a?(Foo)`.
174
+ This is a convienience for a common need. Example:
175
+
176
+ <pre>
177
+ \# print all global variables
178
+ ast.entities.each do |node|
179
+ node.Declaration? or next
180
+ node.declarators.each do |decl|
181
+ unless decl.type.Function?
182
+ puts "#{decl.name}: #{decl.type}"
183
+ end
184
+ end
185
+ end
186
+ </pre>
187
+
188
+ The `=~` method lets you do:
189
+
190
+ if declarator.type =~ 'const int *'
191
+ puts "Ooh, a const int pointer!"
192
+ end
193
+
194
+ This is not the same as `declarator.type.to_s == 'const int *'`;
195
+ that'd require you to guess how `to_s` formats its strings (most
196
+ notably, the whitespace).
197
+
198
+ ### Fields and Children
199
+
200
+ The big table down below lists the *fields* of each `Node`. A field is
201
+ an attribute which:
202
+
203
+ * is used in equality checks (`==` and `eql?`).
204
+ * are copied recursively by `dup` and `clone`.
205
+
206
+ Fields listed as *children* form the tree structure. They only have a
207
+ `Node` or `nil` value, and are yielded/returned/affected by the
208
+ traversal methods:
209
+
210
+ * `next`, `prev`: return the next/prev sibling.
211
+ * `list_next`, `list_prev`: like `next`/`prev`, but also requires the
212
+ parent to be `NodeList`. I'll be honest; I don't remember why I
213
+ added these methods. They may well suddenly disappear.
214
+ * `each`, `reverse_each`: Yield all (non-nil) children. `Node`
215
+ includes `Enumerable`, so, you know.
216
+ * `depth_first`, `reverse_depth_first`: Walk the tree in that order,
217
+ yielding two args (event, node) at each node. event is `:down` on
218
+ the way down, `:up` on the way up. If the block throws `:prune`, it
219
+ won't descend any further.
220
+ * `preorder`, `reverse_preorder`, `postorder`, `reverse_postorder`:
221
+ Walk the tree depth first, yielding nodes in the given order. For
222
+ the preorders, if the block throws `:prune`, it won't descend any
223
+ further.
224
+ * `node_after(child)`, `node_before(child)`: return the node
225
+ before/after child (same as `child.next`).
226
+ * `remove_node(child)`: remove child from this node (same as
227
+ `child.detach`).
228
+ * `replace_node(child, new_child)`: replace child with yeah you
229
+ guessed it (same as `child.replace_with(newchild)`).
230
+
231
+ Note: don't modify the tree during traversal!
232
+
233
+ Other notes about the table:
234
+
235
+ * Field names that end in '?' are always true-or-false.
236
+ * If no default is listed:
237
+ * it is false if the field name ends in a '?'
238
+ * it is a `NodeArray` if it is a `NodeList`.
239
+ * it is `nil` otherwise.
240
+
241
+ <table class="node_desc" cellspacing="0">
242
+ <style>
243
+ table.node_desc tr.first_field td {
244
+ border-top: 1px solid black;
245
+ }
246
+
247
+ table.node_desc tr.first_field table td {
248
+ border: none;
249
+ }
250
+
251
+ table.node_desc td {
252
+ padding: 3px;
253
+ vertical-align: top;
254
+ {
255
+
256
+ table.node_desc table td {
257
+ padding: 0px;
258
+ {
259
+ </style>
260
+
261
+ <tr>
262
+ <th align="center">Class</th>
263
+ <th align="center">Field</th>
264
+ <th align="center">Type / values</th>
265
+ <th align="center">Default</th>
266
+ <th align="center">Comments</th>
267
+ </tr>
268
+
269
+ <tr class="first_field">
270
+ <td class="nd_class" rowspan="1"><tt>TranslationUnit</tt></td>
271
+ <td class="nd_field"><tt>entities *</tt></td>
272
+ <td class="nd_values"><tt>NodeList</tt></td>
273
+ <td class="nd_default"><tt>NodeChain[]</tt></td>
274
+ <td class="nd_comments" rowspan="1">
275
+ The root of a parsed file.
276
+ </td>
277
+ </tr>
278
+
279
+ <tr class="first_field">
280
+ <td class="nd_class" rowspan="4"><tt>Declaration</tt></td>
281
+ <td class="nd_field"><tt>storage</tt></td>
282
+ <td class="nd_values"><tt>:typedef</tt>, <tt>:extern</tt>, <tt>:static</tt>, <tt>:auto</tt>, <tt>:register</tt></td>
283
+ <td class="nd_default"></td>
284
+ <td class="nd_comments" rowspan="4">
285
+ Also:
286
+ <ul>
287
+ <li><tt>#typedef? </tt> -- true iff <tt>storage == :typedef </tt></li>
288
+ <li><tt>#extern? </tt> -- true iff <tt>storage == :extern </tt></li>
289
+ <li><tt>#static? </tt> -- true iff <tt>storage == :static </tt></li>
290
+ <li><tt>#auto? </tt> -- true iff <tt>storage == :auto </tt></li>
291
+ <li><tt>#register?</tt> -- true iff <tt>storage == :register</tt></li>
292
+ </ul>
293
+ </td>
294
+ </tr>
295
+ <tr>
296
+ <td class="nd_field"><tt>type *</tt></td>
297
+ <td class="nd_values"><tt>DirectType</tt></td>
298
+ <td class="nd_default"></td>
299
+ </tr>
300
+ <tr>
301
+ <td class="nd_field"><tt>declarators *</tt></td>
302
+ <td class="nd_values"><tt>NodeList</tt></td>
303
+ <td class="nd_default"><tt>NodeArray[]</tt></td>
304
+ </tr>
305
+ <tr>
306
+ <td class="nd_field"><tt>inline?</tt></td>
307
+ <td class="nd_values"><tt>true</tt>, <tt>false</tt></td>
308
+ <td class="nd_default"></td>
309
+ </tr>
310
+
311
+ <tr class="first_field">
312
+ <td class="nd_class" rowspan="4"><tt>Declarator</tt></td>
313
+ <td class="nd_field"><tt>indirect_type *</tt></td>
314
+ <td class="nd_values"><tt>IndirectType</tt></td>
315
+ <td class="nd_default"></td>
316
+ <td class="nd_comments" rowspan="4">
317
+ What's a "declarator?" Consider "<tt>int i, *ip;</tt>". This is
318
+ a <tt>Declaration</tt> with two <tt>Declarator</tt>s:
319
+ <pre>
320
+ Declaration
321
+ type: Int
322
+ declarators:
323
+ - Declarator
324
+ name: "i"
325
+ - Declarator
326
+ indirect_type: Pointer
327
+ name: "ip"
328
+ </pre>
329
+ The <tt>indirect_type</tt> of the <tt>ip</tt>
330
+ <tt>Declarator</tt> is a <tt>Pointer</tt> to <tt>nil</tt>.
331
+ To get the complete type of the variable use:
332
+ <ul>
333
+ <li>
334
+ <tt>#type</tt> -- return the complete type. This is a clone;
335
+ modifying it won't modify the tree.
336
+ </li>
337
+ </ul>
338
+ So calling <tt>#type</tt> on the <tt>ip</tt> <tt>Declarator</tt>
339
+ gives:
340
+ <pre>
341
+ Pointer
342
+ type: Int
343
+ </pre>
344
+ </td>
345
+ </tr>
346
+ <tr>
347
+ <td class="nd_field"><tt>name</tt></td>
348
+ <td class="nd_values"><tt>String</tt></td>
349
+ <td class="nd_default"></td>
350
+ </tr>
351
+ <tr>
352
+ <td class="nd_field"><tt>init *</tt></td>
353
+ <td class="nd_values"><tt>Expression</tt></td>
354
+ <td class="nd_default"></td>
355
+ </tr>
356
+ <tr>
357
+ <td class="nd_field"><tt>num_bits *</tt></td>
358
+ <td class="nd_values"><tt>Integer</tt></td>
359
+ <td class="nd_default"></td>
360
+ </tr>
361
+
362
+ <tr class="first_field">
363
+ <td class="nd_class" rowspan="6"><tt>FunctionDef</tt></td>
364
+ <td class="nd_field"><tt>storage</tt></td>
365
+ <td class="nd_values"><tt>:extern</tt>, <tt>:static</tt></td>
366
+ <td class="nd_default"></td>
367
+ <td class="nd_comments" rowspan="6">
368
+ Also:
369
+ <ul>
370
+ <li><tt>#extern?</tt> -- return true iff <tt>storage == :extern</tt></li>
371
+ <li><tt>#static?</tt> -- return true iff <tt>storage == :static</tt></li>
372
+ <li><tt>#prototype?</tt> -- same as !no_prototype?</li>
373
+ <li><tt>#prototype=(val)</tt> -- same as no_prototype = !val</li>
374
+ </ul>
375
+ <tt>no_prototype?</tt> means that no prototype was given. That means parameter types weren't given in the parens, but in the "old-style" declaration list. Example:
376
+ <table>
377
+ <tr><td style="padding: 0px 25px">
378
+ <pre>
379
+ int main(argc, argv)
380
+ int argc;
381
+ char **argv;
382
+ {
383
+ return 0;
384
+ }</pre>
385
+ </td><td style="padding: 0px 25px">
386
+ <pre>
387
+ int main(int argc, char **argv) {
388
+ return 0;
389
+ }</pre>
390
+ </td></tr>
391
+ <tr>
392
+ <th>No prototype</th>
393
+ <th>Prototype</th>
394
+ </tr>
395
+ </table>
396
+ Everyone tells you to use prototypes. That's because no type
397
+ checking is done when calling a function declared without a
398
+ prototype.
399
+ </td>
400
+ </tr>
401
+ <tr>
402
+ <td class="nd_field"><tt>inline?</tt></td>
403
+ <td class="nd_values"><tt>true</tt>, <tt>false</tt></td>
404
+ <td class="nd_default"></td>
405
+ </tr>
406
+ <tr>
407
+ <td class="nd_field"><tt>type *</tt></td>
408
+ <td class="nd_values"><tt>Type</tt></td>
409
+ <td class="nd_default"></td>
410
+ </tr>
411
+ <tr>
412
+ <td class="nd_field"><tt>name</tt></td>
413
+ <td class="nd_values"><tt>String</tt></td>
414
+ <td class="nd_default"></td>
415
+ </tr>
416
+ <tr>
417
+ <td class="nd_field"><tt>def *</tt></td>
418
+ <td class="nd_values"><tt>Block</tt></td>
419
+ <td class="nd_default"><tt>Block.new</tt></td>
420
+ </tr>
421
+ <tr>
422
+ <td class="nd_field"><tt>no_prototype?</tt></td>
423
+ <td class="nd_values"><tt>true</tt>, <tt>false</tt></td>
424
+ <td class="nd_default"></td>
425
+ </tr>
426
+
427
+ <tr class="first_field">
428
+ <td class="nd_class" rowspan="3"><tt>Parameter</tt></td>
429
+ <td class="nd_field"><tt>register?</tt></td>
430
+ <td class="nd_values"><tt>true</tt>, <tt>false</tt></td>
431
+ <td class="nd_default"></td>
432
+ <td class="nd_comments" rowspan="3">
433
+ Used in <tt>Function</tt>s.
434
+ </td>
435
+ </tr>
436
+ <tr>
437
+ <td class="nd_field"><tt>type *</tt></td>
438
+ <td class="nd_values"><tt>Type</tt></td>
439
+ <td class="nd_default"></td>
440
+ </tr>
441
+ <tr>
442
+ <td class="nd_field"><tt>name</tt></td>
443
+ <td class="nd_values"><tt>String</tt></td>
444
+ <td class="nd_default"></td>
445
+ </tr>
446
+
447
+ <tr class="first_field">
448
+ <td class="nd_class" rowspan="2"><tt>Enumerator</tt></td>
449
+ <td class="nd_field"><tt>name</tt></td>
450
+ <td class="nd_values"><tt>String</tt></td>
451
+ <td class="nd_default"></td>
452
+ <td class="nd_comments" rowspan="2">
453
+ Used in <tt>Enum</tt>s.
454
+ </td>
455
+ </tr>
456
+ <tr>
457
+ <td class="nd_field"><tt>val *</tt></td>
458
+ <td class="nd_values"><tt>Expression</tt></td>
459
+ <td class="nd_default"></td>
460
+ </tr>
461
+
462
+ <tr class="first_field">
463
+ <td class="nd_class" rowspan="2"><tt>MemberInit</tt></td>
464
+ <td class="nd_field"><tt>member *</tt></td>
465
+ <td class="nd_values"><tt>NodeList</tt> of (<tt>Member</tt> or <tt>Expression</tt>)</td>
466
+ <td class="nd_default"></td>
467
+ <td class="nd_comments" rowspan="2">
468
+ Used in <tt>CompoundLiteral</tt>s.
469
+ </td>
470
+ </tr>
471
+ <tr>
472
+ <td class="nd_field"><tt>init *</tt></td>
473
+ <td class="nd_values"><tt>Expression</tt></td>
474
+ <td class="nd_default"></td>
475
+ </tr>
476
+
477
+ <tr class="first_field">
478
+ <td class="nd_class" rowspan="1"><tt>Member</tt></td>
479
+ <td class="nd_field"><tt>name</tt></td>
480
+ <td class="nd_values"><tt>String</tt></td>
481
+ <td class="nd_default"></td>
482
+ <td class="nd_comments" rowspan="1">
483
+ Used in <tt>MemberInit</tt>s.
484
+ </td>
485
+ </tr>
486
+
487
+ <tr class="first_field">
488
+ <td class="nd_class" rowspan="2"><tt>Block</tt></td>
489
+ <td class="nd_field"><tt>labels *</tt></td>
490
+ <td class="nd_values"><tt>NodeList</tt> of <tt>Label</tt></td>
491
+ <td class="nd_default"><tt>NodeArray[]</tt></td>
492
+ <td class="nd_comments" rowspan="2">
493
+ </td>
494
+ </tr>
495
+ <tr>
496
+ <td class="nd_field"><tt>stmts *</tt></td>
497
+ <td class="nd_values"><tt>NodeList</tt> of (<tt>Statement</tt> or <tt>Declaration</tt> or <tt>Comment</tt>)</td>
498
+ <td class="nd_default"><tt>NodeArray[]</tt></td>
499
+ </tr>
500
+
501
+ <tr class="first_field">
502
+ <td class="nd_class" rowspan="4"><tt>If</tt></td>
503
+ <td class="nd_field"><tt>labels *</tt></td>
504
+ <td class="nd_values"><tt>NodeList</tt> of <tt>Label</tt></td>
505
+ <td class="nd_default"><tt>NodeArray[]</tt></td>
506
+ <td class="nd_comments" rowspan="4">
507
+ </td>
508
+ </tr>
509
+ <tr>
510
+ <td class="nd_field"><tt>cond *</tt></td>
511
+ <td class="nd_values"><tt>Expression</tt></td>
512
+ <td class="nd_default"></td>
513
+ </tr>
514
+ <tr>
515
+ <td class="nd_field"><tt>then *</tt></td>
516
+ <td class="nd_values"><tt>Statement</tt></td>
517
+ <td class="nd_default"></td>
518
+ </tr>
519
+ <tr>
520
+ <td class="nd_field"><tt>else *</tt></td>
521
+ <td class="nd_values"><tt>Statement</tt></td>
522
+ <td class="nd_default"></td>
523
+ </tr>
524
+
525
+ <tr class="first_field">
526
+ <td class="nd_class" rowspan="3"><tt>Switch</tt></td>
527
+ <td class="nd_field"><tt>labels *</tt></td>
528
+ <td class="nd_values"><tt>NodeList</tt> of <tt>Label</tt></td>
529
+ <td class="nd_default"><tt>NodeArray[]</tt></td>
530
+ <td class="nd_comments" rowspan="3">
531
+ </td>
532
+ </tr>
533
+ <tr>
534
+ <td class="nd_field"><tt>cond *</tt></td>
535
+ <td class="nd_values"><tt>Expression</tt></td>
536
+ <td class="nd_default"></td>
537
+ </tr>
538
+ <tr>
539
+ <td class="nd_field"><tt>stmt *</tt></td>
540
+ <td class="nd_values"><tt>Statement</tt></td>
541
+ <td class="nd_default"></td>
542
+ </tr>
543
+
544
+ <tr class="first_field">
545
+ <td class="nd_class" rowspan="4"><tt>While</tt></td>
546
+ <td class="nd_field"><tt>labels *</tt></td>
547
+ <td class="nd_values"><tt>NodeList</tt> of <tt>Label</tt></td>
548
+ <td class="nd_default"><tt>NodeArray[]</tt></td>
549
+ <td class="nd_comments" rowspan="4">
550
+ <tt>do?</tt> means it's a do-while loop.
551
+ </td>
552
+ </tr>
553
+ <tr>
554
+ <td class="nd_field"><tt>do?</tt></td>
555
+ <td class="nd_values"><tt>true</tt>, <tt>false</tt></td>
556
+ <td class="nd_default"></td>
557
+ </tr>
558
+ <tr>
559
+ <td class="nd_field"><tt>cond *</tt></td>
560
+ <td class="nd_values"><tt>Expression</tt></td>
561
+ <td class="nd_default"></td>
562
+ </tr>
563
+ <tr>
564
+ <td class="nd_field"><tt>stmt *</tt></td>
565
+ <td class="nd_values"><tt>Statement</tt></td>
566
+ <td class="nd_default"></td>
567
+ </tr>
568
+
569
+ <tr class="first_field">
570
+ <td class="nd_class" rowspan="5"><tt>For</tt></td>
571
+ <td class="nd_field"><tt>labels *</tt></td>
572
+ <td class="nd_values"><tt>NodeList</tt> of <tt>Label</tt></td>
573
+ <td class="nd_default"><tt>NodeArray[]</tt></td>
574
+ <td class="nd_comments" rowspan="5">
575
+ </td>
576
+ </tr>
577
+ <tr>
578
+ <td class="nd_field"><tt>init *</tt></td>
579
+ <td class="nd_values"><tt>Expression</tt> or <tt>Declaration</tt></td>
580
+ <td class="nd_default"></td>
581
+ </tr>
582
+ <tr>
583
+ <td class="nd_field"><tt>cond *</tt></td>
584
+ <td class="nd_values"><tt>Expression</tt></td>
585
+ <td class="nd_default"></td>
586
+ </tr>
587
+ <tr>
588
+ <td class="nd_field"><tt>iter *</tt></td>
589
+ <td class="nd_values"><tt>Expression</tt></td>
590
+ <td class="nd_default"></td>
591
+ </tr>
592
+ <tr>
593
+ <td class="nd_field"><tt>stmt *</tt></td>
594
+ <td class="nd_values"><tt>Statement</tt></td>
595
+ <td class="nd_default"></td>
596
+ </tr>
597
+
598
+ <tr class="first_field">
599
+ <td class="nd_class" rowspan="2"><tt>Goto</tt></td>
600
+ <td class="nd_field"><tt>labels *</tt></td>
601
+ <td class="nd_values"><tt>NodeList</tt> of <tt>Label</tt></td>
602
+ <td class="nd_default"><tt>NodeArray[]</tt></td>
603
+ <td class="nd_comments" rowspan="2">
604
+ </td>
605
+ </tr>
606
+ <tr>
607
+ <td class="nd_field"><tt>target</tt></td>
608
+ <td class="nd_values"><tt>String</tt></td>
609
+ <td class="nd_default"></td>
610
+ </tr>
611
+
612
+ <tr class="first_field">
613
+ <td class="nd_class" rowspan="1"><tt>Continue</tt></td>
614
+ <td class="nd_field"><tt>labels *</tt></td>
615
+ <td class="nd_values"><tt>NodeList</tt> of <tt>Label</tt></td>
616
+ <td class="nd_default"><tt>NodeArray[]</tt></td>
617
+ <td class="nd_comments" rowspan="1">
618
+ </td>
619
+ </tr>
620
+
621
+ <tr class="first_field">
622
+ <td class="nd_class" rowspan="1"><tt>Break</tt></td>
623
+ <td class="nd_field"><tt>labels *</tt></td>
624
+ <td class="nd_values"><tt>NodeList</tt> of <tt>Label</tt></td>
625
+ <td class="nd_default"><tt>NodeArray[]</tt></td>
626
+ <td class="nd_comments" rowspan="1">
627
+ </td>
628
+ </tr>
629
+
630
+ <tr class="first_field">
631
+ <td class="nd_class" rowspan="2"><tt>Return</tt></td>
632
+ <td class="nd_field"><tt>labels *</tt></td>
633
+ <td class="nd_values"><tt>NodeList</tt> of <tt>Label</tt></td>
634
+ <td class="nd_default"><tt>NodeArray[]</tt></td>
635
+ <td class="nd_comments" rowspan="2">
636
+ </td>
637
+ </tr>
638
+ <tr>
639
+ <td class="nd_field"><tt>expr *</tt></td>
640
+ <td class="nd_values"><tt>Expression</tt></td>
641
+ <td class="nd_default"></td>
642
+ </tr>
643
+
644
+ <tr class="first_field">
645
+ <td class="nd_class" rowspan="2"><tt>ExpressionStatement</tt></td>
646
+ <td class="nd_field"><tt>labels *</tt></td>
647
+ <td class="nd_values"><tt>NodeList</tt> of <tt>Label</tt></td>
648
+ <td class="nd_default"><tt>NodeArray[]</tt></td>
649
+ <td class="nd_comments" rowspan="2">
650
+ </td>
651
+ </tr>
652
+ <tr>
653
+ <td class="nd_field"><tt>expr *</tt></td>
654
+ <td class="nd_values"><tt>Expression</tt></td>
655
+ <td class="nd_default"></td>
656
+ </tr>
657
+
658
+ <tr class="first_field">
659
+ <td class="nd_class" rowspan="1"><tt>PlainLabel</tt></td>
660
+ <td class="nd_field"><tt>name</tt></td>
661
+ <td class="nd_values"><tt>String</tt></td>
662
+ <td class="nd_default"></td>
663
+ <td class="nd_comments" rowspan="1">
664
+ </td>
665
+ </tr>
666
+
667
+ <tr class="first_field">
668
+ <td class="nd_class" rowspan="1"><tt>Default</tt></td>
669
+ <td class="nd_field"></td>
670
+ <td class="nd_values"></td>
671
+ <td class="nd_default"></td>
672
+ <td class="nd_comments" rowspan="1">
673
+ </td>
674
+ </tr>
675
+
676
+ <tr class="first_field">
677
+ <td class="nd_class" rowspan="1"><tt>Case</tt></td>
678
+ <td class="nd_field"><tt>expr *</tt></td>
679
+ <td class="nd_values"><tt>Expression</tt></td>
680
+ <td class="nd_default"></td>
681
+ <td class="nd_comments" rowspan="1">
682
+ </td>
683
+ </tr>
684
+
685
+ <tr class="first_field">
686
+ <td class="nd_class" rowspan="1"><tt>Comma</tt></td>
687
+ <td class="nd_field"><tt>exprs *</tt></td>
688
+ <td class="nd_values"><tt>NodeList</tt> of <tt>Expression</tt></td>
689
+ <td class="nd_default"></td>
690
+ <td class="nd_comments" rowspan="1">
691
+ </td>
692
+ </tr>
693
+
694
+ <tr class="first_field">
695
+ <td class="nd_class" rowspan="3"><tt>Conditional</tt></td>
696
+ <td class="nd_field"><tt>cond *</tt></td>
697
+ <td class="nd_values"><tt>Expression</tt></td>
698
+ <td class="nd_default"></td>
699
+ <td class="nd_comments" rowspan="3">
700
+ </td>
701
+ </tr>
702
+ <tr>
703
+ <td class="nd_field"><tt>then *</tt></td>
704
+ <td class="nd_values"><tt>Expression</tt></td>
705
+ <td class="nd_default"></td>
706
+ </tr>
707
+ <tr>
708
+ <td class="nd_field"><tt>else *</tt></td>
709
+ <td class="nd_values"><tt>Expression</tt></td>
710
+ <td class="nd_default"></td>
711
+ </tr>
712
+
713
+ <tr class="first_field">
714
+ <td class="nd_class" rowspan="1"><tt>Variable</tt></td>
715
+ <td class="nd_field"><tt>name</tt></td>
716
+ <td class="nd_values"><tt>String</tt></td>
717
+ <td class="nd_default"></td>
718
+ <td class="nd_comments" rowspan="1">
719
+ </td>
720
+ </tr>
721
+
722
+ <tr class="first_field">
723
+ <td class="nd_class" rowspan="2"><tt>Index</tt></td>
724
+ <td class="nd_field"><tt>expr *</tt></td>
725
+ <td class="nd_values"><tt>Expression</tt></td>
726
+ <td class="nd_default"></td>
727
+ <td class="nd_comments" rowspan="2">
728
+ </td>
729
+ </tr>
730
+ <tr>
731
+ <td class="nd_field"><tt>index *</tt></td>
732
+ <td class="nd_values"><tt>Expression</tt></td>
733
+ <td class="nd_default"></td>
734
+ </tr>
735
+
736
+ <tr class="first_field">
737
+ <td class="nd_class" rowspan="2"><tt>Call</tt></td>
738
+ <td class="nd_field"><tt>expr *</tt></td>
739
+ <td class="nd_values"><tt>Expression</tt></td>
740
+ <td class="nd_default"></td>
741
+ <td class="nd_comments" rowspan="2">
742
+ </td>
743
+ </tr>
744
+ <tr>
745
+ <td class="nd_field"><tt>args *</tt></td>
746
+ <td class="nd_values"><tt>NodeList</tt> of (<tt>Expression</tt> or <tt>Type</tt>)</td>
747
+ <td class="nd_default"></td>
748
+ </tr>
749
+
750
+ <tr class="first_field">
751
+ <td class="nd_class" rowspan="2"><tt>Dot</tt></td>
752
+ <td class="nd_field"><tt>expr *</tt></td>
753
+ <td class="nd_values"><tt>Expression</tt></td>
754
+ <td class="nd_default"></td>
755
+ <td class="nd_comments" rowspan="2">
756
+ </td>
757
+ </tr>
758
+ <tr>
759
+ <td class="nd_field"><tt>member *</tt></td>
760
+ <td class="nd_values"><tt>String</tt></td>
761
+ <td class="nd_default"></td>
762
+ </tr>
763
+
764
+ <tr class="first_field">
765
+ <td class="nd_class" rowspan="2"><tt>Arrow</tt></td>
766
+ <td class="nd_field"><tt>expr *</tt></td>
767
+ <td class="nd_values"><tt>Expression</tt></td>
768
+ <td class="nd_default"></td>
769
+ <td class="nd_comments" rowspan="2">
770
+ </td>
771
+ </tr>
772
+ <tr>
773
+ <td class="nd_field"><tt>member *</tt></td>
774
+ <td class="nd_values"><tt>String</tt></td>
775
+ <td class="nd_default"></td>
776
+ </tr>
777
+
778
+ <tr class="first_field">
779
+ <td class="nd_class" rowspan="1"><tt>PostInc</tt></td>
780
+ <td class="nd_field"><tt>expr *</tt></td>
781
+ <td class="nd_values"><tt>Expression</tt></td>
782
+ <td class="nd_default"></td>
783
+ <td class="nd_comments" rowspan="1">
784
+ </td>
785
+ </tr>
786
+
787
+ <tr class="first_field">
788
+ <td class="nd_class" rowspan="1"><tt>PostDec</tt></td>
789
+ <td class="nd_field"><tt>expr *</tt></td>
790
+ <td class="nd_values"><tt>Expression</tt></td>
791
+ <td class="nd_default"></td>
792
+ <td class="nd_comments" rowspan="1">
793
+ </td>
794
+ </tr>
795
+
796
+ <tr class="first_field">
797
+ <td class="nd_class" rowspan="2"><tt>Cast</tt></td>
798
+ <td class="nd_field"><tt>type *</tt></td>
799
+ <td class="nd_values"><tt>Type</tt></td>
800
+ <td class="nd_default"></td>
801
+ <td class="nd_comments" rowspan="2">
802
+ </td>
803
+ </tr>
804
+ <tr>
805
+ <td class="nd_field"><tt>expr *</tt></td>
806
+ <td class="nd_values"><tt>Expression</tt></td>
807
+ <td class="nd_default"></td>
808
+ </tr>
809
+
810
+ <tr class="first_field">
811
+ <td class="nd_class" rowspan="1"><tt>Address</tt></td>
812
+ <td class="nd_field"><tt>expr *</tt></td>
813
+ <td class="nd_values"><tt>Expression</tt></td>
814
+ <td class="nd_default"></td>
815
+ <td class="nd_comments" rowspan="1">
816
+ </td>
817
+ </tr>
818
+
819
+ <tr class="first_field">
820
+ <td class="nd_class" rowspan="1"><tt>Dereference</tt></td>
821
+ <td class="nd_field"><tt>expr *</tt></td>
822
+ <td class="nd_values"><tt>Expression</tt></td>
823
+ <td class="nd_default"></td>
824
+ <td class="nd_comments" rowspan="1">
825
+ </td>
826
+ </tr>
827
+
828
+ <tr class="first_field">
829
+ <td class="nd_class" rowspan="1"><tt>Sizeof</tt></td>
830
+ <td class="nd_field"><tt>expr *</tt></td>
831
+ <td class="nd_values"><tt>Type</tt> or <tt>Expression</tt></td>
832
+ <td class="nd_default"></td>
833
+ <td class="nd_comments" rowspan="1">
834
+ </td>
835
+ </tr>
836
+
837
+ <tr class="first_field">
838
+ <td class="nd_class" rowspan="1"><tt>Positive</tt></td>
839
+ <td class="nd_field"><tt>expr *</tt></td>
840
+ <td class="nd_values"><tt>Expression</tt></td>
841
+ <td class="nd_default"></td>
842
+ <td class="nd_comments" rowspan="1">
843
+ </td>
844
+ </tr>
845
+
846
+ <tr class="first_field">
847
+ <td class="nd_class" rowspan="1"><tt>Negative</tt></td>
848
+ <td class="nd_field"><tt>expr *</tt></td>
849
+ <td class="nd_values"><tt>Expression</tt></td>
850
+ <td class="nd_default"></td>
851
+ <td class="nd_comments" rowspan="1">
852
+ </td>
853
+ </tr>
854
+
855
+ <tr class="first_field">
856
+ <td class="nd_class" rowspan="1"><tt>PreInc</tt></td>
857
+ <td class="nd_field"><tt>expr *</tt></td>
858
+ <td class="nd_values"><tt>Expression</tt></td>
859
+ <td class="nd_default"></td>
860
+ <td class="nd_comments" rowspan="1">
861
+ </td>
862
+ </tr>
863
+
864
+ <tr class="first_field">
865
+ <td class="nd_class" rowspan="1"><tt>PreDec</tt></td>
866
+ <td class="nd_field"><tt>expr *</tt></td>
867
+ <td class="nd_values"><tt>Expression</tt></td>
868
+ <td class="nd_default"></td>
869
+ <td class="nd_comments" rowspan="1">
870
+ </td>
871
+ </tr>
872
+
873
+ <tr class="first_field">
874
+ <td class="nd_class" rowspan="1"><tt>BitNot</tt></td>
875
+ <td class="nd_field"><tt>expr *</tt></td>
876
+ <td class="nd_values"><tt>Expression</tt></td>
877
+ <td class="nd_default"></td>
878
+ <td class="nd_comments" rowspan="1">
879
+ </td>
880
+ </tr>
881
+
882
+ <tr class="first_field">
883
+ <td class="nd_class" rowspan="1"><tt>Not</tt></td>
884
+ <td class="nd_field"><tt>expr *</tt></td>
885
+ <td class="nd_values"><tt>Expression</tt></td>
886
+ <td class="nd_default"></td>
887
+ <td class="nd_comments" rowspan="1">
888
+ </td>
889
+ </tr>
890
+
891
+ <tr class="first_field">
892
+ <td class="nd_class" rowspan="2"><tt>Add</tt></td>
893
+ <td class="nd_field"><tt>expr1 *</tt></td>
894
+ <td class="nd_values"><tt>Expression</tt></td>
895
+ <td class="nd_default"></td>
896
+ <td class="nd_comments" rowspan="2">
897
+ </td>
898
+ </tr>
899
+ <tr>
900
+ <td class="nd_field"><tt>expr2 *</tt></td>
901
+ <td class="nd_values"><tt>Expression</tt></td>
902
+ <td class="nd_default"></td>
903
+ </tr>
904
+
905
+ <tr class="first_field">
906
+ <td class="nd_class" rowspan="2"><tt>Subtract</tt></td>
907
+ <td class="nd_field"><tt>expr1 *</tt></td>
908
+ <td class="nd_values"><tt>Expression</tt></td>
909
+ <td class="nd_default"></td>
910
+ <td class="nd_comments" rowspan="2">
911
+ </td>
912
+ </tr>
913
+ <tr>
914
+ <td class="nd_field"><tt>expr2 *</tt></td>
915
+ <td class="nd_values"><tt>Expression</tt></td>
916
+ <td class="nd_default"></td>
917
+ </tr>
918
+
919
+ <tr class="first_field">
920
+ <td class="nd_class" rowspan="2"><tt>Multiply</tt></td>
921
+ <td class="nd_field"><tt>expr1 *</tt></td>
922
+ <td class="nd_values"><tt>Expression</tt></td>
923
+ <td class="nd_default"></td>
924
+ <td class="nd_comments" rowspan="2">
925
+ </td>
926
+ </tr>
927
+ <tr>
928
+ <td class="nd_field"><tt>expr2 *</tt></td>
929
+ <td class="nd_values"><tt>Expression</tt></td>
930
+ <td class="nd_default"></td>
931
+ </tr>
932
+
933
+ <tr class="first_field">
934
+ <td class="nd_class" rowspan="2"><tt>Divide</tt></td>
935
+ <td class="nd_field"><tt>expr1 *</tt></td>
936
+ <td class="nd_values"><tt>Expression</tt></td>
937
+ <td class="nd_default"></td>
938
+ <td class="nd_comments" rowspan="2">
939
+ </td>
940
+ </tr>
941
+ <tr>
942
+ <td class="nd_field"><tt>expr2 *</tt></td>
943
+ <td class="nd_values"><tt>Expression</tt></td>
944
+ <td class="nd_default"></td>
945
+ </tr>
946
+
947
+ <tr class="first_field">
948
+ <td class="nd_class" rowspan="2"><tt>Mod</tt></td>
949
+ <td class="nd_field"><tt>expr1 *</tt></td>
950
+ <td class="nd_values"><tt>Expression</tt></td>
951
+ <td class="nd_default"></td>
952
+ <td class="nd_comments" rowspan="2">
953
+ </td>
954
+ </tr>
955
+ <tr>
956
+ <td class="nd_field"><tt>expr2 *</tt></td>
957
+ <td class="nd_values"><tt>Expression</tt></td>
958
+ <td class="nd_default"></td>
959
+ </tr>
960
+
961
+ <tr class="first_field">
962
+ <td class="nd_class" rowspan="2"><tt>Equal</tt></td>
963
+ <td class="nd_field"><tt>expr1 *</tt></td>
964
+ <td class="nd_values"><tt>Expression</tt></td>
965
+ <td class="nd_default"></td>
966
+ <td class="nd_comments" rowspan="2">
967
+ </td>
968
+ </tr>
969
+ <tr>
970
+ <td class="nd_field"><tt>expr2 *</tt></td>
971
+ <td class="nd_values"><tt>Expression</tt></td>
972
+ <td class="nd_default"></td>
973
+ </tr>
974
+
975
+ <tr class="first_field">
976
+ <td class="nd_class" rowspan="2"><tt>NotEqual</tt></td>
977
+ <td class="nd_field"><tt>expr1 *</tt></td>
978
+ <td class="nd_values"><tt>Expression</tt></td>
979
+ <td class="nd_default"></td>
980
+ <td class="nd_comments" rowspan="2">
981
+ </td>
982
+ </tr>
983
+ <tr>
984
+ <td class="nd_field"><tt>expr2 *</tt></td>
985
+ <td class="nd_values"><tt>Expression</tt></td>
986
+ <td class="nd_default"></td>
987
+ </tr>
988
+
989
+ <tr class="first_field">
990
+ <td class="nd_class" rowspan="2"><tt>Less</tt></td>
991
+ <td class="nd_field"><tt>expr1 *</tt></td>
992
+ <td class="nd_values"><tt>Expression</tt></td>
993
+ <td class="nd_default"></td>
994
+ <td class="nd_comments" rowspan="2">
995
+ </td>
996
+ </tr>
997
+ <tr>
998
+ <td class="nd_field"><tt>expr2 *</tt></td>
999
+ <td class="nd_values"><tt>Expression</tt></td>
1000
+ <td class="nd_default"></td>
1001
+ </tr>
1002
+
1003
+ <tr class="first_field">
1004
+ <td class="nd_class" rowspan="2"><tt>More</tt></td>
1005
+ <td class="nd_field"><tt>expr1 *</tt></td>
1006
+ <td class="nd_values"><tt>Expression</tt></td>
1007
+ <td class="nd_default"></td>
1008
+ <td class="nd_comments" rowspan="2">
1009
+ </td>
1010
+ </tr>
1011
+ <tr>
1012
+ <td class="nd_field"><tt>expr2 *</tt></td>
1013
+ <td class="nd_values"><tt>Expression</tt></td>
1014
+ <td class="nd_default"></td>
1015
+ </tr>
1016
+
1017
+ <tr class="first_field">
1018
+ <td class="nd_class" rowspan="2"><tt>LessOrEqual</tt></td>
1019
+ <td class="nd_field"><tt>expr1 *</tt></td>
1020
+ <td class="nd_values"><tt>Expression</tt></td>
1021
+ <td class="nd_default"></td>
1022
+ <td class="nd_comments" rowspan="2">
1023
+ </td>
1024
+ </tr>
1025
+ <tr>
1026
+ <td class="nd_field"><tt>expr2 *</tt></td>
1027
+ <td class="nd_values"><tt>Expression</tt></td>
1028
+ <td class="nd_default"></td>
1029
+ </tr>
1030
+
1031
+ <tr class="first_field">
1032
+ <td class="nd_class" rowspan="2"><tt>MoreOrEqual</tt></td>
1033
+ <td class="nd_field"><tt>expr1 *</tt></td>
1034
+ <td class="nd_values"><tt>Expression</tt></td>
1035
+ <td class="nd_default"></td>
1036
+ <td class="nd_comments" rowspan="2">
1037
+ </td>
1038
+ </tr>
1039
+ <tr>
1040
+ <td class="nd_field"><tt>expr2 *</tt></td>
1041
+ <td class="nd_values"><tt>Expression</tt></td>
1042
+ <td class="nd_default"></td>
1043
+ </tr>
1044
+
1045
+ <tr class="first_field">
1046
+ <td class="nd_class" rowspan="2"><tt>BitAnd</tt></td>
1047
+ <td class="nd_field"><tt>expr1 *</tt></td>
1048
+ <td class="nd_values"><tt>Expression</tt></td>
1049
+ <td class="nd_default"></td>
1050
+ <td class="nd_comments" rowspan="2">
1051
+ </td>
1052
+ </tr>
1053
+ <tr>
1054
+ <td class="nd_field"><tt>expr2 *</tt></td>
1055
+ <td class="nd_values"><tt>Expression</tt></td>
1056
+ <td class="nd_default"></td>
1057
+ </tr>
1058
+
1059
+ <tr class="first_field">
1060
+ <td class="nd_class" rowspan="2"><tt>BitOr</tt></td>
1061
+ <td class="nd_field"><tt>expr1 *</tt></td>
1062
+ <td class="nd_values"><tt>Expression</tt></td>
1063
+ <td class="nd_default"></td>
1064
+ <td class="nd_comments" rowspan="2">
1065
+ </td>
1066
+ </tr>
1067
+ <tr>
1068
+ <td class="nd_field"><tt>expr2 *</tt></td>
1069
+ <td class="nd_values"><tt>Expression</tt></td>
1070
+ <td class="nd_default"></td>
1071
+ </tr>
1072
+
1073
+ <tr class="first_field">
1074
+ <td class="nd_class" rowspan="2"><tt>BitXor</tt></td>
1075
+ <td class="nd_field"><tt>expr1 *</tt></td>
1076
+ <td class="nd_values"><tt>Expression</tt></td>
1077
+ <td class="nd_default"></td>
1078
+ <td class="nd_comments" rowspan="2">
1079
+ </td>
1080
+ </tr>
1081
+ <tr>
1082
+ <td class="nd_field"><tt>expr2 *</tt></td>
1083
+ <td class="nd_values"><tt>Expression</tt></td>
1084
+ <td class="nd_default"></td>
1085
+ </tr>
1086
+
1087
+ <tr class="first_field">
1088
+ <td class="nd_class" rowspan="2"><tt>ShiftLeft</tt></td>
1089
+ <td class="nd_field"><tt>expr1 *</tt></td>
1090
+ <td class="nd_values"><tt>Expression</tt></td>
1091
+ <td class="nd_default"></td>
1092
+ <td class="nd_comments" rowspan="2">
1093
+ </td>
1094
+ </tr>
1095
+ <tr>
1096
+ <td class="nd_field"><tt>expr2 *</tt></td>
1097
+ <td class="nd_values"><tt>Expression</tt></td>
1098
+ <td class="nd_default"></td>
1099
+ </tr>
1100
+
1101
+ <tr class="first_field">
1102
+ <td class="nd_class" rowspan="2"><tt>ShiftRight</tt></td>
1103
+ <td class="nd_field"><tt>expr1 *</tt></td>
1104
+ <td class="nd_values"><tt>Expression</tt></td>
1105
+ <td class="nd_default"></td>
1106
+ <td class="nd_comments" rowspan="2">
1107
+ </td>
1108
+ </tr>
1109
+ <tr>
1110
+ <td class="nd_field"><tt>expr2 *</tt></td>
1111
+ <td class="nd_values"><tt>Expression</tt></td>
1112
+ <td class="nd_default"></td>
1113
+ </tr>
1114
+
1115
+ <tr class="first_field">
1116
+ <td class="nd_class" rowspan="2"><tt>And</tt></td>
1117
+ <td class="nd_field"><tt>expr1 *</tt></td>
1118
+ <td class="nd_values"><tt>Expression</tt></td>
1119
+ <td class="nd_default"></td>
1120
+ <td class="nd_comments" rowspan="2">
1121
+ </td>
1122
+ </tr>
1123
+ <tr>
1124
+ <td class="nd_field"><tt>expr2 *</tt></td>
1125
+ <td class="nd_values"><tt>Expression</tt></td>
1126
+ <td class="nd_default"></td>
1127
+ </tr>
1128
+
1129
+ <tr class="first_field">
1130
+ <td class="nd_class" rowspan="2"><tt>Or</tt></td>
1131
+ <td class="nd_field"><tt>expr1 *</tt></td>
1132
+ <td class="nd_values"><tt>Expression</tt></td>
1133
+ <td class="nd_default"></td>
1134
+ <td class="nd_comments" rowspan="2">
1135
+ </td>
1136
+ </tr>
1137
+ <tr>
1138
+ <td class="nd_field"><tt>expr2 *</tt></td>
1139
+ <td class="nd_values"><tt>Expression</tt></td>
1140
+ <td class="nd_default"></td>
1141
+ </tr>
1142
+
1143
+ <tr class="first_field">
1144
+ <td class="nd_class" rowspan="2"><tt>Assign</tt></td>
1145
+ <td class="nd_field"><tt>lval *</tt></td>
1146
+ <td class="nd_values"><tt>Expression</tt></td>
1147
+ <td class="nd_default"></td>
1148
+ <td class="nd_comments" rowspan="2">
1149
+ </td>
1150
+ </tr>
1151
+ <tr>
1152
+ <td class="nd_field"><tt>rval *</tt></td>
1153
+ <td class="nd_values"><tt>Expression</tt></td>
1154
+ <td class="nd_default"></td>
1155
+ </tr>
1156
+
1157
+ <tr class="first_field">
1158
+ <td class="nd_class" rowspan="2"><tt>MultiplyAssign</tt></td>
1159
+ <td class="nd_field"><tt>lval *</tt></td>
1160
+ <td class="nd_values"><tt>Expression</tt></td>
1161
+ <td class="nd_default"></td>
1162
+ <td class="nd_comments" rowspan="2">
1163
+ </td>
1164
+ </tr>
1165
+ <tr>
1166
+ <td class="nd_field"><tt>rval *</tt></td>
1167
+ <td class="nd_values"><tt>Expression</tt></td>
1168
+ <td class="nd_default"></td>
1169
+ </tr>
1170
+
1171
+ <tr class="first_field">
1172
+ <td class="nd_class" rowspan="2"><tt>DivideAssign</tt></td>
1173
+ <td class="nd_field"><tt>lval *</tt></td>
1174
+ <td class="nd_values"><tt>Expression</tt></td>
1175
+ <td class="nd_default"></td>
1176
+ <td class="nd_comments" rowspan="2">
1177
+ </td>
1178
+ </tr>
1179
+ <tr>
1180
+ <td class="nd_field"><tt>rval *</tt></td>
1181
+ <td class="nd_values"><tt>Expression</tt></td>
1182
+ <td class="nd_default"></td>
1183
+ </tr>
1184
+
1185
+ <tr class="first_field">
1186
+ <td class="nd_class" rowspan="2"><tt>ModAssign</tt></td>
1187
+ <td class="nd_field"><tt>lval *</tt></td>
1188
+ <td class="nd_values"><tt>Expression</tt></td>
1189
+ <td class="nd_default"></td>
1190
+ <td class="nd_comments" rowspan="2">
1191
+ </td>
1192
+ </tr>
1193
+ <tr>
1194
+ <td class="nd_field"><tt>rval *</tt></td>
1195
+ <td class="nd_values"><tt>Expression</tt></td>
1196
+ <td class="nd_default"></td>
1197
+ </tr>
1198
+
1199
+ <tr class="first_field">
1200
+ <td class="nd_class" rowspan="2"><tt>AddAssign</tt></td>
1201
+ <td class="nd_field"><tt>lval *</tt></td>
1202
+ <td class="nd_values"><tt>Expression</tt></td>
1203
+ <td class="nd_default"></td>
1204
+ <td class="nd_comments" rowspan="2">
1205
+ </td>
1206
+ </tr>
1207
+ <tr>
1208
+ <td class="nd_field"><tt>rval *</tt></td>
1209
+ <td class="nd_values"><tt>Expression</tt></td>
1210
+ <td class="nd_default"></td>
1211
+ </tr>
1212
+
1213
+ <tr class="first_field">
1214
+ <td class="nd_class" rowspan="2"><tt>SubtractAssign</tt></td>
1215
+ <td class="nd_field"><tt>lval *</tt></td>
1216
+ <td class="nd_values"><tt>Expression</tt></td>
1217
+ <td class="nd_default"></td>
1218
+ <td class="nd_comments" rowspan="2">
1219
+ </td>
1220
+ </tr>
1221
+ <tr>
1222
+ <td class="nd_field"><tt>rval *</tt></td>
1223
+ <td class="nd_values"><tt>Expression</tt></td>
1224
+ <td class="nd_default"></td>
1225
+ </tr>
1226
+
1227
+ <tr class="first_field">
1228
+ <td class="nd_class" rowspan="2"><tt>ShiftLeftAssign</tt></td>
1229
+ <td class="nd_field"><tt>lval *</tt></td>
1230
+ <td class="nd_values"><tt>Expression</tt></td>
1231
+ <td class="nd_default"></td>
1232
+ <td class="nd_comments" rowspan="2">
1233
+ </td>
1234
+ </tr>
1235
+ <tr>
1236
+ <td class="nd_field"><tt>rval *</tt></td>
1237
+ <td class="nd_values"><tt>Expression</tt></td>
1238
+ <td class="nd_default"></td>
1239
+ </tr>
1240
+
1241
+ <tr class="first_field">
1242
+ <td class="nd_class" rowspan="2"><tt>ShiftRightAssign</tt></td>
1243
+ <td class="nd_field"><tt>lval *</tt></td>
1244
+ <td class="nd_values"><tt>Expression</tt></td>
1245
+ <td class="nd_default"></td>
1246
+ <td class="nd_comments" rowspan="2">
1247
+ </td>
1248
+ </tr>
1249
+ <tr>
1250
+ <td class="nd_field"><tt>rval *</tt></td>
1251
+ <td class="nd_values"><tt>Expression</tt></td>
1252
+ <td class="nd_default"></td>
1253
+ </tr>
1254
+
1255
+ <tr class="first_field">
1256
+ <td class="nd_class" rowspan="2"><tt>BitAndAssign</tt></td>
1257
+ <td class="nd_field"><tt>lval *</tt></td>
1258
+ <td class="nd_values"><tt>Expression</tt></td>
1259
+ <td class="nd_default"></td>
1260
+ <td class="nd_comments" rowspan="2">
1261
+ </td>
1262
+ </tr>
1263
+ <tr>
1264
+ <td class="nd_field"><tt>rval *</tt></td>
1265
+ <td class="nd_values"><tt>Expression</tt></td>
1266
+ <td class="nd_default"></td>
1267
+ </tr>
1268
+
1269
+ <tr class="first_field">
1270
+ <td class="nd_class" rowspan="2"><tt>BitXorAssign</tt></td>
1271
+ <td class="nd_field"><tt>lval *</tt></td>
1272
+ <td class="nd_values"><tt>Expression</tt></td>
1273
+ <td class="nd_default"></td>
1274
+ <td class="nd_comments" rowspan="2">
1275
+ </td>
1276
+ </tr>
1277
+ <tr>
1278
+ <td class="nd_field"><tt>rval *</tt></td>
1279
+ <td class="nd_values"><tt>Expression</tt></td>
1280
+ <td class="nd_default"></td>
1281
+ </tr>
1282
+
1283
+ <tr class="first_field">
1284
+ <td class="nd_class" rowspan="2"><tt>BitOrAssign</tt></td>
1285
+ <td class="nd_field"><tt>lval *</tt></td>
1286
+ <td class="nd_values"><tt>Expression</tt></td>
1287
+ <td class="nd_default"></td>
1288
+ <td class="nd_comments" rowspan="2">
1289
+ </td>
1290
+ </tr>
1291
+ <tr>
1292
+ <td class="nd_field"><tt>rval *</tt></td>
1293
+ <td class="nd_values"><tt>Expression</tt></td>
1294
+ <td class="nd_default"></td>
1295
+ </tr>
1296
+
1297
+ <tr class="first_field">
1298
+ <td class="nd_class" rowspan="1"><tt>StringLiteral</tt></td>
1299
+ <td class="nd_field"><tt>val</tt></td>
1300
+ <td class="nd_values"><tt>String</tt></td>
1301
+ <td class="nd_default"></td>
1302
+ <td class="nd_comments" rowspan="1">
1303
+ The <tt>String</tt> in <tt>val</tt> is the literal string entered. <tt>"\n"</tt>
1304
+ isn't converted to a newline, for instance.
1305
+ </td>
1306
+ </tr>
1307
+
1308
+ <tr class="first_field">
1309
+ <td class="nd_class" rowspan="1"><tt>CharLiteral</tt></td>
1310
+ <td class="nd_field"><tt>val</tt></td>
1311
+ <td class="nd_values"><tt>String</tt></td>
1312
+ <td class="nd_default"></td>
1313
+ <td class="nd_comments" rowspan="1">
1314
+ The <tt>String</tt> in <tt>val</tt> is the literal string entered. <tt>'\n'</tt>
1315
+ isn't converted to a newline, for instance.
1316
+ </td>
1317
+ </tr>
1318
+
1319
+ <tr class="first_field">
1320
+ <td class="nd_class" rowspan="2"><tt>CompoundLiteral</tt></td>
1321
+ <td class="nd_field"><tt>type *</tt></td>
1322
+ <td class="nd_values"><tt>Type</tt></td>
1323
+ <td class="nd_default"></td>
1324
+ <td class="nd_comments" rowspan="2">
1325
+ <p>Here's an example:</p>
1326
+ <pre>(struct S){1, .x = 2, .y [3] .z = 4}</pre>
1327
+ <p>parses as:</p>
1328
+ <pre>CompoundLiteral
1329
+ type: Struct
1330
+ name: "S"
1331
+ member_inits:
1332
+ - MemberInit
1333
+ init: IntLiteral
1334
+ val: 1
1335
+ - MemberInit
1336
+ member:
1337
+ - Member
1338
+ name: "x"
1339
+ init: IntLiteral
1340
+ val: 2
1341
+ - MemberInit
1342
+ member:
1343
+ - Member
1344
+ name: "y"
1345
+ - IntLiteral
1346
+ val: 3
1347
+ - Member
1348
+ name: "z"
1349
+ init: IntLiteral
1350
+ val: 4</pre>
1351
+ </td>
1352
+ </tr>
1353
+ <tr>
1354
+ <td class="nd_field"><tt>member_inits *</tt></td>
1355
+ <td class="nd_values"><tt>NodeList</tt> of <tt>MemberInit</tt></td>
1356
+ <td class="nd_default"><tt>NodeArray[]</tt></td>
1357
+ </tr>
1358
+
1359
+ <tr class="first_field">
1360
+ <td class="nd_class" rowspan="3"><tt>IntLiteral</tt></td>
1361
+ <td class="nd_field"><tt>format</tt></td>
1362
+ <td class="nd_values"><tt>:dec</tt>, <tt>:hex</tt>, <tt>:oct</tt></td>
1363
+ <td class="nd_default"><tt>:dec</tt></td>
1364
+ <td class="nd_comments" rowspan="3">
1365
+ <p>Also:</p>
1366
+ <ul>
1367
+ <li><tt>#dec?</tt> -- return true iff <tt>format == :dec</tt></li>
1368
+ <li><tt>#hex?</tt> -- return true iff <tt>format == :hex</tt></li>
1369
+ <li><tt>#oct?</tt> -- return true iff <tt>format == :oct</tt></li>
1370
+ </ul>
1371
+ </td>
1372
+ </tr>
1373
+ <tr>
1374
+ <td class="nd_field"><tt>val</tt></td>
1375
+ <td class="nd_values"><tt>Integer</tt></td>
1376
+ <td class="nd_default"></td>
1377
+ </tr>
1378
+ <tr>
1379
+ <td class="nd_field"><tt>suffix</tt></td>
1380
+ <td class="nd_values"><tt>String</tt></td>
1381
+ <td class="nd_default"></td>
1382
+ </tr>
1383
+
1384
+ <tr class="first_field">
1385
+ <td class="nd_class" rowspan="4"><tt>FloatLiteral</tt></td>
1386
+ <td class="nd_field"><tt>format</tt></td>
1387
+ <td class="nd_values"><tt>:dec</tt>, <tt>:hex</tt></td>
1388
+ <td class="nd_default"><tt>:dec</tt></td>
1389
+ <td class="nd_comments" rowspan="4">
1390
+ </td>
1391
+ </tr>
1392
+ <tr>
1393
+ <td class="nd_field"><tt>val</tt></td>
1394
+ <td class="nd_values"><tt>Float</tt></td>
1395
+ <td class="nd_default"></td>
1396
+ </tr>
1397
+ <tr>
1398
+ <td class="nd_field"><tt>exponent</tt></td>
1399
+ <td class="nd_values"><tt>Integer</tt></td>
1400
+ <td class="nd_default"></td>
1401
+ </tr>
1402
+ <tr>
1403
+ <td class="nd_field"><tt>suffix</tt></td>
1404
+ <td class="nd_values"><tt>String</tt></td>
1405
+ <td class="nd_default"></td>
1406
+ </tr>
1407
+
1408
+ <tr class="first_field">
1409
+ <td class="nd_class" rowspan="4"><tt>Pointer</tt></td>
1410
+ <td class="nd_field"><tt>const?</tt></td>
1411
+ <td class="nd_values"><tt>true</tt>, <tt>false</tt></td>
1412
+ <td class="nd_default"></td>
1413
+ <td class="nd_comments" rowspan="4">
1414
+ </td>
1415
+ </tr>
1416
+ <tr>
1417
+ <td class="nd_field"><tt>restrict?</tt></td>
1418
+ <td class="nd_values"><tt>true</tt>, <tt>false</tt></td>
1419
+ <td class="nd_default"></td>
1420
+ </tr>
1421
+ <tr>
1422
+ <td class="nd_field"><tt>volatile?</tt></td>
1423
+ <td class="nd_values"><tt>true</tt>, <tt>false</tt></td>
1424
+ <td class="nd_default"></td>
1425
+ </tr>
1426
+ <tr>
1427
+ <td class="nd_field"><tt>type *</tt></td>
1428
+ <td class="nd_values"><tt>Type</tt></td>
1429
+ <td class="nd_default"></td>
1430
+ </tr>
1431
+
1432
+ <tr class="first_field">
1433
+ <td class="nd_class" rowspan="5"><tt>Array</tt></td>
1434
+ <td class="nd_field"><tt>const?</tt></td>
1435
+ <td class="nd_values"><tt>true</tt>, <tt>false</tt></td>
1436
+ <td class="nd_default"></td>
1437
+ <td class="nd_comments" rowspan="5">
1438
+ </td>
1439
+ </tr>
1440
+ <tr>
1441
+ <td class="nd_field"><tt>restrict?</tt></td>
1442
+ <td class="nd_values"><tt>true</tt>, <tt>false</tt></td>
1443
+ <td class="nd_default"></td>
1444
+ </tr>
1445
+ <tr>
1446
+ <td class="nd_field"><tt>volatile?</tt></td>
1447
+ <td class="nd_values"><tt>true</tt>, <tt>false</tt></td>
1448
+ <td class="nd_default"></td>
1449
+ </tr>
1450
+ <tr>
1451
+ <td class="nd_field"><tt>type *</tt></td>
1452
+ <td class="nd_values"><tt>Type</tt></td>
1453
+ <td class="nd_default"></td>
1454
+ </tr>
1455
+ <tr>
1456
+ <td class="nd_field"><tt>length *</tt></td>
1457
+ <td class="nd_values"><tt>Expression</tt></td>
1458
+ <td class="nd_default"></td>
1459
+ </tr>
1460
+
1461
+ <tr class="first_field">
1462
+ <td class="nd_class" rowspan="6"><tt>Function</tt></td>
1463
+ <td class="nd_field"><tt>const?</tt></td>
1464
+ <td class="nd_values"><tt>true</tt>, <tt>false</tt></td>
1465
+ <td class="nd_default"></td>
1466
+ <td class="nd_comments" rowspan="6">
1467
+ </td>
1468
+ </tr>
1469
+ <tr>
1470
+ <td class="nd_field"><tt>restrict?</tt></td>
1471
+ <td class="nd_values"><tt>true</tt>, <tt>false</tt></td>
1472
+ <td class="nd_default"></td>
1473
+ </tr>
1474
+ <tr>
1475
+ <td class="nd_field"><tt>volatile?</tt></td>
1476
+ <td class="nd_values"><tt>true</tt>, <tt>false</tt></td>
1477
+ <td class="nd_default"></td>
1478
+ </tr>
1479
+ <tr>
1480
+ <td class="nd_field"><tt>type *</tt></td>
1481
+ <td class="nd_values"><tt>Type</tt></td>
1482
+ <td class="nd_default"></td>
1483
+ </tr>
1484
+ <tr>
1485
+ <td class="nd_field"><tt>params *</tt></td>
1486
+ <td class="nd_values"><tt>NodeList</tt> of <tt>Parameter</tt></td>
1487
+ <td class="nd_default"><tt>NodeArray[]</tt></td>
1488
+ </tr>
1489
+ <tr>
1490
+ <td class="nd_field"><tt>var_args?</tt></td>
1491
+ <td class="nd_values"><tt>true</tt>, <tt>false</tt></td>
1492
+ <td class="nd_default"></td>
1493
+ </tr>
1494
+
1495
+ <tr class="first_field">
1496
+ <td class="nd_class" rowspan="5"><tt>Struct</tt></td>
1497
+ <td class="nd_field"><tt>const?</tt></td>
1498
+ <td class="nd_values"><tt>true</tt>, <tt>false</tt></td>
1499
+ <td class="nd_default"></td>
1500
+ <td class="nd_comments" rowspan="5">
1501
+ </td>
1502
+ </tr>
1503
+ <tr>
1504
+ <td class="nd_field"><tt>restrict?</tt></td>
1505
+ <td class="nd_values"><tt>true</tt>, <tt>false</tt></td>
1506
+ <td class="nd_default"></td>
1507
+ </tr>
1508
+ <tr>
1509
+ <td class="nd_field"><tt>volatile?</tt></td>
1510
+ <td class="nd_values"><tt>true</tt>, <tt>false</tt></td>
1511
+ <td class="nd_default"></td>
1512
+ </tr>
1513
+ <tr>
1514
+ <td class="nd_field"><tt>name</tt></td>
1515
+ <td class="nd_values"><tt>String</tt></td>
1516
+ <td class="nd_default"></td>
1517
+ </tr>
1518
+ <tr>
1519
+ <td class="nd_field"><tt>members *</tt></td>
1520
+ <td class="nd_values"><tt>NodeList</tt> of <tt>Member</tt></td>
1521
+ <td class="nd_default"><tt>NodeArray[]</tt></td>
1522
+ </tr>
1523
+
1524
+ <tr class="first_field">
1525
+ <td class="nd_class" rowspan="5"><tt>Union</tt></td>
1526
+ <td class="nd_field"><tt>const?</tt></td>
1527
+ <td class="nd_values"><tt>true</tt>, <tt>false</tt></td>
1528
+ <td class="nd_default"></td>
1529
+ <td class="nd_comments" rowspan="5">
1530
+ </td>
1531
+ </tr>
1532
+ <tr>
1533
+ <td class="nd_field"><tt>restrict?</tt></td>
1534
+ <td class="nd_values"><tt>true</tt>, <tt>false</tt></td>
1535
+ <td class="nd_default"></td>
1536
+ </tr>
1537
+ <tr>
1538
+ <td class="nd_field"><tt>volatile?</tt></td>
1539
+ <td class="nd_values"><tt>true</tt>, <tt>false</tt></td>
1540
+ <td class="nd_default"></td>
1541
+ </tr>
1542
+ <tr>
1543
+ <td class="nd_field"><tt>name</tt></td>
1544
+ <td class="nd_values"><tt>String</tt></td>
1545
+ <td class="nd_default"></td>
1546
+ </tr>
1547
+ <tr>
1548
+ <td class="nd_field"><tt>members *</tt></td>
1549
+ <td class="nd_values"><tt>NodeList</tt> of <tt>Member</tt></td>
1550
+ <td class="nd_default"><tt>NodeArray[]</tt></td>
1551
+ </tr>
1552
+
1553
+ <tr class="first_field">
1554
+ <td class="nd_class" rowspan="5"><tt>Enum</tt></td>
1555
+ <td class="nd_field"><tt>const?</tt></td>
1556
+ <td class="nd_values"><tt>true</tt>, <tt>false</tt></td>
1557
+ <td class="nd_default"></td>
1558
+ <td class="nd_comments" rowspan="5">
1559
+ </td>
1560
+ </tr>
1561
+ <tr>
1562
+ <td class="nd_field"><tt>restrict?</tt></td>
1563
+ <td class="nd_values"><tt>true</tt>, <tt>false</tt></td>
1564
+ <td class="nd_default"></td>
1565
+ </tr>
1566
+ <tr>
1567
+ <td class="nd_field"><tt>volatile?</tt></td>
1568
+ <td class="nd_values"><tt>true</tt>, <tt>false</tt></td>
1569
+ <td class="nd_default"></td>
1570
+ </tr>
1571
+ <tr>
1572
+ <td class="nd_field"><tt>name</tt></td>
1573
+ <td class="nd_values"><tt>String</tt></td>
1574
+ <td class="nd_default"></td>
1575
+ </tr>
1576
+ <tr>
1577
+ <td class="nd_field"><tt>members *</tt></td>
1578
+ <td class="nd_values"><tt>NodeList</tt> of <tt>Enumerator</tt></td>
1579
+ <td class="nd_default"></td>
1580
+ </tr>
1581
+
1582
+ <tr class="first_field">
1583
+ <td class="nd_class" rowspan="4"><tt>CustomType</tt></td>
1584
+ <td class="nd_field"><tt>const?</tt></td>
1585
+ <td class="nd_values"><tt>true</tt>, <tt>false</tt></td>
1586
+ <td class="nd_default"></td>
1587
+ <td class="nd_comments" rowspan="4">
1588
+ For <tt>typedef</tt>'d names.
1589
+ </td>
1590
+ </tr>
1591
+ <tr>
1592
+ <td class="nd_field"><tt>restrict?</tt></td>
1593
+ <td class="nd_values"><tt>true</tt>, <tt>false</tt></td>
1594
+ <td class="nd_default"></td>
1595
+ </tr>
1596
+ <tr>
1597
+ <td class="nd_field"><tt>volatile?</tt></td>
1598
+ <td class="nd_values"><tt>true</tt>, <tt>false</tt></td>
1599
+ <td class="nd_default"></td>
1600
+ </tr>
1601
+ <tr>
1602
+ <td class="nd_field"><tt>name</tt></td>
1603
+ <td class="nd_values"><tt>String</tt></td>
1604
+ <td class="nd_default"></td>
1605
+ </tr>
1606
+
1607
+ <tr class="first_field">
1608
+ <td class="nd_class" rowspan="3"><tt>Void</tt></td>
1609
+ <td class="nd_field"><tt>const?</tt></td>
1610
+ <td class="nd_values"><tt>true</tt>, <tt>false</tt></td>
1611
+ <td class="nd_default"></td>
1612
+ <td class="nd_comments" rowspan="3">
1613
+ <tt>const</tt> is for things like <tt>const void *</tt>.
1614
+ </td>
1615
+ </tr>
1616
+ <tr>
1617
+ <td class="nd_field"><tt>restrict?</tt></td>
1618
+ <td class="nd_values"><tt>true</tt>, <tt>false</tt></td>
1619
+ <td class="nd_default"></td>
1620
+ </tr>
1621
+ <tr>
1622
+ <td class="nd_field"><tt>volatile?</tt></td>
1623
+ <td class="nd_values"><tt>true</tt>, <tt>false</tt></td>
1624
+ <td class="nd_default"></td>
1625
+ </tr>
1626
+
1627
+ <tr class="first_field">
1628
+ <td class="nd_class" rowspan="5"><tt>Int</tt></td>
1629
+ <td class="nd_field"><tt>const?</tt></td>
1630
+ <td class="nd_values"><tt>true</tt>, <tt>false</tt></td>
1631
+ <td class="nd_default"></td>
1632
+ <td class="nd_comments" rowspan="5">
1633
+ Also:
1634
+ <ul>
1635
+ <li><tt>#short?</tt> -- return true iff <tt>longness == -1</tt></li>
1636
+ <li><tt>#plain?</tt> -- return true iff <tt>longness == 0</tt></li>
1637
+ <li><tt>#long?</tt> -- return true iff <tt>longness == 1</tt></li>
1638
+ <li><tt>#long_long?</tt> -- return true iff <tt>longness == 2</tt></li>
1639
+ <li><tt>#signed?</tt> -- same as <tt>!unsigned?</tt></li>
1640
+ <li><tt>#signed=(val)</tt> -- same as <tt>unsigned = !val</tt></li>
1641
+ </ul>
1642
+ </td>
1643
+ </tr>
1644
+ <tr>
1645
+ <td class="nd_field"><tt>restrict?</tt></td>
1646
+ <td class="nd_values"><tt>true</tt>, <tt>false</tt></td>
1647
+ <td class="nd_default"></td>
1648
+ </tr>
1649
+ <tr>
1650
+ <td class="nd_field"><tt>volatile?</tt></td>
1651
+ <td class="nd_values"><tt>true</tt>, <tt>false</tt></td>
1652
+ <td class="nd_default"></td>
1653
+ </tr>
1654
+ <tr>
1655
+ <td class="nd_field"><tt>longness</tt></td>
1656
+ <td class="nd_values"><tt>-1</tt>, <tt>0</tt>, <tt>1</tt>, <tt>2</tt></td>
1657
+ <td class="nd_default"><tt>0</tt></td>
1658
+ </tr>
1659
+ <tr>
1660
+ <td class="nd_field"><tt>unsigned?</tt></td>
1661
+ <td class="nd_values"><tt>true</tt>, <tt>false</tt></td>
1662
+ <td class="nd_default"></td>
1663
+ </tr>
1664
+
1665
+ <tr class="first_field">
1666
+ <td class="nd_class" rowspan="4"><tt>Float</tt></td>
1667
+ <td class="nd_field"><tt>const?</tt></td>
1668
+ <td class="nd_values"><tt>true</tt>, <tt>false</tt></td>
1669
+ <td class="nd_default"></td>
1670
+ <td class="nd_comments" rowspan="4">
1671
+ Also:
1672
+ <ul>
1673
+ <li><tt>#plain?</tt> -- return true iff <tt>longness == 0</tt></li>
1674
+ <li><tt>#double?</tt> -- return true iff <tt>longness == 1</tt></li>
1675
+ <li><tt>#long_double?</tt> -- return true iff <tt>longness == 2</tt></li>
1676
+ </ul>
1677
+ </td>
1678
+ </tr>
1679
+ <tr>
1680
+ <td class="nd_field"><tt>restrict?</tt></td>
1681
+ <td class="nd_values"><tt>true</tt>, <tt>false</tt></td>
1682
+ <td class="nd_default"></td>
1683
+ </tr>
1684
+ <tr>
1685
+ <td class="nd_field"><tt>volatile?</tt></td>
1686
+ <td class="nd_values"><tt>true</tt>, <tt>false</tt></td>
1687
+ <td class="nd_default"></td>
1688
+ </tr>
1689
+ <tr>
1690
+ <td class="nd_field"><tt>longness</tt></td>
1691
+ <td class="nd_values"><tt>0</tt>, <tt>1</tt>, <tt>2</tt></td>
1692
+ <td class="nd_default"><tt>0</tt></td>
1693
+ </tr>
1694
+
1695
+ <tr class="first_field">
1696
+ <td class="nd_class" rowspan="4"><tt>Char</tt></td>
1697
+ <td class="nd_field"><tt>const?</tt></td>
1698
+ <td class="nd_values"><tt>true</tt>, <tt>false</tt></td>
1699
+ <td class="nd_default"></td>
1700
+ <td class="nd_comments" rowspan="4">
1701
+ Also:
1702
+ <ul>
1703
+ <li><tt>#signed?</tt> -- return true iff <tt>signed == true</tt></li>
1704
+ <li><tt>#unsigned?</tt> -- return true iff <tt>signed == false</tt></li>
1705
+ <li><tt>#plain?</tt> -- return true iff <tt>signed == nil</tt></li>
1706
+ </ul>
1707
+ Yes, C99 says that <tt>char</tt>, <tt>signed char</tt>, and
1708
+ <tt>unsigned char</tt> are 3 distinct types (unlike with
1709
+ <tt>int</tt> -- go figure). Like Martian chalk and Venusian
1710
+ cheese: completely different, but you can fit 'em each in one
1711
+ byte.
1712
+ </td>
1713
+ </tr>
1714
+ <tr>
1715
+ <td class="nd_field"><tt>restrict?</tt></td>
1716
+ <td class="nd_values"><tt>true</tt>, <tt>false</tt></td>
1717
+ <td class="nd_default"></td>
1718
+ </tr>
1719
+ <tr>
1720
+ <td class="nd_field"><tt>volatile?</tt></td>
1721
+ <td class="nd_values"><tt>true</tt>, <tt>false</tt></td>
1722
+ <td class="nd_default"></td>
1723
+ </tr>
1724
+ <tr>
1725
+ <td class="nd_field"><tt>signed</tt></td>
1726
+ <td class="nd_values"><tt>true</tt>, <tt>false</tt>, <tt>nil</tt></td>
1727
+ <td class="nd_default"></td>
1728
+ </tr>
1729
+
1730
+ <tr class="first_field">
1731
+ <td class="nd_class" rowspan="3"><tt>Bool</tt></td>
1732
+ <td class="nd_field"><tt>const?</tt></td>
1733
+ <td class="nd_values"><tt>true</tt>, <tt>false</tt></td>
1734
+ <td class="nd_default"></td>
1735
+ <td class="nd_comments" rowspan="3">
1736
+ This is the rarely seen <tt>_Bool</tt> type.
1737
+ </td>
1738
+ </tr>
1739
+ <tr>
1740
+ <td class="nd_field"><tt>restrict?</tt></td>
1741
+ <td class="nd_values"><tt>true</tt>, <tt>false</tt></td>
1742
+ <td class="nd_default"></td>
1743
+ </tr>
1744
+ <tr>
1745
+ <td class="nd_field"><tt>volatile?</tt></td>
1746
+ <td class="nd_values"><tt>true</tt>, <tt>false</tt></td>
1747
+ <td class="nd_default"></td>
1748
+ </tr>
1749
+
1750
+ <tr class="first_field">
1751
+ <td class="nd_class" rowspan="4"><tt>Complex</tt></td>
1752
+ <td class="nd_field"><tt>const?</tt></td>
1753
+ <td class="nd_values"><tt>true</tt>, <tt>false</tt></td>
1754
+ <td class="nd_default"></td>
1755
+ <td class="nd_comments" rowspan="4">
1756
+ <p>This is the rarely seen <tt>_Complex</tt> type.</p>
1757
+ <ul>
1758
+ <li><tt>#plain?</tt> -- return true iff <tt>longness == 0</tt></li>
1759
+ <li><tt>#double?</tt> -- return true iff <tt>longness == 1</tt></li>
1760
+ <li><tt>#long_double?</tt> -- return true iff <tt>longness == 2</tt></li>
1761
+ </ul>
1762
+ </td>
1763
+ </tr>
1764
+ <tr>
1765
+ <td class="nd_field"><tt>restrict?</tt></td>
1766
+ <td class="nd_values"><tt>true</tt>, <tt>false</tt></td>
1767
+ <td class="nd_default"></td>
1768
+ </tr>
1769
+ <tr>
1770
+ <td class="nd_field"><tt>volatile?</tt></td>
1771
+ <td class="nd_values"><tt>true</tt>, <tt>false</tt></td>
1772
+ <td class="nd_default"></td>
1773
+ </tr>
1774
+ <tr>
1775
+ <td class="nd_field"><tt>longness</tt></td>
1776
+ <td class="nd_values"><tt>0</tt>, <tt>1</tt>, <tt>2</tt></td>
1777
+ <td class="nd_default"><tt>0</tt></td>
1778
+ </tr>
1779
+
1780
+ <tr class="first_field">
1781
+ <td class="nd_class" rowspan="4"><tt>Imaginary</tt></td>
1782
+ <td class="nd_field"><tt>const?</tt></td>
1783
+ <td class="nd_values"><tt>true</tt>, <tt>false</tt></td>
1784
+ <td class="nd_default"></td>
1785
+ <td class="nd_comments" rowspan="4">
1786
+ <p>This is the rarely seen <tt>_Imaginary</tt> type.</p>
1787
+ <ul>
1788
+ <li><tt>#plain?</tt> -- return true iff <tt>longness == 0</tt></li>
1789
+ <li><tt>#double?</tt> -- return true iff <tt>longness == 1</tt></li>
1790
+ <li><tt>#long_double?</tt> -- return true iff <tt>longness == 2</tt></li>
1791
+ </ul>
1792
+ </td>
1793
+ </tr>
1794
+ <tr>
1795
+ <td class="nd_field"><tt>restrict?</tt></td>
1796
+ <td class="nd_values"><tt>true</tt>, <tt>false</tt></td>
1797
+ <td class="nd_default"></td>
1798
+ </tr>
1799
+ <tr>
1800
+ <td class="nd_field"><tt>volatile?</tt></td>
1801
+ <td class="nd_values"><tt>true</tt>, <tt>false</tt></td>
1802
+ <td class="nd_default"></td>
1803
+ </tr>
1804
+ <tr>
1805
+ <td class="nd_field"><tt>longness</tt></td>
1806
+ <td class="nd_values"><tt>0</tt>, <tt>1</tt>, <tt>2</tt></td>
1807
+ <td class="nd_default"><tt>0</tt></td>
1808
+ </tr>
1809
+ <tr class="first_field">
1810
+ <td class="nd_class" rowspan="1"><tt>BlockExpression</tt></td>
1811
+ <td class="nd_field"><tt>block *</tt></td>
1812
+ <td class="nd_values"><tt>Block</tt></td>
1813
+ <td class="nd_default"><tt>Block.new</tt></td>
1814
+ <td class="nd_comments" rowspan="1">
1815
+ Only if the <tt>block_expressions</tt> extension is enabled.
1816
+ See "Extensions" section below.
1817
+ </td>
1818
+ </tr>
1819
+ </tbody></table>
1820
+
1821
+ ## Parser
1822
+
1823
+ `C.parse` will use the default parser (`C.default_parser`), but you
1824
+ can also manage your own parser(s) if you need finer control over
1825
+ state. Parser state consists of:
1826
+
1827
+ * `type_names`: a Set of Strings. As a parser eats `typedef`s, this
1828
+ grows.
1829
+ * `pos`: the `Node::Pos` this parser will start parsing at.
1830
+
1831
+ A `Node::Pos` has three read-write attributes: `filename`, `line_num`,
1832
+ `col_num`. Default is nil, 1, 0.
1833
+
1834
+ Note that the type names the parser has seen affects the parser! For
1835
+ example, consider:
1836
+
1837
+ a * b;
1838
+
1839
+ * If only `a` is a type, this is a declaration.
1840
+ * If neither `a` nor `b` are types, this is a multiplication
1841
+ statement.
1842
+ * Otherwise, it's a syntax error.
1843
+
1844
+ You may append type names implicitly, by parsing `typedef`s, or
1845
+ explicitly like this:
1846
+
1847
+ parser.type_names << 'Thing' << 'OtherThing'
1848
+
1849
+ ### Parsing Snippets
1850
+
1851
+ `C.parse` will parse the toplevel C construct, a `C::TranslationUnit`,
1852
+ but you can also parse other snippets of C:
1853
+
1854
+ C::Statement.parse('while (not_looking) { paint_car(); }')
1855
+ C::Type.parse('void *(*)(int *(*)[][2], ...)')
1856
+
1857
+ This works for both concrete and abstract `Node` subclasses. A
1858
+ `Parser` may be given as an optional second argument.
1859
+
1860
+ ### Extensions to C99
1861
+
1862
+ * `Type`s are allowed as function arguments. This is needed to parse
1863
+ C99 macros like `va_arg()`.
1864
+ * `Block`s in parentheses are allowed as expressions ([a gcc
1865
+ extension][gcc-block-expressions]). You need to call
1866
+ `parser.enable_block_expressions` first. They appear as
1867
+ `BlockExpression` nodes.
1868
+
1869
+ [gcc-block-expressions]: http://gcc.gnu.org/onlinedocs/gcc-4.2.1/gcc/Statement-Exprs.html#Statement-Exprs
1870
+
1871
+ ## Parsing Full Programs
1872
+
1873
+ This can be tricky for a number of reasons. Here are the issues you'll
1874
+ likely encounter.
1875
+
1876
+ ### Preprocessing
1877
+
1878
+ Directives that start with `#` are not handled by the `Parser`, as
1879
+ they're external to the C grammar. CAST ships with a `Preprocessor`,
1880
+ which wraps the preprocessor used to build your Ruby interpreter.
1881
+
1882
+ cpp = C::Preprocessor.new
1883
+ cpp.include_path << '/usr/include' << /usr/local/include'
1884
+ cpp.macros['DEBUG'] = '1'
1885
+ cpp.macros['max(a, b)'] = '((a) > (b) ? (a) : (b))'
1886
+ cpp.preprocess(code)
1887
+
1888
+ Note however, that preprocessors tend to leave vendor-specific
1889
+ extensions in their output. GNU `cpp`, for example, leaves
1890
+ "linemarkers" (lines that begin with `#`) in the output which you'll
1891
+ need to filter out manually before feeding it to a `Parser`.
1892
+
1893
+ ### Built-in types
1894
+
1895
+ Mac OS 10.5's system `cpp` for instance assumes the compiler will
1896
+ recognize types such as `__darwin_va_list`.
1897
+
1898
+ ### Syntactic Extensions
1899
+
1900
+ Some code may take advantage of compiler-specific extensions to the
1901
+ syntax. For example, `gcc` supports inline assembly via directives
1902
+ like:
1903
+
1904
+ asm("movl %1, %%eax;
1905
+ "movl %%eax, %0;"
1906
+ :"=r"(y)
1907
+ :"r"(x)
1908
+ :"%eax");
1909
+
1910
+ Such code is fairly rare, so there is no direct support in CAST for
1911
+ this. You'll need to manually massage such constructs out of the
1912
+ `Parser` input. Or send me patches. Delicious patches.
1913
+
1914
+ ## Contributing
1915
+
1916
+ * [Bug reports](http://github.com/oggy/cast/issues)
1917
+ * [Source](http://github.com/oggy/cast)
1918
+ * Patches: Fork on Github, send pull request.
1919
+ * Include tests where practical.
1920
+ * Leave the version alone, or bump it in a separate commit.
1921
+
1922
+ ## Copyright
1923
+
1924
+ Copyright (c) George Ogata. See LICENSE for details.