00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef RUBY_ID_H
00014 #define RUBY_ID_H
00015
00016 #define ID_SCOPE_SHIFT 3
00017 #define ID_SCOPE_MASK 0x07
00018 #define ID_LOCAL 0x00
00019 #define ID_INSTANCE 0x01
00020 #define ID_GLOBAL 0x03
00021 #define ID_ATTRSET 0x04
00022 #define ID_CONST 0x05
00023 #define ID_CLASS 0x06
00024 #define ID_JUNK 0x07
00025 #define ID_INTERNAL ID_JUNK
00026
00027 #ifdef USE_PARSE_H
00028 #include "parse.h"
00029 #endif
00030
00031 #define symIFUNC ID2SYM(idIFUNC)
00032 #define symCFUNC ID2SYM(idCFUNC)
00033
00034 #if !defined tLAST_TOKEN && defined YYTOKENTYPE
00035 #define tLAST_TOKEN tLAST_TOKEN
00036 #endif
00037
00038 enum ruby_method_ids {
00039 #ifndef tLAST_TOKEN
00040 tUPLUS = 321,
00041 tUMINUS = 322,
00042 tPOW = 323,
00043 tCMP = 324,
00044 tEQ = 325,
00045 tEQQ = 326,
00046 tNEQ = 327,
00047 tGEQ = 328,
00048 tLEQ = 329,
00049 tANDOP = 330,
00050 tOROP = 331,
00051 tMATCH = 332,
00052 tNMATCH = 333,
00053 tDOT2 = 334,
00054 tDOT3 = 335,
00055 tAREF = 336,
00056 tASET = 337,
00057 tLSHFT = 338,
00058 tRSHFT = 339,
00059 tLAMBDA = 352,
00060 idNULL = 365,
00061 idRespond_to = 366,
00062 idIFUNC = 367,
00063 idCFUNC = 368,
00064 id_core_set_method_alias = 369,
00065 id_core_set_variable_alias = 370,
00066 id_core_undef_method = 371,
00067 id_core_define_method = 372,
00068 id_core_define_singleton_method = 373,
00069 id_core_set_postexe = 374,
00070 tLAST_TOKEN = 375,
00071 #endif
00072 idDot2 = tDOT2,
00073 idDot3 = tDOT3,
00074 idUPlus = tUPLUS,
00075 idUMinus = tUMINUS,
00076 idPow = tPOW,
00077 idCmp = tCMP,
00078 idPLUS = '+',
00079 idMINUS = '-',
00080 idMULT = '*',
00081 idDIV = '/',
00082 idMOD = '%',
00083 idLT = '<',
00084 idLTLT = tLSHFT,
00085 idLE = tLEQ,
00086 idGT = '>',
00087 idGE = tGEQ,
00088 idEq = tEQ,
00089 idEqq = tEQQ,
00090 idNeq = tNEQ,
00091 idNot = '!',
00092 idBackquote = '`',
00093 idEqTilde = tMATCH,
00094 idNeqTilde = tNMATCH,
00095 idAREF = tAREF,
00096 idASET = tASET,
00097 idLAST_TOKEN = tLAST_TOKEN >> ID_SCOPE_SHIFT,
00098 tIntern,
00099 tMethodMissing,
00100 tLength,
00101 tSize,
00102 tGets,
00103 tSucc,
00104 tEach,
00105 tLambda,
00106 tSend,
00107 t__send__,
00108 tInitialize,
00109 #if SUPPORT_JOKE
00110 tBitblt,
00111 tAnswer,
00112 #endif
00113 tLAST_ID,
00114 #define TOKEN2ID(n) id##n = ((t##n<<ID_SCOPE_SHIFT)|ID_LOCAL)
00115 #if SUPPORT_JOKE
00116 TOKEN2ID(Bitblt),
00117 TOKEN2ID(Answer),
00118 #endif
00119 TOKEN2ID(Intern),
00120 TOKEN2ID(MethodMissing),
00121 TOKEN2ID(Length),
00122 TOKEN2ID(Size),
00123 TOKEN2ID(Gets),
00124 TOKEN2ID(Succ),
00125 TOKEN2ID(Each),
00126 TOKEN2ID(Lambda),
00127 TOKEN2ID(Send),
00128 TOKEN2ID(__send__),
00129 TOKEN2ID(Initialize)
00130 };
00131
00132 #ifdef tLAST_TOKEN
00133 struct ruby_method_ids_check {
00134 #define ruby_method_id_check_for(name, value) \
00135 int checking_for_##name[name == value ? 1 : -1]
00136 ruby_method_id_check_for(tUPLUS, 321);
00137 ruby_method_id_check_for(tUMINUS, 322);
00138 ruby_method_id_check_for(tPOW, 323);
00139 ruby_method_id_check_for(tCMP, 324);
00140 ruby_method_id_check_for(tEQ, 325);
00141 ruby_method_id_check_for(tEQQ, 326);
00142 ruby_method_id_check_for(tNEQ, 327);
00143 ruby_method_id_check_for(tGEQ, 328);
00144 ruby_method_id_check_for(tLEQ, 329);
00145 ruby_method_id_check_for(tANDOP, 330);
00146 ruby_method_id_check_for(tOROP, 331);
00147 ruby_method_id_check_for(tMATCH, 332);
00148 ruby_method_id_check_for(tNMATCH, 333);
00149 ruby_method_id_check_for(tDOT2, 334);
00150 ruby_method_id_check_for(tDOT3, 335);
00151 ruby_method_id_check_for(tAREF, 336);
00152 ruby_method_id_check_for(tASET, 337);
00153 ruby_method_id_check_for(tLSHFT, 338);
00154 ruby_method_id_check_for(tRSHFT, 339);
00155 ruby_method_id_check_for(tLAMBDA, 352);
00156 ruby_method_id_check_for(idNULL, 365);
00157 ruby_method_id_check_for(idRespond_to, 366);
00158 ruby_method_id_check_for(idIFUNC, 367);
00159 ruby_method_id_check_for(idCFUNC, 368);
00160 ruby_method_id_check_for(id_core_set_method_alias, 369);
00161 ruby_method_id_check_for(id_core_set_variable_alias, 370);
00162 ruby_method_id_check_for(id_core_undef_method, 371);
00163 ruby_method_id_check_for(id_core_define_method, 372);
00164 ruby_method_id_check_for(id_core_define_singleton_method, 373);
00165 ruby_method_id_check_for(id_core_set_postexe, 374);
00166 ruby_method_id_check_for(tLAST_TOKEN, 375);
00167 };
00168 #endif
00169
00170 #endif
00171