Ruby: parse.h Source File

Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)

parse.h
Go to the documentation of this file.
1/* A Bison parser, made by GNU Bison 3.8.2. */
2
3/* Bison interface for Yacc-like parsers in C
4
5 Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
6 Inc.
7
8 This program is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <https://www.gnu.org/licenses/>. */
20
21/* As a special exception, you may create a larger work that contains
22 part or all of the Bison parser skeleton and distribute that work
23 under terms of your choice, so long as that work isn't itself a
24 parser generator using the skeleton or a modified version thereof
25 as a parser skeleton. Alternatively, if you modify or redistribute
26 the parser skeleton itself, you may (at your option) remove this
27 special exception, which will cause the skeleton and the resulting
28 Bison output files to be licensed under the GNU General Public
29 License without this special exception.
30
31 This special exception was added by the Free Software Foundation in
32 version 2.2 of Bison. */
33
34/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
35 especially those whose name start with YY_ or yy_. They are
36 private implementation details that can be changed or removed. */
37
38#ifndef YY_YY_Y_TAB_H_INCLUDED
39# define YY_YY_Y_TAB_H_INCLUDED
40/* Debug traces. */
41#ifndef YYDEBUG
42# define YYDEBUG 0
43#endif
44#if YYDEBUG
45extern int yydebug;
46#endif
47
48/* Token kinds. */
49#ifndef YYTOKENTYPE
50# define YYTOKENTYPE
51 enum yytokentype
52 {
53 YYEMPTY = -2,
54 END_OF_INPUT = 0, /* "end-of-input" */
55 YYerror = 256, /* error */
56 YYUNDEF = 257, /* "invalid token" */
57 keyword_class = 258, /* "`class'" */
58 keyword_module = 259, /* "`module'" */
59 keyword_def = 260, /* "`def'" */
60 keyword_undef = 261, /* "`undef'" */
61 keyword_begin = 262, /* "`begin'" */
62 keyword_rescue = 263, /* "`rescue'" */
63 keyword_ensure = 264, /* "`ensure'" */
64 keyword_end = 265, /* "`end'" */
65 keyword_if = 266, /* "`if'" */
66 keyword_unless = 267, /* "`unless'" */
67 keyword_then = 268, /* "`then'" */
68 keyword_elsif = 269, /* "`elsif'" */
69 keyword_else = 270, /* "`else'" */
70 keyword_case = 271, /* "`case'" */
71 keyword_when = 272, /* "`when'" */
72 keyword_while = 273, /* "`while'" */
73 keyword_until = 274, /* "`until'" */
74 keyword_for = 275, /* "`for'" */
75 keyword_break = 276, /* "`break'" */
76 keyword_next = 277, /* "`next'" */
77 keyword_redo = 278, /* "`redo'" */
78 keyword_retry = 279, /* "`retry'" */
79 keyword_in = 280, /* "`in'" */
80 keyword_do = 281, /* "`do'" */
81 keyword_do_cond = 282, /* "`do' for condition" */
82 keyword_do_block = 283, /* "`do' for block" */
83 keyword_do_LAMBDA = 284, /* "`do' for lambda" */
84 keyword_return = 285, /* "`return'" */
85 keyword_yield = 286, /* "`yield'" */
86 keyword_super = 287, /* "`super'" */
87 keyword_self = 288, /* "`self'" */
88 keyword_nil = 289, /* "`nil'" */
89 keyword_true = 290, /* "`true'" */
90 keyword_false = 291, /* "`false'" */
91 keyword_and = 292, /* "`and'" */
92 keyword_or = 293, /* "`or'" */
93 keyword_not = 294, /* "`not'" */
94 modifier_if = 295, /* "`if' modifier" */
95 modifier_unless = 296, /* "`unless' modifier" */
96 modifier_while = 297, /* "`while' modifier" */
97 modifier_until = 298, /* "`until' modifier" */
98 modifier_rescue = 299, /* "`rescue' modifier" */
99 keyword_alias = 300, /* "`alias'" */
100 keyword_defined = 301, /* "`defined?'" */
101 keyword_BEGIN = 302, /* "`BEGIN'" */
102 keyword_END = 303, /* "`END'" */
103 keyword__LINE__ = 304, /* "`__LINE__'" */
104 keyword__FILE__ = 305, /* "`__FILE__'" */
105 keyword__ENCODING__ = 306, /* "`__ENCODING__'" */
106 tIDENTIFIER = 307, /* "local variable or method" */
107 tFID = 308, /* "method" */
108 tGVAR = 309, /* "global variable" */
109 tIVAR = 310, /* "instance variable" */
110 tCONSTANT = 311, /* "constant" */
111 tCVAR = 312, /* "class variable" */
112 tLABEL = 313, /* "label" */
113 tINTEGER = 314, /* "integer literal" */
114 tFLOAT = 315, /* "float literal" */
115 tRATIONAL = 316, /* "rational literal" */
116 tIMAGINARY = 317, /* "imaginary literal" */
117 tCHAR = 318, /* "char literal" */
118 tNTH_REF = 319, /* "numbered reference" */
119 tBACK_REF = 320, /* "back reference" */
120 tSTRING_CONTENT = 321, /* "literal content" */
121 tREGEXP_END = 322, /* tREGEXP_END */
122 tSP = 323, /* "escaped space" */
123 tUPLUS = 132, /* "unary+" */
124 tUMINUS = 133, /* "unary-" */
125 tPOW = 134, /* "**" */
126 tCMP = 135, /* "<=>" */
127 tEQ = 140, /* "==" */
128 tEQQ = 141, /* "===" */
129 tNEQ = 142, /* "!=" */
130 tGEQ = 139, /* ">=" */
131 tLEQ = 138, /* "<=" */
132 tANDOP = 148, /* "&&" */
133 tOROP = 149, /* "||" */
134 tMATCH = 143, /* "=~" */
135 tNMATCH = 144, /* "!~" */
136 tDOT2 = 128, /* ".." */
137 tDOT3 = 129, /* "..." */
138 tBDOT2 = 130, /* "(.." */
139 tBDOT3 = 131, /* "(..." */
140 tAREF = 145, /* "[]" */
141 tASET = 146, /* "[]=" */
142 tLSHFT = 136, /* "<<" */
143 tRSHFT = 137, /* ">>" */
144 tANDDOT = 150, /* "&." */
145 tCOLON2 = 147, /* "::" */
146 tCOLON3 = 324, /* ":: at EXPR_BEG" */
147 tOP_ASGN = 325, /* "operator-assignment" */
148 tASSOC = 326, /* "=>" */
149 tLPAREN = 327, /* "(" */
150 tLPAREN_ARG = 328, /* "( arg" */
151 tRPAREN = 329, /* ")" */
152 tLBRACK = 330, /* "[" */
153 tLBRACE = 331, /* "{" */
154 tLBRACE_ARG = 332, /* "{ arg" */
155 tSTAR = 333, /* "*" */
156 tDSTAR = 334, /* "**arg" */
157 tAMPER = 335, /* "&" */
158 tLAMBDA = 336, /* "->" */
159 tSYMBEG = 337, /* "symbol literal" */
160 tSTRING_BEG = 338, /* "string literal" */
161 tXSTRING_BEG = 339, /* "backtick literal" */
162 tREGEXP_BEG = 340, /* "regexp literal" */
163 tWORDS_BEG = 341, /* "word list" */
164 tQWORDS_BEG = 342, /* "verbatim word list" */
165 tSYMBOLS_BEG = 343, /* "symbol list" */
166 tQSYMBOLS_BEG = 344, /* "verbatim symbol list" */
167 tSTRING_END = 345, /* "terminator" */
168 tSTRING_DEND = 346, /* "'}'" */
169 tSTRING_DBEG = 347, /* tSTRING_DBEG */
170 tSTRING_DVAR = 348, /* tSTRING_DVAR */
171 tLAMBEG = 349, /* tLAMBEG */
172 tLABEL_END = 350, /* tLABEL_END */
173 tLOWEST = 351, /* tLOWEST */
174 tUMINUS_NUM = 352, /* tUMINUS_NUM */
175 tLAST_TOKEN = 353 /* tLAST_TOKEN */
176 };
177 typedef enum yytokentype yytoken_kind_t;
178#endif
179
180/* Value type. */
181#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
182 union YYSTYPE
183{
184
185 VALUE val;
186 NODE *node;
187 ID id;
188 int num;
189 st_table *tbl;
190 const struct vtable *vars;
191 struct rb_strterm_struct *strterm;
192 struct lex_context ctxt;
193
194
195};
196 typedef union YYSTYPE YYSTYPE;
197# define YYSTYPE_IS_TRIVIAL 1
198# define YYSTYPE_IS_DECLARED 1
199#endif
200
201/* Location type. */
202#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
203 typedef struct YYLTYPE YYLTYPE;
204 struct YYLTYPE
205{
206 int first_line;
207 int first_column;
208 int last_line;
209 int last_column;
210};
211# define YYLTYPE_IS_DECLARED 1
212# define YYLTYPE_IS_TRIVIAL 1
213#endif
214
215
216
217
218int yyparse (struct parser_params *p);
219
220
221#endif /* !YY_YY_Y_TAB_H_INCLUDED */
yytokentype
yytokentype
Definition: parse.h:52
tBACK_REF
@ tBACK_REF
Definition: parse.h:119
tGEQ
@ tGEQ
Definition: parse.h:130
keyword_alias
@ keyword_alias
Definition: parse.h:99
tLPAREN_ARG
@ tLPAREN_ARG
Definition: parse.h:150
tBDOT3
@ tBDOT3
Definition: parse.h:139
tWORDS_BEG
@ tWORDS_BEG
Definition: parse.h:163
tAMPER
@ tAMPER
Definition: parse.h:157
keyword_do_cond
@ keyword_do_cond
Definition: parse.h:81
END_OF_INPUT
@ END_OF_INPUT
Definition: parse.h:54
keyword_do_block
@ keyword_do_block
Definition: parse.h:82
keyword_defined
@ keyword_defined
Definition: parse.h:100
tLPAREN
@ tLPAREN
Definition: parse.h:149
tASET
@ tASET
Definition: parse.h:141
tSTRING_DEND
@ tSTRING_DEND
Definition: parse.h:168
tNMATCH
@ tNMATCH
Definition: parse.h:135
tCHAR
@ tCHAR
Definition: parse.h:117
keyword_return
@ keyword_return
Definition: parse.h:84
tCONSTANT
@ tCONSTANT
Definition: parse.h:110
tMATCH
@ tMATCH
Definition: parse.h:134
tFLOAT
@ tFLOAT
Definition: parse.h:114
tANDDOT
@ tANDDOT
Definition: parse.h:144
tLABEL_END
@ tLABEL_END
Definition: parse.h:172
tNEQ
@ tNEQ
Definition: parse.h:129
tDOT2
@ tDOT2
Definition: parse.h:136
tEQ
@ tEQ
Definition: parse.h:127
keyword_module
@ keyword_module
Definition: parse.h:58
tLAMBEG
@ tLAMBEG
Definition: parse.h:171
tCOLON2
@ tCOLON2
Definition: parse.h:145
tCVAR
@ tCVAR
Definition: parse.h:111
tSTRING_DVAR
@ tSTRING_DVAR
Definition: parse.h:170
keyword_undef
@ keyword_undef
Definition: parse.h:60
tLEQ
@ tLEQ
Definition: parse.h:131
tLBRACE
@ tLBRACE
Definition: parse.h:153
keyword_redo
@ keyword_redo
Definition: parse.h:77
tSTRING_CONTENT
@ tSTRING_CONTENT
Definition: parse.h:120
keyword_false
@ keyword_false
Definition: parse.h:90
keyword_class
@ keyword_class
Definition: parse.h:57
keyword_ensure
@ keyword_ensure
Definition: parse.h:63
keyword_end
@ keyword_end
Definition: parse.h:64
keyword_and
@ keyword_and
Definition: parse.h:91
keyword_when
@ keyword_when
Definition: parse.h:71
YYerror
@ YYerror
Definition: parse.h:55
tASSOC
@ tASSOC
Definition: parse.h:148
keyword_retry
@ keyword_retry
Definition: parse.h:78
tSYMBOLS_BEG
@ tSYMBOLS_BEG
Definition: parse.h:165
tLBRACE_ARG
@ tLBRACE_ARG
Definition: parse.h:154
YYEMPTY
@ YYEMPTY
Definition: parse.h:53
tREGEXP_END
@ tREGEXP_END
Definition: parse.h:121
keyword_or
@ keyword_or
Definition: parse.h:92
keyword__ENCODING__
@ keyword__ENCODING__
Definition: parse.h:105
keyword_do
@ keyword_do
Definition: parse.h:80
keyword_rescue
@ keyword_rescue
Definition: parse.h:62
keyword_END
@ keyword_END
Definition: parse.h:102
tLSHFT
@ tLSHFT
Definition: parse.h:142
tUMINUS
@ tUMINUS
Definition: parse.h:124
tBDOT2
@ tBDOT2
Definition: parse.h:138
keyword_next
@ keyword_next
Definition: parse.h:76
modifier_if
@ modifier_if
Definition: parse.h:94
tLOWEST
@ tLOWEST
Definition: parse.h:173
tSYMBEG
@ tSYMBEG
Definition: parse.h:159
keyword_nil
@ keyword_nil
Definition: parse.h:88
tLABEL
@ tLABEL
Definition: parse.h:112
tSTAR
@ tSTAR
Definition: parse.h:155
tCMP
@ tCMP
Definition: parse.h:126
keyword_if
@ keyword_if
Definition: parse.h:65
keyword_BEGIN
@ keyword_BEGIN
Definition: parse.h:101
tIMAGINARY
@ tIMAGINARY
Definition: parse.h:116
tRSHFT
@ tRSHFT
Definition: parse.h:143
tSTRING_DBEG
@ tSTRING_DBEG
Definition: parse.h:169
tNTH_REF
@ tNTH_REF
Definition: parse.h:118
tINTEGER
@ tINTEGER
Definition: parse.h:113
tSTRING_BEG
@ tSTRING_BEG
Definition: parse.h:160
tXSTRING_BEG
@ tXSTRING_BEG
Definition: parse.h:161
tIVAR
@ tIVAR
Definition: parse.h:109
keyword_then
@ keyword_then
Definition: parse.h:67
YYUNDEF
@ YYUNDEF
Definition: parse.h:56
modifier_while
@ modifier_while
Definition: parse.h:96
tQSYMBOLS_BEG
@ tQSYMBOLS_BEG
Definition: parse.h:166
keyword_def
@ keyword_def
Definition: parse.h:59
tDOT3
@ tDOT3
Definition: parse.h:137
keyword__FILE__
@ keyword__FILE__
Definition: parse.h:104
tIDENTIFIER
@ tIDENTIFIER
Definition: parse.h:106
keyword_super
@ keyword_super
Definition: parse.h:86
tOP_ASGN
@ tOP_ASGN
Definition: parse.h:147
keyword_while
@ keyword_while
Definition: parse.h:72
tGVAR
@ tGVAR
Definition: parse.h:108
tPOW
@ tPOW
Definition: parse.h:125
keyword_true
@ keyword_true
Definition: parse.h:89
keyword__LINE__
@ keyword__LINE__
Definition: parse.h:103
keyword_else
@ keyword_else
Definition: parse.h:69
tSTRING_END
@ tSTRING_END
Definition: parse.h:167
keyword_in
@ keyword_in
Definition: parse.h:79
modifier_unless
@ modifier_unless
Definition: parse.h:95
tEQQ
@ tEQQ
Definition: parse.h:128
tRATIONAL
@ tRATIONAL
Definition: parse.h:115
tUMINUS_NUM
@ tUMINUS_NUM
Definition: parse.h:174
keyword_unless
@ keyword_unless
Definition: parse.h:66
tDSTAR
@ tDSTAR
Definition: parse.h:156
tANDOP
@ tANDOP
Definition: parse.h:132
keyword_do_LAMBDA
@ keyword_do_LAMBDA
Definition: parse.h:83
tCOLON3
@ tCOLON3
Definition: parse.h:146
keyword_for
@ keyword_for
Definition: parse.h:74
modifier_rescue
@ modifier_rescue
Definition: parse.h:98
tFID
@ tFID
Definition: parse.h:107
keyword_not
@ keyword_not
Definition: parse.h:93
tAREF
@ tAREF
Definition: parse.h:140
keyword_begin
@ keyword_begin
Definition: parse.h:61
keyword_self
@ keyword_self
Definition: parse.h:87
tRPAREN
@ tRPAREN
Definition: parse.h:151
keyword_break
@ keyword_break
Definition: parse.h:75
keyword_until
@ keyword_until
Definition: parse.h:73
keyword_case
@ keyword_case
Definition: parse.h:70
tSP
@ tSP
Definition: parse.h:122
tOROP
@ tOROP
Definition: parse.h:133
keyword_yield
@ keyword_yield
Definition: parse.h:85
tLBRACK
@ tLBRACK
Definition: parse.h:152
tQWORDS_BEG
@ tQWORDS_BEG
Definition: parse.h:164
tREGEXP_BEG
@ tREGEXP_BEG
Definition: parse.h:162
modifier_until
@ modifier_until
Definition: parse.h:97
tLAST_TOKEN
@ tLAST_TOKEN
Definition: parse.h:175
tLAMBDA
@ tLAMBDA
Definition: parse.h:158
keyword_elsif
@ keyword_elsif
Definition: parse.h:68
tUPLUS
@ tUPLUS
Definition: parse.h:123
yytoken_kind_t
enum yytokentype yytoken_kind_t
Definition: parse.h:177
yyparse
#define yyparse
Definition: ripper.c:533
yydebug
#define yydebug
Definition: ripper.c:144
RNode
Definition: node.h:149
YYLTYPE
Definition: parse.h:205
YYLTYPE::last_line
int last_line
Definition: parse.h:208
YYLTYPE::first_column
int first_column
Definition: parse.h:207
YYLTYPE::first_line
int first_line
Definition: parse.h:206
YYLTYPE::last_column
int last_column
Definition: parse.h:209
lex_context
Definition: ripper.c:124
parser_params
Definition: ripper.c:317
rb_strterm_struct
Definition: ripper.c:818
st_table
Definition: st.h:79
vtable
Definition: ripper.c:254
YYSTYPE
Definition: parse.h:183
YYSTYPE::strterm
struct rb_strterm_struct * strterm
Definition: parse.h:191
YYSTYPE::id
ID id
Definition: parse.h:187
YYSTYPE::ctxt
struct lex_context ctxt
Definition: parse.h:192
YYSTYPE::val
VALUE val
Definition: parse.h:185
YYSTYPE::num
int num
Definition: parse.h:188
YYSTYPE::node
NODE * node
Definition: parse.h:186
YYSTYPE::tbl
st_table * tbl
Definition: parse.h:189
YYSTYPE::vars
const struct vtable * vars
Definition: parse.h:190
VALUE
unsigned long VALUE
Definition: value.h:38
ID
unsigned long ID
Definition: value.h:39