graphql-c_parser 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,3311 @@
1
+ /* A Bison parser, made by GNU Bison 3.8.2. */
2
+
3
+ /* Bison implementation 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
+ /* C LALR(1) parser skeleton written by Richard Stallman, by
35
+ simplifying the original so-called "semantic" parser. */
36
+
37
+ /* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
38
+ especially those whose name start with YY_ or yy_. They are
39
+ private implementation details that can be changed or removed. */
40
+
41
+ /* All symbols defined below should begin with yy or YY, to avoid
42
+ infringing on user name space. This should be done even for local
43
+ variables, as they might otherwise be expanded by user macros.
44
+ There are some unavoidable exceptions within include files to
45
+ define necessary library symbols; they are noted "INFRINGES ON
46
+ USER NAME SPACE" below. */
47
+
48
+ /* Identify Bison output, and Bison version. */
49
+ #define YYBISON 30802
50
+
51
+ /* Bison version string. */
52
+ #define YYBISON_VERSION "3.8.2"
53
+
54
+ /* Skeleton name. */
55
+ #define YYSKELETON_NAME "yacc.c"
56
+
57
+ /* Pure parsers. */
58
+ #define YYPURE 2
59
+
60
+ /* Push parsers. */
61
+ #define YYPUSH 0
62
+
63
+ /* Pull parsers. */
64
+ #define YYPULL 1
65
+
66
+
67
+
68
+
69
+ /* First part of user prologue. */
70
+ #line 5 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
71
+
72
+ // C Declarations
73
+ #include <ruby.h>
74
+ #define YYSTYPE VALUE
75
+ int yylex(YYSTYPE *, VALUE, VALUE);
76
+ void yyerror(VALUE, VALUE, const char*);
77
+
78
+ static VALUE GraphQL_Language_Nodes_NONE;
79
+ static VALUE r_string_query;
80
+
81
+ #define MAKE_AST_NODE(node_class_name, nargs, ...) rb_funcall(GraphQL_Language_Nodes_##node_class_name, rb_intern("from_a"), nargs + 1, filename,__VA_ARGS__)
82
+
83
+ #define SETUP_NODE_CLASS_VARIABLE(node_class_name) static VALUE GraphQL_Language_Nodes_##node_class_name;
84
+
85
+ SETUP_NODE_CLASS_VARIABLE(Argument)
86
+ SETUP_NODE_CLASS_VARIABLE(Directive)
87
+ SETUP_NODE_CLASS_VARIABLE(Document)
88
+ SETUP_NODE_CLASS_VARIABLE(Enum)
89
+ SETUP_NODE_CLASS_VARIABLE(Field)
90
+ SETUP_NODE_CLASS_VARIABLE(FragmentDefinition)
91
+ SETUP_NODE_CLASS_VARIABLE(FragmentSpread)
92
+ SETUP_NODE_CLASS_VARIABLE(InlineFragment)
93
+ SETUP_NODE_CLASS_VARIABLE(InputObject)
94
+ SETUP_NODE_CLASS_VARIABLE(ListType)
95
+ SETUP_NODE_CLASS_VARIABLE(NonNullType)
96
+ SETUP_NODE_CLASS_VARIABLE(NullValue)
97
+ SETUP_NODE_CLASS_VARIABLE(OperationDefinition)
98
+ SETUP_NODE_CLASS_VARIABLE(TypeName)
99
+ SETUP_NODE_CLASS_VARIABLE(VariableDefinition)
100
+ SETUP_NODE_CLASS_VARIABLE(VariableIdentifier)
101
+
102
+ SETUP_NODE_CLASS_VARIABLE(ScalarTypeDefinition)
103
+ SETUP_NODE_CLASS_VARIABLE(ObjectTypeDefinition)
104
+ SETUP_NODE_CLASS_VARIABLE(InterfaceTypeDefinition)
105
+ SETUP_NODE_CLASS_VARIABLE(UnionTypeDefinition)
106
+ SETUP_NODE_CLASS_VARIABLE(EnumTypeDefinition)
107
+ SETUP_NODE_CLASS_VARIABLE(InputObjectTypeDefinition)
108
+ SETUP_NODE_CLASS_VARIABLE(EnumValueDefinition)
109
+ SETUP_NODE_CLASS_VARIABLE(DirectiveDefinition)
110
+ SETUP_NODE_CLASS_VARIABLE(DirectiveLocation)
111
+ SETUP_NODE_CLASS_VARIABLE(FieldDefinition)
112
+ SETUP_NODE_CLASS_VARIABLE(InputValueDefinition)
113
+ SETUP_NODE_CLASS_VARIABLE(SchemaDefinition)
114
+
115
+ SETUP_NODE_CLASS_VARIABLE(ScalarTypeExtension)
116
+ SETUP_NODE_CLASS_VARIABLE(ObjectTypeExtension)
117
+ SETUP_NODE_CLASS_VARIABLE(InterfaceTypeExtension)
118
+ SETUP_NODE_CLASS_VARIABLE(UnionTypeExtension)
119
+ SETUP_NODE_CLASS_VARIABLE(EnumTypeExtension)
120
+ SETUP_NODE_CLASS_VARIABLE(InputObjectTypeExtension)
121
+ SETUP_NODE_CLASS_VARIABLE(SchemaExtension)
122
+
123
+ #line 124 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
124
+
125
+ # ifndef YY_CAST
126
+ # ifdef __cplusplus
127
+ # define YY_CAST(Type, Val) static_cast<Type> (Val)
128
+ # define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
129
+ # else
130
+ # define YY_CAST(Type, Val) ((Type) (Val))
131
+ # define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
132
+ # endif
133
+ # endif
134
+ # ifndef YY_NULLPTR
135
+ # if defined __cplusplus
136
+ # if 201103L <= __cplusplus
137
+ # define YY_NULLPTR nullptr
138
+ # else
139
+ # define YY_NULLPTR 0
140
+ # endif
141
+ # else
142
+ # define YY_NULLPTR ((void*)0)
143
+ # endif
144
+ # endif
145
+
146
+
147
+ /* Debug traces. */
148
+ #ifndef YYDEBUG
149
+ # define YYDEBUG 0
150
+ #endif
151
+ #if YYDEBUG
152
+ extern int yydebug;
153
+ #endif
154
+
155
+ /* Token kinds. */
156
+ #ifndef YYTOKENTYPE
157
+ # define YYTOKENTYPE
158
+ enum yytokentype
159
+ {
160
+ YYEMPTY = -2,
161
+ YYEOF = 0, /* "end of file" */
162
+ YYerror = 256, /* error */
163
+ YYUNDEF = 257, /* "invalid token" */
164
+ AMP = 200, /* AMP */
165
+ BANG = 201, /* BANG */
166
+ COLON = 202, /* COLON */
167
+ DIRECTIVE = 203, /* DIRECTIVE */
168
+ DIR_SIGN = 204, /* DIR_SIGN */
169
+ ENUM = 205, /* ENUM */
170
+ ELLIPSIS = 206, /* ELLIPSIS */
171
+ EQUALS = 207, /* EQUALS */
172
+ EXTEND = 208, /* EXTEND */
173
+ FALSE_LITERAL = 209, /* FALSE_LITERAL */
174
+ FLOAT = 210, /* FLOAT */
175
+ FRAGMENT = 211, /* FRAGMENT */
176
+ IDENTIFIER = 212, /* IDENTIFIER */
177
+ INPUT = 213, /* INPUT */
178
+ IMPLEMENTS = 214, /* IMPLEMENTS */
179
+ INT = 215, /* INT */
180
+ INTERFACE = 216, /* INTERFACE */
181
+ LBRACKET = 217, /* LBRACKET */
182
+ LCURLY = 218, /* LCURLY */
183
+ LPAREN = 219, /* LPAREN */
184
+ MUTATION = 220, /* MUTATION */
185
+ NULL_LITERAL = 221, /* NULL_LITERAL */
186
+ ON = 222, /* ON */
187
+ PIPE = 223, /* PIPE */
188
+ QUERY = 224, /* QUERY */
189
+ RBRACKET = 225, /* RBRACKET */
190
+ RCURLY = 226, /* RCURLY */
191
+ REPEATABLE = 227, /* REPEATABLE */
192
+ RPAREN = 228, /* RPAREN */
193
+ SCALAR = 229, /* SCALAR */
194
+ SCHEMA = 230, /* SCHEMA */
195
+ STRING = 231, /* STRING */
196
+ SUBSCRIPTION = 232, /* SUBSCRIPTION */
197
+ TRUE_LITERAL = 233, /* TRUE_LITERAL */
198
+ TYPE_LITERAL = 234, /* TYPE_LITERAL */
199
+ UNION = 235, /* UNION */
200
+ VAR_SIGN = 236 /* VAR_SIGN */
201
+ };
202
+ typedef enum yytokentype yytoken_kind_t;
203
+ #endif
204
+ /* Token kinds. */
205
+ #define YYEMPTY -2
206
+ #define YYEOF 0
207
+ #define YYerror 256
208
+ #define YYUNDEF 257
209
+ #define AMP 200
210
+ #define BANG 201
211
+ #define COLON 202
212
+ #define DIRECTIVE 203
213
+ #define DIR_SIGN 204
214
+ #define ENUM 205
215
+ #define ELLIPSIS 206
216
+ #define EQUALS 207
217
+ #define EXTEND 208
218
+ #define FALSE_LITERAL 209
219
+ #define FLOAT 210
220
+ #define FRAGMENT 211
221
+ #define IDENTIFIER 212
222
+ #define INPUT 213
223
+ #define IMPLEMENTS 214
224
+ #define INT 215
225
+ #define INTERFACE 216
226
+ #define LBRACKET 217
227
+ #define LCURLY 218
228
+ #define LPAREN 219
229
+ #define MUTATION 220
230
+ #define NULL_LITERAL 221
231
+ #define ON 222
232
+ #define PIPE 223
233
+ #define QUERY 224
234
+ #define RBRACKET 225
235
+ #define RCURLY 226
236
+ #define REPEATABLE 227
237
+ #define RPAREN 228
238
+ #define SCALAR 229
239
+ #define SCHEMA 230
240
+ #define STRING 231
241
+ #define SUBSCRIPTION 232
242
+ #define TRUE_LITERAL 233
243
+ #define TYPE_LITERAL 234
244
+ #define UNION 235
245
+ #define VAR_SIGN 236
246
+
247
+ /* Value type. */
248
+ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
249
+ typedef int YYSTYPE;
250
+ # define YYSTYPE_IS_TRIVIAL 1
251
+ # define YYSTYPE_IS_DECLARED 1
252
+ #endif
253
+
254
+
255
+
256
+
257
+ int yyparse (VALUE parser, VALUE filename);
258
+
259
+
260
+
261
+ /* Symbol kind. */
262
+ enum yysymbol_kind_t
263
+ {
264
+ YYSYMBOL_YYEMPTY = -2,
265
+ YYSYMBOL_YYEOF = 0, /* "end of file" */
266
+ YYSYMBOL_YYerror = 1, /* error */
267
+ YYSYMBOL_YYUNDEF = 2, /* "invalid token" */
268
+ YYSYMBOL_AMP = 3, /* AMP */
269
+ YYSYMBOL_BANG = 4, /* BANG */
270
+ YYSYMBOL_COLON = 5, /* COLON */
271
+ YYSYMBOL_DIRECTIVE = 6, /* DIRECTIVE */
272
+ YYSYMBOL_DIR_SIGN = 7, /* DIR_SIGN */
273
+ YYSYMBOL_ENUM = 8, /* ENUM */
274
+ YYSYMBOL_ELLIPSIS = 9, /* ELLIPSIS */
275
+ YYSYMBOL_EQUALS = 10, /* EQUALS */
276
+ YYSYMBOL_EXTEND = 11, /* EXTEND */
277
+ YYSYMBOL_FALSE_LITERAL = 12, /* FALSE_LITERAL */
278
+ YYSYMBOL_FLOAT = 13, /* FLOAT */
279
+ YYSYMBOL_FRAGMENT = 14, /* FRAGMENT */
280
+ YYSYMBOL_IDENTIFIER = 15, /* IDENTIFIER */
281
+ YYSYMBOL_INPUT = 16, /* INPUT */
282
+ YYSYMBOL_IMPLEMENTS = 17, /* IMPLEMENTS */
283
+ YYSYMBOL_INT = 18, /* INT */
284
+ YYSYMBOL_INTERFACE = 19, /* INTERFACE */
285
+ YYSYMBOL_LBRACKET = 20, /* LBRACKET */
286
+ YYSYMBOL_LCURLY = 21, /* LCURLY */
287
+ YYSYMBOL_LPAREN = 22, /* LPAREN */
288
+ YYSYMBOL_MUTATION = 23, /* MUTATION */
289
+ YYSYMBOL_NULL_LITERAL = 24, /* NULL_LITERAL */
290
+ YYSYMBOL_ON = 25, /* ON */
291
+ YYSYMBOL_PIPE = 26, /* PIPE */
292
+ YYSYMBOL_QUERY = 27, /* QUERY */
293
+ YYSYMBOL_RBRACKET = 28, /* RBRACKET */
294
+ YYSYMBOL_RCURLY = 29, /* RCURLY */
295
+ YYSYMBOL_REPEATABLE = 30, /* REPEATABLE */
296
+ YYSYMBOL_RPAREN = 31, /* RPAREN */
297
+ YYSYMBOL_SCALAR = 32, /* SCALAR */
298
+ YYSYMBOL_SCHEMA = 33, /* SCHEMA */
299
+ YYSYMBOL_STRING = 34, /* STRING */
300
+ YYSYMBOL_SUBSCRIPTION = 35, /* SUBSCRIPTION */
301
+ YYSYMBOL_TRUE_LITERAL = 36, /* TRUE_LITERAL */
302
+ YYSYMBOL_TYPE_LITERAL = 37, /* TYPE_LITERAL */
303
+ YYSYMBOL_UNION = 38, /* UNION */
304
+ YYSYMBOL_VAR_SIGN = 39, /* VAR_SIGN */
305
+ YYSYMBOL_YYACCEPT = 40, /* $accept */
306
+ YYSYMBOL_start = 41, /* start */
307
+ YYSYMBOL_document = 42, /* document */
308
+ YYSYMBOL_definitions_list = 43, /* definitions_list */
309
+ YYSYMBOL_definition = 44, /* definition */
310
+ YYSYMBOL_executable_definition = 45, /* executable_definition */
311
+ YYSYMBOL_operation_definition = 46, /* operation_definition */
312
+ YYSYMBOL_operation_type = 47, /* operation_type */
313
+ YYSYMBOL_operation_name_opt = 48, /* operation_name_opt */
314
+ YYSYMBOL_variable_definitions_opt = 49, /* variable_definitions_opt */
315
+ YYSYMBOL_variable_definitions_list = 50, /* variable_definitions_list */
316
+ YYSYMBOL_variable_definition = 51, /* variable_definition */
317
+ YYSYMBOL_default_value_opt = 52, /* default_value_opt */
318
+ YYSYMBOL_selection_list = 53, /* selection_list */
319
+ YYSYMBOL_selection = 54, /* selection */
320
+ YYSYMBOL_selection_set = 55, /* selection_set */
321
+ YYSYMBOL_selection_set_opt = 56, /* selection_set_opt */
322
+ YYSYMBOL_field = 57, /* field */
323
+ YYSYMBOL_arguments_opt = 58, /* arguments_opt */
324
+ YYSYMBOL_arguments_list = 59, /* arguments_list */
325
+ YYSYMBOL_argument = 60, /* argument */
326
+ YYSYMBOL_literal_value = 61, /* literal_value */
327
+ YYSYMBOL_input_value = 62, /* input_value */
328
+ YYSYMBOL_null_value = 63, /* null_value */
329
+ YYSYMBOL_variable = 64, /* variable */
330
+ YYSYMBOL_list_value = 65, /* list_value */
331
+ YYSYMBOL_list_value_list = 66, /* list_value_list */
332
+ YYSYMBOL_enum_name = 67, /* enum_name */
333
+ YYSYMBOL_enum_value = 68, /* enum_value */
334
+ YYSYMBOL_object_value = 69, /* object_value */
335
+ YYSYMBOL_object_value_list_opt = 70, /* object_value_list_opt */
336
+ YYSYMBOL_object_value_list = 71, /* object_value_list */
337
+ YYSYMBOL_object_value_field = 72, /* object_value_field */
338
+ YYSYMBOL_object_literal_value = 73, /* object_literal_value */
339
+ YYSYMBOL_object_literal_value_list_opt = 74, /* object_literal_value_list_opt */
340
+ YYSYMBOL_object_literal_value_list = 75, /* object_literal_value_list */
341
+ YYSYMBOL_object_literal_value_field = 76, /* object_literal_value_field */
342
+ YYSYMBOL_directives_list_opt = 77, /* directives_list_opt */
343
+ YYSYMBOL_directives_list = 78, /* directives_list */
344
+ YYSYMBOL_directive = 79, /* directive */
345
+ YYSYMBOL_name = 80, /* name */
346
+ YYSYMBOL_schema_keyword = 81, /* schema_keyword */
347
+ YYSYMBOL_name_without_on = 82, /* name_without_on */
348
+ YYSYMBOL_fragment_spread = 83, /* fragment_spread */
349
+ YYSYMBOL_inline_fragment = 84, /* inline_fragment */
350
+ YYSYMBOL_fragment_definition = 85, /* fragment_definition */
351
+ YYSYMBOL_fragment_name_opt = 86, /* fragment_name_opt */
352
+ YYSYMBOL_type = 87, /* type */
353
+ YYSYMBOL_nullable_type = 88, /* nullable_type */
354
+ YYSYMBOL_type_system_definition = 89, /* type_system_definition */
355
+ YYSYMBOL_schema_definition = 90, /* schema_definition */
356
+ YYSYMBOL_operation_type_definition_list_opt = 91, /* operation_type_definition_list_opt */
357
+ YYSYMBOL_operation_type_definition_list = 92, /* operation_type_definition_list */
358
+ YYSYMBOL_operation_type_definition = 93, /* operation_type_definition */
359
+ YYSYMBOL_type_definition = 94, /* type_definition */
360
+ YYSYMBOL_description = 95, /* description */
361
+ YYSYMBOL_description_opt = 96, /* description_opt */
362
+ YYSYMBOL_scalar_type_definition = 97, /* scalar_type_definition */
363
+ YYSYMBOL_object_type_definition = 98, /* object_type_definition */
364
+ YYSYMBOL_implements_opt = 99, /* implements_opt */
365
+ YYSYMBOL_interfaces_list = 100, /* interfaces_list */
366
+ YYSYMBOL_legacy_interfaces_list = 101, /* legacy_interfaces_list */
367
+ YYSYMBOL_input_value_definition = 102, /* input_value_definition */
368
+ YYSYMBOL_input_value_definition_list = 103, /* input_value_definition_list */
369
+ YYSYMBOL_arguments_definitions_opt = 104, /* arguments_definitions_opt */
370
+ YYSYMBOL_field_definition = 105, /* field_definition */
371
+ YYSYMBOL_field_definition_list_opt = 106, /* field_definition_list_opt */
372
+ YYSYMBOL_field_definition_list = 107, /* field_definition_list */
373
+ YYSYMBOL_interface_type_definition = 108, /* interface_type_definition */
374
+ YYSYMBOL_union_members = 109, /* union_members */
375
+ YYSYMBOL_union_type_definition = 110, /* union_type_definition */
376
+ YYSYMBOL_enum_type_definition = 111, /* enum_type_definition */
377
+ YYSYMBOL_enum_value_definition = 112, /* enum_value_definition */
378
+ YYSYMBOL_enum_value_definitions = 113, /* enum_value_definitions */
379
+ YYSYMBOL_input_object_type_definition = 114, /* input_object_type_definition */
380
+ YYSYMBOL_directive_definition = 115, /* directive_definition */
381
+ YYSYMBOL_directive_repeatable_opt = 116, /* directive_repeatable_opt */
382
+ YYSYMBOL_directive_locations = 117, /* directive_locations */
383
+ YYSYMBOL_type_system_extension = 118, /* type_system_extension */
384
+ YYSYMBOL_schema_extension = 119, /* schema_extension */
385
+ YYSYMBOL_type_extension = 120, /* type_extension */
386
+ YYSYMBOL_scalar_type_extension = 121, /* scalar_type_extension */
387
+ YYSYMBOL_object_type_extension = 122, /* object_type_extension */
388
+ YYSYMBOL_interface_type_extension = 123, /* interface_type_extension */
389
+ YYSYMBOL_union_type_extension = 124, /* union_type_extension */
390
+ YYSYMBOL_enum_type_extension = 125, /* enum_type_extension */
391
+ YYSYMBOL_input_object_type_extension = 126 /* input_object_type_extension */
392
+ };
393
+ typedef enum yysymbol_kind_t yysymbol_kind_t;
394
+
395
+
396
+
397
+
398
+ #ifdef short
399
+ # undef short
400
+ #endif
401
+
402
+ /* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
403
+ <limits.h> and (if available) <stdint.h> are included
404
+ so that the code can choose integer types of a good width. */
405
+
406
+ #ifndef __PTRDIFF_MAX__
407
+ # include <limits.h> /* INFRINGES ON USER NAME SPACE */
408
+ # if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
409
+ # include <stdint.h> /* INFRINGES ON USER NAME SPACE */
410
+ # define YY_STDINT_H
411
+ # endif
412
+ #endif
413
+
414
+ /* Narrow types that promote to a signed type and that can represent a
415
+ signed or unsigned integer of at least N bits. In tables they can
416
+ save space and decrease cache pressure. Promoting to a signed type
417
+ helps avoid bugs in integer arithmetic. */
418
+
419
+ #ifdef __INT_LEAST8_MAX__
420
+ typedef __INT_LEAST8_TYPE__ yytype_int8;
421
+ #elif defined YY_STDINT_H
422
+ typedef int_least8_t yytype_int8;
423
+ #else
424
+ typedef signed char yytype_int8;
425
+ #endif
426
+
427
+ #ifdef __INT_LEAST16_MAX__
428
+ typedef __INT_LEAST16_TYPE__ yytype_int16;
429
+ #elif defined YY_STDINT_H
430
+ typedef int_least16_t yytype_int16;
431
+ #else
432
+ typedef short yytype_int16;
433
+ #endif
434
+
435
+ /* Work around bug in HP-UX 11.23, which defines these macros
436
+ incorrectly for preprocessor constants. This workaround can likely
437
+ be removed in 2023, as HPE has promised support for HP-UX 11.23
438
+ (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
439
+ <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>. */
440
+ #ifdef __hpux
441
+ # undef UINT_LEAST8_MAX
442
+ # undef UINT_LEAST16_MAX
443
+ # define UINT_LEAST8_MAX 255
444
+ # define UINT_LEAST16_MAX 65535
445
+ #endif
446
+
447
+ #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
448
+ typedef __UINT_LEAST8_TYPE__ yytype_uint8;
449
+ #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
450
+ && UINT_LEAST8_MAX <= INT_MAX)
451
+ typedef uint_least8_t yytype_uint8;
452
+ #elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
453
+ typedef unsigned char yytype_uint8;
454
+ #else
455
+ typedef short yytype_uint8;
456
+ #endif
457
+
458
+ #if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
459
+ typedef __UINT_LEAST16_TYPE__ yytype_uint16;
460
+ #elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
461
+ && UINT_LEAST16_MAX <= INT_MAX)
462
+ typedef uint_least16_t yytype_uint16;
463
+ #elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
464
+ typedef unsigned short yytype_uint16;
465
+ #else
466
+ typedef int yytype_uint16;
467
+ #endif
468
+
469
+ #ifndef YYPTRDIFF_T
470
+ # if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
471
+ # define YYPTRDIFF_T __PTRDIFF_TYPE__
472
+ # define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
473
+ # elif defined PTRDIFF_MAX
474
+ # ifndef ptrdiff_t
475
+ # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
476
+ # endif
477
+ # define YYPTRDIFF_T ptrdiff_t
478
+ # define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
479
+ # else
480
+ # define YYPTRDIFF_T long
481
+ # define YYPTRDIFF_MAXIMUM LONG_MAX
482
+ # endif
483
+ #endif
484
+
485
+ #ifndef YYSIZE_T
486
+ # ifdef __SIZE_TYPE__
487
+ # define YYSIZE_T __SIZE_TYPE__
488
+ # elif defined size_t
489
+ # define YYSIZE_T size_t
490
+ # elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
491
+ # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
492
+ # define YYSIZE_T size_t
493
+ # else
494
+ # define YYSIZE_T unsigned
495
+ # endif
496
+ #endif
497
+
498
+ #define YYSIZE_MAXIMUM \
499
+ YY_CAST (YYPTRDIFF_T, \
500
+ (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
501
+ ? YYPTRDIFF_MAXIMUM \
502
+ : YY_CAST (YYSIZE_T, -1)))
503
+
504
+ #define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
505
+
506
+
507
+ /* Stored state numbers (used for stacks). */
508
+ typedef yytype_int16 yy_state_t;
509
+
510
+ /* State numbers in computations. */
511
+ typedef int yy_state_fast_t;
512
+
513
+ #ifndef YY_
514
+ # if defined YYENABLE_NLS && YYENABLE_NLS
515
+ # if ENABLE_NLS
516
+ # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
517
+ # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
518
+ # endif
519
+ # endif
520
+ # ifndef YY_
521
+ # define YY_(Msgid) Msgid
522
+ # endif
523
+ #endif
524
+
525
+
526
+ #ifndef YY_ATTRIBUTE_PURE
527
+ # if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
528
+ # define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
529
+ # else
530
+ # define YY_ATTRIBUTE_PURE
531
+ # endif
532
+ #endif
533
+
534
+ #ifndef YY_ATTRIBUTE_UNUSED
535
+ # if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
536
+ # define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
537
+ # else
538
+ # define YY_ATTRIBUTE_UNUSED
539
+ # endif
540
+ #endif
541
+
542
+ /* Suppress unused-variable warnings by "using" E. */
543
+ #if ! defined lint || defined __GNUC__
544
+ # define YY_USE(E) ((void) (E))
545
+ #else
546
+ # define YY_USE(E) /* empty */
547
+ #endif
548
+
549
+ /* Suppress an incorrect diagnostic about yylval being uninitialized. */
550
+ #if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
551
+ # if __GNUC__ * 100 + __GNUC_MINOR__ < 407
552
+ # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
553
+ _Pragma ("GCC diagnostic push") \
554
+ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
555
+ # else
556
+ # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
557
+ _Pragma ("GCC diagnostic push") \
558
+ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
559
+ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
560
+ # endif
561
+ # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
562
+ _Pragma ("GCC diagnostic pop")
563
+ #else
564
+ # define YY_INITIAL_VALUE(Value) Value
565
+ #endif
566
+ #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
567
+ # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
568
+ # define YY_IGNORE_MAYBE_UNINITIALIZED_END
569
+ #endif
570
+ #ifndef YY_INITIAL_VALUE
571
+ # define YY_INITIAL_VALUE(Value) /* Nothing. */
572
+ #endif
573
+
574
+ #if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
575
+ # define YY_IGNORE_USELESS_CAST_BEGIN \
576
+ _Pragma ("GCC diagnostic push") \
577
+ _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
578
+ # define YY_IGNORE_USELESS_CAST_END \
579
+ _Pragma ("GCC diagnostic pop")
580
+ #endif
581
+ #ifndef YY_IGNORE_USELESS_CAST_BEGIN
582
+ # define YY_IGNORE_USELESS_CAST_BEGIN
583
+ # define YY_IGNORE_USELESS_CAST_END
584
+ #endif
585
+
586
+
587
+ #define YY_ASSERT(E) ((void) (0 && (E)))
588
+
589
+ #if 1
590
+
591
+ /* The parser invokes alloca or malloc; define the necessary symbols. */
592
+
593
+ # ifdef YYSTACK_USE_ALLOCA
594
+ # if YYSTACK_USE_ALLOCA
595
+ # ifdef __GNUC__
596
+ # define YYSTACK_ALLOC __builtin_alloca
597
+ # elif defined __BUILTIN_VA_ARG_INCR
598
+ # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
599
+ # elif defined _AIX
600
+ # define YYSTACK_ALLOC __alloca
601
+ # elif defined _MSC_VER
602
+ # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
603
+ # define alloca _alloca
604
+ # else
605
+ # define YYSTACK_ALLOC alloca
606
+ # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
607
+ # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
608
+ /* Use EXIT_SUCCESS as a witness for stdlib.h. */
609
+ # ifndef EXIT_SUCCESS
610
+ # define EXIT_SUCCESS 0
611
+ # endif
612
+ # endif
613
+ # endif
614
+ # endif
615
+ # endif
616
+
617
+ # ifdef YYSTACK_ALLOC
618
+ /* Pacify GCC's 'empty if-body' warning. */
619
+ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
620
+ # ifndef YYSTACK_ALLOC_MAXIMUM
621
+ /* The OS might guarantee only one guard page at the bottom of the stack,
622
+ and a page size can be as small as 4096 bytes. So we cannot safely
623
+ invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
624
+ to allow for a few compiler-allocated temporary stack slots. */
625
+ # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
626
+ # endif
627
+ # else
628
+ # define YYSTACK_ALLOC YYMALLOC
629
+ # define YYSTACK_FREE YYFREE
630
+ # ifndef YYSTACK_ALLOC_MAXIMUM
631
+ # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
632
+ # endif
633
+ # if (defined __cplusplus && ! defined EXIT_SUCCESS \
634
+ && ! ((defined YYMALLOC || defined malloc) \
635
+ && (defined YYFREE || defined free)))
636
+ # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
637
+ # ifndef EXIT_SUCCESS
638
+ # define EXIT_SUCCESS 0
639
+ # endif
640
+ # endif
641
+ # ifndef YYMALLOC
642
+ # define YYMALLOC malloc
643
+ # if ! defined malloc && ! defined EXIT_SUCCESS
644
+ void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
645
+ # endif
646
+ # endif
647
+ # ifndef YYFREE
648
+ # define YYFREE free
649
+ # if ! defined free && ! defined EXIT_SUCCESS
650
+ void free (void *); /* INFRINGES ON USER NAME SPACE */
651
+ # endif
652
+ # endif
653
+ # endif
654
+ #endif /* 1 */
655
+
656
+ #if (! defined yyoverflow \
657
+ && (! defined __cplusplus \
658
+ || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
659
+
660
+ /* A type that is properly aligned for any stack member. */
661
+ union yyalloc
662
+ {
663
+ yy_state_t yyss_alloc;
664
+ YYSTYPE yyvs_alloc;
665
+ };
666
+
667
+ /* The size of the maximum gap between one aligned stack and the next. */
668
+ # define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
669
+
670
+ /* The size of an array large to enough to hold all stacks, each with
671
+ N elements. */
672
+ # define YYSTACK_BYTES(N) \
673
+ ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
674
+ + YYSTACK_GAP_MAXIMUM)
675
+
676
+ # define YYCOPY_NEEDED 1
677
+
678
+ /* Relocate STACK from its old location to the new one. The
679
+ local variables YYSIZE and YYSTACKSIZE give the old and new number of
680
+ elements in the stack, and YYPTR gives the new location of the
681
+ stack. Advance YYPTR to a properly aligned location for the next
682
+ stack. */
683
+ # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
684
+ do \
685
+ { \
686
+ YYPTRDIFF_T yynewbytes; \
687
+ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
688
+ Stack = &yyptr->Stack_alloc; \
689
+ yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
690
+ yyptr += yynewbytes / YYSIZEOF (*yyptr); \
691
+ } \
692
+ while (0)
693
+
694
+ #endif
695
+
696
+ #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
697
+ /* Copy COUNT objects from SRC to DST. The source and destination do
698
+ not overlap. */
699
+ # ifndef YYCOPY
700
+ # if defined __GNUC__ && 1 < __GNUC__
701
+ # define YYCOPY(Dst, Src, Count) \
702
+ __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
703
+ # else
704
+ # define YYCOPY(Dst, Src, Count) \
705
+ do \
706
+ { \
707
+ YYPTRDIFF_T yyi; \
708
+ for (yyi = 0; yyi < (Count); yyi++) \
709
+ (Dst)[yyi] = (Src)[yyi]; \
710
+ } \
711
+ while (0)
712
+ # endif
713
+ # endif
714
+ #endif /* !YYCOPY_NEEDED */
715
+
716
+ /* YYFINAL -- State number of the termination state. */
717
+ #define YYFINAL 77
718
+ /* YYLAST -- Last index in YYTABLE. */
719
+ #define YYLAST 782
720
+
721
+ /* YYNTOKENS -- Number of terminals. */
722
+ #define YYNTOKENS 40
723
+ /* YYNNTS -- Number of nonterminals. */
724
+ #define YYNNTS 87
725
+ /* YYNRULES -- Number of rules. */
726
+ #define YYNRULES 182
727
+ /* YYNSTATES -- Number of states. */
728
+ #define YYNSTATES 310
729
+
730
+ /* YYMAXUTOK -- Last valid token kind. */
731
+ #define YYMAXUTOK 257
732
+
733
+
734
+ /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
735
+ as returned by yylex, with out-of-bounds checking. */
736
+ #define YYTRANSLATE(YYX) \
737
+ (0 <= (YYX) && (YYX) <= YYMAXUTOK \
738
+ ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \
739
+ : YYSYMBOL_YYUNDEF)
740
+
741
+ /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
742
+ as returned by yylex. */
743
+ static const yytype_int8 yytranslate[] =
744
+ {
745
+ 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
746
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
747
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
748
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
749
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
750
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
751
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
752
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
753
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
754
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
755
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
756
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
757
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
758
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
759
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
760
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
761
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
762
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
763
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
764
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
765
+ 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
766
+ 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
767
+ 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
768
+ 33, 34, 35, 36, 37, 38, 39, 2, 2, 2,
769
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
770
+ 2, 2, 2, 2, 2, 2, 1, 2
771
+ };
772
+
773
+ #if YYDEBUG
774
+ /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
775
+ static const yytype_int16 yyrline[] =
776
+ {
777
+ 0, 103, 103, 105, 119, 120, 123, 124, 125, 128,
778
+ 129, 132, 143, 154, 167, 168, 169, 172, 173, 176,
779
+ 177, 180, 181, 184, 195, 196, 199, 200, 203, 204,
780
+ 205, 208, 211, 212, 215, 226, 239, 240, 243, 244,
781
+ 247, 257, 258, 259, 260, 261, 262, 263, 264, 265,
782
+ 268, 269, 270, 272, 280, 289, 290, 293, 294, 297,
783
+ 298, 299, 300, 301, 302, 304, 313, 322, 323, 326,
784
+ 327, 330, 341, 350, 351, 354, 355, 358, 369, 370,
785
+ 373, 374, 376, 386, 387, 390, 391, 392, 393, 394,
786
+ 395, 396, 397, 398, 401, 402, 403, 404, 405, 406,
787
+ 407, 411, 421, 430, 441, 453, 454, 457, 458, 461,
788
+ 468, 477, 478, 479, 482, 495, 496, 499, 503, 508,
789
+ 513, 514, 515, 516, 517, 518, 520, 523, 524, 527,
790
+ 539, 553, 554, 555, 556, 559, 567, 573, 581, 586,
791
+ 600, 601, 604, 605, 608, 622, 623, 626, 627, 628,
792
+ 631, 645, 653, 658, 671, 684, 696, 697, 700, 713,
793
+ 727, 728, 731, 732, 736, 737, 740, 751, 763, 764,
794
+ 765, 766, 767, 768, 770, 780, 792, 804, 813, 824,
795
+ 833, 844, 853
796
+ };
797
+ #endif
798
+
799
+ /** Accessing symbol of state STATE. */
800
+ #define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
801
+
802
+ #if 1
803
+ /* The user-facing name of the symbol whose (internal) number is
804
+ YYSYMBOL. No bounds checking. */
805
+ static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
806
+
807
+ static const char *
808
+ yysymbol_name (yysymbol_kind_t yysymbol)
809
+ {
810
+ static const char *const yy_sname[] =
811
+ {
812
+ "end of file", "error", "invalid token", "AMP", "BANG", "COLON",
813
+ "DIRECTIVE", "DIR_SIGN", "ENUM", "ELLIPSIS", "EQUALS", "EXTEND",
814
+ "FALSE_LITERAL", "FLOAT", "FRAGMENT", "IDENTIFIER", "INPUT",
815
+ "IMPLEMENTS", "INT", "INTERFACE", "LBRACKET", "LCURLY", "LPAREN",
816
+ "MUTATION", "NULL_LITERAL", "ON", "PIPE", "QUERY", "RBRACKET", "RCURLY",
817
+ "REPEATABLE", "RPAREN", "SCALAR", "SCHEMA", "STRING", "SUBSCRIPTION",
818
+ "TRUE_LITERAL", "TYPE_LITERAL", "UNION", "VAR_SIGN", "$accept", "start",
819
+ "document", "definitions_list", "definition", "executable_definition",
820
+ "operation_definition", "operation_type", "operation_name_opt",
821
+ "variable_definitions_opt", "variable_definitions_list",
822
+ "variable_definition", "default_value_opt", "selection_list",
823
+ "selection", "selection_set", "selection_set_opt", "field",
824
+ "arguments_opt", "arguments_list", "argument", "literal_value",
825
+ "input_value", "null_value", "variable", "list_value", "list_value_list",
826
+ "enum_name", "enum_value", "object_value", "object_value_list_opt",
827
+ "object_value_list", "object_value_field", "object_literal_value",
828
+ "object_literal_value_list_opt", "object_literal_value_list",
829
+ "object_literal_value_field", "directives_list_opt", "directives_list",
830
+ "directive", "name", "schema_keyword", "name_without_on",
831
+ "fragment_spread", "inline_fragment", "fragment_definition",
832
+ "fragment_name_opt", "type", "nullable_type", "type_system_definition",
833
+ "schema_definition", "operation_type_definition_list_opt",
834
+ "operation_type_definition_list", "operation_type_definition",
835
+ "type_definition", "description", "description_opt",
836
+ "scalar_type_definition", "object_type_definition", "implements_opt",
837
+ "interfaces_list", "legacy_interfaces_list", "input_value_definition",
838
+ "input_value_definition_list", "arguments_definitions_opt",
839
+ "field_definition", "field_definition_list_opt", "field_definition_list",
840
+ "interface_type_definition", "union_members", "union_type_definition",
841
+ "enum_type_definition", "enum_value_definition",
842
+ "enum_value_definitions", "input_object_type_definition",
843
+ "directive_definition", "directive_repeatable_opt",
844
+ "directive_locations", "type_system_extension", "schema_extension",
845
+ "type_extension", "scalar_type_extension", "object_type_extension",
846
+ "interface_type_extension", "union_type_extension",
847
+ "enum_type_extension", "input_object_type_extension", YY_NULLPTR
848
+ };
849
+ return yy_sname[yysymbol];
850
+ }
851
+ #endif
852
+
853
+ #define YYPACT_NINF (-269)
854
+
855
+ #define yypact_value_is_default(Yyn) \
856
+ ((Yyn) == YYPACT_NINF)
857
+
858
+ #define YYTABLE_NINF (-148)
859
+
860
+ #define yytable_value_is_error(Yyn) \
861
+ 0
862
+
863
+ /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
864
+ STATE-NUM. */
865
+ static const yytype_int16 yypact[] =
866
+ {
867
+ 194, 95, 744, 480, -269, -269, 21, -269, -269, 32,
868
+ -269, 115, -269, -269, -269, 711, -269, -269, -269, -269,
869
+ -269, 59, -269, -269, -269, -269, -269, -269, -269, -269,
870
+ -269, -269, -269, -269, -269, -269, -269, -269, 711, 711,
871
+ 711, 711, 21, 711, 711, -269, -269, -269, -269, -269,
872
+ -269, -269, -269, -269, -269, -269, -269, -269, -269, -269,
873
+ -269, -269, 33, 579, -269, -269, 513, -269, -269, 12,
874
+ -269, -269, -269, 711, 18, 21, -269, -269, -269, 40,
875
+ -269, 64, 711, 711, 711, 711, 711, 711, 21, 21,
876
+ 70, 21, 72, 9, 70, 21, 612, 612, 73, 21,
877
+ -269, -269, 711, 711, 21, 80, 50, -269, -269, 56,
878
+ 21, 711, 21, 21, 70, 21, 70, 21, 89, 9,
879
+ 91, 9, 306, 21, 21, 50, 21, 120, 62, 612,
880
+ -269, 21, 118, 21, 645, -269, -269, 80, 678, -269,
881
+ 142, 73, -269, 148, 63, -269, 711, -8, -269, 73,
882
+ 135, 140, 141, 21, -269, 21, 154, 132, 132, 711,
883
+ 208, 164, 711, 150, 78, 150, 711, 144, 73, -269,
884
+ 73, 546, 21, -269, -269, 413, -269, -269, 711, -269,
885
+ -269, 168, -269, -269, -269, 132, 147, 132, 132, 150,
886
+ 150, 711, 251, -269, -16, 711, -269, 75, -269, 164,
887
+ 711, -269, 87, -269, -269, -269, -269, 153, -269, -269,
888
+ -269, -269, 73, -269, -269, -269, -269, -269, 339, 711,
889
+ -269, -269, -269, -269, -269, 711, -269, -269, -269, -269,
890
+ -269, -269, -269, -269, -269, -269, -269, -269, 612, 103,
891
+ -269, 149, 111, 112, -269, -269, 153, 21, -269, -269,
892
+ 176, -269, -269, -269, 711, -269, 126, 711, -269, -269,
893
+ -269, 379, 155, 711, -269, 157, 711, -269, 177, -269,
894
+ 173, -269, 711, -269, -269, -269, 612, 135, -269, -269,
895
+ -269, -269, -269, -269, -269, 182, -269, -269, 195, 413,
896
+ 447, -269, -269, 175, 173, 198, 413, 447, -269, -269,
897
+ 711, -269, 711, 21, 612, -269, -269, -269, 21, -269
898
+ };
899
+
900
+ /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
901
+ Performed when YYTABLE does not specify something else to do. Zero
902
+ means the default is an error. */
903
+ static const yytype_uint8 yydefact[] =
904
+ {
905
+ 127, 0, 105, 0, 15, 14, 78, 126, 16, 0,
906
+ 2, 127, 4, 6, 9, 17, 10, 7, 111, 112,
907
+ 128, 0, 120, 121, 122, 123, 124, 125, 113, 8,
908
+ 164, 165, 168, 169, 170, 171, 172, 173, 0, 0,
909
+ 0, 0, 78, 0, 0, 93, 91, 98, 95, 94,
910
+ 92, 88, 89, 96, 86, 85, 97, 87, 90, 99,
911
+ 100, 106, 0, 78, 84, 13, 0, 26, 28, 36,
912
+ 83, 29, 30, 0, 115, 79, 80, 1, 5, 19,
913
+ 18, 0, 0, 0, 0, 0, 0, 0, 78, 78,
914
+ 131, 0, 0, 167, 131, 78, 0, 0, 0, 78,
915
+ 12, 27, 0, 0, 78, 36, 0, 114, 81, 0,
916
+ 78, 0, 78, 78, 131, 78, 131, 78, 0, 180,
917
+ 0, 182, 0, 78, 174, 0, 78, 0, 178, 0,
918
+ 109, 78, 107, 78, 0, 103, 101, 36, 0, 38,
919
+ 0, 32, 82, 0, 0, 117, 0, 0, 21, 0,
920
+ 142, 0, 0, 78, 129, 78, 0, 127, 127, 0,
921
+ 135, 133, 134, 145, 0, 145, 0, 0, 0, 108,
922
+ 0, 0, 78, 37, 39, 0, 33, 35, 0, 116,
923
+ 118, 0, 20, 22, 11, 127, 160, 127, 127, 145,
924
+ 145, 0, 0, 156, 127, 0, 140, 127, 135, 132,
925
+ 0, 138, 127, 176, 166, 175, 151, 177, 110, 104,
926
+ 102, 31, 32, 45, 41, 60, 59, 42, 0, 67,
927
+ 53, 62, 61, 43, 44, 0, 63, 50, 40, 46,
928
+ 51, 48, 65, 47, 52, 49, 64, 119, 0, 127,
929
+ 161, 0, 127, 127, 150, 130, 153, 78, 179, 157,
930
+ 0, 181, 141, 136, 0, 148, 127, 0, 34, 55,
931
+ 57, 0, 0, 68, 69, 0, 74, 75, 0, 54,
932
+ 24, 143, 0, 154, 158, 155, 0, 142, 146, 149,
933
+ 152, 56, 58, 66, 70, 0, 72, 76, 0, 0,
934
+ 0, 23, 162, 159, 24, 0, 0, 0, 50, 71,
935
+ 73, 25, 0, 78, 0, 77, 163, 139, 78, 144
936
+ };
937
+
938
+ /* YYPGOTO[NTERM-NUM]. */
939
+ static const yytype_int16 yypgoto[] =
940
+ {
941
+ -269, -269, -269, -269, 188, -269, -269, 14, -269, -269,
942
+ -269, 66, -85, 77, -65, -94, 7, -269, -95, -269,
943
+ 86, -268, -173, -269, -269, -269, -269, 34, -269, -269,
944
+ -269, -269, -33, -269, -269, -269, -31, 81, -35, -60,
945
+ -3, -172, 3, -269, -269, -269, -269, -86, -269, -269,
946
+ -269, -269, 106, -120, -269, -269, 8, -269, -269, -67,
947
+ 82, -269, -191, -34, -40, -17, -139, -269, -269, 49,
948
+ -269, -269, -185, 55, -269, -269, -269, -269, -269, -269,
949
+ -269, -269, -269, -269, -269, -269, -269
950
+ };
951
+
952
+ /* YYDEFGOTO[NTERM-NUM]. */
953
+ static const yytype_int16 yydefgoto[] =
954
+ {
955
+ 0, 9, 10, 11, 12, 13, 14, 59, 79, 110,
956
+ 147, 148, 291, 66, 67, 176, 177, 68, 104, 138,
957
+ 139, 227, 299, 229, 230, 231, 261, 232, 233, 234,
958
+ 262, 263, 264, 235, 265, 266, 267, 74, 75, 76,
959
+ 130, 60, 70, 71, 72, 16, 62, 131, 132, 17,
960
+ 18, 107, 144, 145, 19, 20, 195, 22, 23, 123,
961
+ 161, 162, 196, 197, 186, 255, 203, 256, 24, 207,
962
+ 25, 26, 193, 194, 27, 28, 241, 293, 29, 30,
963
+ 31, 32, 33, 34, 35, 36, 37
964
+ };
965
+
966
+ /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
967
+ positive, shift that token. If negative, reduce the rule whose
968
+ number is the opposite. If YYTABLE_NINF, syntax error. */
969
+ static const yytype_int16 yytable[] =
970
+ {
971
+ 69, 101, 228, 236, 135, 61, 252, 93, 21, 249,
972
+ 142, 133, 80, 248, 15, 108, 73, 102, 7, 21,
973
+ 236, 298, 301, 182, 180, 15, 205, 126, 73, 305,
974
+ -79, 146, 77, 108, 103, 88, 89, 90, 91, 106,
975
+ 94, 95, 172, 167, 180, 260, 236, 153, 252, 155,
976
+ 244, 245, 252, 119, 121, 184, 124, 249, 96, 108,
977
+ 128, 108, 109, 69, 108, 81, 99, 82, 108, 73,
978
+ 105, 111, -79, 4, 209, 83, 210, 5, 84, 112,
979
+ 113, 114, 115, 116, 117, 8, 4, 122, 282, 236,
980
+ 5, 85, 179, 125, 134, 146, 86, 87, 8, 137,
981
+ 140, 4, 103, 38, 251, 5, 101, 204, 150, 7,
982
+ 157, 39, 158, 8, 40, -3, -147, 236, 236, 160,
983
+ 143, 7, 169, 92, 236, 236, 1, 41, 42, 2,
984
+ 166, 69, 43, 44, 271, 140, 3, 7, 4, 143,
985
+ 273, 274, 5, 181, 98, 7, 7, 175, 6, 7,
986
+ 8, 239, 270, 178, 243, 278, 198, 185, 143, 201,
987
+ 7, 187, 188, 206, 191, 192, 7, 200, 69, 118,
988
+ 120, 202, 208, 238, 272, 237, 127, 240, 143, 257,
989
+ 136, 276, 289, 290, 283, 141, 286, 296, 206, 226,
990
+ 294, 149, 250, 151, 152, 192, 154, 253, 156, 78,
991
+ 297, 302, 192, 304, 163, 1, 226, 165, 2, 303,
992
+ 254, 171, 168, 183, 170, 3, 268, 4, 308, 258,
993
+ -137, 5, 269, -137, 174, -137, 247, 6, 7, 8,
994
+ 284, 164, 226, -137, 189, 287, 190, 295, -137, 279,
995
+ 246, 199, 242, 0, -137, 0, 0, 0, 0, 0,
996
+ 192, 277, 0, 212, 280, 0, 0, 45, 0, 46,
997
+ 285, 0, 0, 288, 254, 215, 216, 50, 51, 292,
998
+ 52, 0, 0, 0, 4, 226, 221, 0, 5, 0,
999
+ 0, 222, 0, 54, 55, 0, 8, 0, 57, 58,
1000
+ 0, 0, 0, 0, 0, 0, 0, 288, 0, 306,
1001
+ 0, 0, 0, 226, 226, 0, 0, 0, 0, 159,
1002
+ 226, 226, 45, 0, 46, 0, 0, 0, 47, 0,
1003
+ 48, 49, 50, 51, 0, 52, 0, 0, 275, 4,
1004
+ 0, 64, 0, 5, 0, 0, 53, 0, 54, 55,
1005
+ 0, 8, 56, 57, 58, 45, 0, 46, 0, 0,
1006
+ 0, 213, 214, 215, 216, 50, 51, 217, 52, 218,
1007
+ 219, 0, 4, 220, 221, 0, 5, 259, 0, 222,
1008
+ 0, 54, 55, 223, 8, 224, 57, 58, 225, 0,
1009
+ 0, 0, 0, 0, 307, 45, 0, 46, 0, 309,
1010
+ 0, 213, 214, 215, 216, 50, 51, 217, 52, 218,
1011
+ 219, 0, 4, 220, 221, 0, 5, 281, 0, 222,
1012
+ 0, 54, 55, 223, 8, 224, 57, 58, 225, 45,
1013
+ 0, 46, 0, 0, 0, 213, 214, 215, 216, 50,
1014
+ 51, 217, 52, 218, 219, 0, 4, 220, 221, 0,
1015
+ 5, 0, 0, 222, 0, 54, 55, 223, 8, 224,
1016
+ 57, 58, 225, 45, 0, 46, 0, 0, 0, 213,
1017
+ 214, 215, 216, 50, 51, 217, 52, 218, 300, 0,
1018
+ 4, 220, 221, 0, 5, 0, 0, 222, 0, 54,
1019
+ 55, 223, 8, 224, 57, 58, 45, 0, 46, 63,
1020
+ 0, 0, 47, 0, 48, 49, 50, 51, 0, 52,
1021
+ 0, 0, 0, 4, 0, 64, 0, 5, 0, 65,
1022
+ 53, 0, 54, 55, 0, 8, 56, 57, 58, 45,
1023
+ 0, 46, 63, 0, 0, 47, 0, 48, 49, 50,
1024
+ 51, 0, 52, 0, 0, 0, 4, 0, 64, 0,
1025
+ 5, 0, 100, 53, 0, 54, 55, 0, 8, 56,
1026
+ 57, 58, 45, 0, 46, 63, 0, 0, 47, 0,
1027
+ 48, 49, 50, 51, 0, 52, 0, 0, 0, 4,
1028
+ 0, 64, 0, 5, 0, 211, 53, 0, 54, 55,
1029
+ 0, 8, 56, 57, 58, 45, 73, 46, 0, 0,
1030
+ 0, 47, 0, 48, 49, 50, 51, 0, 52, 0,
1031
+ 0, 0, 4, 0, 97, 0, 5, 0, 0, 53,
1032
+ 0, 54, 55, 0, 8, 56, 57, 58, 45, 0,
1033
+ 46, 0, 0, 0, 47, 0, 48, 49, 50, 51,
1034
+ 0, 52, 129, 0, 0, 4, 0, 64, 0, 5,
1035
+ 0, 0, 53, 0, 54, 55, 0, 8, 56, 57,
1036
+ 58, 45, 0, 46, 63, 0, 0, 47, 0, 48,
1037
+ 49, 50, 51, 0, 52, 0, 0, 0, 4, 0,
1038
+ 64, 0, 5, 0, 0, 53, 0, 54, 55, 0,
1039
+ 8, 56, 57, 58, 45, 0, 46, 0, 0, 0,
1040
+ 47, 0, 48, 49, 50, 51, 0, 52, 0, 0,
1041
+ 0, 4, 0, 64, 0, 5, 0, 0, 53, 173,
1042
+ 54, 55, 0, 8, 56, 57, 58, 45, 0, 46,
1043
+ 0, 0, 0, 47, 0, 48, 49, 50, 51, 0,
1044
+ 52, 0, 0, 0, 4, 0, 64, 0, 5, 0,
1045
+ 0, 53, 0, 54, 55, 0, 8, 56, 57, 58,
1046
+ 45, 0, 46, 0, 0, 0, 47, 0, 48, 49,
1047
+ 50, 51, 0, 52, 0, 0, 0, 4, 0, 0,
1048
+ 0, 5, 0, 0, 53, 0, 54, 55, 0, 8,
1049
+ 56, 57, 58
1050
+ };
1051
+
1052
+ static const yytype_int16 yycheck[] =
1053
+ {
1054
+ 3, 66, 175, 175, 98, 2, 197, 42, 0, 194,
1055
+ 105, 97, 15, 29, 0, 75, 7, 5, 34, 11,
1056
+ 192, 289, 290, 31, 144, 11, 165, 94, 7, 297,
1057
+ 21, 39, 0, 93, 22, 38, 39, 40, 41, 21,
1058
+ 43, 44, 137, 129, 164, 218, 218, 114, 239, 116,
1059
+ 189, 190, 243, 88, 89, 149, 91, 242, 25, 119,
1060
+ 95, 121, 22, 66, 124, 6, 63, 8, 128, 7,
1061
+ 73, 7, 10, 23, 168, 16, 170, 27, 19, 82,
1062
+ 83, 84, 85, 86, 87, 35, 23, 17, 261, 261,
1063
+ 27, 32, 29, 21, 21, 39, 37, 38, 35, 102,
1064
+ 103, 23, 22, 8, 29, 27, 171, 29, 111, 34,
1065
+ 21, 16, 21, 35, 19, 0, 29, 289, 290, 122,
1066
+ 106, 34, 4, 42, 296, 297, 11, 32, 33, 14,
1067
+ 10, 134, 37, 38, 31, 138, 21, 34, 23, 125,
1068
+ 29, 29, 27, 146, 63, 34, 34, 5, 33, 34,
1069
+ 35, 185, 238, 5, 188, 29, 159, 22, 144, 162,
1070
+ 34, 21, 21, 166, 10, 157, 34, 3, 171, 88,
1071
+ 89, 21, 28, 5, 25, 178, 95, 30, 164, 26,
1072
+ 99, 5, 5, 10, 29, 104, 29, 5, 191, 175,
1073
+ 276, 110, 195, 112, 113, 187, 115, 200, 117, 11,
1074
+ 5, 26, 194, 5, 123, 11, 192, 126, 14, 294,
1075
+ 202, 134, 131, 147, 133, 21, 219, 23, 304, 212,
1076
+ 12, 27, 225, 15, 138, 17, 192, 33, 34, 35,
1077
+ 263, 125, 218, 25, 153, 266, 155, 277, 30, 256,
1078
+ 191, 159, 187, -1, 36, -1, -1, -1, -1, -1,
1079
+ 242, 254, -1, 172, 257, -1, -1, 6, -1, 8,
1080
+ 263, -1, -1, 266, 256, 14, 15, 16, 17, 272,
1081
+ 19, -1, -1, -1, 23, 261, 25, -1, 27, -1,
1082
+ -1, 30, -1, 32, 33, -1, 35, -1, 37, 38,
1083
+ -1, -1, -1, -1, -1, -1, -1, 300, -1, 302,
1084
+ -1, -1, -1, 289, 290, -1, -1, -1, -1, 3,
1085
+ 296, 297, 6, -1, 8, -1, -1, -1, 12, -1,
1086
+ 14, 15, 16, 17, -1, 19, -1, -1, 247, 23,
1087
+ -1, 25, -1, 27, -1, -1, 30, -1, 32, 33,
1088
+ -1, 35, 36, 37, 38, 6, -1, 8, -1, -1,
1089
+ -1, 12, 13, 14, 15, 16, 17, 18, 19, 20,
1090
+ 21, -1, 23, 24, 25, -1, 27, 28, -1, 30,
1091
+ -1, 32, 33, 34, 35, 36, 37, 38, 39, -1,
1092
+ -1, -1, -1, -1, 303, 6, -1, 8, -1, 308,
1093
+ -1, 12, 13, 14, 15, 16, 17, 18, 19, 20,
1094
+ 21, -1, 23, 24, 25, -1, 27, 28, -1, 30,
1095
+ -1, 32, 33, 34, 35, 36, 37, 38, 39, 6,
1096
+ -1, 8, -1, -1, -1, 12, 13, 14, 15, 16,
1097
+ 17, 18, 19, 20, 21, -1, 23, 24, 25, -1,
1098
+ 27, -1, -1, 30, -1, 32, 33, 34, 35, 36,
1099
+ 37, 38, 39, 6, -1, 8, -1, -1, -1, 12,
1100
+ 13, 14, 15, 16, 17, 18, 19, 20, 21, -1,
1101
+ 23, 24, 25, -1, 27, -1, -1, 30, -1, 32,
1102
+ 33, 34, 35, 36, 37, 38, 6, -1, 8, 9,
1103
+ -1, -1, 12, -1, 14, 15, 16, 17, -1, 19,
1104
+ -1, -1, -1, 23, -1, 25, -1, 27, -1, 29,
1105
+ 30, -1, 32, 33, -1, 35, 36, 37, 38, 6,
1106
+ -1, 8, 9, -1, -1, 12, -1, 14, 15, 16,
1107
+ 17, -1, 19, -1, -1, -1, 23, -1, 25, -1,
1108
+ 27, -1, 29, 30, -1, 32, 33, -1, 35, 36,
1109
+ 37, 38, 6, -1, 8, 9, -1, -1, 12, -1,
1110
+ 14, 15, 16, 17, -1, 19, -1, -1, -1, 23,
1111
+ -1, 25, -1, 27, -1, 29, 30, -1, 32, 33,
1112
+ -1, 35, 36, 37, 38, 6, 7, 8, -1, -1,
1113
+ -1, 12, -1, 14, 15, 16, 17, -1, 19, -1,
1114
+ -1, -1, 23, -1, 25, -1, 27, -1, -1, 30,
1115
+ -1, 32, 33, -1, 35, 36, 37, 38, 6, -1,
1116
+ 8, -1, -1, -1, 12, -1, 14, 15, 16, 17,
1117
+ -1, 19, 20, -1, -1, 23, -1, 25, -1, 27,
1118
+ -1, -1, 30, -1, 32, 33, -1, 35, 36, 37,
1119
+ 38, 6, -1, 8, 9, -1, -1, 12, -1, 14,
1120
+ 15, 16, 17, -1, 19, -1, -1, -1, 23, -1,
1121
+ 25, -1, 27, -1, -1, 30, -1, 32, 33, -1,
1122
+ 35, 36, 37, 38, 6, -1, 8, -1, -1, -1,
1123
+ 12, -1, 14, 15, 16, 17, -1, 19, -1, -1,
1124
+ -1, 23, -1, 25, -1, 27, -1, -1, 30, 31,
1125
+ 32, 33, -1, 35, 36, 37, 38, 6, -1, 8,
1126
+ -1, -1, -1, 12, -1, 14, 15, 16, 17, -1,
1127
+ 19, -1, -1, -1, 23, -1, 25, -1, 27, -1,
1128
+ -1, 30, -1, 32, 33, -1, 35, 36, 37, 38,
1129
+ 6, -1, 8, -1, -1, -1, 12, -1, 14, 15,
1130
+ 16, 17, -1, 19, -1, -1, -1, 23, -1, -1,
1131
+ -1, 27, -1, -1, 30, -1, 32, 33, -1, 35,
1132
+ 36, 37, 38
1133
+ };
1134
+
1135
+ /* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
1136
+ state STATE-NUM. */
1137
+ static const yytype_int8 yystos[] =
1138
+ {
1139
+ 0, 11, 14, 21, 23, 27, 33, 34, 35, 41,
1140
+ 42, 43, 44, 45, 46, 47, 85, 89, 90, 94,
1141
+ 95, 96, 97, 98, 108, 110, 111, 114, 115, 118,
1142
+ 119, 120, 121, 122, 123, 124, 125, 126, 8, 16,
1143
+ 19, 32, 33, 37, 38, 6, 8, 12, 14, 15,
1144
+ 16, 17, 19, 30, 32, 33, 36, 37, 38, 47,
1145
+ 81, 82, 86, 9, 25, 29, 53, 54, 57, 80,
1146
+ 82, 83, 84, 7, 77, 78, 79, 0, 44, 48,
1147
+ 80, 6, 8, 16, 19, 32, 37, 38, 80, 80,
1148
+ 80, 80, 77, 78, 80, 80, 25, 25, 77, 82,
1149
+ 29, 54, 5, 22, 58, 80, 21, 91, 79, 22,
1150
+ 49, 7, 80, 80, 80, 80, 80, 80, 77, 78,
1151
+ 77, 78, 17, 99, 78, 21, 99, 77, 78, 20,
1152
+ 80, 87, 88, 87, 21, 55, 77, 80, 59, 60,
1153
+ 80, 77, 58, 47, 92, 93, 39, 50, 51, 77,
1154
+ 80, 77, 77, 99, 77, 99, 77, 21, 21, 3,
1155
+ 80, 100, 101, 77, 92, 77, 10, 87, 77, 4,
1156
+ 77, 53, 58, 31, 60, 5, 55, 56, 5, 29,
1157
+ 93, 80, 31, 51, 55, 22, 104, 21, 21, 77,
1158
+ 77, 10, 96, 112, 113, 96, 102, 103, 80, 100,
1159
+ 3, 80, 21, 106, 29, 106, 80, 109, 28, 55,
1160
+ 55, 29, 77, 12, 13, 14, 15, 18, 20, 21,
1161
+ 24, 25, 30, 34, 36, 39, 47, 61, 62, 63,
1162
+ 64, 65, 67, 68, 69, 73, 81, 80, 5, 103,
1163
+ 30, 116, 113, 103, 106, 106, 109, 67, 29, 112,
1164
+ 80, 29, 102, 80, 96, 105, 107, 26, 56, 28,
1165
+ 62, 66, 70, 71, 72, 74, 75, 76, 80, 80,
1166
+ 87, 31, 25, 29, 29, 77, 5, 80, 29, 105,
1167
+ 80, 28, 62, 29, 72, 80, 29, 76, 80, 5,
1168
+ 10, 52, 80, 117, 87, 104, 5, 5, 61, 62,
1169
+ 21, 61, 26, 52, 5, 61, 80, 77, 87, 77
1170
+ };
1171
+
1172
+ /* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */
1173
+ static const yytype_int8 yyr1[] =
1174
+ {
1175
+ 0, 40, 41, 42, 43, 43, 44, 44, 44, 45,
1176
+ 45, 46, 46, 46, 47, 47, 47, 48, 48, 49,
1177
+ 49, 50, 50, 51, 52, 52, 53, 53, 54, 54,
1178
+ 54, 55, 56, 56, 57, 57, 58, 58, 59, 59,
1179
+ 60, 61, 61, 61, 61, 61, 61, 61, 61, 61,
1180
+ 62, 62, 62, 63, 64, 65, 65, 66, 66, 67,
1181
+ 67, 67, 67, 67, 67, 68, 69, 70, 70, 71,
1182
+ 71, 72, 73, 74, 74, 75, 75, 76, 77, 77,
1183
+ 78, 78, 79, 80, 80, 81, 81, 81, 81, 81,
1184
+ 81, 81, 81, 81, 82, 82, 82, 82, 82, 82,
1185
+ 82, 83, 84, 84, 85, 86, 86, 87, 87, 88,
1186
+ 88, 89, 89, 89, 90, 91, 91, 92, 92, 93,
1187
+ 94, 94, 94, 94, 94, 94, 95, 96, 96, 97,
1188
+ 98, 99, 99, 99, 99, 100, 100, 101, 101, 102,
1189
+ 103, 103, 104, 104, 105, 106, 106, 107, 107, 107,
1190
+ 108, 109, 109, 110, 111, 112, 113, 113, 114, 115,
1191
+ 116, 116, 117, 117, 118, 118, 119, 119, 120, 120,
1192
+ 120, 120, 120, 120, 121, 122, 123, 124, 124, 125,
1193
+ 125, 126, 126
1194
+ };
1195
+
1196
+ /* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */
1197
+ static const yytype_int8 yyr2[] =
1198
+ {
1199
+ 0, 2, 1, 1, 1, 2, 1, 1, 1, 1,
1200
+ 1, 5, 3, 2, 1, 1, 1, 0, 1, 0,
1201
+ 3, 1, 2, 5, 0, 2, 1, 2, 1, 1,
1202
+ 1, 3, 0, 1, 6, 4, 0, 3, 1, 2,
1203
+ 3, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1204
+ 1, 1, 1, 1, 2, 2, 3, 1, 2, 1,
1205
+ 1, 1, 1, 1, 1, 1, 3, 0, 1, 1,
1206
+ 2, 3, 3, 0, 1, 1, 2, 3, 0, 1,
1207
+ 1, 2, 3, 1, 1, 1, 1, 1, 1, 1,
1208
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1209
+ 1, 3, 5, 3, 6, 0, 1, 1, 2, 1,
1210
+ 3, 1, 1, 1, 3, 0, 3, 1, 2, 3,
1211
+ 1, 1, 1, 1, 1, 1, 1, 0, 1, 4,
1212
+ 6, 0, 3, 2, 2, 1, 3, 1, 2, 6,
1213
+ 1, 2, 0, 3, 6, 0, 3, 0, 1, 2,
1214
+ 6, 1, 3, 6, 7, 3, 1, 2, 7, 8,
1215
+ 0, 1, 1, 3, 1, 1, 6, 3, 1, 1,
1216
+ 1, 1, 1, 1, 4, 6, 6, 6, 4, 7,
1217
+ 4, 7, 4
1218
+ };
1219
+
1220
+
1221
+ enum { YYENOMEM = -2 };
1222
+
1223
+ #define yyerrok (yyerrstatus = 0)
1224
+ #define yyclearin (yychar = YYEMPTY)
1225
+
1226
+ #define YYACCEPT goto yyacceptlab
1227
+ #define YYABORT goto yyabortlab
1228
+ #define YYERROR goto yyerrorlab
1229
+ #define YYNOMEM goto yyexhaustedlab
1230
+
1231
+
1232
+ #define YYRECOVERING() (!!yyerrstatus)
1233
+
1234
+ #define YYBACKUP(Token, Value) \
1235
+ do \
1236
+ if (yychar == YYEMPTY) \
1237
+ { \
1238
+ yychar = (Token); \
1239
+ yylval = (Value); \
1240
+ YYPOPSTACK (yylen); \
1241
+ yystate = *yyssp; \
1242
+ goto yybackup; \
1243
+ } \
1244
+ else \
1245
+ { \
1246
+ yyerror (parser, filename, YY_("syntax error: cannot back up")); \
1247
+ YYERROR; \
1248
+ } \
1249
+ while (0)
1250
+
1251
+ /* Backward compatibility with an undocumented macro.
1252
+ Use YYerror or YYUNDEF. */
1253
+ #define YYERRCODE YYUNDEF
1254
+
1255
+
1256
+ /* Enable debugging if requested. */
1257
+ #if YYDEBUG
1258
+
1259
+ # ifndef YYFPRINTF
1260
+ # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1261
+ # define YYFPRINTF fprintf
1262
+ # endif
1263
+
1264
+ # define YYDPRINTF(Args) \
1265
+ do { \
1266
+ if (yydebug) \
1267
+ YYFPRINTF Args; \
1268
+ } while (0)
1269
+
1270
+
1271
+
1272
+
1273
+ # define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \
1274
+ do { \
1275
+ if (yydebug) \
1276
+ { \
1277
+ YYFPRINTF (stderr, "%s ", Title); \
1278
+ yy_symbol_print (stderr, \
1279
+ Kind, Value, parser, filename); \
1280
+ YYFPRINTF (stderr, "\n"); \
1281
+ } \
1282
+ } while (0)
1283
+
1284
+
1285
+ /*-----------------------------------.
1286
+ | Print this symbol's value on YYO. |
1287
+ `-----------------------------------*/
1288
+
1289
+ static void
1290
+ yy_symbol_value_print (FILE *yyo,
1291
+ yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, VALUE parser, VALUE filename)
1292
+ {
1293
+ FILE *yyoutput = yyo;
1294
+ YY_USE (yyoutput);
1295
+ YY_USE (parser);
1296
+ YY_USE (filename);
1297
+ if (!yyvaluep)
1298
+ return;
1299
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1300
+ YY_USE (yykind);
1301
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
1302
+ }
1303
+
1304
+
1305
+ /*---------------------------.
1306
+ | Print this symbol on YYO. |
1307
+ `---------------------------*/
1308
+
1309
+ static void
1310
+ yy_symbol_print (FILE *yyo,
1311
+ yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, VALUE parser, VALUE filename)
1312
+ {
1313
+ YYFPRINTF (yyo, "%s %s (",
1314
+ yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
1315
+
1316
+ yy_symbol_value_print (yyo, yykind, yyvaluep, parser, filename);
1317
+ YYFPRINTF (yyo, ")");
1318
+ }
1319
+
1320
+ /*------------------------------------------------------------------.
1321
+ | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1322
+ | TOP (included). |
1323
+ `------------------------------------------------------------------*/
1324
+
1325
+ static void
1326
+ yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
1327
+ {
1328
+ YYFPRINTF (stderr, "Stack now");
1329
+ for (; yybottom <= yytop; yybottom++)
1330
+ {
1331
+ int yybot = *yybottom;
1332
+ YYFPRINTF (stderr, " %d", yybot);
1333
+ }
1334
+ YYFPRINTF (stderr, "\n");
1335
+ }
1336
+
1337
+ # define YY_STACK_PRINT(Bottom, Top) \
1338
+ do { \
1339
+ if (yydebug) \
1340
+ yy_stack_print ((Bottom), (Top)); \
1341
+ } while (0)
1342
+
1343
+
1344
+ /*------------------------------------------------.
1345
+ | Report that the YYRULE is going to be reduced. |
1346
+ `------------------------------------------------*/
1347
+
1348
+ static void
1349
+ yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp,
1350
+ int yyrule, VALUE parser, VALUE filename)
1351
+ {
1352
+ int yylno = yyrline[yyrule];
1353
+ int yynrhs = yyr2[yyrule];
1354
+ int yyi;
1355
+ YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
1356
+ yyrule - 1, yylno);
1357
+ /* The symbols being reduced. */
1358
+ for (yyi = 0; yyi < yynrhs; yyi++)
1359
+ {
1360
+ YYFPRINTF (stderr, " $%d = ", yyi + 1);
1361
+ yy_symbol_print (stderr,
1362
+ YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
1363
+ &yyvsp[(yyi + 1) - (yynrhs)], parser, filename);
1364
+ YYFPRINTF (stderr, "\n");
1365
+ }
1366
+ }
1367
+
1368
+ # define YY_REDUCE_PRINT(Rule) \
1369
+ do { \
1370
+ if (yydebug) \
1371
+ yy_reduce_print (yyssp, yyvsp, Rule, parser, filename); \
1372
+ } while (0)
1373
+
1374
+ /* Nonzero means print parse trace. It is left uninitialized so that
1375
+ multiple parsers can coexist. */
1376
+ int yydebug;
1377
+ #else /* !YYDEBUG */
1378
+ # define YYDPRINTF(Args) ((void) 0)
1379
+ # define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
1380
+ # define YY_STACK_PRINT(Bottom, Top)
1381
+ # define YY_REDUCE_PRINT(Rule)
1382
+ #endif /* !YYDEBUG */
1383
+
1384
+
1385
+ /* YYINITDEPTH -- initial size of the parser's stacks. */
1386
+ #ifndef YYINITDEPTH
1387
+ # define YYINITDEPTH 200
1388
+ #endif
1389
+
1390
+ /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1391
+ if the built-in stack extension method is used).
1392
+
1393
+ Do not make this value too large; the results are undefined if
1394
+ YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1395
+ evaluated with infinite-precision integer arithmetic. */
1396
+
1397
+ #ifndef YYMAXDEPTH
1398
+ # define YYMAXDEPTH 10000
1399
+ #endif
1400
+
1401
+
1402
+ /* Context of a parse error. */
1403
+ typedef struct
1404
+ {
1405
+ yy_state_t *yyssp;
1406
+ yysymbol_kind_t yytoken;
1407
+ } yypcontext_t;
1408
+
1409
+ /* Put in YYARG at most YYARGN of the expected tokens given the
1410
+ current YYCTX, and return the number of tokens stored in YYARG. If
1411
+ YYARG is null, return the number of expected tokens (guaranteed to
1412
+ be less than YYNTOKENS). Return YYENOMEM on memory exhaustion.
1413
+ Return 0 if there are more than YYARGN expected tokens, yet fill
1414
+ YYARG up to YYARGN. */
1415
+ static int
1416
+ yypcontext_expected_tokens (const yypcontext_t *yyctx,
1417
+ yysymbol_kind_t yyarg[], int yyargn)
1418
+ {
1419
+ /* Actual size of YYARG. */
1420
+ int yycount = 0;
1421
+ int yyn = yypact[+*yyctx->yyssp];
1422
+ if (!yypact_value_is_default (yyn))
1423
+ {
1424
+ /* Start YYX at -YYN if negative to avoid negative indexes in
1425
+ YYCHECK. In other words, skip the first -YYN actions for
1426
+ this state because they are default actions. */
1427
+ int yyxbegin = yyn < 0 ? -yyn : 0;
1428
+ /* Stay within bounds of both yycheck and yytname. */
1429
+ int yychecklim = YYLAST - yyn + 1;
1430
+ int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1431
+ int yyx;
1432
+ for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1433
+ if (yycheck[yyx + yyn] == yyx && yyx != YYSYMBOL_YYerror
1434
+ && !yytable_value_is_error (yytable[yyx + yyn]))
1435
+ {
1436
+ if (!yyarg)
1437
+ ++yycount;
1438
+ else if (yycount == yyargn)
1439
+ return 0;
1440
+ else
1441
+ yyarg[yycount++] = YY_CAST (yysymbol_kind_t, yyx);
1442
+ }
1443
+ }
1444
+ if (yyarg && yycount == 0 && 0 < yyargn)
1445
+ yyarg[0] = YYSYMBOL_YYEMPTY;
1446
+ return yycount;
1447
+ }
1448
+
1449
+
1450
+
1451
+
1452
+ #ifndef yystrlen
1453
+ # if defined __GLIBC__ && defined _STRING_H
1454
+ # define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S)))
1455
+ # else
1456
+ /* Return the length of YYSTR. */
1457
+ static YYPTRDIFF_T
1458
+ yystrlen (const char *yystr)
1459
+ {
1460
+ YYPTRDIFF_T yylen;
1461
+ for (yylen = 0; yystr[yylen]; yylen++)
1462
+ continue;
1463
+ return yylen;
1464
+ }
1465
+ # endif
1466
+ #endif
1467
+
1468
+ #ifndef yystpcpy
1469
+ # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1470
+ # define yystpcpy stpcpy
1471
+ # else
1472
+ /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1473
+ YYDEST. */
1474
+ static char *
1475
+ yystpcpy (char *yydest, const char *yysrc)
1476
+ {
1477
+ char *yyd = yydest;
1478
+ const char *yys = yysrc;
1479
+
1480
+ while ((*yyd++ = *yys++) != '\0')
1481
+ continue;
1482
+
1483
+ return yyd - 1;
1484
+ }
1485
+ # endif
1486
+ #endif
1487
+
1488
+
1489
+
1490
+ static int
1491
+ yy_syntax_error_arguments (const yypcontext_t *yyctx,
1492
+ yysymbol_kind_t yyarg[], int yyargn)
1493
+ {
1494
+ /* Actual size of YYARG. */
1495
+ int yycount = 0;
1496
+ /* There are many possibilities here to consider:
1497
+ - If this state is a consistent state with a default action, then
1498
+ the only way this function was invoked is if the default action
1499
+ is an error action. In that case, don't check for expected
1500
+ tokens because there are none.
1501
+ - The only way there can be no lookahead present (in yychar) is if
1502
+ this state is a consistent state with a default action. Thus,
1503
+ detecting the absence of a lookahead is sufficient to determine
1504
+ that there is no unexpected or expected token to report. In that
1505
+ case, just report a simple "syntax error".
1506
+ - Don't assume there isn't a lookahead just because this state is a
1507
+ consistent state with a default action. There might have been a
1508
+ previous inconsistent state, consistent state with a non-default
1509
+ action, or user semantic action that manipulated yychar.
1510
+ - Of course, the expected token list depends on states to have
1511
+ correct lookahead information, and it depends on the parser not
1512
+ to perform extra reductions after fetching a lookahead from the
1513
+ scanner and before detecting a syntax error. Thus, state merging
1514
+ (from LALR or IELR) and default reductions corrupt the expected
1515
+ token list. However, the list is correct for canonical LR with
1516
+ one exception: it will still contain any token that will not be
1517
+ accepted due to an error action in a later state.
1518
+ */
1519
+ if (yyctx->yytoken != YYSYMBOL_YYEMPTY)
1520
+ {
1521
+ int yyn;
1522
+ if (yyarg)
1523
+ yyarg[yycount] = yyctx->yytoken;
1524
+ ++yycount;
1525
+ yyn = yypcontext_expected_tokens (yyctx,
1526
+ yyarg ? yyarg + 1 : yyarg, yyargn - 1);
1527
+ if (yyn == YYENOMEM)
1528
+ return YYENOMEM;
1529
+ else
1530
+ yycount += yyn;
1531
+ }
1532
+ return yycount;
1533
+ }
1534
+
1535
+ /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1536
+ about the unexpected token YYTOKEN for the state stack whose top is
1537
+ YYSSP.
1538
+
1539
+ Return 0 if *YYMSG was successfully written. Return -1 if *YYMSG is
1540
+ not large enough to hold the message. In that case, also set
1541
+ *YYMSG_ALLOC to the required number of bytes. Return YYENOMEM if the
1542
+ required number of bytes is too large to store. */
1543
+ static int
1544
+ yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg,
1545
+ const yypcontext_t *yyctx)
1546
+ {
1547
+ enum { YYARGS_MAX = 5 };
1548
+ /* Internationalized format string. */
1549
+ const char *yyformat = YY_NULLPTR;
1550
+ /* Arguments of yyformat: reported tokens (one for the "unexpected",
1551
+ one per "expected"). */
1552
+ yysymbol_kind_t yyarg[YYARGS_MAX];
1553
+ /* Cumulated lengths of YYARG. */
1554
+ YYPTRDIFF_T yysize = 0;
1555
+
1556
+ /* Actual size of YYARG. */
1557
+ int yycount = yy_syntax_error_arguments (yyctx, yyarg, YYARGS_MAX);
1558
+ if (yycount == YYENOMEM)
1559
+ return YYENOMEM;
1560
+
1561
+ switch (yycount)
1562
+ {
1563
+ #define YYCASE_(N, S) \
1564
+ case N: \
1565
+ yyformat = S; \
1566
+ break
1567
+ default: /* Avoid compiler warnings. */
1568
+ YYCASE_(0, YY_("syntax error"));
1569
+ YYCASE_(1, YY_("syntax error, unexpected %s"));
1570
+ YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1571
+ YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1572
+ YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1573
+ YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1574
+ #undef YYCASE_
1575
+ }
1576
+
1577
+ /* Compute error message size. Don't count the "%s"s, but reserve
1578
+ room for the terminator. */
1579
+ yysize = yystrlen (yyformat) - 2 * yycount + 1;
1580
+ {
1581
+ int yyi;
1582
+ for (yyi = 0; yyi < yycount; ++yyi)
1583
+ {
1584
+ YYPTRDIFF_T yysize1
1585
+ = yysize + yystrlen (yysymbol_name (yyarg[yyi]));
1586
+ if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
1587
+ yysize = yysize1;
1588
+ else
1589
+ return YYENOMEM;
1590
+ }
1591
+ }
1592
+
1593
+ if (*yymsg_alloc < yysize)
1594
+ {
1595
+ *yymsg_alloc = 2 * yysize;
1596
+ if (! (yysize <= *yymsg_alloc
1597
+ && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1598
+ *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1599
+ return -1;
1600
+ }
1601
+
1602
+ /* Avoid sprintf, as that infringes on the user's name space.
1603
+ Don't have undefined behavior even if the translation
1604
+ produced a string with the wrong number of "%s"s. */
1605
+ {
1606
+ char *yyp = *yymsg;
1607
+ int yyi = 0;
1608
+ while ((*yyp = *yyformat) != '\0')
1609
+ if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1610
+ {
1611
+ yyp = yystpcpy (yyp, yysymbol_name (yyarg[yyi++]));
1612
+ yyformat += 2;
1613
+ }
1614
+ else
1615
+ {
1616
+ ++yyp;
1617
+ ++yyformat;
1618
+ }
1619
+ }
1620
+ return 0;
1621
+ }
1622
+
1623
+
1624
+ /*-----------------------------------------------.
1625
+ | Release the memory associated to this symbol. |
1626
+ `-----------------------------------------------*/
1627
+
1628
+ static void
1629
+ yydestruct (const char *yymsg,
1630
+ yysymbol_kind_t yykind, YYSTYPE *yyvaluep, VALUE parser, VALUE filename)
1631
+ {
1632
+ YY_USE (yyvaluep);
1633
+ YY_USE (parser);
1634
+ YY_USE (filename);
1635
+ if (!yymsg)
1636
+ yymsg = "Deleting";
1637
+ YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
1638
+
1639
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1640
+ YY_USE (yykind);
1641
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
1642
+ }
1643
+
1644
+
1645
+
1646
+
1647
+
1648
+
1649
+ /*----------.
1650
+ | yyparse. |
1651
+ `----------*/
1652
+
1653
+ int
1654
+ yyparse (VALUE parser, VALUE filename)
1655
+ {
1656
+ /* Lookahead token kind. */
1657
+ int yychar;
1658
+
1659
+
1660
+ /* The semantic value of the lookahead symbol. */
1661
+ /* Default value used for initialization, for pacifying older GCCs
1662
+ or non-GCC compilers. */
1663
+ YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
1664
+ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
1665
+
1666
+ /* Number of syntax errors so far. */
1667
+ int yynerrs = 0;
1668
+
1669
+ yy_state_fast_t yystate = 0;
1670
+ /* Number of tokens to shift before error messages enabled. */
1671
+ int yyerrstatus = 0;
1672
+
1673
+ /* Refer to the stacks through separate pointers, to allow yyoverflow
1674
+ to reallocate them elsewhere. */
1675
+
1676
+ /* Their size. */
1677
+ YYPTRDIFF_T yystacksize = YYINITDEPTH;
1678
+
1679
+ /* The state stack: array, bottom, top. */
1680
+ yy_state_t yyssa[YYINITDEPTH];
1681
+ yy_state_t *yyss = yyssa;
1682
+ yy_state_t *yyssp = yyss;
1683
+
1684
+ /* The semantic value stack: array, bottom, top. */
1685
+ YYSTYPE yyvsa[YYINITDEPTH];
1686
+ YYSTYPE *yyvs = yyvsa;
1687
+ YYSTYPE *yyvsp = yyvs;
1688
+
1689
+ int yyn;
1690
+ /* The return value of yyparse. */
1691
+ int yyresult;
1692
+ /* Lookahead symbol kind. */
1693
+ yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
1694
+ /* The variables used to return semantic value and location from the
1695
+ action routines. */
1696
+ YYSTYPE yyval;
1697
+
1698
+ /* Buffer for error messages, and its allocated size. */
1699
+ char yymsgbuf[128];
1700
+ char *yymsg = yymsgbuf;
1701
+ YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf;
1702
+
1703
+ #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1704
+
1705
+ /* The number of symbols on the RHS of the reduced rule.
1706
+ Keep to zero when no symbol should be popped. */
1707
+ int yylen = 0;
1708
+
1709
+ YYDPRINTF ((stderr, "Starting parse\n"));
1710
+
1711
+ yychar = YYEMPTY; /* Cause a token to be read. */
1712
+
1713
+ goto yysetstate;
1714
+
1715
+
1716
+ /*------------------------------------------------------------.
1717
+ | yynewstate -- push a new state, which is found in yystate. |
1718
+ `------------------------------------------------------------*/
1719
+ yynewstate:
1720
+ /* In all cases, when you get here, the value and location stacks
1721
+ have just been pushed. So pushing a state here evens the stacks. */
1722
+ yyssp++;
1723
+
1724
+
1725
+ /*--------------------------------------------------------------------.
1726
+ | yysetstate -- set current state (the top of the stack) to yystate. |
1727
+ `--------------------------------------------------------------------*/
1728
+ yysetstate:
1729
+ YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1730
+ YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
1731
+ YY_IGNORE_USELESS_CAST_BEGIN
1732
+ *yyssp = YY_CAST (yy_state_t, yystate);
1733
+ YY_IGNORE_USELESS_CAST_END
1734
+ YY_STACK_PRINT (yyss, yyssp);
1735
+
1736
+ if (yyss + yystacksize - 1 <= yyssp)
1737
+ #if !defined yyoverflow && !defined YYSTACK_RELOCATE
1738
+ YYNOMEM;
1739
+ #else
1740
+ {
1741
+ /* Get the current used size of the three stacks, in elements. */
1742
+ YYPTRDIFF_T yysize = yyssp - yyss + 1;
1743
+
1744
+ # if defined yyoverflow
1745
+ {
1746
+ /* Give user a chance to reallocate the stack. Use copies of
1747
+ these so that the &'s don't force the real ones into
1748
+ memory. */
1749
+ yy_state_t *yyss1 = yyss;
1750
+ YYSTYPE *yyvs1 = yyvs;
1751
+
1752
+ /* Each stack pointer address is followed by the size of the
1753
+ data in use in that stack, in bytes. This used to be a
1754
+ conditional around just the two extra args, but that might
1755
+ be undefined if yyoverflow is a macro. */
1756
+ yyoverflow (YY_("memory exhausted"),
1757
+ &yyss1, yysize * YYSIZEOF (*yyssp),
1758
+ &yyvs1, yysize * YYSIZEOF (*yyvsp),
1759
+ &yystacksize);
1760
+ yyss = yyss1;
1761
+ yyvs = yyvs1;
1762
+ }
1763
+ # else /* defined YYSTACK_RELOCATE */
1764
+ /* Extend the stack our own way. */
1765
+ if (YYMAXDEPTH <= yystacksize)
1766
+ YYNOMEM;
1767
+ yystacksize *= 2;
1768
+ if (YYMAXDEPTH < yystacksize)
1769
+ yystacksize = YYMAXDEPTH;
1770
+
1771
+ {
1772
+ yy_state_t *yyss1 = yyss;
1773
+ union yyalloc *yyptr =
1774
+ YY_CAST (union yyalloc *,
1775
+ YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
1776
+ if (! yyptr)
1777
+ YYNOMEM;
1778
+ YYSTACK_RELOCATE (yyss_alloc, yyss);
1779
+ YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1780
+ # undef YYSTACK_RELOCATE
1781
+ if (yyss1 != yyssa)
1782
+ YYSTACK_FREE (yyss1);
1783
+ }
1784
+ # endif
1785
+
1786
+ yyssp = yyss + yysize - 1;
1787
+ yyvsp = yyvs + yysize - 1;
1788
+
1789
+ YY_IGNORE_USELESS_CAST_BEGIN
1790
+ YYDPRINTF ((stderr, "Stack size increased to %ld\n",
1791
+ YY_CAST (long, yystacksize)));
1792
+ YY_IGNORE_USELESS_CAST_END
1793
+
1794
+ if (yyss + yystacksize - 1 <= yyssp)
1795
+ YYABORT;
1796
+ }
1797
+ #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
1798
+
1799
+
1800
+ if (yystate == YYFINAL)
1801
+ YYACCEPT;
1802
+
1803
+ goto yybackup;
1804
+
1805
+
1806
+ /*-----------.
1807
+ | yybackup. |
1808
+ `-----------*/
1809
+ yybackup:
1810
+ /* Do appropriate processing given the current state. Read a
1811
+ lookahead token if we need one and don't already have one. */
1812
+
1813
+ /* First try to decide what to do without reference to lookahead token. */
1814
+ yyn = yypact[yystate];
1815
+ if (yypact_value_is_default (yyn))
1816
+ goto yydefault;
1817
+
1818
+ /* Not known => get a lookahead token if don't already have one. */
1819
+
1820
+ /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */
1821
+ if (yychar == YYEMPTY)
1822
+ {
1823
+ YYDPRINTF ((stderr, "Reading a token\n"));
1824
+ yychar = yylex (&yylval, parser, filename);
1825
+ }
1826
+
1827
+ if (yychar <= YYEOF)
1828
+ {
1829
+ yychar = YYEOF;
1830
+ yytoken = YYSYMBOL_YYEOF;
1831
+ YYDPRINTF ((stderr, "Now at end of input.\n"));
1832
+ }
1833
+ else if (yychar == YYerror)
1834
+ {
1835
+ /* The scanner already issued an error message, process directly
1836
+ to error recovery. But do not keep the error token as
1837
+ lookahead, it is too special and may lead us to an endless
1838
+ loop in error recovery. */
1839
+ yychar = YYUNDEF;
1840
+ yytoken = YYSYMBOL_YYerror;
1841
+ goto yyerrlab1;
1842
+ }
1843
+ else
1844
+ {
1845
+ yytoken = YYTRANSLATE (yychar);
1846
+ YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1847
+ }
1848
+
1849
+ /* If the proper action on seeing token YYTOKEN is to reduce or to
1850
+ detect an error, take that action. */
1851
+ yyn += yytoken;
1852
+ if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1853
+ goto yydefault;
1854
+ yyn = yytable[yyn];
1855
+ if (yyn <= 0)
1856
+ {
1857
+ if (yytable_value_is_error (yyn))
1858
+ goto yyerrlab;
1859
+ yyn = -yyn;
1860
+ goto yyreduce;
1861
+ }
1862
+
1863
+ /* Count tokens shifted since error; after three, turn off error
1864
+ status. */
1865
+ if (yyerrstatus)
1866
+ yyerrstatus--;
1867
+
1868
+ /* Shift the lookahead token. */
1869
+ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1870
+ yystate = yyn;
1871
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1872
+ *++yyvsp = yylval;
1873
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
1874
+
1875
+ /* Discard the shifted token. */
1876
+ yychar = YYEMPTY;
1877
+ goto yynewstate;
1878
+
1879
+
1880
+ /*-----------------------------------------------------------.
1881
+ | yydefault -- do the default action for the current state. |
1882
+ `-----------------------------------------------------------*/
1883
+ yydefault:
1884
+ yyn = yydefact[yystate];
1885
+ if (yyn == 0)
1886
+ goto yyerrlab;
1887
+ goto yyreduce;
1888
+
1889
+
1890
+ /*-----------------------------.
1891
+ | yyreduce -- do a reduction. |
1892
+ `-----------------------------*/
1893
+ yyreduce:
1894
+ /* yyn is the number of a rule to reduce with. */
1895
+ yylen = yyr2[yyn];
1896
+
1897
+ /* If YYLEN is nonzero, implement the default value of the action:
1898
+ '$$ = $1'.
1899
+
1900
+ Otherwise, the following line sets YYVAL to garbage.
1901
+ This behavior is undocumented and Bison
1902
+ users should not rely upon it. Assigning to YYVAL
1903
+ unconditionally makes the parser a bit smaller, and it avoids a
1904
+ GCC warning that YYVAL may be used uninitialized. */
1905
+ yyval = yyvsp[1-yylen];
1906
+
1907
+
1908
+ YY_REDUCE_PRINT (yyn);
1909
+ switch (yyn)
1910
+ {
1911
+ case 2: /* start: document */
1912
+ #line 103 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
1913
+ { rb_ivar_set(parser, rb_intern("@result"), yyvsp[0]); }
1914
+ #line 1915 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
1915
+ break;
1916
+
1917
+ case 3: /* document: definitions_list */
1918
+ #line 105 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
1919
+ {
1920
+ VALUE position_source = rb_ary_entry(yyvsp[0], 0);
1921
+ VALUE line, col;
1922
+ if (RB_TEST(position_source)) {
1923
+ line = rb_funcall(position_source, rb_intern("line"), 0);
1924
+ col = rb_funcall(position_source, rb_intern("col"), 0);
1925
+ } else {
1926
+ line = INT2FIX(1);
1927
+ col = INT2FIX(1);
1928
+ }
1929
+ yyval = MAKE_AST_NODE(Document, 3, line, col, yyvsp[0]);
1930
+ }
1931
+ #line 1932 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
1932
+ break;
1933
+
1934
+ case 4: /* definitions_list: definition */
1935
+ #line 119 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
1936
+ { yyval = rb_ary_new_from_args(1, yyvsp[0]); }
1937
+ #line 1938 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
1938
+ break;
1939
+
1940
+ case 5: /* definitions_list: definitions_list definition */
1941
+ #line 120 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
1942
+ { rb_ary_push(yyval, yyvsp[0]); }
1943
+ #line 1944 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
1944
+ break;
1945
+
1946
+ case 11: /* operation_definition: operation_type operation_name_opt variable_definitions_opt directives_list_opt selection_set */
1947
+ #line 132 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
1948
+ {
1949
+ yyval = MAKE_AST_NODE(OperationDefinition, 7,
1950
+ rb_ary_entry(yyvsp[-4], 1),
1951
+ rb_ary_entry(yyvsp[-4], 2),
1952
+ rb_ary_entry(yyvsp[-4], 3),
1953
+ (RB_TEST(yyvsp[-3]) ? rb_ary_entry(yyvsp[-3], 3) : Qnil),
1954
+ yyvsp[-2],
1955
+ yyvsp[-1],
1956
+ yyvsp[0]
1957
+ );
1958
+ }
1959
+ #line 1960 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
1960
+ break;
1961
+
1962
+ case 12: /* operation_definition: LCURLY selection_list RCURLY */
1963
+ #line 143 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
1964
+ {
1965
+ yyval = MAKE_AST_NODE(OperationDefinition, 7,
1966
+ rb_ary_entry(yyvsp[-2], 1),
1967
+ rb_ary_entry(yyvsp[-2], 2),
1968
+ r_string_query,
1969
+ Qnil,
1970
+ GraphQL_Language_Nodes_NONE,
1971
+ GraphQL_Language_Nodes_NONE,
1972
+ yyvsp[-1]
1973
+ );
1974
+ }
1975
+ #line 1976 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
1976
+ break;
1977
+
1978
+ case 13: /* operation_definition: LCURLY RCURLY */
1979
+ #line 154 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
1980
+ {
1981
+ yyval = MAKE_AST_NODE(OperationDefinition, 7,
1982
+ rb_ary_entry(yyvsp[-1], 1),
1983
+ rb_ary_entry(yyvsp[-1], 2),
1984
+ r_string_query,
1985
+ Qnil,
1986
+ GraphQL_Language_Nodes_NONE,
1987
+ GraphQL_Language_Nodes_NONE,
1988
+ GraphQL_Language_Nodes_NONE
1989
+ );
1990
+ }
1991
+ #line 1992 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
1992
+ break;
1993
+
1994
+ case 17: /* operation_name_opt: %empty */
1995
+ #line 172 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
1996
+ { yyval = Qnil; }
1997
+ #line 1998 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
1998
+ break;
1999
+
2000
+ case 19: /* variable_definitions_opt: %empty */
2001
+ #line 176 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2002
+ { yyval = GraphQL_Language_Nodes_NONE; }
2003
+ #line 2004 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2004
+ break;
2005
+
2006
+ case 20: /* variable_definitions_opt: LPAREN variable_definitions_list RPAREN */
2007
+ #line 177 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2008
+ { yyval = yyvsp[-1]; }
2009
+ #line 2010 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2010
+ break;
2011
+
2012
+ case 21: /* variable_definitions_list: variable_definition */
2013
+ #line 180 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2014
+ { yyval = rb_ary_new_from_args(1, yyvsp[0]); }
2015
+ #line 2016 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2016
+ break;
2017
+
2018
+ case 22: /* variable_definitions_list: variable_definitions_list variable_definition */
2019
+ #line 181 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2020
+ { rb_ary_push(yyval, yyvsp[0]); }
2021
+ #line 2022 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2022
+ break;
2023
+
2024
+ case 23: /* variable_definition: VAR_SIGN name COLON type default_value_opt */
2025
+ #line 184 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2026
+ {
2027
+ yyval = MAKE_AST_NODE(VariableDefinition, 5,
2028
+ rb_ary_entry(yyvsp[-4], 1),
2029
+ rb_ary_entry(yyvsp[-4], 2),
2030
+ rb_ary_entry(yyvsp[-3], 3),
2031
+ yyvsp[-1],
2032
+ yyvsp[0]
2033
+ );
2034
+ }
2035
+ #line 2036 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2036
+ break;
2037
+
2038
+ case 24: /* default_value_opt: %empty */
2039
+ #line 195 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2040
+ { yyval = Qnil; }
2041
+ #line 2042 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2042
+ break;
2043
+
2044
+ case 25: /* default_value_opt: EQUALS literal_value */
2045
+ #line 196 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2046
+ { yyval = yyvsp[0]; }
2047
+ #line 2048 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2048
+ break;
2049
+
2050
+ case 26: /* selection_list: selection */
2051
+ #line 199 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2052
+ { yyval = rb_ary_new_from_args(1, yyvsp[0]); }
2053
+ #line 2054 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2054
+ break;
2055
+
2056
+ case 27: /* selection_list: selection_list selection */
2057
+ #line 200 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2058
+ { rb_ary_push(yyval, yyvsp[0]); }
2059
+ #line 2060 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2060
+ break;
2061
+
2062
+ case 31: /* selection_set: LCURLY selection_list RCURLY */
2063
+ #line 208 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2064
+ { yyval = yyvsp[-1]; }
2065
+ #line 2066 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2066
+ break;
2067
+
2068
+ case 32: /* selection_set_opt: %empty */
2069
+ #line 211 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2070
+ { yyval = rb_ary_new(); }
2071
+ #line 2072 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2072
+ break;
2073
+
2074
+ case 34: /* field: name COLON name arguments_opt directives_list_opt selection_set_opt */
2075
+ #line 215 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2076
+ {
2077
+ yyval = MAKE_AST_NODE(Field, 7,
2078
+ rb_ary_entry(yyvsp[-5], 1),
2079
+ rb_ary_entry(yyvsp[-5], 2),
2080
+ rb_ary_entry(yyvsp[-5], 3), // alias
2081
+ rb_ary_entry(yyvsp[-3], 3), // name
2082
+ yyvsp[-2], // args
2083
+ yyvsp[-1], // directives
2084
+ yyvsp[0] // subselections
2085
+ );
2086
+ }
2087
+ #line 2088 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2088
+ break;
2089
+
2090
+ case 35: /* field: name arguments_opt directives_list_opt selection_set_opt */
2091
+ #line 226 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2092
+ {
2093
+ yyval = MAKE_AST_NODE(Field, 7,
2094
+ rb_ary_entry(yyvsp[-3], 1),
2095
+ rb_ary_entry(yyvsp[-3], 2),
2096
+ Qnil, // alias
2097
+ rb_ary_entry(yyvsp[-3], 3), // name
2098
+ yyvsp[-2], // args
2099
+ yyvsp[-1], // directives
2100
+ yyvsp[0] // subselections
2101
+ );
2102
+ }
2103
+ #line 2104 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2104
+ break;
2105
+
2106
+ case 36: /* arguments_opt: %empty */
2107
+ #line 239 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2108
+ { yyval = GraphQL_Language_Nodes_NONE; }
2109
+ #line 2110 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2110
+ break;
2111
+
2112
+ case 37: /* arguments_opt: LPAREN arguments_list RPAREN */
2113
+ #line 240 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2114
+ { yyval = yyvsp[-1]; }
2115
+ #line 2116 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2116
+ break;
2117
+
2118
+ case 38: /* arguments_list: argument */
2119
+ #line 243 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2120
+ { yyval = rb_ary_new_from_args(1, yyvsp[0]); }
2121
+ #line 2122 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2122
+ break;
2123
+
2124
+ case 39: /* arguments_list: arguments_list argument */
2125
+ #line 244 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2126
+ { rb_ary_push(yyval, yyvsp[0]); }
2127
+ #line 2128 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2128
+ break;
2129
+
2130
+ case 40: /* argument: name COLON input_value */
2131
+ #line 247 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2132
+ {
2133
+ yyval = MAKE_AST_NODE(Argument, 4,
2134
+ rb_ary_entry(yyvsp[-2], 1),
2135
+ rb_ary_entry(yyvsp[-2], 2),
2136
+ rb_ary_entry(yyvsp[-2], 3),
2137
+ yyvsp[0]
2138
+ );
2139
+ }
2140
+ #line 2141 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2141
+ break;
2142
+
2143
+ case 41: /* literal_value: FLOAT */
2144
+ #line 257 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2145
+ { yyval = rb_funcall(rb_ary_entry(yyvsp[0], 3), rb_intern("to_f"), 0); }
2146
+ #line 2147 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2147
+ break;
2148
+
2149
+ case 42: /* literal_value: INT */
2150
+ #line 258 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2151
+ { yyval = rb_funcall(rb_ary_entry(yyvsp[0], 3), rb_intern("to_i"), 0); }
2152
+ #line 2153 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2153
+ break;
2154
+
2155
+ case 43: /* literal_value: STRING */
2156
+ #line 259 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2157
+ { yyval = rb_ary_entry(yyvsp[0], 3); }
2158
+ #line 2159 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2159
+ break;
2160
+
2161
+ case 44: /* literal_value: TRUE_LITERAL */
2162
+ #line 260 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2163
+ { yyval = Qtrue; }
2164
+ #line 2165 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2165
+ break;
2166
+
2167
+ case 45: /* literal_value: FALSE_LITERAL */
2168
+ #line 261 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2169
+ { yyval = Qfalse; }
2170
+ #line 2171 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2171
+ break;
2172
+
2173
+ case 53: /* null_value: NULL_LITERAL */
2174
+ #line 272 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2175
+ {
2176
+ yyval = MAKE_AST_NODE(NullValue, 3,
2177
+ rb_ary_entry(yyvsp[0], 1),
2178
+ rb_ary_entry(yyvsp[0], 2),
2179
+ rb_ary_entry(yyvsp[0], 3)
2180
+ );
2181
+ }
2182
+ #line 2183 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2183
+ break;
2184
+
2185
+ case 54: /* variable: VAR_SIGN name */
2186
+ #line 280 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2187
+ {
2188
+ yyval = MAKE_AST_NODE(VariableIdentifier, 3,
2189
+ rb_ary_entry(yyvsp[-1], 1),
2190
+ rb_ary_entry(yyvsp[-1], 2),
2191
+ rb_ary_entry(yyvsp[0], 3)
2192
+ );
2193
+ }
2194
+ #line 2195 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2195
+ break;
2196
+
2197
+ case 55: /* list_value: LBRACKET RBRACKET */
2198
+ #line 289 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2199
+ { yyval = GraphQL_Language_Nodes_NONE; }
2200
+ #line 2201 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2201
+ break;
2202
+
2203
+ case 56: /* list_value: LBRACKET list_value_list RBRACKET */
2204
+ #line 290 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2205
+ { yyval = yyvsp[-1]; }
2206
+ #line 2207 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2207
+ break;
2208
+
2209
+ case 57: /* list_value_list: input_value */
2210
+ #line 293 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2211
+ { yyval = rb_ary_new_from_args(1, yyvsp[0]); }
2212
+ #line 2213 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2213
+ break;
2214
+
2215
+ case 58: /* list_value_list: list_value_list input_value */
2216
+ #line 294 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2217
+ { rb_ary_push(yyval, yyvsp[0]); }
2218
+ #line 2219 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2219
+ break;
2220
+
2221
+ case 65: /* enum_value: enum_name */
2222
+ #line 304 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2223
+ {
2224
+ yyval = MAKE_AST_NODE(Enum, 3,
2225
+ rb_ary_entry(yyvsp[0], 1),
2226
+ rb_ary_entry(yyvsp[0], 2),
2227
+ rb_ary_entry(yyvsp[0], 3)
2228
+ );
2229
+ }
2230
+ #line 2231 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2231
+ break;
2232
+
2233
+ case 66: /* object_value: LCURLY object_value_list_opt RCURLY */
2234
+ #line 313 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2235
+ {
2236
+ yyval = MAKE_AST_NODE(InputObject, 3,
2237
+ rb_ary_entry(yyvsp[-2], 1),
2238
+ rb_ary_entry(yyvsp[-2], 2),
2239
+ yyvsp[-1]
2240
+ );
2241
+ }
2242
+ #line 2243 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2243
+ break;
2244
+
2245
+ case 67: /* object_value_list_opt: %empty */
2246
+ #line 322 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2247
+ { yyval = GraphQL_Language_Nodes_NONE; }
2248
+ #line 2249 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2249
+ break;
2250
+
2251
+ case 69: /* object_value_list: object_value_field */
2252
+ #line 326 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2253
+ { yyval = rb_ary_new_from_args(1, yyvsp[0]); }
2254
+ #line 2255 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2255
+ break;
2256
+
2257
+ case 70: /* object_value_list: object_value_list object_value_field */
2258
+ #line 327 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2259
+ { rb_ary_push(yyval, yyvsp[0]); }
2260
+ #line 2261 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2261
+ break;
2262
+
2263
+ case 71: /* object_value_field: name COLON input_value */
2264
+ #line 330 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2265
+ {
2266
+ yyval = MAKE_AST_NODE(Argument, 4,
2267
+ rb_ary_entry(yyvsp[-2], 1),
2268
+ rb_ary_entry(yyvsp[-2], 2),
2269
+ rb_ary_entry(yyvsp[-2], 3),
2270
+ yyvsp[0]
2271
+ );
2272
+ }
2273
+ #line 2274 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2274
+ break;
2275
+
2276
+ case 72: /* object_literal_value: LCURLY object_literal_value_list_opt RCURLY */
2277
+ #line 341 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2278
+ {
2279
+ yyval = MAKE_AST_NODE(InputObject, 3,
2280
+ rb_ary_entry(yyvsp[-2], 1),
2281
+ rb_ary_entry(yyvsp[-2], 2),
2282
+ yyvsp[-1]
2283
+ );
2284
+ }
2285
+ #line 2286 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2286
+ break;
2287
+
2288
+ case 73: /* object_literal_value_list_opt: %empty */
2289
+ #line 350 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2290
+ { yyval = GraphQL_Language_Nodes_NONE; }
2291
+ #line 2292 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2292
+ break;
2293
+
2294
+ case 75: /* object_literal_value_list: object_literal_value_field */
2295
+ #line 354 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2296
+ { yyval = rb_ary_new_from_args(1, yyvsp[0]); }
2297
+ #line 2298 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2298
+ break;
2299
+
2300
+ case 76: /* object_literal_value_list: object_literal_value_list object_literal_value_field */
2301
+ #line 355 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2302
+ { rb_ary_push(yyval, yyvsp[0]); }
2303
+ #line 2304 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2304
+ break;
2305
+
2306
+ case 77: /* object_literal_value_field: name COLON literal_value */
2307
+ #line 358 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2308
+ {
2309
+ yyval = MAKE_AST_NODE(Argument, 4,
2310
+ rb_ary_entry(yyvsp[-2], 1),
2311
+ rb_ary_entry(yyvsp[-2], 2),
2312
+ rb_ary_entry(yyvsp[-2], 3),
2313
+ yyvsp[0]
2314
+ );
2315
+ }
2316
+ #line 2317 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2317
+ break;
2318
+
2319
+ case 78: /* directives_list_opt: %empty */
2320
+ #line 369 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2321
+ { yyval = GraphQL_Language_Nodes_NONE; }
2322
+ #line 2323 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2323
+ break;
2324
+
2325
+ case 80: /* directives_list: directive */
2326
+ #line 373 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2327
+ { yyval = rb_ary_new_from_args(1, yyvsp[0]); }
2328
+ #line 2329 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2329
+ break;
2330
+
2331
+ case 81: /* directives_list: directives_list directive */
2332
+ #line 374 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2333
+ { rb_ary_push(yyval, yyvsp[0]); }
2334
+ #line 2335 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2335
+ break;
2336
+
2337
+ case 82: /* directive: DIR_SIGN name arguments_opt */
2338
+ #line 376 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2339
+ {
2340
+ yyval = MAKE_AST_NODE(Directive, 4,
2341
+ rb_ary_entry(yyvsp[-2], 1),
2342
+ rb_ary_entry(yyvsp[-2], 2),
2343
+ rb_ary_entry(yyvsp[-1], 3),
2344
+ yyvsp[0]
2345
+ );
2346
+ }
2347
+ #line 2348 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2348
+ break;
2349
+
2350
+ case 101: /* fragment_spread: ELLIPSIS name_without_on directives_list_opt */
2351
+ #line 411 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2352
+ {
2353
+ yyval = MAKE_AST_NODE(FragmentSpread, 4,
2354
+ rb_ary_entry(yyvsp[-2], 1),
2355
+ rb_ary_entry(yyvsp[-2], 2),
2356
+ rb_ary_entry(yyvsp[-1], 3),
2357
+ yyvsp[0]
2358
+ );
2359
+ }
2360
+ #line 2361 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2361
+ break;
2362
+
2363
+ case 102: /* inline_fragment: ELLIPSIS ON type directives_list_opt selection_set */
2364
+ #line 421 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2365
+ {
2366
+ yyval = MAKE_AST_NODE(InlineFragment, 5,
2367
+ rb_ary_entry(yyvsp[-4], 1),
2368
+ rb_ary_entry(yyvsp[-4], 2),
2369
+ yyvsp[-2],
2370
+ yyvsp[-1],
2371
+ yyvsp[0]
2372
+ );
2373
+ }
2374
+ #line 2375 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2375
+ break;
2376
+
2377
+ case 103: /* inline_fragment: ELLIPSIS directives_list_opt selection_set */
2378
+ #line 430 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2379
+ {
2380
+ yyval = MAKE_AST_NODE(InlineFragment, 5,
2381
+ rb_ary_entry(yyvsp[-2], 1),
2382
+ rb_ary_entry(yyvsp[-2], 2),
2383
+ Qnil,
2384
+ yyvsp[-1],
2385
+ yyvsp[0]
2386
+ );
2387
+ }
2388
+ #line 2389 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2389
+ break;
2390
+
2391
+ case 104: /* fragment_definition: FRAGMENT fragment_name_opt ON type directives_list_opt selection_set */
2392
+ #line 441 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2393
+ {
2394
+ yyval = MAKE_AST_NODE(FragmentDefinition, 6,
2395
+ rb_ary_entry(yyvsp[-5], 1),
2396
+ rb_ary_entry(yyvsp[-5], 2),
2397
+ yyvsp[-4],
2398
+ yyvsp[-2],
2399
+ yyvsp[-1],
2400
+ yyvsp[0]
2401
+ );
2402
+ }
2403
+ #line 2404 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2404
+ break;
2405
+
2406
+ case 105: /* fragment_name_opt: %empty */
2407
+ #line 453 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2408
+ { yyval = Qnil; }
2409
+ #line 2410 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2410
+ break;
2411
+
2412
+ case 106: /* fragment_name_opt: name_without_on */
2413
+ #line 454 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2414
+ { yyval = rb_ary_entry(yyvsp[0], 3); }
2415
+ #line 2416 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2416
+ break;
2417
+
2418
+ case 108: /* type: nullable_type BANG */
2419
+ #line 458 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2420
+ { yyval = MAKE_AST_NODE(NonNullType, 3, rb_funcall(yyvsp[-1], rb_intern("line"), 0), rb_funcall(yyvsp[-1], rb_intern("col"), 0), yyvsp[-1]); }
2421
+ #line 2422 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2422
+ break;
2423
+
2424
+ case 109: /* nullable_type: name */
2425
+ #line 461 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2426
+ {
2427
+ yyval = MAKE_AST_NODE(TypeName, 3,
2428
+ rb_ary_entry(yyvsp[0], 1),
2429
+ rb_ary_entry(yyvsp[0], 2),
2430
+ rb_ary_entry(yyvsp[0], 3)
2431
+ );
2432
+ }
2433
+ #line 2434 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2434
+ break;
2435
+
2436
+ case 110: /* nullable_type: LBRACKET type RBRACKET */
2437
+ #line 468 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2438
+ {
2439
+ yyval = MAKE_AST_NODE(ListType, 3,
2440
+ rb_funcall(yyvsp[-1], rb_intern("line"), 0),
2441
+ rb_funcall(yyvsp[-1], rb_intern("col"), 0),
2442
+ yyvsp[-1]
2443
+ );
2444
+ }
2445
+ #line 2446 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2446
+ break;
2447
+
2448
+ case 114: /* schema_definition: SCHEMA directives_list_opt operation_type_definition_list_opt */
2449
+ #line 482 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2450
+ {
2451
+ yyval = MAKE_AST_NODE(SchemaDefinition, 6,
2452
+ rb_ary_entry(yyvsp[-2], 1),
2453
+ rb_ary_entry(yyvsp[-2], 2),
2454
+ // TODO use static strings:
2455
+ rb_hash_aref(yyvsp[0], rb_str_new_cstr("query")),
2456
+ rb_hash_aref(yyvsp[0], rb_str_new_cstr("mutation")),
2457
+ rb_hash_aref(yyvsp[0], rb_str_new_cstr("subscription")),
2458
+ yyvsp[-1]
2459
+ );
2460
+ }
2461
+ #line 2462 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2462
+ break;
2463
+
2464
+ case 115: /* operation_type_definition_list_opt: %empty */
2465
+ #line 495 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2466
+ { yyval = rb_hash_new(); }
2467
+ #line 2468 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2468
+ break;
2469
+
2470
+ case 116: /* operation_type_definition_list_opt: LCURLY operation_type_definition_list RCURLY */
2471
+ #line 496 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2472
+ { yyval = yyvsp[-1]; }
2473
+ #line 2474 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2474
+ break;
2475
+
2476
+ case 117: /* operation_type_definition_list: operation_type_definition */
2477
+ #line 499 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2478
+ {
2479
+ yyval = rb_hash_new();
2480
+ rb_hash_aset(yyval, rb_ary_entry(yyvsp[0], 0), rb_ary_entry(yyvsp[0], 1));
2481
+ }
2482
+ #line 2483 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2483
+ break;
2484
+
2485
+ case 118: /* operation_type_definition_list: operation_type_definition_list operation_type_definition */
2486
+ #line 503 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2487
+ {
2488
+ rb_hash_aset(yyval, rb_ary_entry(yyvsp[0], 0), rb_ary_entry(yyvsp[0], 1));
2489
+ }
2490
+ #line 2491 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2491
+ break;
2492
+
2493
+ case 119: /* operation_type_definition: operation_type COLON name */
2494
+ #line 508 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2495
+ {
2496
+ yyval = rb_ary_new_from_args(2, rb_ary_entry(yyvsp[-2], 3), rb_ary_entry(yyvsp[0], 3));
2497
+ }
2498
+ #line 2499 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2499
+ break;
2500
+
2501
+ case 127: /* description_opt: %empty */
2502
+ #line 523 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2503
+ { yyval = Qnil; }
2504
+ #line 2505 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2505
+ break;
2506
+
2507
+ case 129: /* scalar_type_definition: description_opt SCALAR name directives_list_opt */
2508
+ #line 527 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2509
+ {
2510
+ yyval = MAKE_AST_NODE(ScalarTypeDefinition, 5,
2511
+ rb_ary_entry(yyvsp[-2], 1),
2512
+ rb_ary_entry(yyvsp[-2], 2),
2513
+ rb_ary_entry(yyvsp[-1], 3),
2514
+ // TODO see get_description for reading a description from comments
2515
+ (RB_TEST(yyvsp[-3]) ? rb_ary_entry(yyvsp[-3], 3) : Qnil),
2516
+ yyvsp[0]
2517
+ );
2518
+ }
2519
+ #line 2520 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2520
+ break;
2521
+
2522
+ case 130: /* object_type_definition: description_opt TYPE_LITERAL name implements_opt directives_list_opt field_definition_list_opt */
2523
+ #line 539 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2524
+ {
2525
+ yyval = MAKE_AST_NODE(ObjectTypeDefinition, 7,
2526
+ rb_ary_entry(yyvsp[-4], 1),
2527
+ rb_ary_entry(yyvsp[-4], 2),
2528
+ rb_ary_entry(yyvsp[-3], 3),
2529
+ yyvsp[-2], // implements
2530
+ // TODO see get_description for reading a description from comments
2531
+ (RB_TEST(yyvsp[-5]) ? rb_ary_entry(yyvsp[-5], 3) : Qnil),
2532
+ yyvsp[-1],
2533
+ yyvsp[0]
2534
+ );
2535
+ }
2536
+ #line 2537 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2537
+ break;
2538
+
2539
+ case 131: /* implements_opt: %empty */
2540
+ #line 553 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2541
+ { yyval = GraphQL_Language_Nodes_NONE; }
2542
+ #line 2543 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2543
+ break;
2544
+
2545
+ case 132: /* implements_opt: IMPLEMENTS AMP interfaces_list */
2546
+ #line 554 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2547
+ { yyval = yyvsp[0]; }
2548
+ #line 2549 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2549
+ break;
2550
+
2551
+ case 133: /* implements_opt: IMPLEMENTS interfaces_list */
2552
+ #line 555 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2553
+ { yyval = yyvsp[0]; }
2554
+ #line 2555 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2555
+ break;
2556
+
2557
+ case 134: /* implements_opt: IMPLEMENTS legacy_interfaces_list */
2558
+ #line 556 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2559
+ { yyval = yyvsp[0]; }
2560
+ #line 2561 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2561
+ break;
2562
+
2563
+ case 135: /* interfaces_list: name */
2564
+ #line 559 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2565
+ {
2566
+ VALUE new_name = MAKE_AST_NODE(TypeName, 3,
2567
+ rb_ary_entry(yyvsp[0], 1),
2568
+ rb_ary_entry(yyvsp[0], 2),
2569
+ rb_ary_entry(yyvsp[0], 3)
2570
+ );
2571
+ yyval = rb_ary_new_from_args(1, new_name);
2572
+ }
2573
+ #line 2574 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2574
+ break;
2575
+
2576
+ case 136: /* interfaces_list: interfaces_list AMP name */
2577
+ #line 567 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2578
+ {
2579
+ VALUE new_name = MAKE_AST_NODE(TypeName, 3, rb_ary_entry(yyvsp[0], 1), rb_ary_entry(yyvsp[0], 2), rb_ary_entry(yyvsp[0], 3));
2580
+ rb_ary_push(yyval, new_name);
2581
+ }
2582
+ #line 2583 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2583
+ break;
2584
+
2585
+ case 137: /* legacy_interfaces_list: name */
2586
+ #line 573 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2587
+ {
2588
+ VALUE new_name = MAKE_AST_NODE(TypeName, 3,
2589
+ rb_ary_entry(yyvsp[0], 1),
2590
+ rb_ary_entry(yyvsp[0], 2),
2591
+ rb_ary_entry(yyvsp[0], 3)
2592
+ );
2593
+ yyval = rb_ary_new_from_args(1, new_name);
2594
+ }
2595
+ #line 2596 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2596
+ break;
2597
+
2598
+ case 138: /* legacy_interfaces_list: legacy_interfaces_list name */
2599
+ #line 581 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2600
+ {
2601
+ rb_ary_push(yyval, MAKE_AST_NODE(TypeName, 3, rb_ary_entry(yyvsp[0], 1), rb_ary_entry(yyvsp[0], 2), rb_ary_entry(yyvsp[0], 3)));
2602
+ }
2603
+ #line 2604 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2604
+ break;
2605
+
2606
+ case 139: /* input_value_definition: description_opt name COLON type default_value_opt directives_list_opt */
2607
+ #line 586 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2608
+ {
2609
+ yyval = MAKE_AST_NODE(InputValueDefinition, 7,
2610
+ rb_ary_entry(yyvsp[-4], 1),
2611
+ rb_ary_entry(yyvsp[-4], 2),
2612
+ rb_ary_entry(yyvsp[-4], 3),
2613
+ yyvsp[-2],
2614
+ yyvsp[-1],
2615
+ // TODO see get_description for reading a description from comments
2616
+ (RB_TEST(yyvsp[-5]) ? rb_ary_entry(yyvsp[-5], 3) : Qnil),
2617
+ yyvsp[0]
2618
+ );
2619
+ }
2620
+ #line 2621 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2621
+ break;
2622
+
2623
+ case 140: /* input_value_definition_list: input_value_definition */
2624
+ #line 600 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2625
+ { yyval = rb_ary_new_from_args(1, yyvsp[0]); }
2626
+ #line 2627 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2627
+ break;
2628
+
2629
+ case 141: /* input_value_definition_list: input_value_definition_list input_value_definition */
2630
+ #line 601 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2631
+ { rb_ary_push(yyval, yyvsp[0]); }
2632
+ #line 2633 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2633
+ break;
2634
+
2635
+ case 142: /* arguments_definitions_opt: %empty */
2636
+ #line 604 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2637
+ { yyval = GraphQL_Language_Nodes_NONE; }
2638
+ #line 2639 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2639
+ break;
2640
+
2641
+ case 143: /* arguments_definitions_opt: LPAREN input_value_definition_list RPAREN */
2642
+ #line 605 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2643
+ { yyval = yyvsp[-1]; }
2644
+ #line 2645 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2645
+ break;
2646
+
2647
+ case 144: /* field_definition: description_opt name arguments_definitions_opt COLON type directives_list_opt */
2648
+ #line 608 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2649
+ {
2650
+ yyval = MAKE_AST_NODE(FieldDefinition, 7,
2651
+ rb_ary_entry(yyvsp[-4], 1),
2652
+ rb_ary_entry(yyvsp[-4], 2),
2653
+ rb_ary_entry(yyvsp[-4], 3),
2654
+ yyvsp[-1],
2655
+ // TODO see get_description for reading a description from comments
2656
+ (RB_TEST(yyvsp[-5]) ? rb_ary_entry(yyvsp[-5], 3) : Qnil),
2657
+ yyvsp[-3],
2658
+ yyvsp[0]
2659
+ );
2660
+ }
2661
+ #line 2662 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2662
+ break;
2663
+
2664
+ case 145: /* field_definition_list_opt: %empty */
2665
+ #line 622 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2666
+ { yyval = GraphQL_Language_Nodes_NONE; }
2667
+ #line 2668 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2668
+ break;
2669
+
2670
+ case 146: /* field_definition_list_opt: LCURLY field_definition_list RCURLY */
2671
+ #line 623 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2672
+ { yyval = yyvsp[-1]; }
2673
+ #line 2674 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2674
+ break;
2675
+
2676
+ case 147: /* field_definition_list: %empty */
2677
+ #line 626 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2678
+ { yyval = GraphQL_Language_Nodes_NONE; }
2679
+ #line 2680 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2680
+ break;
2681
+
2682
+ case 148: /* field_definition_list: field_definition */
2683
+ #line 627 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2684
+ { yyval = rb_ary_new_from_args(1, yyvsp[0]); }
2685
+ #line 2686 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2686
+ break;
2687
+
2688
+ case 149: /* field_definition_list: field_definition_list field_definition */
2689
+ #line 628 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2690
+ { rb_ary_push(yyval, yyvsp[0]); }
2691
+ #line 2692 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2692
+ break;
2693
+
2694
+ case 150: /* interface_type_definition: description_opt INTERFACE name implements_opt directives_list_opt field_definition_list_opt */
2695
+ #line 631 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2696
+ {
2697
+ yyval = MAKE_AST_NODE(InterfaceTypeDefinition, 7,
2698
+ rb_ary_entry(yyvsp[-4], 1),
2699
+ rb_ary_entry(yyvsp[-4], 2),
2700
+ rb_ary_entry(yyvsp[-3], 3),
2701
+ // TODO see get_description for reading a description from comments
2702
+ (RB_TEST(yyvsp[-5]) ? rb_ary_entry(yyvsp[-5], 3) : Qnil),
2703
+ yyvsp[-2],
2704
+ yyvsp[-1],
2705
+ yyvsp[0]
2706
+ );
2707
+ }
2708
+ #line 2709 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2709
+ break;
2710
+
2711
+ case 151: /* union_members: name */
2712
+ #line 645 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2713
+ {
2714
+ VALUE new_member = MAKE_AST_NODE(TypeName, 3,
2715
+ rb_ary_entry(yyvsp[0], 1),
2716
+ rb_ary_entry(yyvsp[0], 2),
2717
+ rb_ary_entry(yyvsp[0], 3)
2718
+ );
2719
+ yyval = rb_ary_new_from_args(1, new_member);
2720
+ }
2721
+ #line 2722 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2722
+ break;
2723
+
2724
+ case 152: /* union_members: union_members PIPE name */
2725
+ #line 653 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2726
+ {
2727
+ rb_ary_push(yyval, MAKE_AST_NODE(TypeName, 3, rb_ary_entry(yyvsp[0], 1), rb_ary_entry(yyvsp[0], 2), rb_ary_entry(yyvsp[0], 3)));
2728
+ }
2729
+ #line 2730 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2730
+ break;
2731
+
2732
+ case 153: /* union_type_definition: description_opt UNION name directives_list_opt EQUALS union_members */
2733
+ #line 658 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2734
+ {
2735
+ yyval = MAKE_AST_NODE(UnionTypeDefinition, 6,
2736
+ rb_ary_entry(yyvsp[-4], 1),
2737
+ rb_ary_entry(yyvsp[-4], 2),
2738
+ rb_ary_entry(yyvsp[-3], 3),
2739
+ yyvsp[0], // types
2740
+ // TODO see get_description for reading a description from comments
2741
+ (RB_TEST(yyvsp[-5]) ? rb_ary_entry(yyvsp[-5], 3) : Qnil),
2742
+ yyvsp[-2]
2743
+ );
2744
+ }
2745
+ #line 2746 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2746
+ break;
2747
+
2748
+ case 154: /* enum_type_definition: description_opt ENUM name directives_list_opt LCURLY enum_value_definitions RCURLY */
2749
+ #line 671 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2750
+ {
2751
+ yyval = MAKE_AST_NODE(EnumTypeDefinition, 6,
2752
+ rb_ary_entry(yyvsp[-5], 1),
2753
+ rb_ary_entry(yyvsp[-5], 2),
2754
+ rb_ary_entry(yyvsp[-4], 3),
2755
+ // TODO see get_description for reading a description from comments
2756
+ (RB_TEST(yyvsp[-6]) ? rb_ary_entry(yyvsp[-6], 3) : Qnil),
2757
+ yyvsp[-3],
2758
+ yyvsp[-1]
2759
+ );
2760
+ }
2761
+ #line 2762 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2762
+ break;
2763
+
2764
+ case 155: /* enum_value_definition: description_opt enum_name directives_list_opt */
2765
+ #line 684 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2766
+ {
2767
+ yyval = MAKE_AST_NODE(EnumValueDefinition, 5,
2768
+ rb_ary_entry(yyvsp[-1], 1),
2769
+ rb_ary_entry(yyvsp[-1], 2),
2770
+ rb_ary_entry(yyvsp[-1], 3),
2771
+ // TODO see get_description for reading a description from comments
2772
+ (RB_TEST(yyvsp[-2]) ? rb_ary_entry(yyvsp[-2], 3) : Qnil),
2773
+ yyvsp[0]
2774
+ );
2775
+ }
2776
+ #line 2777 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2777
+ break;
2778
+
2779
+ case 156: /* enum_value_definitions: enum_value_definition */
2780
+ #line 696 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2781
+ { yyval = rb_ary_new_from_args(1, yyvsp[0]); }
2782
+ #line 2783 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2783
+ break;
2784
+
2785
+ case 157: /* enum_value_definitions: enum_value_definitions enum_value_definition */
2786
+ #line 697 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2787
+ { rb_ary_push(yyval, yyvsp[0]); }
2788
+ #line 2789 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2789
+ break;
2790
+
2791
+ case 158: /* input_object_type_definition: description_opt INPUT name directives_list_opt LCURLY input_value_definition_list RCURLY */
2792
+ #line 700 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2793
+ {
2794
+ yyval = MAKE_AST_NODE(InputObjectTypeDefinition, 6,
2795
+ rb_ary_entry(yyvsp[-5], 1),
2796
+ rb_ary_entry(yyvsp[-5], 2),
2797
+ rb_ary_entry(yyvsp[-4], 3),
2798
+ // TODO see get_description for reading a description from comments
2799
+ (RB_TEST(yyvsp[-6]) ? rb_ary_entry(yyvsp[-6], 3) : Qnil),
2800
+ yyvsp[-3],
2801
+ yyvsp[-1]
2802
+ );
2803
+ }
2804
+ #line 2805 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2805
+ break;
2806
+
2807
+ case 159: /* directive_definition: description_opt DIRECTIVE DIR_SIGN name arguments_definitions_opt directive_repeatable_opt ON directive_locations */
2808
+ #line 713 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2809
+ {
2810
+ yyval = MAKE_AST_NODE(DirectiveDefinition, 7,
2811
+ rb_ary_entry(yyvsp[-6], 1),
2812
+ rb_ary_entry(yyvsp[-6], 2),
2813
+ rb_ary_entry(yyvsp[-4], 3),
2814
+ (RB_TEST(yyvsp[-2]) ? Qtrue : Qfalse), // repeatable
2815
+ // TODO see get_description for reading a description from comments
2816
+ (RB_TEST(yyvsp[-7]) ? rb_ary_entry(yyvsp[-7], 3) : Qnil),
2817
+ yyvsp[-3],
2818
+ yyvsp[0]
2819
+ );
2820
+ }
2821
+ #line 2822 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2822
+ break;
2823
+
2824
+ case 160: /* directive_repeatable_opt: %empty */
2825
+ #line 727 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2826
+ { yyval = Qnil; }
2827
+ #line 2828 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2828
+ break;
2829
+
2830
+ case 161: /* directive_repeatable_opt: REPEATABLE */
2831
+ #line 728 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2832
+ { yyval = Qtrue; }
2833
+ #line 2834 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2834
+ break;
2835
+
2836
+ case 162: /* directive_locations: name */
2837
+ #line 731 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2838
+ { yyval = rb_ary_new_from_args(1, MAKE_AST_NODE(DirectiveLocation, 3, rb_ary_entry(yyvsp[0], 1), rb_ary_entry(yyvsp[0], 2), rb_ary_entry(yyvsp[0], 3))); }
2839
+ #line 2840 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2840
+ break;
2841
+
2842
+ case 163: /* directive_locations: directive_locations PIPE name */
2843
+ #line 732 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2844
+ { rb_ary_push(yyval, MAKE_AST_NODE(DirectiveLocation, 3, rb_ary_entry(yyvsp[0], 1), rb_ary_entry(yyvsp[0], 2), rb_ary_entry(yyvsp[0], 3))); }
2845
+ #line 2846 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2846
+ break;
2847
+
2848
+ case 166: /* schema_extension: EXTEND SCHEMA directives_list_opt LCURLY operation_type_definition_list RCURLY */
2849
+ #line 740 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2850
+ {
2851
+ yyval = MAKE_AST_NODE(SchemaExtension, 6,
2852
+ rb_ary_entry(yyvsp[-5], 1),
2853
+ rb_ary_entry(yyvsp[-5], 2),
2854
+ // TODO use static strings:
2855
+ rb_hash_aref(yyvsp[-1], rb_str_new_cstr("query")),
2856
+ rb_hash_aref(yyvsp[-1], rb_str_new_cstr("mutation")),
2857
+ rb_hash_aref(yyvsp[-1], rb_str_new_cstr("subscription")),
2858
+ yyvsp[-3]
2859
+ );
2860
+ }
2861
+ #line 2862 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2862
+ break;
2863
+
2864
+ case 167: /* schema_extension: EXTEND SCHEMA directives_list */
2865
+ #line 751 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2866
+ {
2867
+ yyval = MAKE_AST_NODE(SchemaExtension, 6,
2868
+ rb_ary_entry(yyvsp[-2], 1),
2869
+ rb_ary_entry(yyvsp[-2], 2),
2870
+ Qnil,
2871
+ Qnil,
2872
+ Qnil,
2873
+ yyvsp[0]
2874
+ );
2875
+ }
2876
+ #line 2877 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2877
+ break;
2878
+
2879
+ case 174: /* scalar_type_extension: EXTEND SCALAR name directives_list */
2880
+ #line 770 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2881
+ {
2882
+ yyval = MAKE_AST_NODE(ScalarTypeExtension, 4,
2883
+ rb_ary_entry(yyvsp[-3], 1),
2884
+ rb_ary_entry(yyvsp[-3], 2),
2885
+ rb_ary_entry(yyvsp[-1], 3),
2886
+ yyvsp[0]
2887
+ );
2888
+ }
2889
+ #line 2890 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2890
+ break;
2891
+
2892
+ case 175: /* object_type_extension: EXTEND TYPE_LITERAL name implements_opt directives_list_opt field_definition_list_opt */
2893
+ #line 780 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2894
+ {
2895
+ yyval = MAKE_AST_NODE(ObjectTypeExtension, 6,
2896
+ rb_ary_entry(yyvsp[-5], 1),
2897
+ rb_ary_entry(yyvsp[-5], 2),
2898
+ rb_ary_entry(yyvsp[-3], 3),
2899
+ yyvsp[-2], // implements
2900
+ yyvsp[-1],
2901
+ yyvsp[0]
2902
+ );
2903
+ }
2904
+ #line 2905 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2905
+ break;
2906
+
2907
+ case 176: /* interface_type_extension: EXTEND INTERFACE name implements_opt directives_list_opt field_definition_list_opt */
2908
+ #line 792 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2909
+ {
2910
+ yyval = MAKE_AST_NODE(InterfaceTypeExtension, 6,
2911
+ rb_ary_entry(yyvsp[-5], 1),
2912
+ rb_ary_entry(yyvsp[-5], 2),
2913
+ rb_ary_entry(yyvsp[-3], 3),
2914
+ yyvsp[-2],
2915
+ yyvsp[-1],
2916
+ yyvsp[0]
2917
+ );
2918
+ }
2919
+ #line 2920 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2920
+ break;
2921
+
2922
+ case 177: /* union_type_extension: EXTEND UNION name directives_list_opt EQUALS union_members */
2923
+ #line 804 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2924
+ {
2925
+ yyval = MAKE_AST_NODE(UnionTypeExtension, 5,
2926
+ rb_ary_entry(yyvsp[-5], 1),
2927
+ rb_ary_entry(yyvsp[-5], 2),
2928
+ rb_ary_entry(yyvsp[-3], 3),
2929
+ yyvsp[0], // types
2930
+ yyvsp[-2]
2931
+ );
2932
+ }
2933
+ #line 2934 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2934
+ break;
2935
+
2936
+ case 178: /* union_type_extension: EXTEND UNION name directives_list */
2937
+ #line 813 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2938
+ {
2939
+ yyval = MAKE_AST_NODE(UnionTypeExtension, 5,
2940
+ rb_ary_entry(yyvsp[-3], 1),
2941
+ rb_ary_entry(yyvsp[-3], 2),
2942
+ rb_ary_entry(yyvsp[-1], 3),
2943
+ GraphQL_Language_Nodes_NONE, // types
2944
+ yyvsp[0]
2945
+ );
2946
+ }
2947
+ #line 2948 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2948
+ break;
2949
+
2950
+ case 179: /* enum_type_extension: EXTEND ENUM name directives_list_opt LCURLY enum_value_definitions RCURLY */
2951
+ #line 824 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2952
+ {
2953
+ yyval = MAKE_AST_NODE(EnumTypeExtension, 5,
2954
+ rb_ary_entry(yyvsp[-6], 1),
2955
+ rb_ary_entry(yyvsp[-6], 2),
2956
+ rb_ary_entry(yyvsp[-4], 3),
2957
+ yyvsp[-3],
2958
+ yyvsp[-1]
2959
+ );
2960
+ }
2961
+ #line 2962 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2962
+ break;
2963
+
2964
+ case 180: /* enum_type_extension: EXTEND ENUM name directives_list */
2965
+ #line 833 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2966
+ {
2967
+ yyval = MAKE_AST_NODE(EnumTypeExtension, 5,
2968
+ rb_ary_entry(yyvsp[-3], 1),
2969
+ rb_ary_entry(yyvsp[-3], 2),
2970
+ rb_ary_entry(yyvsp[-1], 3),
2971
+ yyvsp[0],
2972
+ GraphQL_Language_Nodes_NONE
2973
+ );
2974
+ }
2975
+ #line 2976 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2976
+ break;
2977
+
2978
+ case 181: /* input_object_type_extension: EXTEND INPUT name directives_list_opt LCURLY input_value_definition_list RCURLY */
2979
+ #line 844 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2980
+ {
2981
+ yyval = MAKE_AST_NODE(InputObjectTypeExtension, 5,
2982
+ rb_ary_entry(yyvsp[-6], 1),
2983
+ rb_ary_entry(yyvsp[-6], 2),
2984
+ rb_ary_entry(yyvsp[-4], 3),
2985
+ yyvsp[-3],
2986
+ yyvsp[-1]
2987
+ );
2988
+ }
2989
+ #line 2990 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
2990
+ break;
2991
+
2992
+ case 182: /* input_object_type_extension: EXTEND INPUT name directives_list */
2993
+ #line 853 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
2994
+ {
2995
+ yyval = MAKE_AST_NODE(InputObjectTypeExtension, 5,
2996
+ rb_ary_entry(yyvsp[-3], 1),
2997
+ rb_ary_entry(yyvsp[-3], 2),
2998
+ rb_ary_entry(yyvsp[-1], 3),
2999
+ yyvsp[0],
3000
+ GraphQL_Language_Nodes_NONE
3001
+ );
3002
+ }
3003
+ #line 3004 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
3004
+ break;
3005
+
3006
+
3007
+ #line 3008 "graphql-c_parser/ext/graphql_c_parser_ext/parser.c"
3008
+
3009
+ default: break;
3010
+ }
3011
+ /* User semantic actions sometimes alter yychar, and that requires
3012
+ that yytoken be updated with the new translation. We take the
3013
+ approach of translating immediately before every use of yytoken.
3014
+ One alternative is translating here after every semantic action,
3015
+ but that translation would be missed if the semantic action invokes
3016
+ YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
3017
+ if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
3018
+ incorrect destructor might then be invoked immediately. In the
3019
+ case of YYERROR or YYBACKUP, subsequent parser actions might lead
3020
+ to an incorrect destructor call or verbose syntax error message
3021
+ before the lookahead is translated. */
3022
+ YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
3023
+
3024
+ YYPOPSTACK (yylen);
3025
+ yylen = 0;
3026
+
3027
+ *++yyvsp = yyval;
3028
+
3029
+ /* Now 'shift' the result of the reduction. Determine what state
3030
+ that goes to, based on the state we popped back to and the rule
3031
+ number reduced by. */
3032
+ {
3033
+ const int yylhs = yyr1[yyn] - YYNTOKENS;
3034
+ const int yyi = yypgoto[yylhs] + *yyssp;
3035
+ yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
3036
+ ? yytable[yyi]
3037
+ : yydefgoto[yylhs]);
3038
+ }
3039
+
3040
+ goto yynewstate;
3041
+
3042
+
3043
+ /*--------------------------------------.
3044
+ | yyerrlab -- here on detecting error. |
3045
+ `--------------------------------------*/
3046
+ yyerrlab:
3047
+ /* Make sure we have latest lookahead translation. See comments at
3048
+ user semantic actions for why this is necessary. */
3049
+ yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
3050
+ /* If not already recovering from an error, report this error. */
3051
+ if (!yyerrstatus)
3052
+ {
3053
+ ++yynerrs;
3054
+ {
3055
+ yypcontext_t yyctx
3056
+ = {yyssp, yytoken};
3057
+ char const *yymsgp = YY_("syntax error");
3058
+ int yysyntax_error_status;
3059
+ yysyntax_error_status = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx);
3060
+ if (yysyntax_error_status == 0)
3061
+ yymsgp = yymsg;
3062
+ else if (yysyntax_error_status == -1)
3063
+ {
3064
+ if (yymsg != yymsgbuf)
3065
+ YYSTACK_FREE (yymsg);
3066
+ yymsg = YY_CAST (char *,
3067
+ YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc)));
3068
+ if (yymsg)
3069
+ {
3070
+ yysyntax_error_status
3071
+ = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx);
3072
+ yymsgp = yymsg;
3073
+ }
3074
+ else
3075
+ {
3076
+ yymsg = yymsgbuf;
3077
+ yymsg_alloc = sizeof yymsgbuf;
3078
+ yysyntax_error_status = YYENOMEM;
3079
+ }
3080
+ }
3081
+ yyerror (parser, filename, yymsgp);
3082
+ if (yysyntax_error_status == YYENOMEM)
3083
+ YYNOMEM;
3084
+ }
3085
+ }
3086
+
3087
+ if (yyerrstatus == 3)
3088
+ {
3089
+ /* If just tried and failed to reuse lookahead token after an
3090
+ error, discard it. */
3091
+
3092
+ if (yychar <= YYEOF)
3093
+ {
3094
+ /* Return failure if at end of input. */
3095
+ if (yychar == YYEOF)
3096
+ YYABORT;
3097
+ }
3098
+ else
3099
+ {
3100
+ yydestruct ("Error: discarding",
3101
+ yytoken, &yylval, parser, filename);
3102
+ yychar = YYEMPTY;
3103
+ }
3104
+ }
3105
+
3106
+ /* Else will try to reuse lookahead token after shifting the error
3107
+ token. */
3108
+ goto yyerrlab1;
3109
+
3110
+
3111
+ /*---------------------------------------------------.
3112
+ | yyerrorlab -- error raised explicitly by YYERROR. |
3113
+ `---------------------------------------------------*/
3114
+ yyerrorlab:
3115
+ /* Pacify compilers when the user code never invokes YYERROR and the
3116
+ label yyerrorlab therefore never appears in user code. */
3117
+ if (0)
3118
+ YYERROR;
3119
+ ++yynerrs;
3120
+
3121
+ /* Do not reclaim the symbols of the rule whose action triggered
3122
+ this YYERROR. */
3123
+ YYPOPSTACK (yylen);
3124
+ yylen = 0;
3125
+ YY_STACK_PRINT (yyss, yyssp);
3126
+ yystate = *yyssp;
3127
+ goto yyerrlab1;
3128
+
3129
+
3130
+ /*-------------------------------------------------------------.
3131
+ | yyerrlab1 -- common code for both syntax error and YYERROR. |
3132
+ `-------------------------------------------------------------*/
3133
+ yyerrlab1:
3134
+ yyerrstatus = 3; /* Each real token shifted decrements this. */
3135
+
3136
+ /* Pop stack until we find a state that shifts the error token. */
3137
+ for (;;)
3138
+ {
3139
+ yyn = yypact[yystate];
3140
+ if (!yypact_value_is_default (yyn))
3141
+ {
3142
+ yyn += YYSYMBOL_YYerror;
3143
+ if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
3144
+ {
3145
+ yyn = yytable[yyn];
3146
+ if (0 < yyn)
3147
+ break;
3148
+ }
3149
+ }
3150
+
3151
+ /* Pop the current state because it cannot handle the error token. */
3152
+ if (yyssp == yyss)
3153
+ YYABORT;
3154
+
3155
+
3156
+ yydestruct ("Error: popping",
3157
+ YY_ACCESSING_SYMBOL (yystate), yyvsp, parser, filename);
3158
+ YYPOPSTACK (1);
3159
+ yystate = *yyssp;
3160
+ YY_STACK_PRINT (yyss, yyssp);
3161
+ }
3162
+
3163
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
3164
+ *++yyvsp = yylval;
3165
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
3166
+
3167
+
3168
+ /* Shift the error token. */
3169
+ YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
3170
+
3171
+ yystate = yyn;
3172
+ goto yynewstate;
3173
+
3174
+
3175
+ /*-------------------------------------.
3176
+ | yyacceptlab -- YYACCEPT comes here. |
3177
+ `-------------------------------------*/
3178
+ yyacceptlab:
3179
+ yyresult = 0;
3180
+ goto yyreturnlab;
3181
+
3182
+
3183
+ /*-----------------------------------.
3184
+ | yyabortlab -- YYABORT comes here. |
3185
+ `-----------------------------------*/
3186
+ yyabortlab:
3187
+ yyresult = 1;
3188
+ goto yyreturnlab;
3189
+
3190
+
3191
+ /*-----------------------------------------------------------.
3192
+ | yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. |
3193
+ `-----------------------------------------------------------*/
3194
+ yyexhaustedlab:
3195
+ yyerror (parser, filename, YY_("memory exhausted"));
3196
+ yyresult = 2;
3197
+ goto yyreturnlab;
3198
+
3199
+
3200
+ /*----------------------------------------------------------.
3201
+ | yyreturnlab -- parsing is finished, clean up and return. |
3202
+ `----------------------------------------------------------*/
3203
+ yyreturnlab:
3204
+ if (yychar != YYEMPTY)
3205
+ {
3206
+ /* Make sure we have latest lookahead translation. See comments at
3207
+ user semantic actions for why this is necessary. */
3208
+ yytoken = YYTRANSLATE (yychar);
3209
+ yydestruct ("Cleanup: discarding lookahead",
3210
+ yytoken, &yylval, parser, filename);
3211
+ }
3212
+ /* Do not reclaim the symbols of the rule whose action triggered
3213
+ this YYABORT or YYACCEPT. */
3214
+ YYPOPSTACK (yylen);
3215
+ YY_STACK_PRINT (yyss, yyssp);
3216
+ while (yyssp != yyss)
3217
+ {
3218
+ yydestruct ("Cleanup: popping",
3219
+ YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, parser, filename);
3220
+ YYPOPSTACK (1);
3221
+ }
3222
+ #ifndef yyoverflow
3223
+ if (yyss != yyssa)
3224
+ YYSTACK_FREE (yyss);
3225
+ #endif
3226
+ if (yymsg != yymsgbuf)
3227
+ YYSTACK_FREE (yymsg);
3228
+ return yyresult;
3229
+ }
3230
+
3231
+ #line 863 "graphql-c_parser/ext/graphql_c_parser_ext/parser.y"
3232
+
3233
+
3234
+ // Custom functions
3235
+ int yylex (YYSTYPE *lvalp, VALUE parser, VALUE filename) {
3236
+ int next_token_idx = FIX2INT(rb_ivar_get(parser, rb_intern("@next_token_index")));
3237
+ VALUE tokens = rb_ivar_get(parser, rb_intern("@tokens"));
3238
+ VALUE next_token = rb_ary_entry(tokens, next_token_idx);
3239
+
3240
+ if (!RB_TEST(next_token)) {
3241
+ return YYEOF;
3242
+ }
3243
+ rb_ivar_set(parser, rb_intern("@next_token_index"), INT2FIX(next_token_idx + 1));
3244
+ VALUE token_type_rb_int = rb_ary_entry(next_token, 5);
3245
+ int next_token_type = FIX2INT(token_type_rb_int);
3246
+
3247
+ *lvalp = next_token;
3248
+ return next_token_type;
3249
+ }
3250
+
3251
+ void yyerror(VALUE parser, VALUE filename, const char *msg) {
3252
+ VALUE mGraphQL = rb_const_get_at(rb_cObject, rb_intern("GraphQL"));
3253
+ VALUE mCParser = rb_const_get_at(mGraphQL, rb_intern("CParser"));
3254
+ VALUE rb_message = rb_str_new_cstr(msg);
3255
+ VALUE exception = rb_funcall(
3256
+ mCParser, rb_intern("prepare_parse_error"), 2,
3257
+ rb_message,
3258
+ parser
3259
+ );
3260
+ rb_exc_raise(exception);
3261
+ }
3262
+
3263
+ #define INITIALIZE_NODE_CLASS_VARIABLE(node_class_name) GraphQL_Language_Nodes_##node_class_name = rb_const_get_at(mGraphQLLanguageNodes, rb_intern(#node_class_name));
3264
+
3265
+ void initialize_node_class_variables() {
3266
+ VALUE mGraphQL = rb_const_get_at(rb_cObject, rb_intern("GraphQL"));
3267
+ VALUE mGraphQLLanguage = rb_const_get_at(mGraphQL, rb_intern("Language"));
3268
+ VALUE mGraphQLLanguageNodes = rb_const_get_at(mGraphQLLanguage, rb_intern("Nodes"));
3269
+ GraphQL_Language_Nodes_NONE = rb_const_get_at(mGraphQLLanguageNodes, rb_intern("NONE"));
3270
+ r_string_query = rb_str_new_cstr("query");
3271
+ rb_global_variable(&r_string_query);
3272
+ rb_str_freeze(r_string_query);
3273
+
3274
+ INITIALIZE_NODE_CLASS_VARIABLE(Argument)
3275
+ INITIALIZE_NODE_CLASS_VARIABLE(Directive)
3276
+ INITIALIZE_NODE_CLASS_VARIABLE(Document)
3277
+ INITIALIZE_NODE_CLASS_VARIABLE(Enum)
3278
+ INITIALIZE_NODE_CLASS_VARIABLE(Field)
3279
+ INITIALIZE_NODE_CLASS_VARIABLE(FragmentDefinition)
3280
+ INITIALIZE_NODE_CLASS_VARIABLE(FragmentSpread)
3281
+ INITIALIZE_NODE_CLASS_VARIABLE(InlineFragment)
3282
+ INITIALIZE_NODE_CLASS_VARIABLE(InputObject)
3283
+ INITIALIZE_NODE_CLASS_VARIABLE(ListType)
3284
+ INITIALIZE_NODE_CLASS_VARIABLE(NonNullType)
3285
+ INITIALIZE_NODE_CLASS_VARIABLE(NullValue)
3286
+ INITIALIZE_NODE_CLASS_VARIABLE(OperationDefinition)
3287
+ INITIALIZE_NODE_CLASS_VARIABLE(TypeName)
3288
+ INITIALIZE_NODE_CLASS_VARIABLE(VariableDefinition)
3289
+ INITIALIZE_NODE_CLASS_VARIABLE(VariableIdentifier)
3290
+
3291
+ INITIALIZE_NODE_CLASS_VARIABLE(ScalarTypeDefinition)
3292
+ INITIALIZE_NODE_CLASS_VARIABLE(ObjectTypeDefinition)
3293
+ INITIALIZE_NODE_CLASS_VARIABLE(InterfaceTypeDefinition)
3294
+ INITIALIZE_NODE_CLASS_VARIABLE(UnionTypeDefinition)
3295
+ INITIALIZE_NODE_CLASS_VARIABLE(EnumTypeDefinition)
3296
+ INITIALIZE_NODE_CLASS_VARIABLE(InputObjectTypeDefinition)
3297
+ INITIALIZE_NODE_CLASS_VARIABLE(EnumValueDefinition)
3298
+ INITIALIZE_NODE_CLASS_VARIABLE(DirectiveDefinition)
3299
+ INITIALIZE_NODE_CLASS_VARIABLE(DirectiveLocation)
3300
+ INITIALIZE_NODE_CLASS_VARIABLE(FieldDefinition)
3301
+ INITIALIZE_NODE_CLASS_VARIABLE(InputValueDefinition)
3302
+ INITIALIZE_NODE_CLASS_VARIABLE(SchemaDefinition)
3303
+
3304
+ INITIALIZE_NODE_CLASS_VARIABLE(ScalarTypeExtension)
3305
+ INITIALIZE_NODE_CLASS_VARIABLE(ObjectTypeExtension)
3306
+ INITIALIZE_NODE_CLASS_VARIABLE(InterfaceTypeExtension)
3307
+ INITIALIZE_NODE_CLASS_VARIABLE(UnionTypeExtension)
3308
+ INITIALIZE_NODE_CLASS_VARIABLE(EnumTypeExtension)
3309
+ INITIALIZE_NODE_CLASS_VARIABLE(InputObjectTypeExtension)
3310
+ INITIALIZE_NODE_CLASS_VARIABLE(SchemaExtension)
3311
+ }