17 RUBY_ID_STATIC_SYM = 0x01,
19 RUBY_ID_INSTANCE = (0x01<<1),
20 RUBY_ID_GLOBAL = (0x03<<1),
21 RUBY_ID_ATTRSET = (0x04<<1),
22 RUBY_ID_CONST = (0x05<<1),
23 RUBY_ID_CLASS = (0x06<<1),
24 RUBY_ID_JUNK = (0x07<<1),
25 RUBY_ID_INTERNAL = RUBY_ID_JUNK,
26 RUBY_ID_SCOPE_SHIFT = 4,
27 RUBY_ID_SCOPE_MASK = (~(~0
U<<(RUBY_ID_SCOPE_SHIFT-1))<<1)
30#define ID_STATIC_SYM RUBY_ID_STATIC_SYM
31#define ID_SCOPE_SHIFT RUBY_ID_SCOPE_SHIFT
32#define ID_SCOPE_MASK RUBY_ID_SCOPE_MASK
33#define ID_LOCAL RUBY_ID_LOCAL
34#define ID_INSTANCE RUBY_ID_INSTANCE
35#define ID_GLOBAL RUBY_ID_GLOBAL
36#define ID_ATTRSET RUBY_ID_ATTRSET
37#define ID_CONST RUBY_ID_CONST
38#define ID_CLASS RUBY_ID_CLASS
39#define ID_JUNK RUBY_ID_JUNK
40#define ID_INTERNAL RUBY_ID_INTERNAL
42#define symIFUNC ID2SYM(idIFUNC)
43#define symCFUNC ID2SYM(idCFUNC)
45#define RUBY_TOKEN_DOT2 128
46#define RUBY_TOKEN_DOT3 129
47#define RUBY_TOKEN_BDOT2 130
48#define RUBY_TOKEN_BDOT3 131
49#define RUBY_TOKEN_UPLUS 132
50#define RUBY_TOKEN_UMINUS 133
51#define RUBY_TOKEN_POW 134
52#define RUBY_TOKEN_CMP 135
53#define RUBY_TOKEN_LSHFT 136
54#define RUBY_TOKEN_RSHFT 137
55#define RUBY_TOKEN_LEQ 138
56#define RUBY_TOKEN_GEQ 139
57#define RUBY_TOKEN_EQ 140
58#define RUBY_TOKEN_EQQ 141
59#define RUBY_TOKEN_NEQ 142
60#define RUBY_TOKEN_MATCH 143
61#define RUBY_TOKEN_NMATCH 144
62#define RUBY_TOKEN_AREF 145
63#define RUBY_TOKEN_ASET 146
64#define RUBY_TOKEN_COLON2 147
65#define RUBY_TOKEN_ANDOP 148
66#define RUBY_TOKEN_OROP 149
67#define RUBY_TOKEN_ANDDOT 150
68#define RUBY_TOKEN(t) RUBY_TOKEN_##t
70#define RUBY_TOKEN2ID_TYPE(tok, type) ((tok<<RUBY_ID_SCOPE_SHIFT)|type|RUBY_ID_STATIC_SYM)
71#define TOKEN2LOCALID(tok) RUBY_TOKEN2ID_TYPE(tok, RUBY_ID_LOCAL)
72#define TOKEN2INSTANCEID(tok) RUBY_TOKEN2ID_TYPE(tok, RUBY_ID_INSTANCE)
73#define TOKEN2GLOBALID(tok) RUBY_TOKEN2ID_TYPE(tok, RUBY_ID_GLOBAL)
74#define TOKEN2CONSTID(tok) RUBY_TOKEN2ID_TYPE(tok, RUBY_ID_CONST)
75#define TOKEN2CLASSID(tok) RUBY_TOKEN2ID_TYPE(tok, RUBY_ID_CLASS)
76#define TOKEN2ATTRSETID(tok) RUBY_TOKEN2ID_TYPE(tok, RUBY_ID_ATTRSET)
79 idDot2 = RUBY_TOKEN(DOT2),
80 idDot3 = RUBY_TOKEN(DOT3),
81 idUPlus = RUBY_TOKEN(UPLUS),
82 idUMinus = RUBY_TOKEN(UMINUS),
83 idPow = RUBY_TOKEN(POW),
84 idCmp = RUBY_TOKEN(CMP),
90 idLTLT = RUBY_TOKEN(LSHFT),
91 idGTGT = RUBY_TOKEN(RSHFT),
93 idLE = RUBY_TOKEN(LEQ),
95 idGE = RUBY_TOKEN(GEQ),
96 idEq = RUBY_TOKEN(EQ),
97 idEqq = RUBY_TOKEN(EQQ),
98 idNeq = RUBY_TOKEN(NEQ),
103 idEqTilde = RUBY_TOKEN(MATCH),
104 idNeqTilde = RUBY_TOKEN(NMATCH),
105 idAREF = RUBY_TOKEN(AREF),
106 idASET = RUBY_TOKEN(ASET),
107 idCOLON2 = RUBY_TOKEN(COLON2),
108 idANDOP = RUBY_TOKEN(ANDOP),
109 idOROP = RUBY_TOKEN(OROP),
110 idANDDOT = RUBY_TOKEN(ANDDOT),
111 tPRESERVED_ID_BEGIN = 150,
118 idRespond_to_missing,
121 id_core_set_method_alias,
122 id_core_set_variable_alias,
123 id_core_undef_method,
124 id_core_define_method,
125 id_core_define_singleton_method,
127 id_core_hash_merge_ptr,
128 id_core_hash_merge_kwd,
131 id_debug_created_info,
135 tTOKEN_LOCAL_BEGIN = tPRESERVED_ID_END-1,
148 tSingleton_method_added,
150 tSingleton_method_removed,
152 tSingleton_method_undefined,
212 tTOKEN_INSTANCE_BEGIN = tTOKEN_LOCAL_END-1,
217 tTOKEN_GLOBAL_BEGIN = tTOKEN_INSTANCE_END-1,
225 tTOKEN_CONST_BEGIN = tTOKEN_GLOBAL_END-1,
231 tTOKEN_CLASS_BEGIN = tTOKEN_CONST_END-1,
236 tTOKEN_ATTRSET_BEGIN = tTOKEN_CLASS_END-1,
240 tNEXT_ID = tTOKEN_ATTRSET_END,
243#define DEFINE_LOCALID_FROM_TOKEN(n) id##n = TOKEN2LOCALID(t##n)
244 DEFINE_LOCALID_FROM_TOKEN(Max),
245 DEFINE_LOCALID_FROM_TOKEN(Min),
246 DEFINE_LOCALID_FROM_TOKEN(Hash),
247 DEFINE_LOCALID_FROM_TOKEN(Freeze),
248 DEFINE_LOCALID_FROM_TOKEN(Inspect),
249 DEFINE_LOCALID_FROM_TOKEN(Intern),
250 DEFINE_LOCALID_FROM_TOKEN(Object_id),
251 DEFINE_LOCALID_FROM_TOKEN(__id__),
252 DEFINE_LOCALID_FROM_TOKEN(Const_added),
253 DEFINE_LOCALID_FROM_TOKEN(Const_missing),
254 DEFINE_LOCALID_FROM_TOKEN(MethodMissing),
255 DEFINE_LOCALID_FROM_TOKEN(Method_added),
256 DEFINE_LOCALID_FROM_TOKEN(Singleton_method_added),
257 DEFINE_LOCALID_FROM_TOKEN(Method_removed),
258 DEFINE_LOCALID_FROM_TOKEN(Singleton_method_removed),
259 DEFINE_LOCALID_FROM_TOKEN(Method_undefined),
260 DEFINE_LOCALID_FROM_TOKEN(Singleton_method_undefined),
261 DEFINE_LOCALID_FROM_TOKEN(Length),
262 DEFINE_LOCALID_FROM_TOKEN(Size),
263 DEFINE_LOCALID_FROM_TOKEN(Gets),
264 DEFINE_LOCALID_FROM_TOKEN(Succ),
265 DEFINE_LOCALID_FROM_TOKEN(Each),
266 DEFINE_LOCALID_FROM_TOKEN(Proc),
267 DEFINE_LOCALID_FROM_TOKEN(Lambda),
268 DEFINE_LOCALID_FROM_TOKEN(Send),
269 DEFINE_LOCALID_FROM_TOKEN(__send__),
270 DEFINE_LOCALID_FROM_TOKEN(__recursive_key__),
271 DEFINE_LOCALID_FROM_TOKEN(Initialize),
272 DEFINE_LOCALID_FROM_TOKEN(Initialize_copy),
273 DEFINE_LOCALID_FROM_TOKEN(Initialize_clone),
274 DEFINE_LOCALID_FROM_TOKEN(Initialize_dup),
275 DEFINE_LOCALID_FROM_TOKEN(To_int),
276 DEFINE_LOCALID_FROM_TOKEN(To_ary),
277 DEFINE_LOCALID_FROM_TOKEN(To_str),
278 DEFINE_LOCALID_FROM_TOKEN(To_sym),
279 DEFINE_LOCALID_FROM_TOKEN(To_hash),
280 DEFINE_LOCALID_FROM_TOKEN(To_proc),
281 DEFINE_LOCALID_FROM_TOKEN(To_io),
282 DEFINE_LOCALID_FROM_TOKEN(To_a),
283 DEFINE_LOCALID_FROM_TOKEN(To_s),
284 DEFINE_LOCALID_FROM_TOKEN(To_i),
285 DEFINE_LOCALID_FROM_TOKEN(To_f),
286 DEFINE_LOCALID_FROM_TOKEN(To_r),
287 DEFINE_LOCALID_FROM_TOKEN(Bt),
288 DEFINE_LOCALID_FROM_TOKEN(Bt_locations),
289 DEFINE_LOCALID_FROM_TOKEN(Call),
290 DEFINE_LOCALID_FROM_TOKEN(Mesg),
291 DEFINE_LOCALID_FROM_TOKEN(Exception),
292 DEFINE_LOCALID_FROM_TOKEN(Locals),
293 DEFINE_LOCALID_FROM_TOKEN(NOT),
294 DEFINE_LOCALID_FROM_TOKEN(AND),
295 DEFINE_LOCALID_FROM_TOKEN(OR),
296 DEFINE_LOCALID_FROM_TOKEN(Div),
297 DEFINE_LOCALID_FROM_TOKEN(Divmod),
298 DEFINE_LOCALID_FROM_TOKEN(Fdiv),
299 DEFINE_LOCALID_FROM_TOKEN(Quo),
300 DEFINE_LOCALID_FROM_TOKEN(Name),
301 DEFINE_LOCALID_FROM_TOKEN(Nil),
302 DEFINE_LOCALID_FROM_TOKEN(Path),
303 DEFINE_LOCALID_FROM_TOKEN(Pack),
304 DEFINE_LOCALID_FROM_TOKEN(Buffer),
305 DEFINE_LOCALID_FROM_TOKEN(UScore),
306 DEFINE_LOCALID_FROM_TOKEN(NUMPARAM_1),
307 DEFINE_LOCALID_FROM_TOKEN(NUMPARAM_2),
308 DEFINE_LOCALID_FROM_TOKEN(NUMPARAM_3),
309 DEFINE_LOCALID_FROM_TOKEN(NUMPARAM_4),
310 DEFINE_LOCALID_FROM_TOKEN(NUMPARAM_5),
311 DEFINE_LOCALID_FROM_TOKEN(NUMPARAM_6),
312 DEFINE_LOCALID_FROM_TOKEN(NUMPARAM_7),
313 DEFINE_LOCALID_FROM_TOKEN(NUMPARAM_8),
314 DEFINE_LOCALID_FROM_TOKEN(NUMPARAM_9),
315 DEFINE_LOCALID_FROM_TOKEN(Default),
316#undef DEFINE_LOCALID_FROM_TOKEN
320#define DEFINE_INSTANCEID_FROM_TOKEN(n) id##n = TOKEN2INSTANCEID(t##n)
321#undef DEFINE_INSTANCEID_FROM_TOKEN
325#define DEFINE_GLOBALID_FROM_TOKEN(n) id##n = TOKEN2GLOBALID(t##n)
326 DEFINE_GLOBALID_FROM_TOKEN(LASTLINE),
327 DEFINE_GLOBALID_FROM_TOKEN(BACKREF),
328 DEFINE_GLOBALID_FROM_TOKEN(ERROR_INFO),
329#undef DEFINE_GLOBALID_FROM_TOKEN
333#define DEFINE_CONSTID_FROM_TOKEN(n) id##n = TOKEN2CONSTID(t##n)
334 DEFINE_CONSTID_FROM_TOKEN(Ruby),
335#undef DEFINE_CONSTID_FROM_TOKEN
339#define DEFINE_CLASSID_FROM_TOKEN(n) id##n = TOKEN2CLASSID(t##n)
340#undef DEFINE_CLASSID_FROM_TOKEN
344#define DEFINE_ATTRSETID_FROM_TOKEN(n) id##n = TOKEN2ATTRSETID(t##n)
345#undef DEFINE_ATTRSETID_FROM_TOKEN
348 tLAST_OP_ID = tPRESERVED_ID_END-1,
349 idLAST_OP_ID = tLAST_OP_ID >> ID_SCOPE_SHIFT