Ruby  2.5.0dev(2017-10-22revision60238)
id.c
Go to the documentation of this file.
1 /* DO NOT EDIT THIS FILE DIRECTLY */
2 /**********************************************************************
3 
4  id.c -
5 
6  $Author$
7  created at: Wed Dec 5 02:36:10 2012
8 
9  Copyright (C) 2004-2007 Koichi Sasada
10 
11 **********************************************************************/
12 
13 #define tDOT2 RUBY_TOKEN(DOT2)
14 #define tDOT3 RUBY_TOKEN(DOT3)
15 #define tUPLUS RUBY_TOKEN(UPLUS)
16 #define tUMINUS RUBY_TOKEN(UMINUS)
17 #define tPOW RUBY_TOKEN(POW)
18 #define tCMP RUBY_TOKEN(CMP)
19 #define tLSHFT RUBY_TOKEN(LSHFT)
20 #define tRSHFT RUBY_TOKEN(RSHFT)
21 #define tLEQ RUBY_TOKEN(LEQ)
22 #define tGEQ RUBY_TOKEN(GEQ)
23 #define tEQ RUBY_TOKEN(EQ)
24 #define tEQQ RUBY_TOKEN(EQQ)
25 #define tNEQ RUBY_TOKEN(NEQ)
26 #define tMATCH RUBY_TOKEN(MATCH)
27 #define tNMATCH RUBY_TOKEN(NMATCH)
28 #define tAREF RUBY_TOKEN(AREF)
29 #define tASET RUBY_TOKEN(ASET)
30 #define tCOLON2 RUBY_TOKEN(COLON2)
31 #define tANDOP RUBY_TOKEN(ANDOP)
32 #define tOROP RUBY_TOKEN(OROP)
33 #define tANDDOT RUBY_TOKEN(ANDDOT)
34 
35 static const struct {
36  unsigned short token;
37  const char name[3], term;
38 } op_tbl[] = {
39  {tDOT2, ".."},
40  {tDOT3, "..."},
41  {tUPLUS, "+@"},
42  {tUMINUS, "-@"},
43  {tPOW, "**"},
44  {tCMP, "<=>"},
45  {tLSHFT, "<<"},
46  {tRSHFT, ">>"},
47  {tLEQ, "<="},
48  {tGEQ, ">="},
49  {tEQ, "=="},
50  {tEQQ, "==="},
51  {tNEQ, "!="},
52  {tMATCH, "=~"},
53  {tNMATCH, "!~"},
54  {tAREF, "[]"},
55  {tASET, "[]="},
56  {tCOLON2, "::"},
57  {tANDOP, "&&"},
58  {tOROP, "||"},
59  {tANDDOT, "&."},
60 };
61 
62 static void
63 Init_id(void)
64 {
65 #undef rb_intern
66 #define rb_intern(str) rb_intern_const(str)
68 
69  REGISTER_SYMID(idMax, "max");
70  REGISTER_SYMID(idMin, "min");
71  REGISTER_SYMID(idFreeze, "freeze");
72  REGISTER_SYMID(idInspect, "inspect");
73  REGISTER_SYMID(idIntern, "intern");
74  REGISTER_SYMID(idObject_id, "object_id");
75  REGISTER_SYMID(idConst_missing, "const_missing");
76  REGISTER_SYMID(idMethodMissing, "method_missing");
77  REGISTER_SYMID(idMethod_added, "method_added");
78  REGISTER_SYMID(idSingleton_method_added, "singleton_method_added");
79  REGISTER_SYMID(idMethod_removed, "method_removed");
80  REGISTER_SYMID(idSingleton_method_removed, "singleton_method_removed");
81  REGISTER_SYMID(idMethod_undefined, "method_undefined");
82  REGISTER_SYMID(idSingleton_method_undefined, "singleton_method_undefined");
83  REGISTER_SYMID(idLength, "length");
84  REGISTER_SYMID(idSize, "size");
85  REGISTER_SYMID(idGets, "gets");
86  REGISTER_SYMID(idSucc, "succ");
87  REGISTER_SYMID(idEach, "each");
88  REGISTER_SYMID(idProc, "proc");
89  REGISTER_SYMID(idLambda, "lambda");
90  REGISTER_SYMID(idSend, "send");
91  REGISTER_SYMID(id__send__, "__send__");
92  REGISTER_SYMID(id__attached__, "__attached__");
93  REGISTER_SYMID(idInitialize, "initialize");
94  REGISTER_SYMID(idInitialize_copy, "initialize_copy");
95  REGISTER_SYMID(idInitialize_clone, "initialize_clone");
96  REGISTER_SYMID(idInitialize_dup, "initialize_dup");
97  REGISTER_SYMID(idTo_int, "to_int");
98  REGISTER_SYMID(idTo_ary, "to_ary");
99  REGISTER_SYMID(idTo_str, "to_str");
100  REGISTER_SYMID(idTo_sym, "to_sym");
101  REGISTER_SYMID(idTo_hash, "to_hash");
102  REGISTER_SYMID(idTo_proc, "to_proc");
103  REGISTER_SYMID(idTo_io, "to_io");
104  REGISTER_SYMID(idTo_a, "to_a");
105  REGISTER_SYMID(idTo_s, "to_s");
106  REGISTER_SYMID(idTo_i, "to_i");
107  REGISTER_SYMID(idTo_r, "to_r");
108  REGISTER_SYMID(idBt, "bt");
109  REGISTER_SYMID(idBt_locations, "bt_locations");
110  REGISTER_SYMID(idCall, "call");
111  REGISTER_SYMID(idMesg, "mesg");
112  REGISTER_SYMID(idException, "exception");
113  REGISTER_SYMID(idNOT, "not");
114  REGISTER_SYMID(idAND, "and");
115  REGISTER_SYMID(idOR, "or");
116  REGISTER_SYMID(idUScore, "_");
117  REGISTER_SYMID(idNULL, ""/*NULL*/"");
118  REGISTER_SYMID(idEmptyP, "empty?");
119  REGISTER_SYMID(idEqlP, "eql?");
120  REGISTER_SYMID(idRespond_to, "respond_to?");
121  REGISTER_SYMID(idRespond_to_missing, "respond_to_missing?");
122  REGISTER_SYMID(idIFUNC, "<IFUNC>");
123  REGISTER_SYMID(idCFUNC, "<CFUNC>");
124  REGISTER_SYMID(id_core_set_method_alias, "core#set_method_alias");
125  REGISTER_SYMID(id_core_set_variable_alias, "core#set_variable_alias");
126  REGISTER_SYMID(id_core_undef_method, "core#undef_method");
127  REGISTER_SYMID(id_core_define_method, "core#define_method");
128  REGISTER_SYMID(id_core_define_singleton_method, "core#define_singleton_method");
129  REGISTER_SYMID(id_core_set_postexe, "core#set_postexe");
130  REGISTER_SYMID(id_core_hash_from_ary, "core#hash_from_ary");
131  REGISTER_SYMID(id_core_hash_merge_ary, "core#hash_merge_ary");
132  REGISTER_SYMID(id_core_hash_merge_ptr, "core#hash_merge_ptr");
133  REGISTER_SYMID(id_core_hash_merge_kwd, "core#hash_merge_kwd");
134  REGISTER_SYMID(idLASTLINE, "$_");
135  REGISTER_SYMID(idBACKREF, "$~");
136 }
#define REGISTER_SYMID(id, name)
Definition: symbol.c:28
#define tRSHFT
Definition: id.c:20
Definition: id.h:108
#define tANDOP
Definition: id.c:31
#define tNEQ
Definition: id.c:25
unsigned short token
Definition: id.c:36
#define tOROP
Definition: id.c:32
#define tEQ
Definition: id.c:23
#define tASET
Definition: id.c:29
const char term
Definition: id.c:37
Definition: id.h:110
#define tCOLON2
Definition: id.c:30
#define tMATCH
Definition: id.c:26
const char name[3]
Definition: id.c:37
#define tANDDOT
Definition: id.c:33
Definition: id.h:113
Definition: id.h:114
rb_encoding * rb_usascii_encoding(void)
Definition: encoding.c:1335
#define tAREF
Definition: id.c:28
#define tPOW
Definition: id.c:17
#define tLEQ
Definition: id.c:21
#define tDOT3
Definition: id.c:14
#define tCMP
Definition: id.c:18
Definition: id.h:109
#define tDOT2
Definition: id.c:13
#define tUPLUS
Definition: id.c:15
#define tLSHFT
Definition: id.c:19
#define tGEQ
Definition: id.c:22
#define tNMATCH
Definition: id.c:27
#define tUMINUS
Definition: id.c:16
#define tEQQ
Definition: id.c:24