cast 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README +4 -4
- data/doc/index.html +7 -15
- data/ext/cast.h +141 -0
- data/ext/cast_ext.c +10 -0
- data/ext/extconf.rb +2 -0
- data/ext/parser.c +287 -0
- data/ext/yylex.c +8189 -0
- data/ext/yylex.re +330 -0
- data/lib/cast.rb +15 -8
- data/lib/cast/c.tab.rb +3398 -0
- data/lib/{c.y → cast/c.y} +212 -270
- data/lib/{c_nodes.rb → cast/c_nodes.rb} +12 -7
- data/lib/{to_debug.rb → cast/inspect.rb} +12 -12
- data/lib/{node.rb → cast/node.rb} +0 -0
- data/lib/{node_list.rb → cast/node_list.rb} +10 -2
- data/lib/{parse.rb → cast/parse.rb} +0 -0
- data/lib/{to_s.rb → cast/to_s.rb} +12 -3
- data/test/run.rb +204 -2
- data/test/test_c_nodes.rb +5 -9
- data/test/test_node.rb +0 -10
- data/test/test_node_list.rb +20 -3
- data/test/test_parse.rb +623 -626
- data/test/test_parser.rb +80 -33
- metadata +44 -32
- data/install.rb +0 -14
- data/lib/c.tab.rb +0 -3433
- data/test/common.rb +0 -174
data/README
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
Installation: ruby install.rb
|
2
|
-
Uninstallation: ruby install.rb remove
|
3
1
|
Gem install: gem install cast
|
4
|
-
|
5
|
-
|
2
|
+
Gem uninstall: gem uninstall cast
|
3
|
+
Site install: rake install
|
4
|
+
Site uninstall: rake uninstall
|
5
|
+
Documentation: See doc/index.html. Latest at http://cast.rubyforge.org .
|
6
6
|
Licence: Ruby's.
|
data/doc/index.html
CHANGED
@@ -158,7 +158,7 @@ ugly_c_code = open("toy.c"){|f| f.read}
|
|
158
158
|
tree = parser.parse(ugly_c_code)
|
159
159
|
|
160
160
|
<span class="code_comment">## what's the tree look like?</span>
|
161
|
-
|
161
|
+
p tree
|
162
162
|
</pre>
|
163
163
|
|
164
164
|
<p>
|
@@ -388,7 +388,7 @@ puts tree.to_debug
|
|
388
388
|
<tt>String</tt>).
|
389
389
|
</li>
|
390
390
|
<li>
|
391
|
-
<tt>#
|
391
|
+
<tt>#inspect</tt> -- return a pretty string for inspection.
|
392
392
|
<b>Try it</b>.
|
393
393
|
</li>
|
394
394
|
<li>
|
@@ -1167,7 +1167,7 @@ int main(int argc, char **argv) {
|
|
1167
1167
|
<tr class="node_desc_oddrow">
|
1168
1168
|
<td class="nd_field"><tt>args</tt></td>
|
1169
1169
|
<td class="nd_child">Y</td>
|
1170
|
-
<td class="nd_values"><tt>NodeList</tt> of <tt>Expression</tt></td>
|
1170
|
+
<td class="nd_values"><tt>NodeList</tt> of <tt>Expression</tt>-or-<tt>Type</tt></td>
|
1171
1171
|
<td class="nd_default"></td>
|
1172
1172
|
</tr>
|
1173
1173
|
|
@@ -2448,13 +2448,10 @@ ast = C.parse(STDIN)
|
|
2448
2448
|
It'd be the common case, but special cases make uniform treatment
|
2449
2449
|
more arduous. Is "uniform treatment" an issue?
|
2450
2450
|
</li>
|
2451
|
-
<li>
|
2452
|
-
Should <tt>to_debug</tt> have a better name? What?
|
2453
|
-
</li>
|
2454
2451
|
</ul>
|
2455
2452
|
|
2456
2453
|
<p>
|
2457
|
-
<a href="mailto:
|
2454
|
+
<a href="mailto:george.ogata@gmail.com">Vote now</a>.
|
2458
2455
|
</p>
|
2459
2456
|
|
2460
2457
|
<a name="to_do"></a><h2>To Do</h2>
|
@@ -2481,14 +2478,11 @@ ast = C.parse(STDIN)
|
|
2481
2478
|
<li>
|
2482
2479
|
Make it rdoc-able.
|
2483
2480
|
</li>
|
2484
|
-
<li>
|
2485
|
-
Make a starmonkey.
|
2486
|
-
</li>
|
2487
2481
|
</ul>
|
2488
2482
|
|
2489
2483
|
<p>
|
2490
2484
|
If any of these affect you greatly, <a
|
2491
|
-
href="mailto:
|
2485
|
+
href="mailto:george.ogata@gmail.com">kick me</a> to make it happen
|
2492
2486
|
faster.
|
2493
2487
|
</p>
|
2494
2488
|
|
@@ -2498,11 +2492,9 @@ I'm not really sure what people are going to try to use this for. If
|
|
2498
2492
|
there's some functionality you think would make a good addition, or
|
2499
2493
|
think I've made a mess of this poor puppy, give me a yell.
|
2500
2494
|
|
2501
|
-
<p>I read <a href="mailto:ruby-talk@ruby-lang.org">ruby-talk</a> (a.k.a. <a href="news:comp.lang.ruby">comp.lang.ruby</a>).</p>
|
2502
|
-
|
2503
2495
|
<p>
|
2504
|
-
You can
|
2505
|
-
href="mailto:
|
2496
|
+
You can spam me at <a
|
2497
|
+
href="mailto:george.ogata@gmail.com">george.ogata@gmail.com</a>.
|
2506
2498
|
It'd help if you prefixed the subject with "[cast] " so I can easily
|
2507
2499
|
distinguish CAST spam from fake Rolex spam.
|
2508
2500
|
</p>
|
data/ext/cast.h
ADDED
@@ -0,0 +1,141 @@
|
|
1
|
+
#include <assert.h>
|
2
|
+
#include "ruby.h"
|
3
|
+
|
4
|
+
/* Modules and classes.
|
5
|
+
*/
|
6
|
+
extern VALUE cast_mC;
|
7
|
+
extern VALUE cast_cParser;
|
8
|
+
extern VALUE cast_eParseError;
|
9
|
+
|
10
|
+
/*
|
11
|
+
* -------------------------------------------------------------------
|
12
|
+
* Helpers
|
13
|
+
* -------------------------------------------------------------------
|
14
|
+
*/
|
15
|
+
|
16
|
+
#define Get_Struct(value, type, sval) do { \
|
17
|
+
sval = (cast_##type *)DATA_PTR(value); \
|
18
|
+
} while (0)
|
19
|
+
|
20
|
+
#define Find_Struct(value, type, sval) do { \
|
21
|
+
if (!rb_obj_is_kind_of(value, cast_c##type)) \
|
22
|
+
rb_raise(rb_eTypeError, #type " expected, got %s", rb_obj_classname(value)); \
|
23
|
+
sval = (cast_##type *)DATA_PTR(value); \
|
24
|
+
} while (0)
|
25
|
+
|
26
|
+
#define Wrap_Struct(ptr, type, klass) \
|
27
|
+
Data_Wrap_Struct(klass, cast_##type##_mark, cast_##type##_free, ptr)
|
28
|
+
|
29
|
+
/*
|
30
|
+
* -------------------------------------------------------------------
|
31
|
+
* Parser
|
32
|
+
* -------------------------------------------------------------------
|
33
|
+
*/
|
34
|
+
|
35
|
+
typedef struct {
|
36
|
+
/* stuff used by yylex */
|
37
|
+
char *bot, *tok, *ptr, *cur, *pos, *lim, *top, *eof;
|
38
|
+
long lineno; /* line number */
|
39
|
+
VALUE token; /* last token (2-element array) */
|
40
|
+
} cast_Parser;
|
41
|
+
|
42
|
+
VALUE cast_Parser_alloc(VALUE klass);
|
43
|
+
void cast_Parser_mark(cast_Parser *parser);
|
44
|
+
void cast_Parser_free(cast_Parser *parser);
|
45
|
+
VALUE cast_Parser_next_token(VALUE self);
|
46
|
+
void yylex(VALUE self, cast_Parser *p);
|
47
|
+
void cast_init_parser(void);
|
48
|
+
|
49
|
+
/* Lexer symbols. */
|
50
|
+
extern VALUE cast_sym_AUTO;
|
51
|
+
extern VALUE cast_sym_BREAK;
|
52
|
+
extern VALUE cast_sym_CASE;
|
53
|
+
extern VALUE cast_sym_CHAR;
|
54
|
+
extern VALUE cast_sym_CONST;
|
55
|
+
extern VALUE cast_sym_CONTINUE;
|
56
|
+
extern VALUE cast_sym_DEFAULT;
|
57
|
+
extern VALUE cast_sym_DO;
|
58
|
+
extern VALUE cast_sym_DOUBLE;
|
59
|
+
extern VALUE cast_sym_ELSE;
|
60
|
+
extern VALUE cast_sym_ENUM;
|
61
|
+
extern VALUE cast_sym_EXTERN;
|
62
|
+
extern VALUE cast_sym_FLOAT;
|
63
|
+
extern VALUE cast_sym_FOR;
|
64
|
+
extern VALUE cast_sym_GOTO;
|
65
|
+
extern VALUE cast_sym_IF;
|
66
|
+
extern VALUE cast_sym_INT;
|
67
|
+
extern VALUE cast_sym_LONG;
|
68
|
+
extern VALUE cast_sym_REGISTER;
|
69
|
+
extern VALUE cast_sym_RETURN;
|
70
|
+
extern VALUE cast_sym_SHORT;
|
71
|
+
extern VALUE cast_sym_SIGNED;
|
72
|
+
extern VALUE cast_sym_SIZEOF;
|
73
|
+
extern VALUE cast_sym_STATIC;
|
74
|
+
extern VALUE cast_sym_STRUCT;
|
75
|
+
extern VALUE cast_sym_SWITCH;
|
76
|
+
extern VALUE cast_sym_TYPEDEF;
|
77
|
+
extern VALUE cast_sym_UNION;
|
78
|
+
extern VALUE cast_sym_UNSIGNED;
|
79
|
+
extern VALUE cast_sym_VOID;
|
80
|
+
extern VALUE cast_sym_VOLATILE;
|
81
|
+
extern VALUE cast_sym_WHILE;
|
82
|
+
extern VALUE cast_sym_INLINE;
|
83
|
+
extern VALUE cast_sym_RESTRICT;
|
84
|
+
extern VALUE cast_sym_BOOL;
|
85
|
+
extern VALUE cast_sym_COMPLEX;
|
86
|
+
extern VALUE cast_sym_IMAGINARY;
|
87
|
+
|
88
|
+
extern VALUE cast_sym_FCON;
|
89
|
+
extern VALUE cast_sym_ICON;
|
90
|
+
extern VALUE cast_sym_ID;
|
91
|
+
extern VALUE cast_sym_SCON;
|
92
|
+
extern VALUE cast_sym_CCON;
|
93
|
+
extern VALUE cast_sym_TYPENAME;
|
94
|
+
|
95
|
+
extern VALUE cast_sym_ADDEQ;
|
96
|
+
extern VALUE cast_sym_ANDAND;
|
97
|
+
extern VALUE cast_sym_ANDEQ;
|
98
|
+
extern VALUE cast_sym_DEC;
|
99
|
+
extern VALUE cast_sym_ARROW;
|
100
|
+
extern VALUE cast_sym_DIVEQ;
|
101
|
+
extern VALUE cast_sym_ELLIPSIS;
|
102
|
+
extern VALUE cast_sym_EQEQ;
|
103
|
+
extern VALUE cast_sym_GEQ;
|
104
|
+
extern VALUE cast_sym_INC;
|
105
|
+
extern VALUE cast_sym_LEQ;
|
106
|
+
extern VALUE cast_sym_LSHIFT;
|
107
|
+
extern VALUE cast_sym_LSHIFTEQ;
|
108
|
+
extern VALUE cast_sym_MODEQ;
|
109
|
+
extern VALUE cast_sym_MULEQ;
|
110
|
+
extern VALUE cast_sym_NEQ;
|
111
|
+
extern VALUE cast_sym_OREQ;
|
112
|
+
extern VALUE cast_sym_OROR;
|
113
|
+
extern VALUE cast_sym_RSHIFT;
|
114
|
+
extern VALUE cast_sym_RSHIFTEQ;
|
115
|
+
extern VALUE cast_sym_SUBEQ;
|
116
|
+
extern VALUE cast_sym_XOREQ;
|
117
|
+
|
118
|
+
extern VALUE cast_sym_SEMICOLON;
|
119
|
+
extern VALUE cast_sym_LBRACE;
|
120
|
+
extern VALUE cast_sym_RBRACE;
|
121
|
+
extern VALUE cast_sym_COMMA;
|
122
|
+
extern VALUE cast_sym_COLON;
|
123
|
+
extern VALUE cast_sym_EQ;
|
124
|
+
extern VALUE cast_sym_LPAREN;
|
125
|
+
extern VALUE cast_sym_RPAREN;
|
126
|
+
extern VALUE cast_sym_LBRACKET;
|
127
|
+
extern VALUE cast_sym_RBRACKET;
|
128
|
+
extern VALUE cast_sym_DOT;
|
129
|
+
extern VALUE cast_sym_AND;
|
130
|
+
extern VALUE cast_sym_BANG;
|
131
|
+
extern VALUE cast_sym_NOT;
|
132
|
+
extern VALUE cast_sym_SUB;
|
133
|
+
extern VALUE cast_sym_ADD;
|
134
|
+
extern VALUE cast_sym_MUL;
|
135
|
+
extern VALUE cast_sym_DIV;
|
136
|
+
extern VALUE cast_sym_MOD;
|
137
|
+
extern VALUE cast_sym_LT;
|
138
|
+
extern VALUE cast_sym_GT;
|
139
|
+
extern VALUE cast_sym_XOR;
|
140
|
+
extern VALUE cast_sym_OR;
|
141
|
+
extern VALUE cast_sym_QUESTION;
|
data/ext/cast_ext.c
ADDED
data/ext/extconf.rb
ADDED
data/ext/parser.c
ADDED
@@ -0,0 +1,287 @@
|
|
1
|
+
#include "cast.h"
|
2
|
+
|
3
|
+
/* Modules and classes.
|
4
|
+
*/
|
5
|
+
VALUE cast_mC;
|
6
|
+
VALUE cast_cParser;
|
7
|
+
VALUE cast_eParseError;
|
8
|
+
|
9
|
+
/* Lexer symbols.
|
10
|
+
*/
|
11
|
+
VALUE cast_sym_AUTO;
|
12
|
+
VALUE cast_sym_BREAK;
|
13
|
+
VALUE cast_sym_CASE;
|
14
|
+
VALUE cast_sym_CHAR;
|
15
|
+
VALUE cast_sym_CONST;
|
16
|
+
VALUE cast_sym_CONTINUE;
|
17
|
+
VALUE cast_sym_DEFAULT;
|
18
|
+
VALUE cast_sym_DO;
|
19
|
+
VALUE cast_sym_DOUBLE;
|
20
|
+
VALUE cast_sym_ELSE;
|
21
|
+
VALUE cast_sym_ENUM;
|
22
|
+
VALUE cast_sym_EXTERN;
|
23
|
+
VALUE cast_sym_FLOAT;
|
24
|
+
VALUE cast_sym_FOR;
|
25
|
+
VALUE cast_sym_GOTO;
|
26
|
+
VALUE cast_sym_IF;
|
27
|
+
VALUE cast_sym_INT;
|
28
|
+
VALUE cast_sym_LONG;
|
29
|
+
VALUE cast_sym_REGISTER;
|
30
|
+
VALUE cast_sym_RETURN;
|
31
|
+
VALUE cast_sym_SHORT;
|
32
|
+
VALUE cast_sym_SIGNED;
|
33
|
+
VALUE cast_sym_SIZEOF;
|
34
|
+
VALUE cast_sym_STATIC;
|
35
|
+
VALUE cast_sym_STRUCT;
|
36
|
+
VALUE cast_sym_SWITCH;
|
37
|
+
VALUE cast_sym_TYPEDEF;
|
38
|
+
VALUE cast_sym_UNION;
|
39
|
+
VALUE cast_sym_UNSIGNED;
|
40
|
+
VALUE cast_sym_VOID;
|
41
|
+
VALUE cast_sym_VOLATILE;
|
42
|
+
VALUE cast_sym_WHILE;
|
43
|
+
VALUE cast_sym_INLINE;
|
44
|
+
VALUE cast_sym_RESTRICT;
|
45
|
+
VALUE cast_sym_BOOL;
|
46
|
+
VALUE cast_sym_COMPLEX;
|
47
|
+
VALUE cast_sym_IMAGINARY;
|
48
|
+
|
49
|
+
VALUE cast_sym_FCON;
|
50
|
+
VALUE cast_sym_ICON;
|
51
|
+
VALUE cast_sym_ID;
|
52
|
+
VALUE cast_sym_SCON;
|
53
|
+
VALUE cast_sym_CCON;
|
54
|
+
VALUE cast_sym_TYPENAME;
|
55
|
+
|
56
|
+
VALUE cast_sym_ADDEQ;
|
57
|
+
VALUE cast_sym_ANDAND;
|
58
|
+
VALUE cast_sym_ANDEQ;
|
59
|
+
VALUE cast_sym_DEC;
|
60
|
+
VALUE cast_sym_ARROW;
|
61
|
+
VALUE cast_sym_DIVEQ;
|
62
|
+
VALUE cast_sym_ELLIPSIS;
|
63
|
+
VALUE cast_sym_EQEQ;
|
64
|
+
VALUE cast_sym_GEQ;
|
65
|
+
VALUE cast_sym_INC;
|
66
|
+
VALUE cast_sym_LEQ;
|
67
|
+
VALUE cast_sym_LSHIFT;
|
68
|
+
VALUE cast_sym_LSHIFTEQ;
|
69
|
+
VALUE cast_sym_MODEQ;
|
70
|
+
VALUE cast_sym_MULEQ;
|
71
|
+
VALUE cast_sym_NEQ;
|
72
|
+
VALUE cast_sym_OREQ;
|
73
|
+
VALUE cast_sym_OROR;
|
74
|
+
VALUE cast_sym_RSHIFT;
|
75
|
+
VALUE cast_sym_RSHIFTEQ;
|
76
|
+
VALUE cast_sym_SUBEQ;
|
77
|
+
VALUE cast_sym_XOREQ;
|
78
|
+
|
79
|
+
VALUE cast_sym_SEMICOLON;
|
80
|
+
VALUE cast_sym_LBRACE;
|
81
|
+
VALUE cast_sym_RBRACE;
|
82
|
+
VALUE cast_sym_COMMA;
|
83
|
+
VALUE cast_sym_COLON;
|
84
|
+
VALUE cast_sym_EQ;
|
85
|
+
VALUE cast_sym_LPAREN;
|
86
|
+
VALUE cast_sym_RPAREN;
|
87
|
+
VALUE cast_sym_LBRACKET;
|
88
|
+
VALUE cast_sym_RBRACKET;
|
89
|
+
VALUE cast_sym_DOT;
|
90
|
+
VALUE cast_sym_AND;
|
91
|
+
VALUE cast_sym_BANG;
|
92
|
+
VALUE cast_sym_NOT;
|
93
|
+
VALUE cast_sym_SUB;
|
94
|
+
VALUE cast_sym_ADD;
|
95
|
+
VALUE cast_sym_MUL;
|
96
|
+
VALUE cast_sym_DIV;
|
97
|
+
VALUE cast_sym_MOD;
|
98
|
+
VALUE cast_sym_LT;
|
99
|
+
VALUE cast_sym_GT;
|
100
|
+
VALUE cast_sym_XOR;
|
101
|
+
VALUE cast_sym_OR;
|
102
|
+
VALUE cast_sym_QUESTION;
|
103
|
+
|
104
|
+
VALUE cast_Parser_alloc(VALUE klass) {
|
105
|
+
VALUE ret;
|
106
|
+
cast_Parser *ret_p;
|
107
|
+
ret_p = ALLOC(cast_Parser);
|
108
|
+
memset(ret_p, 0, sizeof(cast_Parser));
|
109
|
+
ret = Wrap_Struct(ret_p, Parser, klass);
|
110
|
+
ret_p->lineno = 1;
|
111
|
+
ret_p->token = rb_ary_new2(2);
|
112
|
+
rb_ary_push(ret_p->token, Qnil);
|
113
|
+
rb_ary_push(ret_p->token, Qnil);
|
114
|
+
return ret;
|
115
|
+
}
|
116
|
+
|
117
|
+
void cast_Parser_mark(cast_Parser *parser) {
|
118
|
+
rb_gc_mark(parser->token);
|
119
|
+
}
|
120
|
+
|
121
|
+
void cast_Parser_free(cast_Parser *parser) {
|
122
|
+
/* nothing to do */
|
123
|
+
}
|
124
|
+
|
125
|
+
/* (Private.) Called by #parse to prepare for lexing.
|
126
|
+
*/
|
127
|
+
VALUE cast_Parser_prepare_lexer(VALUE self, VALUE string) {
|
128
|
+
cast_Parser *self_p;
|
129
|
+
char *b, *e;
|
130
|
+
|
131
|
+
Get_Struct(self, Parser, self_p);
|
132
|
+
string = rb_convert_type(string, T_STRING, "String", "to_s");
|
133
|
+
|
134
|
+
b = RSTRING(string)->ptr;
|
135
|
+
e = b + RSTRING(string)->len + 1;
|
136
|
+
|
137
|
+
self_p->bot = b;
|
138
|
+
self_p->tok = b;
|
139
|
+
self_p->ptr = b;
|
140
|
+
self_p->cur = b;
|
141
|
+
self_p->pos = b;
|
142
|
+
self_p->lim = e;
|
143
|
+
self_p->top = e;
|
144
|
+
self_p->eof = e;
|
145
|
+
self_p->lineno = 1;
|
146
|
+
|
147
|
+
return Qnil;
|
148
|
+
}
|
149
|
+
|
150
|
+
/* (Private.) Called by #parse to get the next token (as required by
|
151
|
+
* racc). Returns a 2-element array: [TOKEN_SYM, VALUE].
|
152
|
+
*/
|
153
|
+
VALUE cast_Parser_next_token(VALUE self) {
|
154
|
+
cast_Parser *self_p;
|
155
|
+
VALUE token, pos;
|
156
|
+
Get_Struct(self, Parser, self_p);
|
157
|
+
|
158
|
+
/* clear the token val */
|
159
|
+
rb_ary_store(self_p->token, 1, Qnil);
|
160
|
+
|
161
|
+
/* call the lexer */
|
162
|
+
yylex(self, self_p);
|
163
|
+
|
164
|
+
/* return nil if EOF */
|
165
|
+
if (rb_ary_entry(self_p->token, 0) == Qnil)
|
166
|
+
return Qnil;
|
167
|
+
|
168
|
+
/* set self.pos */
|
169
|
+
pos = rb_iv_get(self, "@pos");
|
170
|
+
rb_funcall(pos, rb_intern("line_num="), 1, LONG2NUM(self_p->lineno));
|
171
|
+
/* make token */
|
172
|
+
token = rb_funcall(rb_const_get(cast_cParser, rb_intern("Token")),
|
173
|
+
rb_intern("new"), 2,
|
174
|
+
rb_funcall2(pos, rb_intern("dup"), 0, NULL),
|
175
|
+
rb_ary_entry(self_p->token, 1));
|
176
|
+
/* put the token in the array */
|
177
|
+
rb_ary_store(self_p->token, 1, token);
|
178
|
+
return self_p->token;
|
179
|
+
}
|
180
|
+
|
181
|
+
/* Called from Init_cast_ext to initialize the Parser section.
|
182
|
+
*/
|
183
|
+
void cast_init_parser(void) {
|
184
|
+
VALUE cRaccParser;
|
185
|
+
rb_require("racc/parser");
|
186
|
+
cRaccParser = rb_const_get(rb_const_get(rb_cObject, rb_intern("Racc")),
|
187
|
+
rb_intern("Parser"));
|
188
|
+
cast_cParser = rb_define_class_under(cast_mC, "Parser", cRaccParser);
|
189
|
+
rb_define_alloc_func(cast_cParser, cast_Parser_alloc);
|
190
|
+
cast_eParseError = rb_define_class_under(cast_mC, "ParseError", rb_eStandardError);
|
191
|
+
|
192
|
+
rb_define_private_method(cast_cParser, "next_token", cast_Parser_next_token, 0);
|
193
|
+
rb_define_private_method(cast_cParser, "prepare_lexer", cast_Parser_prepare_lexer, 1);
|
194
|
+
|
195
|
+
cast_sym_AUTO = ID2SYM(rb_intern("AUTO"));
|
196
|
+
cast_sym_BREAK = ID2SYM(rb_intern("BREAK"));
|
197
|
+
cast_sym_CASE = ID2SYM(rb_intern("CASE"));
|
198
|
+
cast_sym_CHAR = ID2SYM(rb_intern("CHAR"));
|
199
|
+
cast_sym_CONST = ID2SYM(rb_intern("CONST"));
|
200
|
+
cast_sym_CONTINUE = ID2SYM(rb_intern("CONTINUE"));
|
201
|
+
cast_sym_DEFAULT = ID2SYM(rb_intern("DEFAULT"));
|
202
|
+
cast_sym_DO = ID2SYM(rb_intern("DO"));
|
203
|
+
cast_sym_DOUBLE = ID2SYM(rb_intern("DOUBLE"));
|
204
|
+
cast_sym_ELSE = ID2SYM(rb_intern("ELSE"));
|
205
|
+
cast_sym_ENUM = ID2SYM(rb_intern("ENUM"));
|
206
|
+
cast_sym_EXTERN = ID2SYM(rb_intern("EXTERN"));
|
207
|
+
cast_sym_FLOAT = ID2SYM(rb_intern("FLOAT"));
|
208
|
+
cast_sym_FOR = ID2SYM(rb_intern("FOR"));
|
209
|
+
cast_sym_GOTO = ID2SYM(rb_intern("GOTO"));
|
210
|
+
cast_sym_IF = ID2SYM(rb_intern("IF"));
|
211
|
+
cast_sym_INT = ID2SYM(rb_intern("INT"));
|
212
|
+
cast_sym_LONG = ID2SYM(rb_intern("LONG"));
|
213
|
+
cast_sym_REGISTER = ID2SYM(rb_intern("REGISTER"));
|
214
|
+
cast_sym_RETURN = ID2SYM(rb_intern("RETURN"));
|
215
|
+
cast_sym_SHORT = ID2SYM(rb_intern("SHORT"));
|
216
|
+
cast_sym_SIGNED = ID2SYM(rb_intern("SIGNED"));
|
217
|
+
cast_sym_SIZEOF = ID2SYM(rb_intern("SIZEOF"));
|
218
|
+
cast_sym_STATIC = ID2SYM(rb_intern("STATIC"));
|
219
|
+
cast_sym_STRUCT = ID2SYM(rb_intern("STRUCT"));
|
220
|
+
cast_sym_SWITCH = ID2SYM(rb_intern("SWITCH"));
|
221
|
+
cast_sym_TYPEDEF = ID2SYM(rb_intern("TYPEDEF"));
|
222
|
+
cast_sym_UNION = ID2SYM(rb_intern("UNION"));
|
223
|
+
cast_sym_UNSIGNED = ID2SYM(rb_intern("UNSIGNED"));
|
224
|
+
cast_sym_VOID = ID2SYM(rb_intern("VOID"));
|
225
|
+
cast_sym_VOLATILE = ID2SYM(rb_intern("VOLATILE"));
|
226
|
+
cast_sym_WHILE = ID2SYM(rb_intern("WHILE"));
|
227
|
+
cast_sym_INLINE = ID2SYM(rb_intern("INLINE"));
|
228
|
+
cast_sym_RESTRICT = ID2SYM(rb_intern("RESTRICT"));
|
229
|
+
cast_sym_BOOL = ID2SYM(rb_intern("BOOL"));
|
230
|
+
cast_sym_COMPLEX = ID2SYM(rb_intern("COMPLEX"));
|
231
|
+
cast_sym_IMAGINARY = ID2SYM(rb_intern("IMAGINARY"));
|
232
|
+
|
233
|
+
cast_sym_FCON = ID2SYM(rb_intern("FCON"));
|
234
|
+
cast_sym_ICON = ID2SYM(rb_intern("ICON"));
|
235
|
+
cast_sym_ID = ID2SYM(rb_intern("ID"));
|
236
|
+
cast_sym_SCON = ID2SYM(rb_intern("SCON"));
|
237
|
+
cast_sym_CCON = ID2SYM(rb_intern("CCON"));
|
238
|
+
cast_sym_TYPENAME = ID2SYM(rb_intern("TYPENAME"));
|
239
|
+
|
240
|
+
cast_sym_ADDEQ = ID2SYM(rb_intern("ADDEQ"));
|
241
|
+
cast_sym_ANDAND = ID2SYM(rb_intern("ANDAND"));
|
242
|
+
cast_sym_ANDEQ = ID2SYM(rb_intern("ANDEQ"));
|
243
|
+
cast_sym_DEC = ID2SYM(rb_intern("DEC"));
|
244
|
+
cast_sym_ARROW = ID2SYM(rb_intern("ARROW"));
|
245
|
+
cast_sym_DIVEQ = ID2SYM(rb_intern("DIVEQ"));
|
246
|
+
cast_sym_ELLIPSIS = ID2SYM(rb_intern("ELLIPSIS"));
|
247
|
+
cast_sym_EQEQ = ID2SYM(rb_intern("EQEQ"));
|
248
|
+
cast_sym_GEQ = ID2SYM(rb_intern("GEQ"));
|
249
|
+
cast_sym_INC = ID2SYM(rb_intern("INC"));
|
250
|
+
cast_sym_LEQ = ID2SYM(rb_intern("LEQ"));
|
251
|
+
cast_sym_LSHIFT = ID2SYM(rb_intern("LSHIFT"));
|
252
|
+
cast_sym_LSHIFTEQ = ID2SYM(rb_intern("LSHIFTEQ"));
|
253
|
+
cast_sym_MODEQ = ID2SYM(rb_intern("MODEQ"));
|
254
|
+
cast_sym_MULEQ = ID2SYM(rb_intern("MULEQ"));
|
255
|
+
cast_sym_NEQ = ID2SYM(rb_intern("NEQ"));
|
256
|
+
cast_sym_OREQ = ID2SYM(rb_intern("OREQ"));
|
257
|
+
cast_sym_OROR = ID2SYM(rb_intern("OROR"));
|
258
|
+
cast_sym_RSHIFT = ID2SYM(rb_intern("RSHIFT"));
|
259
|
+
cast_sym_RSHIFTEQ = ID2SYM(rb_intern("RSHIFTEQ"));
|
260
|
+
cast_sym_SUBEQ = ID2SYM(rb_intern("SUBEQ"));
|
261
|
+
cast_sym_XOREQ = ID2SYM(rb_intern("XOREQ"));
|
262
|
+
|
263
|
+
cast_sym_SEMICOLON = ID2SYM(rb_intern("SEMICOLON"));
|
264
|
+
cast_sym_LBRACE = ID2SYM(rb_intern("LBRACE"));
|
265
|
+
cast_sym_RBRACE = ID2SYM(rb_intern("RBRACE"));
|
266
|
+
cast_sym_COMMA = ID2SYM(rb_intern("COMMA"));
|
267
|
+
cast_sym_COLON = ID2SYM(rb_intern("COLON"));
|
268
|
+
cast_sym_EQ = ID2SYM(rb_intern("EQ"));
|
269
|
+
cast_sym_LPAREN = ID2SYM(rb_intern("LPAREN"));
|
270
|
+
cast_sym_RPAREN = ID2SYM(rb_intern("RPAREN"));
|
271
|
+
cast_sym_LBRACKET = ID2SYM(rb_intern("LBRACKET"));
|
272
|
+
cast_sym_RBRACKET = ID2SYM(rb_intern("RBRACKET"));
|
273
|
+
cast_sym_DOT = ID2SYM(rb_intern("DOT"));
|
274
|
+
cast_sym_AND = ID2SYM(rb_intern("AND"));
|
275
|
+
cast_sym_BANG = ID2SYM(rb_intern("BANG"));
|
276
|
+
cast_sym_NOT = ID2SYM(rb_intern("NOT"));
|
277
|
+
cast_sym_SUB = ID2SYM(rb_intern("SUB"));
|
278
|
+
cast_sym_ADD = ID2SYM(rb_intern("ADD"));
|
279
|
+
cast_sym_MUL = ID2SYM(rb_intern("MUL"));
|
280
|
+
cast_sym_DIV = ID2SYM(rb_intern("DIV"));
|
281
|
+
cast_sym_MOD = ID2SYM(rb_intern("MOD"));
|
282
|
+
cast_sym_LT = ID2SYM(rb_intern("LT"));
|
283
|
+
cast_sym_GT = ID2SYM(rb_intern("GT"));
|
284
|
+
cast_sym_XOR = ID2SYM(rb_intern("XOR"));
|
285
|
+
cast_sym_OR = ID2SYM(rb_intern("OR"));
|
286
|
+
cast_sym_QUESTION = ID2SYM(rb_intern("QUESTION"));
|
287
|
+
}
|