2008-10-19 16:12:53 +04:00
|
|
|
/* DO NOT EDIT THIS FILE DIRECTLY */
|
2007-11-16 04:30:29 +03:00
|
|
|
/**********************************************************************
|
|
|
|
|
2008-12-09 10:14:13 +03:00
|
|
|
id.h -
|
2007-11-16 04:30:29 +03:00
|
|
|
|
2008-12-24 23:05:12 +03:00
|
|
|
$Author: nobu $
|
|
|
|
created at: Sun Oct 19 21:12:51 2008
|
2007-11-16 04:30:29 +03:00
|
|
|
|
|
|
|
Copyright (C) 2007 Koichi Sasada
|
|
|
|
|
|
|
|
**********************************************************************/
|
|
|
|
|
2008-01-18 11:56:11 +03:00
|
|
|
#ifndef RUBY_ID_H
|
|
|
|
#define RUBY_ID_H
|
|
|
|
|
2008-08-14 12:57:07 +04:00
|
|
|
#define ID_SCOPE_SHIFT 3
|
|
|
|
#define ID_SCOPE_MASK 0x07
|
|
|
|
#define ID_LOCAL 0x00
|
|
|
|
#define ID_INSTANCE 0x01
|
|
|
|
#define ID_GLOBAL 0x03
|
|
|
|
#define ID_ATTRSET 0x04
|
|
|
|
#define ID_CONST 0x05
|
|
|
|
#define ID_CLASS 0x06
|
|
|
|
#define ID_JUNK 0x07
|
|
|
|
#define ID_INTERNAL ID_JUNK
|
|
|
|
|
2008-10-17 14:46:23 +04:00
|
|
|
#ifdef USE_PARSE_H
|
2008-08-13 09:00:26 +04:00
|
|
|
#include "parse.h"
|
2008-10-17 14:46:23 +04:00
|
|
|
#endif
|
2008-08-13 09:00:26 +04:00
|
|
|
|
2008-08-14 12:57:07 +04:00
|
|
|
#define symIFUNC ID2SYM(idIFUNC)
|
|
|
|
#define symCFUNC ID2SYM(idCFUNC)
|
2007-11-16 04:30:29 +03:00
|
|
|
|
2008-12-24 23:05:12 +03:00
|
|
|
#if !defined tLAST_TOKEN && defined YYTOKENTYPE
|
|
|
|
#define tLAST_TOKEN tLAST_TOKEN
|
|
|
|
#endif
|
|
|
|
|
2008-08-13 09:00:26 +04:00
|
|
|
enum ruby_method_ids {
|
2008-12-24 23:05:12 +03:00
|
|
|
#ifndef tLAST_TOKEN
|
2008-10-17 15:56:11 +04:00
|
|
|
tUPLUS = 321,
|
|
|
|
tUMINUS = 322,
|
|
|
|
tPOW = 323,
|
|
|
|
tCMP = 324,
|
|
|
|
tEQ = 325,
|
|
|
|
tEQQ = 326,
|
|
|
|
tNEQ = 327,
|
|
|
|
tGEQ = 328,
|
|
|
|
tLEQ = 329,
|
|
|
|
tANDOP = 330,
|
|
|
|
tOROP = 331,
|
|
|
|
tMATCH = 332,
|
|
|
|
tNMATCH = 333,
|
|
|
|
tDOT2 = 334,
|
|
|
|
tDOT3 = 335,
|
|
|
|
tAREF = 336,
|
|
|
|
tASET = 337,
|
|
|
|
tLSHFT = 338,
|
|
|
|
tRSHFT = 339,
|
|
|
|
tLAMBDA = 352,
|
|
|
|
idNULL = 365,
|
|
|
|
idRespond_to = 366,
|
|
|
|
idIFUNC = 367,
|
|
|
|
idCFUNC = 368,
|
|
|
|
idThrowState = 369,
|
|
|
|
id_core_set_method_alias = 370,
|
|
|
|
id_core_set_variable_alias = 371,
|
|
|
|
id_core_undef_method = 372,
|
|
|
|
id_core_define_method = 373,
|
|
|
|
id_core_define_singleton_method = 374,
|
|
|
|
id_core_set_postexe = 375,
|
|
|
|
tLAST_TOKEN = 376,
|
2008-10-17 14:46:23 +04:00
|
|
|
#endif
|
2008-08-13 09:00:26 +04:00
|
|
|
idPLUS = '+',
|
|
|
|
idMINUS = '-',
|
|
|
|
idMULT = '*',
|
|
|
|
idDIV = '/',
|
|
|
|
idMOD = '%',
|
|
|
|
idLT = '<',
|
|
|
|
idLTLT = tLSHFT,
|
|
|
|
idLE = tLEQ,
|
|
|
|
idGT = '>',
|
|
|
|
idGE = tGEQ,
|
|
|
|
idEq = tEQ,
|
|
|
|
idEqq = tEQQ,
|
|
|
|
idNeq = tNEQ,
|
|
|
|
idNot = '!',
|
|
|
|
idBackquote = '`',
|
|
|
|
idEqTilde = tMATCH,
|
|
|
|
idAREF = tAREF,
|
|
|
|
idASET = tASET,
|
2008-08-14 12:57:07 +04:00
|
|
|
idLAST_TOKEN = tLAST_TOKEN >> ID_SCOPE_SHIFT,
|
|
|
|
tIntern,
|
|
|
|
tMethodMissing,
|
|
|
|
tLength,
|
|
|
|
tGets,
|
|
|
|
tSucc,
|
|
|
|
tEach,
|
|
|
|
tLambda,
|
|
|
|
tSend,
|
|
|
|
t__send__,
|
|
|
|
tInitialize,
|
|
|
|
#if SUPPORT_JOKE
|
|
|
|
tBitblt,
|
|
|
|
tAnswer,
|
|
|
|
#endif
|
2008-10-17 14:46:23 +04:00
|
|
|
tLAST_ID,
|
|
|
|
#define TOKEN2ID(n) id##n = ((t##n<<ID_SCOPE_SHIFT)|ID_LOCAL)
|
2008-10-24 16:50:35 +04:00
|
|
|
#if SUPPORT_JOKE
|
|
|
|
TOKEN2ID(Bitblt),
|
|
|
|
TOKEN2ID(Answer),
|
|
|
|
#endif
|
2008-10-17 14:46:23 +04:00
|
|
|
TOKEN2ID(Intern),
|
|
|
|
TOKEN2ID(MethodMissing),
|
|
|
|
TOKEN2ID(Length),
|
|
|
|
TOKEN2ID(Gets),
|
|
|
|
TOKEN2ID(Succ),
|
|
|
|
TOKEN2ID(Each),
|
|
|
|
TOKEN2ID(Lambda),
|
|
|
|
TOKEN2ID(Send),
|
|
|
|
TOKEN2ID(__send__),
|
2008-10-24 14:24:01 +04:00
|
|
|
TOKEN2ID(Initialize)
|
2008-10-17 14:46:23 +04:00
|
|
|
};
|
2008-07-01 07:05:58 +04:00
|
|
|
|
2008-12-24 23:05:12 +03:00
|
|
|
#ifdef tLAST_TOKEN
|
2008-12-24 23:53:06 +03:00
|
|
|
struct ruby_method_ids_check {
|
2008-12-24 23:05:12 +03:00
|
|
|
#define ruby_method_id_check_for(name, value) \
|
2008-12-24 23:53:06 +03:00
|
|
|
int checking_for_##name[name == value ? 1 : -1]
|
2008-12-24 23:05:12 +03:00
|
|
|
ruby_method_id_check_for(tUPLUS, 321);
|
|
|
|
ruby_method_id_check_for(tUMINUS, 322);
|
|
|
|
ruby_method_id_check_for(tPOW, 323);
|
|
|
|
ruby_method_id_check_for(tCMP, 324);
|
|
|
|
ruby_method_id_check_for(tEQ, 325);
|
|
|
|
ruby_method_id_check_for(tEQQ, 326);
|
|
|
|
ruby_method_id_check_for(tNEQ, 327);
|
|
|
|
ruby_method_id_check_for(tGEQ, 328);
|
|
|
|
ruby_method_id_check_for(tLEQ, 329);
|
|
|
|
ruby_method_id_check_for(tANDOP, 330);
|
|
|
|
ruby_method_id_check_for(tOROP, 331);
|
|
|
|
ruby_method_id_check_for(tMATCH, 332);
|
|
|
|
ruby_method_id_check_for(tNMATCH, 333);
|
|
|
|
ruby_method_id_check_for(tDOT2, 334);
|
|
|
|
ruby_method_id_check_for(tDOT3, 335);
|
|
|
|
ruby_method_id_check_for(tAREF, 336);
|
|
|
|
ruby_method_id_check_for(tASET, 337);
|
|
|
|
ruby_method_id_check_for(tLSHFT, 338);
|
|
|
|
ruby_method_id_check_for(tRSHFT, 339);
|
|
|
|
ruby_method_id_check_for(tLAMBDA, 352);
|
|
|
|
ruby_method_id_check_for(idNULL, 365);
|
|
|
|
ruby_method_id_check_for(idRespond_to, 366);
|
|
|
|
ruby_method_id_check_for(idIFUNC, 367);
|
|
|
|
ruby_method_id_check_for(idCFUNC, 368);
|
|
|
|
ruby_method_id_check_for(idThrowState, 369);
|
|
|
|
ruby_method_id_check_for(id_core_set_method_alias, 370);
|
|
|
|
ruby_method_id_check_for(id_core_set_variable_alias, 371);
|
|
|
|
ruby_method_id_check_for(id_core_undef_method, 372);
|
|
|
|
ruby_method_id_check_for(id_core_define_method, 373);
|
|
|
|
ruby_method_id_check_for(id_core_define_singleton_method, 374);
|
|
|
|
ruby_method_id_check_for(id_core_set_postexe, 375);
|
|
|
|
ruby_method_id_check_for(tLAST_TOKEN, 376);
|
2008-12-24 23:53:06 +03:00
|
|
|
};
|
2008-12-24 23:05:12 +03:00
|
|
|
#endif
|
|
|
|
|
2008-01-18 11:56:11 +03:00
|
|
|
#endif /* RUBY_ID_H */
|