Ruby 2.7.0p0(2019-12-25revision647ee6f091eafcce70ffb75ddf7e121e192ab217)

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)
67 rb_encoding *enc = rb_usascii_encoding();
68
69 REGISTER_SYMID(idMax, "max");
70 REGISTER_SYMID(idMin, "min");
71 REGISTER_SYMID(idFreeze, "freeze");
72 REGISTER_SYMID(idNilP, "nil?");
73 REGISTER_SYMID(idInspect, "inspect");
74 REGISTER_SYMID(idIntern, "intern");
75 REGISTER_SYMID(idObject_id, "object_id");
76 REGISTER_SYMID(idConst_missing, "const_missing");
77 REGISTER_SYMID(idMethodMissing, "method_missing");
78 REGISTER_SYMID(idMethod_added, "method_added");
79 REGISTER_SYMID(idSingleton_method_added, "singleton_method_added");
80 REGISTER_SYMID(idMethod_removed, "method_removed");
81 REGISTER_SYMID(idSingleton_method_removed, "singleton_method_removed");
82 REGISTER_SYMID(idMethod_undefined, "method_undefined");
83 REGISTER_SYMID(idSingleton_method_undefined, "singleton_method_undefined");
84 REGISTER_SYMID(idLength, "length");
85 REGISTER_SYMID(idSize, "size");
86 REGISTER_SYMID(idGets, "gets");
87 REGISTER_SYMID(idSucc, "succ");
88 REGISTER_SYMID(idEach, "each");
89 REGISTER_SYMID(idProc, "proc");
90 REGISTER_SYMID(idLambda, "lambda");
91 REGISTER_SYMID(idSend, "send");
92 REGISTER_SYMID(id__send__, "__send__");
93 REGISTER_SYMID(id__attached__, "__attached__");
94 REGISTER_SYMID(idInitialize, "initialize");
95 REGISTER_SYMID(idInitialize_copy, "initialize_copy");
96 REGISTER_SYMID(idInitialize_clone, "initialize_clone");
97 REGISTER_SYMID(idInitialize_dup, "initialize_dup");
98 REGISTER_SYMID(idTo_int, "to_int");
99 REGISTER_SYMID(idTo_ary, "to_ary");
100 REGISTER_SYMID(idTo_str, "to_str");
101 REGISTER_SYMID(idTo_sym, "to_sym");
102 REGISTER_SYMID(idTo_hash, "to_hash");
103 REGISTER_SYMID(idTo_proc, "to_proc");
104 REGISTER_SYMID(idTo_io, "to_io");
105 REGISTER_SYMID(idTo_a, "to_a");
106 REGISTER_SYMID(idTo_s, "to_s");
107 REGISTER_SYMID(idTo_i, "to_i");
108 REGISTER_SYMID(idTo_f, "to_f");
109 REGISTER_SYMID(idTo_r, "to_r");
110 REGISTER_SYMID(idBt, "bt");
111 REGISTER_SYMID(idBt_locations, "bt_locations");
112 REGISTER_SYMID(idCall, "call");
113 REGISTER_SYMID(idMesg, "mesg");
114 REGISTER_SYMID(idException, "exception");
115 REGISTER_SYMID(idLocals, "locals");
116 REGISTER_SYMID(idNOT, "not");
117 REGISTER_SYMID(idAND, "and");
118 REGISTER_SYMID(idOR, "or");
119 REGISTER_SYMID(idDiv, "div");
120 REGISTER_SYMID(idDivmod, "divmod");
121 REGISTER_SYMID(idFdiv, "fdiv");
122 REGISTER_SYMID(idQuo, "quo");
123 REGISTER_SYMID(idName, "name");
124 REGISTER_SYMID(idNil, "nil");
125 REGISTER_SYMID(idUScore, "_");
126 REGISTER_SYMID(idNUMPARAM_1, "_1");
127 REGISTER_SYMID(idNUMPARAM_2, "_2");
128 REGISTER_SYMID(idNUMPARAM_3, "_3");
129 REGISTER_SYMID(idNUMPARAM_4, "_4");
130 REGISTER_SYMID(idNUMPARAM_5, "_5");
131 REGISTER_SYMID(idNUMPARAM_6, "_6");
132 REGISTER_SYMID(idNUMPARAM_7, "_7");
133 REGISTER_SYMID(idNUMPARAM_8, "_8");
134 REGISTER_SYMID(idNUMPARAM_9, "_9");
135 REGISTER_SYMID(idNULL, ""/*NULL*/"");
136 REGISTER_SYMID(idEmptyP, "empty?");
137 REGISTER_SYMID(idEqlP, "eql?");
138 REGISTER_SYMID(idRespond_to, "respond_to?");
139 REGISTER_SYMID(idRespond_to_missing, "respond_to_missing?");
140 REGISTER_SYMID(idIFUNC, "<IFUNC>");
141 REGISTER_SYMID(idCFUNC, "<CFUNC>");
142 REGISTER_SYMID(id_core_set_method_alias, "core#set_method_alias");
143 REGISTER_SYMID(id_core_set_variable_alias, "core#set_variable_alias");
144 REGISTER_SYMID(id_core_undef_method, "core#undef_method");
145 REGISTER_SYMID(id_core_define_method, "core#define_method");
146 REGISTER_SYMID(id_core_define_singleton_method, "core#define_singleton_method");
147 REGISTER_SYMID(id_core_set_postexe, "core#set_postexe");
148 REGISTER_SYMID(id_core_hash_merge_ptr, "core#hash_merge_ptr");
149 REGISTER_SYMID(id_core_hash_merge_kwd, "core#hash_merge_kwd");
150 REGISTER_SYMID(id_core_raise, "core#raise");
151 REGISTER_SYMID(idLASTLINE, "$_");
152 REGISTER_SYMID(idBACKREF, "$~");
153 REGISTER_SYMID(idERROR_INFO, "$!");
154 }
idNULL
@ idNULL
Definition: id.h:113
idTo_int
@ idTo_int
Definition: rb_mjit_min_header-2.7.0.h:8713
tDOT2
#define tDOT2
Definition: id.c:13
idMethod_added
@ idMethod_added
Definition: rb_mjit_min_header-2.7.0.h:8693
name
const char name[3]
Definition: id.c:37
idTo_s
@ idTo_s
Definition: rb_mjit_min_header-2.7.0.h:8721
tGEQ
#define tGEQ
Definition: id.c:22
tOROP
#define tOROP
Definition: id.c:32
idMax
@ idMax
Definition: rb_mjit_min_header-2.7.0.h:8685
idEach
@ idEach
Definition: rb_mjit_min_header-2.7.0.h:8703
idNilP
@ idNilP
Definition: id.h:112
idInitialize_copy
@ idInitialize_copy
Definition: rb_mjit_min_header-2.7.0.h:8710
idRespond_to_missing
@ idRespond_to_missing
Definition: id.h:117
id_core_raise
@ id_core_raise
Definition: id.h:128
idTo_io
@ idTo_io
Definition: rb_mjit_min_header-2.7.0.h:8719
idIntern
@ idIntern
Definition: rb_mjit_min_header-2.7.0.h:8689
idNOT
@ idNOT
Definition: rb_mjit_min_header-2.7.0.h:8731
REGISTER_SYMID
#define REGISTER_SYMID(id, name)
Definition: symbol.c:32
idNUMPARAM_7
@ idNUMPARAM_7
Definition: rb_mjit_min_header-2.7.0.h:8747
idTo_ary
@ idTo_ary
Definition: rb_mjit_min_header-2.7.0.h:8714
idNUMPARAM_5
@ idNUMPARAM_5
Definition: rb_mjit_min_header-2.7.0.h:8745
idInitialize_dup
@ idInitialize_dup
Definition: rb_mjit_min_header-2.7.0.h:8712
tEQQ
#define tEQQ
Definition: id.c:24
tAREF
#define tAREF
Definition: id.c:28
idSucc
@ idSucc
Definition: rb_mjit_min_header-2.7.0.h:8702
tCOLON2
#define tCOLON2
Definition: id.c:30
idGets
@ idGets
Definition: rb_mjit_min_header-2.7.0.h:8701
idAND
@ idAND
Definition: rb_mjit_min_header-2.7.0.h:8732
idException
@ idException
Definition: rb_mjit_min_header-2.7.0.h:8729
idConst_missing
@ idConst_missing
Definition: rb_mjit_min_header-2.7.0.h:8691
idNUMPARAM_1
@ idNUMPARAM_1
Definition: rb_mjit_min_header-2.7.0.h:8741
idInitialize
@ idInitialize
Definition: rb_mjit_min_header-2.7.0.h:8709
idCall
@ idCall
Definition: rb_mjit_min_header-2.7.0.h:8727
tMATCH
#define tMATCH
Definition: id.c:26
id_core_undef_method
@ id_core_undef_method
Definition: id.h:122
idSend
@ idSend
Definition: rb_mjit_min_header-2.7.0.h:8706
idTo_str
@ idTo_str
Definition: rb_mjit_min_header-2.7.0.h:8715
idObject_id
@ idObject_id
Definition: rb_mjit_min_header-2.7.0.h:8690
tUPLUS
#define tUPLUS
Definition: id.c:15
id_core_hash_merge_kwd
@ id_core_hash_merge_kwd
Definition: id.h:127
idSingleton_method_added
@ idSingleton_method_added
Definition: rb_mjit_min_header-2.7.0.h:8694
idMesg
@ idMesg
Definition: rb_mjit_min_header-2.7.0.h:8728
idInitialize_clone
@ idInitialize_clone
Definition: rb_mjit_min_header-2.7.0.h:8711
idNil
@ idNil
Definition: rb_mjit_min_header-2.7.0.h:8739
id_core_define_method
@ id_core_define_method
Definition: id.h:123
id_core_set_method_alias
@ id_core_set_method_alias
Definition: id.h:120
idDivmod
@ idDivmod
Definition: rb_mjit_min_header-2.7.0.h:8735
tNMATCH
#define tNMATCH
Definition: id.c:27
rb_encoding
const typedef OnigEncodingType rb_encoding
Definition: encoding.h:115
token
unsigned short token
Definition: id.c:36
idNUMPARAM_8
@ idNUMPARAM_8
Definition: rb_mjit_min_header-2.7.0.h:8748
tLEQ
#define tLEQ
Definition: id.c:21
idLocals
@ idLocals
Definition: rb_mjit_min_header-2.7.0.h:8730
idEmptyP
@ idEmptyP
Definition: id.h:114
idEqlP
@ idEqlP
Definition: id.h:115
id__send__
@ id__send__
Definition: rb_mjit_min_header-2.7.0.h:8707
tRSHFT
#define tRSHFT
Definition: id.c:20
idInspect
@ idInspect
Definition: rb_mjit_min_header-2.7.0.h:8688
idSingleton_method_removed
@ idSingleton_method_removed
Definition: rb_mjit_min_header-2.7.0.h:8696
idSize
@ idSize
Definition: rb_mjit_min_header-2.7.0.h:8700
idOR
@ idOR
Definition: rb_mjit_min_header-2.7.0.h:8733
term
const char term
Definition: id.c:37
idNUMPARAM_9
@ idNUMPARAM_9
Definition: rb_mjit_min_header-2.7.0.h:8749
tANDOP
#define tANDOP
Definition: id.c:31
idQuo
@ idQuo
Definition: rb_mjit_min_header-2.7.0.h:8737
tCMP
#define tCMP
Definition: id.c:18
idUScore
@ idUScore
Definition: rb_mjit_min_header-2.7.0.h:8740
id_core_set_postexe
@ id_core_set_postexe
Definition: id.h:125
idTo_hash
@ idTo_hash
Definition: rb_mjit_min_header-2.7.0.h:8717
idNUMPARAM_3
@ idNUMPARAM_3
Definition: rb_mjit_min_header-2.7.0.h:8743
tLSHFT
#define tLSHFT
Definition: id.c:19
idTo_a
@ idTo_a
Definition: rb_mjit_min_header-2.7.0.h:8720
idIFUNC
@ idIFUNC
Definition: id.h:118
idTo_i
@ idTo_i
Definition: rb_mjit_min_header-2.7.0.h:8722
idLength
@ idLength
Definition: rb_mjit_min_header-2.7.0.h:8699
tUMINUS
#define tUMINUS
Definition: id.c:16
tEQ
#define tEQ
Definition: id.c:23
idFreeze
@ idFreeze
Definition: rb_mjit_min_header-2.7.0.h:8687
id_core_set_variable_alias
@ id_core_set_variable_alias
Definition: id.h:121
idDiv
@ idDiv
Definition: rb_mjit_min_header-2.7.0.h:8734
idLASTLINE
@ idLASTLINE
Definition: rb_mjit_min_header-2.7.0.h:8752
idBt_locations
@ idBt_locations
Definition: rb_mjit_min_header-2.7.0.h:8726
idMethodMissing
@ idMethodMissing
Definition: rb_mjit_min_header-2.7.0.h:8692
idTo_proc
@ idTo_proc
Definition: rb_mjit_min_header-2.7.0.h:8718
tNEQ
#define tNEQ
Definition: id.c:25
id_core_hash_merge_ptr
@ id_core_hash_merge_ptr
Definition: id.h:126
tPOW
#define tPOW
Definition: id.c:17
tASET
#define tASET
Definition: id.c:29
idTo_f
@ idTo_f
Definition: rb_mjit_min_header-2.7.0.h:8723
idNUMPARAM_6
@ idNUMPARAM_6
Definition: rb_mjit_min_header-2.7.0.h:8746
idERROR_INFO
@ idERROR_INFO
Definition: rb_mjit_min_header-2.7.0.h:8754
idMethod_removed
@ idMethod_removed
Definition: rb_mjit_min_header-2.7.0.h:8695
idProc
@ idProc
Definition: rb_mjit_min_header-2.7.0.h:8704
idMethod_undefined
@ idMethod_undefined
Definition: rb_mjit_min_header-2.7.0.h:8697
idTo_sym
@ idTo_sym
Definition: rb_mjit_min_header-2.7.0.h:8716
idNUMPARAM_2
@ idNUMPARAM_2
Definition: rb_mjit_min_header-2.7.0.h:8742
idBt
@ idBt
Definition: rb_mjit_min_header-2.7.0.h:8725
idBACKREF
@ idBACKREF
Definition: rb_mjit_min_header-2.7.0.h:8753
idRespond_to
@ idRespond_to
Definition: id.h:116
id_core_define_singleton_method
@ id_core_define_singleton_method
Definition: id.h:124
idCFUNC
@ idCFUNC
Definition: id.h:119
idName
@ idName
Definition: rb_mjit_min_header-2.7.0.h:8738
idSingleton_method_undefined
@ idSingleton_method_undefined
Definition: rb_mjit_min_header-2.7.0.h:8698
id__attached__
@ id__attached__
Definition: rb_mjit_min_header-2.7.0.h:8708
idLambda
@ idLambda
Definition: rb_mjit_min_header-2.7.0.h:8705
idTo_r
@ idTo_r
Definition: rb_mjit_min_header-2.7.0.h:8724
tDOT3
#define tDOT3
Definition: id.c:14
idFdiv
@ idFdiv
Definition: rb_mjit_min_header-2.7.0.h:8736
rb_usascii_encoding
rb_encoding * rb_usascii_encoding(void)
Definition: encoding.c:1340
idNUMPARAM_4
@ idNUMPARAM_4
Definition: rb_mjit_min_header-2.7.0.h:8744
idMin
@ idMin
Definition: rb_mjit_min_header-2.7.0.h:8686
tANDDOT
#define tANDDOT
Definition: id.c:33