Ruby  1.9.3p484(2013-11-22revision43786)
id.h
Go to the documentation of this file.
1 /* DO NOT EDIT THIS FILE DIRECTLY */
2 /**********************************************************************
3 
4  id.h -
5 
6  $Author: usa $
7  created at: Sun Oct 19 21:12:51 2008
8 
9  Copyright (C) 2007 Koichi Sasada
10 
11 **********************************************************************/
12 
13 #ifndef RUBY_ID_H
14 #define RUBY_ID_H
15 
16 #define ID_SCOPE_SHIFT 3
17 #define ID_SCOPE_MASK 0x07
18 #define ID_LOCAL 0x00
19 #define ID_INSTANCE 0x01
20 #define ID_GLOBAL 0x03
21 #define ID_ATTRSET 0x04
22 #define ID_CONST 0x05
23 #define ID_CLASS 0x06
24 #define ID_JUNK 0x07
25 #define ID_INTERNAL ID_JUNK
26 
27 #ifdef USE_PARSE_H
28 #include "parse.h"
29 #endif
30 
31 #include "vm_opts.h" /* for SUPPORT_JOKE */
32 
33 #define symIFUNC ID2SYM(idIFUNC)
34 #define symCFUNC ID2SYM(idCFUNC)
35 
36 #if !defined tLAST_TOKEN && defined YYTOKENTYPE
37 #define tLAST_TOKEN tLAST_TOKEN
38 #endif
39 
41 #ifndef tLAST_TOKEN
42  tUPLUS = 321,
43  tUMINUS = 322,
44  tPOW = 323,
45  tCMP = 324,
46  tEQ = 325,
47  tEQQ = 326,
48  tNEQ = 327,
49  tGEQ = 328,
50  tLEQ = 329,
51  tANDOP = 330,
52  tOROP = 331,
53  tMATCH = 332,
54  tNMATCH = 333,
55  tDOT2 = 334,
56  tDOT3 = 335,
57  tAREF = 336,
58  tASET = 337,
59  tLSHFT = 338,
60  tRSHFT = 339,
61  tLAMBDA = 352,
62  idNULL = 365,
63  idRespond_to = 366,
64  idIFUNC = 367,
65  idCFUNC = 368,
72  tLAST_TOKEN = 375,
73 #endif
80  idPLUS = '+',
81  idMINUS = '-',
82  idMULT = '*',
83  idDIV = '/',
84  idMOD = '%',
85  idLT = '<',
88  idGT = '>',
90  idEq = tEQ,
93  idNot = '!',
94  idBackquote = '`',
113 #if SUPPORT_JOKE
114  tBitblt,
115  tAnswer,
116 #endif
118 #define TOKEN2ID(n) id##n = ((t##n<<ID_SCOPE_SHIFT)|ID_LOCAL)
119 #if SUPPORT_JOKE
120  TOKEN2ID(Bitblt),
121  TOKEN2ID(Answer),
122 #endif
123  TOKEN2ID(Intern),
124  TOKEN2ID(MethodMissing),
125  TOKEN2ID(Length),
126  TOKEN2ID(Size),
127  TOKEN2ID(Gets),
128  TOKEN2ID(Succ),
129  TOKEN2ID(Each),
130  TOKEN2ID(Proc),
131  TOKEN2ID(Lambda),
132  TOKEN2ID(Send),
133  TOKEN2ID(__send__),
134  TOKEN2ID(Initialize),
135  TOKEN2ID(UScore),
136  TOKEN2ID(LAST_ID)
137 };
138 
139 #ifdef tLAST_TOKEN
140 struct ruby_method_ids_check {
141 #define ruby_method_id_check_for(name, value) \
142  int checking_for_##name[name == (value) ? 1 : -1]
143 ruby_method_id_check_for(tUPLUS, 321);
144 ruby_method_id_check_for(tUMINUS, 322);
145 ruby_method_id_check_for(tPOW, 323);
146 ruby_method_id_check_for(tCMP, 324);
147 ruby_method_id_check_for(tEQ, 325);
148 ruby_method_id_check_for(tEQQ, 326);
149 ruby_method_id_check_for(tNEQ, 327);
150 ruby_method_id_check_for(tGEQ, 328);
151 ruby_method_id_check_for(tLEQ, 329);
152 ruby_method_id_check_for(tANDOP, 330);
153 ruby_method_id_check_for(tOROP, 331);
154 ruby_method_id_check_for(tMATCH, 332);
155 ruby_method_id_check_for(tNMATCH, 333);
156 ruby_method_id_check_for(tDOT2, 334);
157 ruby_method_id_check_for(tDOT3, 335);
158 ruby_method_id_check_for(tAREF, 336);
159 ruby_method_id_check_for(tASET, 337);
160 ruby_method_id_check_for(tLSHFT, 338);
161 ruby_method_id_check_for(tRSHFT, 339);
162 ruby_method_id_check_for(tLAMBDA, 352);
163 ruby_method_id_check_for(idNULL, 365);
164 ruby_method_id_check_for(idRespond_to, 366);
165 ruby_method_id_check_for(idIFUNC, 367);
166 ruby_method_id_check_for(idCFUNC, 368);
167 ruby_method_id_check_for(id_core_set_method_alias, 369);
168 ruby_method_id_check_for(id_core_set_variable_alias, 370);
169 ruby_method_id_check_for(id_core_undef_method, 371);
170 ruby_method_id_check_for(id_core_define_method, 372);
171 ruby_method_id_check_for(id_core_define_singleton_method, 373);
172 ruby_method_id_check_for(id_core_set_postexe, 374);
173 ruby_method_id_check_for(tLAST_TOKEN, 375);
174 };
175 #endif
176 
177 #endif /* RUBY_ID_H */
178