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 #define ID2ATTRSET(id) (((id)&~ID_SCOPE_MASK)|ID_ATTRSET)
00028
00029 #define symIFUNC ID2SYM(idIFUNC)
00030 #define symCFUNC ID2SYM(idCFUNC)
00031
00032 #define RUBY_TOKEN_DOT2 128
00033 #define RUBY_TOKEN_DOT3 129
00034 #define RUBY_TOKEN_UPLUS 130
00035 #define RUBY_TOKEN_UMINUS 131
00036 #define RUBY_TOKEN_POW 132
00037 #define RUBY_TOKEN_DSTAR 133
00038 #define RUBY_TOKEN_CMP 134
00039 #define RUBY_TOKEN_LSHFT 135
00040 #define RUBY_TOKEN_RSHFT 136
00041 #define RUBY_TOKEN_LEQ 137
00042 #define RUBY_TOKEN_GEQ 138
00043 #define RUBY_TOKEN_EQ 139
00044 #define RUBY_TOKEN_EQQ 140
00045 #define RUBY_TOKEN_NEQ 141
00046 #define RUBY_TOKEN_MATCH 142
00047 #define RUBY_TOKEN_NMATCH 143
00048 #define RUBY_TOKEN_AREF 144
00049 #define RUBY_TOKEN_ASET 145
00050 #define RUBY_TOKEN_COLON2 146
00051 #define RUBY_TOKEN_COLON3 147
00052 #define RUBY_TOKEN(t) RUBY_TOKEN_##t
00053
00054 enum ruby_method_ids {
00055 idDot2 = RUBY_TOKEN(DOT2),
00056 idDot3 = RUBY_TOKEN(DOT3),
00057 idUPlus = RUBY_TOKEN(UPLUS),
00058 idUMinus = RUBY_TOKEN(UMINUS),
00059 idPow = RUBY_TOKEN(POW),
00060 idCmp = RUBY_TOKEN(CMP),
00061 idPLUS = '+',
00062 idMINUS = '-',
00063 idMULT = '*',
00064 idDIV = '/',
00065 idMOD = '%',
00066 idLT = '<',
00067 idLTLT = RUBY_TOKEN(LSHFT),
00068 idLE = RUBY_TOKEN(LEQ),
00069 idGT = '>',
00070 idGE = RUBY_TOKEN(GEQ),
00071 idEq = RUBY_TOKEN(EQ),
00072 idEqq = RUBY_TOKEN(EQQ),
00073 idNeq = RUBY_TOKEN(NEQ),
00074 idNot = '!',
00075 idBackquote = '`',
00076 idEqTilde = RUBY_TOKEN(MATCH),
00077 idNeqTilde = RUBY_TOKEN(NMATCH),
00078 idAREF = RUBY_TOKEN(AREF),
00079 idASET = RUBY_TOKEN(ASET),
00080 tPRESERVED_ID_BEGIN = 147,
00081 idNULL,
00082 idEmptyP,
00083 idRespond_to,
00084 idRespond_to_missing,
00085 idIFUNC,
00086 idCFUNC,
00087 id_core_set_method_alias,
00088 id_core_set_variable_alias,
00089 id_core_undef_method,
00090 id_core_define_method,
00091 id_core_define_singleton_method,
00092 id_core_set_postexe,
00093 id_core_hash_from_ary,
00094 id_core_hash_merge_ary,
00095 id_core_hash_merge_ptr,
00096 id_core_hash_merge_kwd,
00097 tPRESERVED_ID_END,
00098 tIntern,
00099 tMethodMissing,
00100 tLength,
00101 tSize,
00102 tGets,
00103 tSucc,
00104 tEach,
00105 tProc,
00106 tLambda,
00107 tSend,
00108 t__send__,
00109 tInitialize,
00110 tInitialize_copy,
00111 tInitialize_clone,
00112 tInitialize_dup,
00113 tUScore,
00114 #define TOKEN2LOCALID(n) id##n = ((t##n<<ID_SCOPE_SHIFT)|ID_LOCAL)
00115 TOKEN2LOCALID(Intern),
00116 TOKEN2LOCALID(MethodMissing),
00117 TOKEN2LOCALID(Length),
00118 TOKEN2LOCALID(Size),
00119 TOKEN2LOCALID(Gets),
00120 TOKEN2LOCALID(Succ),
00121 TOKEN2LOCALID(Each),
00122 TOKEN2LOCALID(Proc),
00123 TOKEN2LOCALID(Lambda),
00124 TOKEN2LOCALID(Send),
00125 TOKEN2LOCALID(__send__),
00126 TOKEN2LOCALID(Initialize),
00127 TOKEN2LOCALID(Initialize_copy),
00128 TOKEN2LOCALID(Initialize_clone),
00129 TOKEN2LOCALID(Initialize_dup),
00130 TOKEN2LOCALID(UScore),
00131 tLAST_OP_ID = tPRESERVED_ID_END-1,
00132 idLAST_OP_ID = tLAST_OP_ID >> ID_SCOPE_SHIFT
00133 };
00134
00135 #endif
00136