slow_blink 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/slow_blink/ext_schema_parser/common.h +27 -0
- data/ext/slow_blink/ext_schema_parser/extconf.rb +3 -0
- data/ext/slow_blink/ext_schema_parser/lexer.c +2701 -0
- data/ext/slow_blink/ext_schema_parser/lexer.h +486 -0
- data/ext/slow_blink/ext_schema_parser/parser.c +3848 -0
- data/ext/slow_blink/ext_schema_parser/parser.h +110 -0
- data/ext/slow_blink/ext_schema_parser/parser.l +139 -0
- data/ext/slow_blink/ext_schema_parser/parser.y +932 -0
- data/lib/slow_blink/annotatable.rb +46 -0
- data/lib/slow_blink/annotation.rb +38 -0
- data/lib/slow_blink/compact_encoder.rb +97 -0
- data/lib/slow_blink/component_reference.rb +50 -0
- data/lib/slow_blink/definition.rb +57 -0
- data/lib/slow_blink/enumeration.rb +105 -0
- data/lib/slow_blink/error.rb +4 -0
- data/lib/slow_blink/field.rb +82 -0
- data/lib/slow_blink/group.rb +129 -0
- data/lib/slow_blink/incremental_annotation.rb +91 -0
- data/lib/slow_blink/message.rb +43 -0
- data/lib/slow_blink/name_with_id.rb +49 -0
- data/lib/slow_blink/schema.rb +135 -0
- data/lib/slow_blink/sym.rb +54 -0
- data/lib/slow_blink/type.rb +448 -0
- data/lib/slow_blink/version.rb +22 -0
- data/lib/slow_blink.rb +20 -0
- data/rakefile +29 -0
- data/test/integration/capture_stderr.rb +20 -0
- data/test/integration/tc_inputs.rb +57 -0
- metadata +36 -5
@@ -0,0 +1,3848 @@
|
|
1
|
+
/* A Bison parser, made by GNU Bison 3.0.2. */
|
2
|
+
|
3
|
+
/* Skeleton implementation for Bison GLR parsers in C
|
4
|
+
|
5
|
+
Copyright (C) 2002-2013 Free Software Foundation, Inc.
|
6
|
+
|
7
|
+
This program is free software: you can redistribute it and/or modify
|
8
|
+
it under the terms of the GNU General Public License as published by
|
9
|
+
the Free Software Foundation, either version 3 of the License, or
|
10
|
+
(at your option) any later version.
|
11
|
+
|
12
|
+
This program is distributed in the hope that it will be useful,
|
13
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
GNU General Public License for more details.
|
16
|
+
|
17
|
+
You should have received a copy of the GNU General Public License
|
18
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
19
|
+
|
20
|
+
/* As a special exception, you may create a larger work that contains
|
21
|
+
part or all of the Bison parser skeleton and distribute that work
|
22
|
+
under terms of your choice, so long as that work isn't itself a
|
23
|
+
parser generator using the skeleton or a modified version thereof
|
24
|
+
as a parser skeleton. Alternatively, if you modify or redistribute
|
25
|
+
the parser skeleton itself, you may (at your option) remove this
|
26
|
+
special exception, which will cause the skeleton and the resulting
|
27
|
+
Bison output files to be licensed under the GNU General Public
|
28
|
+
License without this special exception.
|
29
|
+
|
30
|
+
This special exception was added by the Free Software Foundation in
|
31
|
+
version 2.2 of Bison. */
|
32
|
+
|
33
|
+
/* C GLR parser skeleton written by Paul Hilfinger. */
|
34
|
+
|
35
|
+
/* Identify Bison output. */
|
36
|
+
#define YYBISON 1
|
37
|
+
|
38
|
+
/* Bison version. */
|
39
|
+
#define YYBISON_VERSION "3.0.2"
|
40
|
+
|
41
|
+
/* Skeleton name. */
|
42
|
+
#define YYSKELETON_NAME "glr.c"
|
43
|
+
|
44
|
+
/* Pure parsers. */
|
45
|
+
#define YYPURE 1
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
|
52
|
+
/* First part of user declarations. */
|
53
|
+
#line 6 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:207 */
|
54
|
+
|
55
|
+
|
56
|
+
/* includes ***********************************************************/
|
57
|
+
|
58
|
+
#include <stdio.h>
|
59
|
+
#include <stdlib.h>
|
60
|
+
#include <stdbool.h>
|
61
|
+
#include <ruby.h>
|
62
|
+
#include <assert.h>
|
63
|
+
|
64
|
+
#include "lexer.h"
|
65
|
+
|
66
|
+
/* function prototypes ************************************************/
|
67
|
+
|
68
|
+
void yyerror(YYLTYPE *locp, yyscan_t scanner, VALUE filename, VALUE *tree, char const *msg, ... );
|
69
|
+
|
70
|
+
/* static function prototypes *****************************************/
|
71
|
+
|
72
|
+
static VALUE parseFileBuffer(int argc, VALUE* argv, VALUE self);
|
73
|
+
static VALUE newLocation(VALUE filename, const YYLTYPE *location);
|
74
|
+
|
75
|
+
/* static variables ***************************************************/
|
76
|
+
|
77
|
+
static VALUE cSlowBlink;
|
78
|
+
|
79
|
+
static VALUE cNameWithID;
|
80
|
+
|
81
|
+
static VALUE cSchema;
|
82
|
+
static VALUE cGroup;
|
83
|
+
static VALUE cField;
|
84
|
+
static VALUE cAnnotation;
|
85
|
+
static VALUE cIncrementalAnnotation;
|
86
|
+
|
87
|
+
static VALUE cDefinition;
|
88
|
+
static VALUE cEnumeration;
|
89
|
+
static VALUE cSym;
|
90
|
+
|
91
|
+
static VALUE cI8;
|
92
|
+
static VALUE cI16;
|
93
|
+
static VALUE cI32;
|
94
|
+
static VALUE cI64;
|
95
|
+
static VALUE cU8;
|
96
|
+
static VALUE cU16;
|
97
|
+
static VALUE cU32;
|
98
|
+
static VALUE cU64;
|
99
|
+
static VALUE cF64;
|
100
|
+
static VALUE cDECIMAL;
|
101
|
+
static VALUE cFIXED;
|
102
|
+
static VALUE cSEQUENCE;
|
103
|
+
static VALUE cSTRING;
|
104
|
+
static VALUE cBOOLEAN;
|
105
|
+
static VALUE cOBJECT;
|
106
|
+
static VALUE cBINARY;
|
107
|
+
static VALUE cREF;
|
108
|
+
|
109
|
+
static VALUE cDATE;
|
110
|
+
static VALUE cTIME_OF_DAY_MILLI;
|
111
|
+
static VALUE cTIME_OF_DAY_NANO;
|
112
|
+
static VALUE cMILLI_TIME;
|
113
|
+
static VALUE cNANO_TIME;
|
114
|
+
|
115
|
+
static VALUE cSchemaRef;
|
116
|
+
static VALUE cDefinitionRef;
|
117
|
+
static VALUE cDefinitionTypeRef;
|
118
|
+
static VALUE cFieldRef;
|
119
|
+
static VALUE cFieldTypeRef;
|
120
|
+
|
121
|
+
/* generated **********************************************************/
|
122
|
+
|
123
|
+
|
124
|
+
#line 125 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:207 */
|
125
|
+
|
126
|
+
# ifndef YY_NULLPTR
|
127
|
+
# if defined __cplusplus && 201103L <= __cplusplus
|
128
|
+
# define YY_NULLPTR nullptr
|
129
|
+
# else
|
130
|
+
# define YY_NULLPTR 0
|
131
|
+
# endif
|
132
|
+
# endif
|
133
|
+
|
134
|
+
#include "parser.h"
|
135
|
+
|
136
|
+
/* Enabling verbose error messages. */
|
137
|
+
#ifdef YYERROR_VERBOSE
|
138
|
+
# undef YYERROR_VERBOSE
|
139
|
+
# define YYERROR_VERBOSE 1
|
140
|
+
#else
|
141
|
+
# define YYERROR_VERBOSE 1
|
142
|
+
#endif
|
143
|
+
|
144
|
+
/* Default (constant) value used for initialization for null
|
145
|
+
right-hand sides. Unlike the standard yacc.c template, here we set
|
146
|
+
the default value of $$ to a zeroed-out value. Since the default
|
147
|
+
value is undefined, this behavior is technically correct. */
|
148
|
+
static YYSTYPE yyval_default;
|
149
|
+
static YYLTYPE yyloc_default
|
150
|
+
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
|
151
|
+
= { 1, 1, 1, 1 }
|
152
|
+
# endif
|
153
|
+
;
|
154
|
+
|
155
|
+
/* Copy the second part of user declarations. */
|
156
|
+
|
157
|
+
#line 158 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:230 */
|
158
|
+
|
159
|
+
#include <stdio.h>
|
160
|
+
#include <stdlib.h>
|
161
|
+
#include <string.h>
|
162
|
+
|
163
|
+
#ifndef YY_
|
164
|
+
# if defined YYENABLE_NLS && YYENABLE_NLS
|
165
|
+
# if ENABLE_NLS
|
166
|
+
# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
|
167
|
+
# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
|
168
|
+
# endif
|
169
|
+
# endif
|
170
|
+
# ifndef YY_
|
171
|
+
# define YY_(Msgid) Msgid
|
172
|
+
# endif
|
173
|
+
#endif
|
174
|
+
|
175
|
+
#ifndef YYFREE
|
176
|
+
# define YYFREE free
|
177
|
+
#endif
|
178
|
+
#ifndef YYMALLOC
|
179
|
+
# define YYMALLOC malloc
|
180
|
+
#endif
|
181
|
+
#ifndef YYREALLOC
|
182
|
+
# define YYREALLOC realloc
|
183
|
+
#endif
|
184
|
+
|
185
|
+
#define YYSIZEMAX ((size_t) -1)
|
186
|
+
|
187
|
+
#ifdef __cplusplus
|
188
|
+
typedef bool yybool;
|
189
|
+
#else
|
190
|
+
typedef unsigned char yybool;
|
191
|
+
#endif
|
192
|
+
#define yytrue 1
|
193
|
+
#define yyfalse 0
|
194
|
+
|
195
|
+
#ifndef YYSETJMP
|
196
|
+
# include <setjmp.h>
|
197
|
+
# define YYJMP_BUF jmp_buf
|
198
|
+
# define YYSETJMP(Env) setjmp (Env)
|
199
|
+
/* Pacify clang. */
|
200
|
+
# define YYLONGJMP(Env, Val) (longjmp (Env, Val), YYASSERT (0))
|
201
|
+
#endif
|
202
|
+
|
203
|
+
#ifndef YY_ATTRIBUTE
|
204
|
+
# if (defined __GNUC__ \
|
205
|
+
&& (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
|
206
|
+
|| defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
|
207
|
+
# define YY_ATTRIBUTE(Spec) __attribute__(Spec)
|
208
|
+
# else
|
209
|
+
# define YY_ATTRIBUTE(Spec) /* empty */
|
210
|
+
# endif
|
211
|
+
#endif
|
212
|
+
|
213
|
+
#ifndef YY_ATTRIBUTE_PURE
|
214
|
+
# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
|
215
|
+
#endif
|
216
|
+
|
217
|
+
#ifndef YY_ATTRIBUTE_UNUSED
|
218
|
+
# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
|
219
|
+
#endif
|
220
|
+
|
221
|
+
#if !defined _Noreturn \
|
222
|
+
&& (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
|
223
|
+
# if defined _MSC_VER && 1200 <= _MSC_VER
|
224
|
+
# define _Noreturn __declspec (noreturn)
|
225
|
+
# else
|
226
|
+
# define _Noreturn YY_ATTRIBUTE ((__noreturn__))
|
227
|
+
# endif
|
228
|
+
#endif
|
229
|
+
|
230
|
+
/* Suppress unused-variable warnings by "using" E. */
|
231
|
+
#if ! defined lint || defined __GNUC__
|
232
|
+
# define YYUSE(E) ((void) (E))
|
233
|
+
#else
|
234
|
+
# define YYUSE(E) /* empty */
|
235
|
+
#endif
|
236
|
+
|
237
|
+
#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
|
238
|
+
/* Suppress an incorrect diagnostic about yylval being uninitialized. */
|
239
|
+
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
|
240
|
+
_Pragma ("GCC diagnostic push") \
|
241
|
+
_Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
|
242
|
+
_Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
|
243
|
+
# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
|
244
|
+
_Pragma ("GCC diagnostic pop")
|
245
|
+
#else
|
246
|
+
# define YY_INITIAL_VALUE(Value) Value
|
247
|
+
#endif
|
248
|
+
#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
|
249
|
+
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
|
250
|
+
# define YY_IGNORE_MAYBE_UNINITIALIZED_END
|
251
|
+
#endif
|
252
|
+
#ifndef YY_INITIAL_VALUE
|
253
|
+
# define YY_INITIAL_VALUE(Value) /* Nothing. */
|
254
|
+
#endif
|
255
|
+
|
256
|
+
|
257
|
+
#ifndef YYASSERT
|
258
|
+
# define YYASSERT(Condition) ((void) ((Condition) || (abort (), 0)))
|
259
|
+
#endif
|
260
|
+
|
261
|
+
/* YYFINAL -- State number of the termination state. */
|
262
|
+
#define YYFINAL 49
|
263
|
+
/* YYLAST -- Last index in YYTABLE. */
|
264
|
+
#define YYLAST 201
|
265
|
+
|
266
|
+
/* YYNTOKENS -- Number of terminals. */
|
267
|
+
#define YYNTOKENS 50
|
268
|
+
/* YYNNTS -- Number of nonterminals. */
|
269
|
+
#define YYNNTS 46
|
270
|
+
/* YYNRULES -- Number of rules. */
|
271
|
+
#define YYNRULES 125
|
272
|
+
/* YYNRULES -- Number of states. */
|
273
|
+
#define YYNSTATES 158
|
274
|
+
/* YYMAXRHS -- Maximum number of symbols on right-hand side of rule. */
|
275
|
+
#define YYMAXRHS 5
|
276
|
+
/* YYMAXLEFT -- Maximum number of symbols to the left of a handle
|
277
|
+
accessed by $0, $-1, etc., in any rule. */
|
278
|
+
#define YYMAXLEFT 0
|
279
|
+
|
280
|
+
/* YYTRANSLATE(X) -- Bison symbol number corresponding to X. */
|
281
|
+
#define YYUNDEFTOK 2
|
282
|
+
#define YYMAXUTOK 291
|
283
|
+
|
284
|
+
#define YYTRANSLATE(YYX) \
|
285
|
+
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
|
286
|
+
|
287
|
+
/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
|
288
|
+
static const unsigned char yytranslate[] =
|
289
|
+
{
|
290
|
+
0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
291
|
+
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
292
|
+
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
293
|
+
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
294
|
+
43, 44, 45, 2, 39, 2, 49, 47, 2, 2,
|
295
|
+
2, 2, 2, 2, 2, 2, 2, 2, 38, 2,
|
296
|
+
2, 37, 2, 40, 48, 2, 2, 2, 2, 2,
|
297
|
+
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
298
|
+
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
299
|
+
2, 41, 2, 42, 2, 2, 2, 2, 2, 2,
|
300
|
+
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
301
|
+
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
302
|
+
2, 2, 2, 2, 46, 2, 2, 2, 2, 2,
|
303
|
+
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
304
|
+
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
305
|
+
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
306
|
+
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
307
|
+
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
308
|
+
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
309
|
+
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
310
|
+
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
311
|
+
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
312
|
+
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
313
|
+
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
314
|
+
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
315
|
+
2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
|
316
|
+
5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
|
317
|
+
15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
|
318
|
+
25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
|
319
|
+
35, 36
|
320
|
+
};
|
321
|
+
|
322
|
+
#if YYDEBUG
|
323
|
+
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
|
324
|
+
static const unsigned short int yyrline[] =
|
325
|
+
{
|
326
|
+
0, 126, 126, 133, 139, 147, 152, 156, 161, 168,
|
327
|
+
174, 180, 184, 191, 199, 205, 212, 219, 227, 232,
|
328
|
+
239, 250, 255, 262, 264, 268, 270, 272, 274, 276,
|
329
|
+
278, 280, 286, 294, 302, 308, 316, 322, 330, 338,
|
330
|
+
343, 350, 356, 364, 370, 376, 382, 388, 394, 400,
|
331
|
+
406, 412, 418, 426, 432, 438, 444, 450, 459, 464,
|
332
|
+
468, 473, 480, 489, 491, 496, 503, 508, 512, 517,
|
333
|
+
523, 531, 533, 540, 548, 550, 555, 562, 570, 576,
|
334
|
+
582, 588, 594, 602, 607, 615, 617, 619, 621, 625,
|
335
|
+
627, 631, 633, 637, 642, 647, 652, 657, 662, 667,
|
336
|
+
672, 677, 682, 687, 692, 697, 702, 707, 712, 717,
|
337
|
+
722, 727, 732, 737, 742, 747, 754, 758, 760, 764,
|
338
|
+
771, 775, 777, 781, 785, 789
|
339
|
+
};
|
340
|
+
#endif
|
341
|
+
|
342
|
+
#if YYDEBUG || YYERROR_VERBOSE || 1
|
343
|
+
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
|
344
|
+
First, the terminals, then, starting at YYNTOKENS, nonterminals. */
|
345
|
+
static const char *const yytname[] =
|
346
|
+
{
|
347
|
+
"$end", "error", "$undefined", "\"i8\"", "\"i16\"", "\"i32\"",
|
348
|
+
"\"i64\"", "\"u8\"", "\"u16\"", "\"u32\"", "\"u64\"", "\"f64\"",
|
349
|
+
"\"decimal\"", "\"date\"", "\"timeOfDayMilli\"", "\"timeOfDayNano\"",
|
350
|
+
"\"nanotime\"", "\"millitime\"", "\"boolean\"", "\"string\"",
|
351
|
+
"\"object\"", "\"namespace\"", "\"type\"", "\"schema\"", "\"binary\"",
|
352
|
+
"\"number\"", "\"fixed\"", "\"<-\"", "\"->\"", "\"hexnum\"", "\"uint\"",
|
353
|
+
"\"int\"", "\"name\"", "\"ncName\"", "\"\\\\ncName\"", "\"cName\"",
|
354
|
+
"\"\\\"<annotation>\\\" or '<annotation>'\"", "'='", "':'", "','", "'?'",
|
355
|
+
"'['", "']'", "'('", "')'", "'*'", "'|'", "'/'", "'@'", "'.'", "$accept",
|
356
|
+
"top", "schema", "defs", "defList", "def", "define", "groupDef",
|
357
|
+
"fields", "field", "opt", "type", "single", "sequence", "string",
|
358
|
+
"binary", "fixed", "size", "ref", "number", "time", "enum", "symList",
|
359
|
+
"sym", "val", "annots", "annotList", "annot", "literal", "nameWithId",
|
360
|
+
"id", "incrAnnot", "compRef", "incrAnnotList", "incrAnnotItem", "qName",
|
361
|
+
"qNameOrKeyword", "keyword", "cName", "name", "nsDecl", "literalSegment",
|
362
|
+
"int", "uInt", "hexNum", "e", YY_NULLPTR
|
363
|
+
};
|
364
|
+
#endif
|
365
|
+
|
366
|
+
#define YYPACT_NINF -87
|
367
|
+
#define YYTABLE_NINF -6
|
368
|
+
|
369
|
+
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
|
370
|
+
STATE-NUM. */
|
371
|
+
static const short int yypact[] =
|
372
|
+
{
|
373
|
+
83, 15, -87, -87, -87, -87, 18, 14, -87, -87,
|
374
|
+
150, -87, 15, -32, -87, -87, -8, 11, -87, -87,
|
375
|
+
153, 50, -87, -87, -87, -87, -87, -87, -87, -87,
|
376
|
+
-87, -87, -87, -87, -87, -87, -87, -87, -87, -87,
|
377
|
+
-87, -87, -87, -87, -87, -87, -87, 35, -87, -87,
|
378
|
+
-87, -87, -87, -87, 26, 29, -87, 27, -16, -87,
|
379
|
+
37, -32, 77, -26, 39, -87, -87, -87, -87, -87,
|
380
|
+
-87, -87, 51, -87, 49, -87, 37, -87, 60, -87,
|
381
|
+
146, -87, -87, -87, -87, -87, -87, -87, -87, -87,
|
382
|
+
-87, -87, -87, -87, -87, -87, -87, 57, -87, 57,
|
383
|
+
57, -32, -87, 61, -87, -87, -87, -87, -87, -87,
|
384
|
+
-87, -87, 59, -87, 15, 62, 80, -87, -87, -87,
|
385
|
+
-87, 27, 91, -87, -32, -32, 39, -87, -87, -87,
|
386
|
+
-87, 72, -32, 73, -87, -32, -87, -87, -87, 15,
|
387
|
+
75, 78, -87, -87, -19, -87, -87, 60, 81, -87,
|
388
|
+
-87, -87, -87, -87, -87, -87, -87, -87
|
389
|
+
};
|
390
|
+
|
391
|
+
/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
|
392
|
+
Performed when YYTABLE does not specify something else to do. Zero
|
393
|
+
means the default is an error. */
|
394
|
+
static const unsigned char yydefact[] =
|
395
|
+
{
|
396
|
+
125, 0, 78, 117, 118, 116, 0, 0, 2, 3,
|
397
|
+
6, 7, 0, 67, 68, 11, 0, 79, 90, 89,
|
398
|
+
125, 66, 119, 93, 94, 95, 96, 97, 98, 99,
|
399
|
+
100, 101, 102, 103, 104, 105, 106, 107, 108, 109,
|
400
|
+
112, 113, 114, 115, 110, 111, 91, 0, 92, 1,
|
401
|
+
8, 66, 9, 10, 14, 125, 69, 0, 0, 4,
|
402
|
+
0, 125, 0, 0, 0, 73, 74, 87, 86, 85,
|
403
|
+
88, 77, 83, 80, 81, 120, 70, 71, 17, 18,
|
404
|
+
0, 43, 44, 45, 46, 47, 48, 49, 50, 51,
|
405
|
+
52, 53, 54, 55, 56, 57, 31, 34, 32, 36,
|
406
|
+
0, 125, 13, 23, 24, 28, 29, 30, 25, 27,
|
407
|
+
26, 12, 59, 60, 0, 41, 15, 124, 123, 75,
|
408
|
+
76, 0, 0, 72, 125, 125, 0, 35, 37, 38,
|
409
|
+
58, 0, 125, 125, 42, 125, 84, 82, 19, 0,
|
410
|
+
0, 0, 33, 61, 0, 62, 63, 16, 125, 39,
|
411
|
+
40, 122, 121, 64, 65, 22, 20, 21
|
412
|
+
};
|
413
|
+
|
414
|
+
/* YYPGOTO[NTERM-NUM]. */
|
415
|
+
static const signed char yypgoto[] =
|
416
|
+
{
|
417
|
+
-87, -87, -87, 104, -87, 116, -87, -87, -7, 3,
|
418
|
+
-87, 52, -87, -87, -87, -87, -87, -29, -87, -87,
|
419
|
+
-87, -87, -87, -86, -87, -58, -87, -12, -87, -10,
|
420
|
+
-87, -87, -87, 9, -87, -1, -87, -87, -87, 1,
|
421
|
+
-87, 58, -87, 10, -79, 0
|
422
|
+
};
|
423
|
+
|
424
|
+
/* YYDEFGOTO[NTERM-NUM]. */
|
425
|
+
static const short int yydefgoto[] =
|
426
|
+
{
|
427
|
+
-1, 7, 8, 9, 10, 11, 52, 53, 78, 79,
|
428
|
+
156, 102, 103, 104, 105, 106, 107, 127, 108, 109,
|
429
|
+
110, 111, 112, 113, 145, 12, 13, 14, 76, 54,
|
430
|
+
65, 15, 16, 71, 72, 17, 47, 48, 18, 19,
|
431
|
+
20, 77, 153, 119, 120, 51
|
432
|
+
};
|
433
|
+
|
434
|
+
/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
|
435
|
+
positive, shift that token. If negative, reduce the rule whose
|
436
|
+
number is the opposite. If YYTABLE_NINF, syntax error. */
|
437
|
+
static const short int yytable[] =
|
438
|
+
{
|
439
|
+
21, 56, 22, 80, 114, 46, 73, 3, 4, 5,
|
440
|
+
117, 151, 152, 55, 49, 130, 6, 3, 4, 57,
|
441
|
+
21, 23, 24, 25, 26, 27, 28, 29, 30, 31,
|
442
|
+
32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
|
443
|
+
42, 43, 44, 114, 45, 70, 143, 141, 3, 4,
|
444
|
+
-5, 3, 4, 5, 61, 66, 67, 68, 69, 74,
|
445
|
+
58, 115, 116, 62, 63, 154, 80, 139, 117, 118,
|
446
|
+
128, 129, 60, 75, 114, 6, 64, 80, 121, 115,
|
447
|
+
81, 82, 83, 84, 85, 86, 87, 88, 89, 90,
|
448
|
+
91, 92, 93, 94, 95, 96, 97, 98, 122, 124,
|
449
|
+
126, 99, 131, 100, 1, 132, 2, 134, 135, 70,
|
450
|
+
3, 4, 5, 137, 142, 133, 3, 4, 5, 149,
|
451
|
+
144, 155, 150, 101, 59, 6, 50, 138, 147, 148,
|
452
|
+
136, 6, 125, 146, 123, 0, 140, 0, 0, 0,
|
453
|
+
55, 0, 0, 0, 0, 0, 0, 0, 157, 81,
|
454
|
+
82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
|
455
|
+
92, 93, 94, 95, 96, 97, 98, 0, 0, 0,
|
456
|
+
99, 0, 100, 2, 0, 0, 2, 0, 0, 3,
|
457
|
+
4, 5, 0, 3, 4, 5, 3, 4, 5, 0,
|
458
|
+
0, 0, 0, 0, 0, 0, 0, 0, 6, 0,
|
459
|
+
0, 6
|
460
|
+
};
|
461
|
+
|
462
|
+
static const short int yycheck[] =
|
463
|
+
{
|
464
|
+
0, 13, 1, 61, 62, 6, 22, 33, 34, 35,
|
465
|
+
29, 30, 31, 12, 0, 101, 48, 33, 34, 27,
|
466
|
+
20, 3, 4, 5, 6, 7, 8, 9, 10, 11,
|
467
|
+
12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
|
468
|
+
22, 23, 24, 101, 26, 57, 132, 126, 33, 34,
|
469
|
+
0, 33, 34, 35, 28, 55, 29, 30, 31, 58,
|
470
|
+
49, 62, 63, 37, 38, 144, 124, 125, 29, 30,
|
471
|
+
99, 100, 37, 36, 132, 48, 47, 135, 27, 80,
|
472
|
+
3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
|
473
|
+
13, 14, 15, 16, 17, 18, 19, 20, 49, 39,
|
474
|
+
43, 24, 41, 26, 21, 46, 23, 45, 28, 121,
|
475
|
+
33, 34, 35, 22, 42, 114, 33, 34, 35, 44,
|
476
|
+
47, 40, 44, 46, 20, 48, 10, 124, 135, 139,
|
477
|
+
121, 48, 80, 133, 76, -1, 126, -1, -1, -1,
|
478
|
+
139, -1, -1, -1, -1, -1, -1, -1, 148, 3,
|
479
|
+
4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
|
480
|
+
14, 15, 16, 17, 18, 19, 20, -1, -1, -1,
|
481
|
+
24, -1, 26, 23, -1, -1, 23, -1, -1, 33,
|
482
|
+
34, 35, -1, 33, 34, 35, 33, 34, 35, -1,
|
483
|
+
-1, -1, -1, -1, -1, -1, -1, -1, 48, -1,
|
484
|
+
-1, 48
|
485
|
+
};
|
486
|
+
|
487
|
+
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
|
488
|
+
symbol of state STATE-NUM. */
|
489
|
+
static const unsigned char yystos[] =
|
490
|
+
{
|
491
|
+
0, 21, 23, 33, 34, 35, 48, 51, 52, 53,
|
492
|
+
54, 55, 75, 76, 77, 81, 82, 85, 88, 89,
|
493
|
+
90, 95, 89, 3, 4, 5, 6, 7, 8, 9,
|
494
|
+
10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
|
495
|
+
20, 21, 22, 23, 24, 26, 85, 86, 87, 0,
|
496
|
+
55, 95, 56, 57, 79, 89, 77, 27, 49, 53,
|
497
|
+
37, 28, 37, 38, 47, 80, 95, 29, 30, 31,
|
498
|
+
77, 83, 84, 22, 89, 36, 78, 91, 58, 59,
|
499
|
+
75, 3, 4, 5, 6, 7, 8, 9, 10, 11,
|
500
|
+
12, 13, 14, 15, 16, 17, 18, 19, 20, 24,
|
501
|
+
26, 46, 61, 62, 63, 64, 65, 66, 68, 69,
|
502
|
+
70, 71, 72, 73, 75, 85, 85, 29, 30, 93,
|
503
|
+
94, 27, 49, 91, 39, 61, 43, 67, 67, 67,
|
504
|
+
73, 41, 46, 89, 45, 28, 83, 22, 59, 75,
|
505
|
+
93, 94, 42, 73, 47, 74, 95, 58, 79, 44,
|
506
|
+
44, 30, 31, 92, 94, 40, 60, 95
|
507
|
+
};
|
508
|
+
|
509
|
+
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
|
510
|
+
static const unsigned char yyr1[] =
|
511
|
+
{
|
512
|
+
0, 50, 51, 52, 52, 53, 53, 54, 54, 55,
|
513
|
+
55, 55, 56, 56, 57, 57, 57, 57, 58, 58,
|
514
|
+
59, 60, 60, 61, 61, 62, 62, 62, 62, 62,
|
515
|
+
62, 62, 62, 63, 64, 64, 65, 65, 66, 67,
|
516
|
+
67, 68, 68, 69, 69, 69, 69, 69, 69, 69,
|
517
|
+
69, 69, 69, 70, 70, 70, 70, 70, 71, 71,
|
518
|
+
72, 72, 73, 74, 74, 74, 75, 75, 76, 76,
|
519
|
+
77, 78, 78, 79, 80, 80, 80, 81, 82, 82,
|
520
|
+
82, 82, 82, 83, 83, 84, 84, 84, 84, 85,
|
521
|
+
85, 86, 86, 87, 87, 87, 87, 87, 87, 87,
|
522
|
+
87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
|
523
|
+
87, 87, 87, 87, 87, 87, 88, 89, 89, 90,
|
524
|
+
91, 92, 92, 93, 94, 95
|
525
|
+
};
|
526
|
+
|
527
|
+
/* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
|
528
|
+
static const unsigned char yyr2[] =
|
529
|
+
{
|
530
|
+
0, 2, 1, 1, 2, 1, 1, 1, 2, 2,
|
531
|
+
2, 1, 3, 3, 1, 3, 5, 3, 1, 3,
|
532
|
+
5, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
533
|
+
1, 1, 1, 3, 1, 2, 1, 2, 2, 3,
|
534
|
+
3, 1, 2, 1, 1, 1, 1, 1, 1, 1,
|
535
|
+
1, 1, 1, 1, 1, 1, 1, 1, 2, 1,
|
536
|
+
1, 3, 3, 1, 2, 2, 1, 1, 1, 2,
|
537
|
+
4, 1, 2, 2, 1, 2, 2, 3, 1, 1,
|
538
|
+
3, 3, 5, 1, 3, 1, 1, 1, 1, 1,
|
539
|
+
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
540
|
+
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
541
|
+
1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
|
542
|
+
1, 1, 1, 1, 1, 0
|
543
|
+
};
|
544
|
+
|
545
|
+
|
546
|
+
/* YYDPREC[RULE-NUM] -- Dynamic precedence of rule #RULE-NUM (0 if none). */
|
547
|
+
static const unsigned char yydprec[] =
|
548
|
+
{
|
549
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
550
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
551
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
552
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
553
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
554
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
555
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
556
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
557
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
558
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
559
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
560
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
561
|
+
0, 0, 0, 0, 0, 0
|
562
|
+
};
|
563
|
+
|
564
|
+
/* YYMERGER[RULE-NUM] -- Index of merging function for rule #RULE-NUM. */
|
565
|
+
static const unsigned char yymerger[] =
|
566
|
+
{
|
567
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
568
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
569
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
570
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
571
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
572
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
573
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
574
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
575
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
576
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
577
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
578
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
579
|
+
0, 0, 0, 0, 0, 0
|
580
|
+
};
|
581
|
+
|
582
|
+
/* YYIMMEDIATE[RULE-NUM] -- True iff rule #RULE-NUM is not to be deferred, as
|
583
|
+
in the case of predicates. */
|
584
|
+
static const yybool yyimmediate[] =
|
585
|
+
{
|
586
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
587
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
588
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
589
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
590
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
591
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
592
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
593
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
594
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
595
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
596
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
597
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
598
|
+
0, 0, 0, 0, 0, 0
|
599
|
+
};
|
600
|
+
|
601
|
+
/* YYCONFLP[YYPACT[STATE-NUM]] -- Pointer into YYCONFL of start of
|
602
|
+
list of conflicting reductions corresponding to action entry for
|
603
|
+
state STATE-NUM in yytable. 0 means no conflicts. The list in
|
604
|
+
yyconfl is terminated by a rule number of 0. */
|
605
|
+
static const unsigned char yyconflp[] =
|
606
|
+
{
|
607
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
608
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
609
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
610
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
611
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
612
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
613
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
614
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
615
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
616
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
617
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
618
|
+
13, 15, 0, 0, 0, 0, 1, 3, 0, 0,
|
619
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
620
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
621
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
622
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
623
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
624
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
625
|
+
0, 0, 0, 5, 7, 0, 9, 11, 0, 0,
|
626
|
+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
627
|
+
0, 0
|
628
|
+
};
|
629
|
+
|
630
|
+
/* YYCONFL[I] -- lists of conflicting rule numbers, each terminated by
|
631
|
+
0, pointed into by YYCONFLP. */
|
632
|
+
static const short int yyconfl[] =
|
633
|
+
{
|
634
|
+
0, 125, 0, 125, 0, 125, 0, 125, 0, 125,
|
635
|
+
0, 125, 0, 125, 0, 125, 0
|
636
|
+
};
|
637
|
+
|
638
|
+
/* Error token number */
|
639
|
+
#define YYTERROR 1
|
640
|
+
|
641
|
+
|
642
|
+
/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
|
643
|
+
If N is 0, then set CURRENT to the empty location which ends
|
644
|
+
the previous symbol: RHS[0] (always defined). */
|
645
|
+
|
646
|
+
#ifndef YYLLOC_DEFAULT
|
647
|
+
# define YYLLOC_DEFAULT(Current, Rhs, N) \
|
648
|
+
do \
|
649
|
+
if (N) \
|
650
|
+
{ \
|
651
|
+
(Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
|
652
|
+
(Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
|
653
|
+
(Current).last_line = YYRHSLOC (Rhs, N).last_line; \
|
654
|
+
(Current).last_column = YYRHSLOC (Rhs, N).last_column; \
|
655
|
+
} \
|
656
|
+
else \
|
657
|
+
{ \
|
658
|
+
(Current).first_line = (Current).last_line = \
|
659
|
+
YYRHSLOC (Rhs, 0).last_line; \
|
660
|
+
(Current).first_column = (Current).last_column = \
|
661
|
+
YYRHSLOC (Rhs, 0).last_column; \
|
662
|
+
} \
|
663
|
+
while (0)
|
664
|
+
#endif
|
665
|
+
|
666
|
+
# define YYRHSLOC(Rhs, K) ((Rhs)[K].yystate.yyloc)
|
667
|
+
|
668
|
+
|
669
|
+
|
670
|
+
#undef yynerrs
|
671
|
+
#define yynerrs (yystackp->yyerrcnt)
|
672
|
+
#undef yychar
|
673
|
+
#define yychar (yystackp->yyrawchar)
|
674
|
+
#undef yylval
|
675
|
+
#define yylval (yystackp->yyval)
|
676
|
+
#undef yylloc
|
677
|
+
#define yylloc (yystackp->yyloc)
|
678
|
+
|
679
|
+
|
680
|
+
static const int YYEOF = 0;
|
681
|
+
static const int YYEMPTY = -2;
|
682
|
+
|
683
|
+
typedef enum { yyok, yyaccept, yyabort, yyerr } YYRESULTTAG;
|
684
|
+
|
685
|
+
#define YYCHK(YYE) \
|
686
|
+
do { \
|
687
|
+
YYRESULTTAG yychk_flag = YYE; \
|
688
|
+
if (yychk_flag != yyok) \
|
689
|
+
return yychk_flag; \
|
690
|
+
} while (0)
|
691
|
+
|
692
|
+
#if YYDEBUG
|
693
|
+
|
694
|
+
# ifndef YYFPRINTF
|
695
|
+
# define YYFPRINTF fprintf
|
696
|
+
# endif
|
697
|
+
|
698
|
+
|
699
|
+
/* YY_LOCATION_PRINT -- Print the location on the stream.
|
700
|
+
This macro was not mandated originally: define only if we know
|
701
|
+
we won't break user code: when these are the locations we know. */
|
702
|
+
|
703
|
+
#ifndef YY_LOCATION_PRINT
|
704
|
+
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
|
705
|
+
|
706
|
+
/* Print *YYLOCP on YYO. Private, do not rely on its existence. */
|
707
|
+
|
708
|
+
YY_ATTRIBUTE_UNUSED
|
709
|
+
static unsigned
|
710
|
+
yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp)
|
711
|
+
{
|
712
|
+
unsigned res = 0;
|
713
|
+
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
|
714
|
+
if (0 <= yylocp->first_line)
|
715
|
+
{
|
716
|
+
res += YYFPRINTF (yyo, "%d", yylocp->first_line);
|
717
|
+
if (0 <= yylocp->first_column)
|
718
|
+
res += YYFPRINTF (yyo, ".%d", yylocp->first_column);
|
719
|
+
}
|
720
|
+
if (0 <= yylocp->last_line)
|
721
|
+
{
|
722
|
+
if (yylocp->first_line < yylocp->last_line)
|
723
|
+
{
|
724
|
+
res += YYFPRINTF (yyo, "-%d", yylocp->last_line);
|
725
|
+
if (0 <= end_col)
|
726
|
+
res += YYFPRINTF (yyo, ".%d", end_col);
|
727
|
+
}
|
728
|
+
else if (0 <= end_col && yylocp->first_column < end_col)
|
729
|
+
res += YYFPRINTF (yyo, "-%d", end_col);
|
730
|
+
}
|
731
|
+
return res;
|
732
|
+
}
|
733
|
+
|
734
|
+
# define YY_LOCATION_PRINT(File, Loc) \
|
735
|
+
yy_location_print_ (File, &(Loc))
|
736
|
+
|
737
|
+
# else
|
738
|
+
# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
|
739
|
+
# endif
|
740
|
+
#endif
|
741
|
+
|
742
|
+
|
743
|
+
# define YYDPRINTF(Args) \
|
744
|
+
do { \
|
745
|
+
if (yydebug) \
|
746
|
+
YYFPRINTF Args; \
|
747
|
+
} while (0)
|
748
|
+
|
749
|
+
|
750
|
+
/*----------------------------------------.
|
751
|
+
| Print this symbol's value on YYOUTPUT. |
|
752
|
+
`----------------------------------------*/
|
753
|
+
|
754
|
+
static void
|
755
|
+
yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, yyscan_t scanner, VALUE filename, VALUE *tree)
|
756
|
+
{
|
757
|
+
FILE *yyo = yyoutput;
|
758
|
+
YYUSE (yyo);
|
759
|
+
YYUSE (yylocationp);
|
760
|
+
YYUSE (scanner);
|
761
|
+
YYUSE (filename);
|
762
|
+
YYUSE (tree);
|
763
|
+
if (!yyvaluep)
|
764
|
+
return;
|
765
|
+
YYUSE (yytype);
|
766
|
+
}
|
767
|
+
|
768
|
+
|
769
|
+
/*--------------------------------.
|
770
|
+
| Print this symbol on YYOUTPUT. |
|
771
|
+
`--------------------------------*/
|
772
|
+
|
773
|
+
static void
|
774
|
+
yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, yyscan_t scanner, VALUE filename, VALUE *tree)
|
775
|
+
{
|
776
|
+
YYFPRINTF (yyoutput, "%s %s (",
|
777
|
+
yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
|
778
|
+
|
779
|
+
YY_LOCATION_PRINT (yyoutput, *yylocationp);
|
780
|
+
YYFPRINTF (yyoutput, ": ");
|
781
|
+
yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, scanner, filename, tree);
|
782
|
+
YYFPRINTF (yyoutput, ")");
|
783
|
+
}
|
784
|
+
|
785
|
+
# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
|
786
|
+
do { \
|
787
|
+
if (yydebug) \
|
788
|
+
{ \
|
789
|
+
YYFPRINTF (stderr, "%s ", Title); \
|
790
|
+
yy_symbol_print (stderr, Type, Value, Location, scanner, filename, tree); \
|
791
|
+
YYFPRINTF (stderr, "\n"); \
|
792
|
+
} \
|
793
|
+
} while (0)
|
794
|
+
|
795
|
+
/* Nonzero means print parse trace. It is left uninitialized so that
|
796
|
+
multiple parsers can coexist. */
|
797
|
+
int yydebug;
|
798
|
+
|
799
|
+
struct yyGLRStack;
|
800
|
+
static void yypstack (struct yyGLRStack* yystackp, size_t yyk)
|
801
|
+
YY_ATTRIBUTE_UNUSED;
|
802
|
+
static void yypdumpstack (struct yyGLRStack* yystackp)
|
803
|
+
YY_ATTRIBUTE_UNUSED;
|
804
|
+
|
805
|
+
#else /* !YYDEBUG */
|
806
|
+
|
807
|
+
# define YYDPRINTF(Args)
|
808
|
+
# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
|
809
|
+
|
810
|
+
#endif /* !YYDEBUG */
|
811
|
+
|
812
|
+
/* YYINITDEPTH -- initial size of the parser's stacks. */
|
813
|
+
#ifndef YYINITDEPTH
|
814
|
+
# define YYINITDEPTH 200
|
815
|
+
#endif
|
816
|
+
|
817
|
+
/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
|
818
|
+
if the built-in stack extension method is used).
|
819
|
+
|
820
|
+
Do not make this value too large; the results are undefined if
|
821
|
+
SIZE_MAX < YYMAXDEPTH * sizeof (GLRStackItem)
|
822
|
+
evaluated with infinite-precision integer arithmetic. */
|
823
|
+
|
824
|
+
#ifndef YYMAXDEPTH
|
825
|
+
# define YYMAXDEPTH 10000
|
826
|
+
#endif
|
827
|
+
|
828
|
+
/* Minimum number of free items on the stack allowed after an
|
829
|
+
allocation. This is to allow allocation and initialization
|
830
|
+
to be completed by functions that call yyexpandGLRStack before the
|
831
|
+
stack is expanded, thus insuring that all necessary pointers get
|
832
|
+
properly redirected to new data. */
|
833
|
+
#define YYHEADROOM 2
|
834
|
+
|
835
|
+
#ifndef YYSTACKEXPANDABLE
|
836
|
+
# define YYSTACKEXPANDABLE 1
|
837
|
+
#endif
|
838
|
+
|
839
|
+
#if YYSTACKEXPANDABLE
|
840
|
+
# define YY_RESERVE_GLRSTACK(Yystack) \
|
841
|
+
do { \
|
842
|
+
if (Yystack->yyspaceLeft < YYHEADROOM) \
|
843
|
+
yyexpandGLRStack (Yystack); \
|
844
|
+
} while (0)
|
845
|
+
#else
|
846
|
+
# define YY_RESERVE_GLRSTACK(Yystack) \
|
847
|
+
do { \
|
848
|
+
if (Yystack->yyspaceLeft < YYHEADROOM) \
|
849
|
+
yyMemoryExhausted (Yystack); \
|
850
|
+
} while (0)
|
851
|
+
#endif
|
852
|
+
|
853
|
+
|
854
|
+
#if YYERROR_VERBOSE
|
855
|
+
|
856
|
+
# ifndef yystpcpy
|
857
|
+
# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
|
858
|
+
# define yystpcpy stpcpy
|
859
|
+
# else
|
860
|
+
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
|
861
|
+
YYDEST. */
|
862
|
+
static char *
|
863
|
+
yystpcpy (char *yydest, const char *yysrc)
|
864
|
+
{
|
865
|
+
char *yyd = yydest;
|
866
|
+
const char *yys = yysrc;
|
867
|
+
|
868
|
+
while ((*yyd++ = *yys++) != '\0')
|
869
|
+
continue;
|
870
|
+
|
871
|
+
return yyd - 1;
|
872
|
+
}
|
873
|
+
# endif
|
874
|
+
# endif
|
875
|
+
|
876
|
+
# ifndef yytnamerr
|
877
|
+
/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
|
878
|
+
quotes and backslashes, so that it's suitable for yyerror. The
|
879
|
+
heuristic is that double-quoting is unnecessary unless the string
|
880
|
+
contains an apostrophe, a comma, or backslash (other than
|
881
|
+
backslash-backslash). YYSTR is taken from yytname. If YYRES is
|
882
|
+
null, do not copy; instead, return the length of what the result
|
883
|
+
would have been. */
|
884
|
+
static size_t
|
885
|
+
yytnamerr (char *yyres, const char *yystr)
|
886
|
+
{
|
887
|
+
if (*yystr == '"')
|
888
|
+
{
|
889
|
+
size_t yyn = 0;
|
890
|
+
char const *yyp = yystr;
|
891
|
+
|
892
|
+
for (;;)
|
893
|
+
switch (*++yyp)
|
894
|
+
{
|
895
|
+
case '\'':
|
896
|
+
case ',':
|
897
|
+
goto do_not_strip_quotes;
|
898
|
+
|
899
|
+
case '\\':
|
900
|
+
if (*++yyp != '\\')
|
901
|
+
goto do_not_strip_quotes;
|
902
|
+
/* Fall through. */
|
903
|
+
default:
|
904
|
+
if (yyres)
|
905
|
+
yyres[yyn] = *yyp;
|
906
|
+
yyn++;
|
907
|
+
break;
|
908
|
+
|
909
|
+
case '"':
|
910
|
+
if (yyres)
|
911
|
+
yyres[yyn] = '\0';
|
912
|
+
return yyn;
|
913
|
+
}
|
914
|
+
do_not_strip_quotes: ;
|
915
|
+
}
|
916
|
+
|
917
|
+
if (! yyres)
|
918
|
+
return strlen (yystr);
|
919
|
+
|
920
|
+
return yystpcpy (yyres, yystr) - yyres;
|
921
|
+
}
|
922
|
+
# endif
|
923
|
+
|
924
|
+
#endif /* !YYERROR_VERBOSE */
|
925
|
+
|
926
|
+
/** State numbers, as in LALR(1) machine */
|
927
|
+
typedef int yyStateNum;
|
928
|
+
|
929
|
+
/** Rule numbers, as in LALR(1) machine */
|
930
|
+
typedef int yyRuleNum;
|
931
|
+
|
932
|
+
/** Grammar symbol */
|
933
|
+
typedef int yySymbol;
|
934
|
+
|
935
|
+
/** Item references, as in LALR(1) machine */
|
936
|
+
typedef short int yyItemNum;
|
937
|
+
|
938
|
+
typedef struct yyGLRState yyGLRState;
|
939
|
+
typedef struct yyGLRStateSet yyGLRStateSet;
|
940
|
+
typedef struct yySemanticOption yySemanticOption;
|
941
|
+
typedef union yyGLRStackItem yyGLRStackItem;
|
942
|
+
typedef struct yyGLRStack yyGLRStack;
|
943
|
+
|
944
|
+
struct yyGLRState {
|
945
|
+
/** Type tag: always true. */
|
946
|
+
yybool yyisState;
|
947
|
+
/** Type tag for yysemantics. If true, yysval applies, otherwise
|
948
|
+
* yyfirstVal applies. */
|
949
|
+
yybool yyresolved;
|
950
|
+
/** Number of corresponding LALR(1) machine state. */
|
951
|
+
yyStateNum yylrState;
|
952
|
+
/** Preceding state in this stack */
|
953
|
+
yyGLRState* yypred;
|
954
|
+
/** Source position of the last token produced by my symbol */
|
955
|
+
size_t yyposn;
|
956
|
+
union {
|
957
|
+
/** First in a chain of alternative reductions producing the
|
958
|
+
* non-terminal corresponding to this state, threaded through
|
959
|
+
* yynext. */
|
960
|
+
yySemanticOption* yyfirstVal;
|
961
|
+
/** Semantic value for this state. */
|
962
|
+
YYSTYPE yysval;
|
963
|
+
} yysemantics;
|
964
|
+
/** Source location for this state. */
|
965
|
+
YYLTYPE yyloc;
|
966
|
+
};
|
967
|
+
|
968
|
+
struct yyGLRStateSet {
|
969
|
+
yyGLRState** yystates;
|
970
|
+
/** During nondeterministic operation, yylookaheadNeeds tracks which
|
971
|
+
* stacks have actually needed the current lookahead. During deterministic
|
972
|
+
* operation, yylookaheadNeeds[0] is not maintained since it would merely
|
973
|
+
* duplicate yychar != YYEMPTY. */
|
974
|
+
yybool* yylookaheadNeeds;
|
975
|
+
size_t yysize, yycapacity;
|
976
|
+
};
|
977
|
+
|
978
|
+
struct yySemanticOption {
|
979
|
+
/** Type tag: always false. */
|
980
|
+
yybool yyisState;
|
981
|
+
/** Rule number for this reduction */
|
982
|
+
yyRuleNum yyrule;
|
983
|
+
/** The last RHS state in the list of states to be reduced. */
|
984
|
+
yyGLRState* yystate;
|
985
|
+
/** The lookahead for this reduction. */
|
986
|
+
int yyrawchar;
|
987
|
+
YYSTYPE yyval;
|
988
|
+
YYLTYPE yyloc;
|
989
|
+
/** Next sibling in chain of options. To facilitate merging,
|
990
|
+
* options are chained in decreasing order by address. */
|
991
|
+
yySemanticOption* yynext;
|
992
|
+
};
|
993
|
+
|
994
|
+
/** Type of the items in the GLR stack. The yyisState field
|
995
|
+
* indicates which item of the union is valid. */
|
996
|
+
union yyGLRStackItem {
|
997
|
+
yyGLRState yystate;
|
998
|
+
yySemanticOption yyoption;
|
999
|
+
};
|
1000
|
+
|
1001
|
+
struct yyGLRStack {
|
1002
|
+
int yyerrState;
|
1003
|
+
/* To compute the location of the error token. */
|
1004
|
+
yyGLRStackItem yyerror_range[3];
|
1005
|
+
|
1006
|
+
int yyerrcnt;
|
1007
|
+
int yyrawchar;
|
1008
|
+
YYSTYPE yyval;
|
1009
|
+
YYLTYPE yyloc;
|
1010
|
+
|
1011
|
+
YYJMP_BUF yyexception_buffer;
|
1012
|
+
yyGLRStackItem* yyitems;
|
1013
|
+
yyGLRStackItem* yynextFree;
|
1014
|
+
size_t yyspaceLeft;
|
1015
|
+
yyGLRState* yysplitPoint;
|
1016
|
+
yyGLRState* yylastDeleted;
|
1017
|
+
yyGLRStateSet yytops;
|
1018
|
+
};
|
1019
|
+
|
1020
|
+
#if YYSTACKEXPANDABLE
|
1021
|
+
static void yyexpandGLRStack (yyGLRStack* yystackp);
|
1022
|
+
#endif
|
1023
|
+
|
1024
|
+
static _Noreturn void
|
1025
|
+
yyFail (yyGLRStack* yystackp, YYLTYPE *yylocp, yyscan_t scanner, VALUE filename, VALUE *tree, const char* yymsg)
|
1026
|
+
{
|
1027
|
+
if (yymsg != YY_NULLPTR)
|
1028
|
+
yyerror (yylocp, scanner, filename, tree, yymsg);
|
1029
|
+
YYLONGJMP (yystackp->yyexception_buffer, 1);
|
1030
|
+
}
|
1031
|
+
|
1032
|
+
static _Noreturn void
|
1033
|
+
yyMemoryExhausted (yyGLRStack* yystackp)
|
1034
|
+
{
|
1035
|
+
YYLONGJMP (yystackp->yyexception_buffer, 2);
|
1036
|
+
}
|
1037
|
+
|
1038
|
+
#if YYDEBUG || YYERROR_VERBOSE
|
1039
|
+
/** A printable representation of TOKEN. */
|
1040
|
+
static inline const char*
|
1041
|
+
yytokenName (yySymbol yytoken)
|
1042
|
+
{
|
1043
|
+
if (yytoken == YYEMPTY)
|
1044
|
+
return "";
|
1045
|
+
|
1046
|
+
return yytname[yytoken];
|
1047
|
+
}
|
1048
|
+
#endif
|
1049
|
+
|
1050
|
+
/** Fill in YYVSP[YYLOW1 .. YYLOW0-1] from the chain of states starting
|
1051
|
+
* at YYVSP[YYLOW0].yystate.yypred. Leaves YYVSP[YYLOW1].yystate.yypred
|
1052
|
+
* containing the pointer to the next state in the chain. */
|
1053
|
+
static void yyfillin (yyGLRStackItem *, int, int) YY_ATTRIBUTE_UNUSED;
|
1054
|
+
static void
|
1055
|
+
yyfillin (yyGLRStackItem *yyvsp, int yylow0, int yylow1)
|
1056
|
+
{
|
1057
|
+
int i;
|
1058
|
+
yyGLRState *s = yyvsp[yylow0].yystate.yypred;
|
1059
|
+
for (i = yylow0-1; i >= yylow1; i -= 1)
|
1060
|
+
{
|
1061
|
+
#if YYDEBUG
|
1062
|
+
yyvsp[i].yystate.yylrState = s->yylrState;
|
1063
|
+
#endif
|
1064
|
+
yyvsp[i].yystate.yyresolved = s->yyresolved;
|
1065
|
+
if (s->yyresolved)
|
1066
|
+
yyvsp[i].yystate.yysemantics.yysval = s->yysemantics.yysval;
|
1067
|
+
else
|
1068
|
+
/* The effect of using yysval or yyloc (in an immediate rule) is
|
1069
|
+
* undefined. */
|
1070
|
+
yyvsp[i].yystate.yysemantics.yyfirstVal = YY_NULLPTR;
|
1071
|
+
yyvsp[i].yystate.yyloc = s->yyloc;
|
1072
|
+
s = yyvsp[i].yystate.yypred = s->yypred;
|
1073
|
+
}
|
1074
|
+
}
|
1075
|
+
|
1076
|
+
/* Do nothing if YYNORMAL or if *YYLOW <= YYLOW1. Otherwise, fill in
|
1077
|
+
* YYVSP[YYLOW1 .. *YYLOW-1] as in yyfillin and set *YYLOW = YYLOW1.
|
1078
|
+
* For convenience, always return YYLOW1. */
|
1079
|
+
static inline int yyfill (yyGLRStackItem *, int *, int, yybool)
|
1080
|
+
YY_ATTRIBUTE_UNUSED;
|
1081
|
+
static inline int
|
1082
|
+
yyfill (yyGLRStackItem *yyvsp, int *yylow, int yylow1, yybool yynormal)
|
1083
|
+
{
|
1084
|
+
if (!yynormal && yylow1 < *yylow)
|
1085
|
+
{
|
1086
|
+
yyfillin (yyvsp, *yylow, yylow1);
|
1087
|
+
*yylow = yylow1;
|
1088
|
+
}
|
1089
|
+
return yylow1;
|
1090
|
+
}
|
1091
|
+
|
1092
|
+
/** Perform user action for rule number YYN, with RHS length YYRHSLEN,
|
1093
|
+
* and top stack item YYVSP. YYLVALP points to place to put semantic
|
1094
|
+
* value ($$), and yylocp points to place for location information
|
1095
|
+
* (@$). Returns yyok for normal return, yyaccept for YYACCEPT,
|
1096
|
+
* yyerr for YYERROR, yyabort for YYABORT. */
|
1097
|
+
static YYRESULTTAG
|
1098
|
+
yyuserAction (yyRuleNum yyn, size_t yyrhslen, yyGLRStackItem* yyvsp,
|
1099
|
+
yyGLRStack* yystackp,
|
1100
|
+
YYSTYPE* yyvalp, YYLTYPE *yylocp, yyscan_t scanner, VALUE filename, VALUE *tree)
|
1101
|
+
{
|
1102
|
+
yybool yynormal YY_ATTRIBUTE_UNUSED = (yystackp->yysplitPoint == YY_NULLPTR);
|
1103
|
+
int yylow;
|
1104
|
+
YYUSE (yyvalp);
|
1105
|
+
YYUSE (yylocp);
|
1106
|
+
YYUSE (scanner);
|
1107
|
+
YYUSE (filename);
|
1108
|
+
YYUSE (tree);
|
1109
|
+
YYUSE (yyrhslen);
|
1110
|
+
# undef yyerrok
|
1111
|
+
# define yyerrok (yystackp->yyerrState = 0)
|
1112
|
+
# undef YYACCEPT
|
1113
|
+
# define YYACCEPT return yyaccept
|
1114
|
+
# undef YYABORT
|
1115
|
+
# define YYABORT return yyabort
|
1116
|
+
# undef YYERROR
|
1117
|
+
# define YYERROR return yyerrok, yyerr
|
1118
|
+
# undef YYRECOVERING
|
1119
|
+
# define YYRECOVERING() (yystackp->yyerrState != 0)
|
1120
|
+
# undef yyclearin
|
1121
|
+
# define yyclearin (yychar = YYEMPTY)
|
1122
|
+
# undef YYFILL
|
1123
|
+
# define YYFILL(N) yyfill (yyvsp, &yylow, N, yynormal)
|
1124
|
+
# undef YYBACKUP
|
1125
|
+
# define YYBACKUP(Token, Value) \
|
1126
|
+
return yyerror (yylocp, scanner, filename, tree, YY_("syntax error: cannot back up")), \
|
1127
|
+
yyerrok, yyerr
|
1128
|
+
|
1129
|
+
yylow = 1;
|
1130
|
+
if (yyrhslen == 0)
|
1131
|
+
*yyvalp = yyval_default;
|
1132
|
+
else
|
1133
|
+
*yyvalp = yyvsp[YYFILL (1-yyrhslen)].yystate.yysemantics.yysval;
|
1134
|
+
YYLLOC_DEFAULT ((*yylocp), (yyvsp - yyrhslen), yyrhslen);
|
1135
|
+
yystackp->yyerror_range[1].yystate.yyloc = *yylocp;
|
1136
|
+
|
1137
|
+
switch (yyn)
|
1138
|
+
{
|
1139
|
+
case 2:
|
1140
|
+
#line 127 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1141
|
+
{
|
1142
|
+
*tree = (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval);
|
1143
|
+
}
|
1144
|
+
#line 1145 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1145
|
+
break;
|
1146
|
+
|
1147
|
+
case 3:
|
1148
|
+
#line 134 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1149
|
+
{
|
1150
|
+
VALUE args[] = {Qnil, (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval)};
|
1151
|
+
((*yyvalp)) = rb_class_new_instance(sizeof(args)/sizeof(*args),args, cSchema);
|
1152
|
+
}
|
1153
|
+
#line 1154 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1154
|
+
break;
|
1155
|
+
|
1156
|
+
case 4:
|
1157
|
+
#line 140 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1158
|
+
{
|
1159
|
+
VALUE args[] = {(((yyGLRStackItem const *)yyvsp)[YYFILL (-1)].yystate.yysemantics.yysval), (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval)};
|
1160
|
+
((*yyvalp)) = rb_class_new_instance(sizeof(args)/sizeof(*args),args, cSchema);
|
1161
|
+
}
|
1162
|
+
#line 1163 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1163
|
+
break;
|
1164
|
+
|
1165
|
+
case 5:
|
1166
|
+
#line 148 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1167
|
+
{
|
1168
|
+
((*yyvalp)) = rb_ary_new();
|
1169
|
+
}
|
1170
|
+
#line 1171 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1171
|
+
break;
|
1172
|
+
|
1173
|
+
case 7:
|
1174
|
+
#line 157 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1175
|
+
{
|
1176
|
+
((*yyvalp)) = rb_ary_new_from_args(1, (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval));
|
1177
|
+
}
|
1178
|
+
#line 1179 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1179
|
+
break;
|
1180
|
+
|
1181
|
+
case 8:
|
1182
|
+
#line 162 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1183
|
+
{
|
1184
|
+
rb_ary_push(((*yyvalp)), (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval));
|
1185
|
+
}
|
1186
|
+
#line 1187 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1187
|
+
break;
|
1188
|
+
|
1189
|
+
case 9:
|
1190
|
+
#line 169 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1191
|
+
{
|
1192
|
+
((*yyvalp)) = (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval);
|
1193
|
+
rb_funcall(((*yyvalp)), rb_intern("annote"), 1, (((yyGLRStackItem const *)yyvsp)[YYFILL (-1)].yystate.yysemantics.yysval));
|
1194
|
+
}
|
1195
|
+
#line 1196 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1196
|
+
break;
|
1197
|
+
|
1198
|
+
case 10:
|
1199
|
+
#line 175 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1200
|
+
{
|
1201
|
+
((*yyvalp)) = (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval);
|
1202
|
+
rb_funcall(((*yyvalp)), rb_intern("annote"), 1, (((yyGLRStackItem const *)yyvsp)[YYFILL (-1)].yystate.yysemantics.yysval));
|
1203
|
+
}
|
1204
|
+
#line 1205 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1205
|
+
break;
|
1206
|
+
|
1207
|
+
case 12:
|
1208
|
+
#line 185 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1209
|
+
{
|
1210
|
+
VALUE enumArgs[] = {(((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval)};
|
1211
|
+
VALUE args[] = {(((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval), rb_class_new_instance(sizeof(enumArgs)/sizeof(*enumArgs),enumArgs, cEnumeration), newLocation(filename, &(*yylocp))};
|
1212
|
+
((*yyvalp)) = rb_class_new_instance(sizeof(args)/sizeof(*args), args, cDefinition);
|
1213
|
+
}
|
1214
|
+
#line 1215 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1215
|
+
break;
|
1216
|
+
|
1217
|
+
case 13:
|
1218
|
+
#line 192 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1219
|
+
{
|
1220
|
+
VALUE args[] = {(((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval), (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval), newLocation(filename, &(*yylocp))};
|
1221
|
+
((*yyvalp)) = rb_class_new_instance(sizeof(args)/sizeof(*args),args, cDefinition);
|
1222
|
+
}
|
1223
|
+
#line 1224 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1224
|
+
break;
|
1225
|
+
|
1226
|
+
case 14:
|
1227
|
+
#line 200 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1228
|
+
{
|
1229
|
+
VALUE args[] = {(((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval), Qnil, rb_ary_new(), newLocation(filename, &(*yylocp))};
|
1230
|
+
((*yyvalp)) = rb_class_new_instance(sizeof(args)/sizeof(*args),args, cGroup);
|
1231
|
+
}
|
1232
|
+
#line 1233 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1233
|
+
break;
|
1234
|
+
|
1235
|
+
case 15:
|
1236
|
+
#line 206 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1237
|
+
{
|
1238
|
+
VALUE refArgs[] = {(((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval), Qfalse, newLocation(filename, &(((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yyloc))};
|
1239
|
+
VALUE args[] = {(((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval), rb_class_new_instance(sizeof(refArgs)/sizeof(*refArgs),refArgs, cREF), rb_ary_new(), newLocation(filename, &(*yylocp))};
|
1240
|
+
((*yyvalp)) = rb_class_new_instance(sizeof(args)/sizeof(*args),args, cGroup);
|
1241
|
+
}
|
1242
|
+
#line 1243 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1243
|
+
break;
|
1244
|
+
|
1245
|
+
case 16:
|
1246
|
+
#line 213 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1247
|
+
{
|
1248
|
+
VALUE refArgs[] = {(((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval), Qfalse, newLocation(filename, &(((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yyloc))};
|
1249
|
+
VALUE args[] = {(((yyGLRStackItem const *)yyvsp)[YYFILL (-4)].yystate.yysemantics.yysval), rb_class_new_instance(sizeof(refArgs)/sizeof(*refArgs),refArgs, cREF), (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval), newLocation(filename, &(*yylocp))};
|
1250
|
+
((*yyvalp)) = rb_class_new_instance(sizeof(args)/sizeof(*args),args, cGroup);
|
1251
|
+
}
|
1252
|
+
#line 1253 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1253
|
+
break;
|
1254
|
+
|
1255
|
+
case 17:
|
1256
|
+
#line 220 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1257
|
+
{
|
1258
|
+
VALUE args[] = {(((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval), Qnil, (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval), newLocation(filename, &(*yylocp))};
|
1259
|
+
((*yyvalp)) = rb_class_new_instance(sizeof(args)/sizeof(*args),args, cGroup);
|
1260
|
+
}
|
1261
|
+
#line 1262 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1262
|
+
break;
|
1263
|
+
|
1264
|
+
case 18:
|
1265
|
+
#line 228 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1266
|
+
{
|
1267
|
+
((*yyvalp)) = rb_ary_new_from_args(1, (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval));
|
1268
|
+
}
|
1269
|
+
#line 1270 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1270
|
+
break;
|
1271
|
+
|
1272
|
+
case 19:
|
1273
|
+
#line 233 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1274
|
+
{
|
1275
|
+
rb_ary_push(((*yyvalp)), (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval));
|
1276
|
+
}
|
1277
|
+
#line 1278 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1278
|
+
break;
|
1279
|
+
|
1280
|
+
case 20:
|
1281
|
+
#line 240 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1282
|
+
{
|
1283
|
+
VALUE args[] = {(((yyGLRStackItem const *)yyvsp)[YYFILL (-1)].yystate.yysemantics.yysval), (((yyGLRStackItem const *)yyvsp)[YYFILL (-3)].yystate.yysemantics.yysval), (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval), rb_funcall((((yyGLRStackItem const *)yyvsp)[YYFILL (-3)].yystate.yysemantics.yysval), rb_intern("location"), 0)};
|
1284
|
+
((*yyvalp)) = rb_class_new_instance(sizeof(args)/sizeof(*args),args, cField);
|
1285
|
+
|
1286
|
+
rb_funcall(((*yyvalp)), rb_intern("annote"), 1, (((yyGLRStackItem const *)yyvsp)[YYFILL (-4)].yystate.yysemantics.yysval));
|
1287
|
+
rb_funcall((((yyGLRStackItem const *)yyvsp)[YYFILL (-1)].yystate.yysemantics.yysval), rb_intern("annote"), 1, (((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval));
|
1288
|
+
}
|
1289
|
+
#line 1290 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1290
|
+
break;
|
1291
|
+
|
1292
|
+
case 21:
|
1293
|
+
#line 251 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1294
|
+
{
|
1295
|
+
((*yyvalp)) = Qfalse;
|
1296
|
+
}
|
1297
|
+
#line 1298 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1298
|
+
break;
|
1299
|
+
|
1300
|
+
case 22:
|
1301
|
+
#line 256 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1302
|
+
{
|
1303
|
+
((*yyvalp)) = Qtrue;
|
1304
|
+
}
|
1305
|
+
#line 1306 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1306
|
+
break;
|
1307
|
+
|
1308
|
+
case 31:
|
1309
|
+
#line 281 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1310
|
+
{
|
1311
|
+
VALUE args[] = {Qnil, newLocation(filename, &(*yylocp))};
|
1312
|
+
((*yyvalp)) = rb_class_new_instance(sizeof(args)/sizeof(*args), args, cBOOLEAN);
|
1313
|
+
}
|
1314
|
+
#line 1315 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1315
|
+
break;
|
1316
|
+
|
1317
|
+
case 32:
|
1318
|
+
#line 287 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1319
|
+
{
|
1320
|
+
VALUE args[] = {Qnil, newLocation(filename, &(*yylocp))};
|
1321
|
+
((*yyvalp)) = rb_class_new_instance(sizeof(args)/sizeof(*args), args, cOBJECT);
|
1322
|
+
}
|
1323
|
+
#line 1324 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1324
|
+
break;
|
1325
|
+
|
1326
|
+
case 33:
|
1327
|
+
#line 295 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1328
|
+
{
|
1329
|
+
VALUE args[] = {(((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval), rb_funcall((((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval), rb_intern("location"), 0)};
|
1330
|
+
((*yyvalp)) = rb_class_new_instance(sizeof(args)/sizeof(*args), args, cSEQUENCE);
|
1331
|
+
}
|
1332
|
+
#line 1333 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1333
|
+
break;
|
1334
|
+
|
1335
|
+
case 34:
|
1336
|
+
#line 303 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1337
|
+
{
|
1338
|
+
VALUE args[] = {Qnil, newLocation(filename, &(*yylocp))};
|
1339
|
+
((*yyvalp)) = rb_class_new_instance(sizeof(args)/sizeof(*args), args, cSTRING);
|
1340
|
+
}
|
1341
|
+
#line 1342 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1342
|
+
break;
|
1343
|
+
|
1344
|
+
case 35:
|
1345
|
+
#line 309 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1346
|
+
{
|
1347
|
+
VALUE args[] = {(((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval), newLocation(filename, &(*yylocp))};
|
1348
|
+
((*yyvalp)) = rb_class_new_instance(sizeof(args)/sizeof(*args), args, cSTRING);
|
1349
|
+
}
|
1350
|
+
#line 1351 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1351
|
+
break;
|
1352
|
+
|
1353
|
+
case 36:
|
1354
|
+
#line 317 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1355
|
+
{
|
1356
|
+
VALUE args[] = {Qnil, newLocation(filename, &(*yylocp))};
|
1357
|
+
((*yyvalp)) = rb_class_new_instance(sizeof(args)/sizeof(*args), args, cBINARY);
|
1358
|
+
}
|
1359
|
+
#line 1360 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1360
|
+
break;
|
1361
|
+
|
1362
|
+
case 37:
|
1363
|
+
#line 323 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1364
|
+
{
|
1365
|
+
VALUE args[] = {(((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval), newLocation(filename, &(*yylocp))};
|
1366
|
+
((*yyvalp)) = rb_class_new_instance(sizeof(args)/sizeof(*args), args, cBINARY);
|
1367
|
+
}
|
1368
|
+
#line 1369 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1369
|
+
break;
|
1370
|
+
|
1371
|
+
case 38:
|
1372
|
+
#line 331 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1373
|
+
{
|
1374
|
+
VALUE args[] = {(((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval), newLocation(filename, &(*yylocp))};
|
1375
|
+
((*yyvalp)) = rb_class_new_instance(sizeof(args)/sizeof(*args), args, cFIXED);
|
1376
|
+
}
|
1377
|
+
#line 1378 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1378
|
+
break;
|
1379
|
+
|
1380
|
+
case 39:
|
1381
|
+
#line 339 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1382
|
+
{
|
1383
|
+
((*yyvalp)) = (((yyGLRStackItem const *)yyvsp)[YYFILL (-1)].yystate.yysemantics.yysval);
|
1384
|
+
}
|
1385
|
+
#line 1386 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1386
|
+
break;
|
1387
|
+
|
1388
|
+
case 40:
|
1389
|
+
#line 344 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1390
|
+
{
|
1391
|
+
((*yyvalp)) = (((yyGLRStackItem const *)yyvsp)[YYFILL (-1)].yystate.yysemantics.yysval);
|
1392
|
+
}
|
1393
|
+
#line 1394 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1394
|
+
break;
|
1395
|
+
|
1396
|
+
case 41:
|
1397
|
+
#line 351 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1398
|
+
{
|
1399
|
+
VALUE args[] = {(((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval), Qfalse};
|
1400
|
+
((*yyvalp)) = rb_class_new_instance(sizeof(args)/sizeof(*args), args, cREF);
|
1401
|
+
}
|
1402
|
+
#line 1403 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1403
|
+
break;
|
1404
|
+
|
1405
|
+
case 42:
|
1406
|
+
#line 357 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1407
|
+
{
|
1408
|
+
VALUE args[] = {(((yyGLRStackItem const *)yyvsp)[YYFILL (-1)].yystate.yysemantics.yysval), Qtrue};
|
1409
|
+
((*yyvalp)) = rb_class_new_instance(sizeof(args)/sizeof(*args), args, cREF);
|
1410
|
+
}
|
1411
|
+
#line 1412 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1412
|
+
break;
|
1413
|
+
|
1414
|
+
case 43:
|
1415
|
+
#line 365 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1416
|
+
{
|
1417
|
+
VALUE args[] = {newLocation(filename, &(*yylocp))};
|
1418
|
+
((*yyvalp)) = rb_class_new_instance(sizeof(args)/sizeof(*args), args, cI8);
|
1419
|
+
}
|
1420
|
+
#line 1421 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1421
|
+
break;
|
1422
|
+
|
1423
|
+
case 44:
|
1424
|
+
#line 371 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1425
|
+
{
|
1426
|
+
VALUE args[] = {newLocation(filename, &(*yylocp))};
|
1427
|
+
((*yyvalp)) = rb_class_new_instance(sizeof(args)/sizeof(*args), args, cI16);
|
1428
|
+
}
|
1429
|
+
#line 1430 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1430
|
+
break;
|
1431
|
+
|
1432
|
+
case 45:
|
1433
|
+
#line 377 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1434
|
+
{
|
1435
|
+
VALUE args[] = {newLocation(filename, &(*yylocp))};
|
1436
|
+
((*yyvalp)) = rb_class_new_instance(sizeof(args)/sizeof(*args), args, cI32);
|
1437
|
+
}
|
1438
|
+
#line 1439 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1439
|
+
break;
|
1440
|
+
|
1441
|
+
case 46:
|
1442
|
+
#line 383 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1443
|
+
{
|
1444
|
+
VALUE args[] = {newLocation(filename, &(*yylocp))};
|
1445
|
+
((*yyvalp)) = rb_class_new_instance(sizeof(args)/sizeof(*args), args, cI64);
|
1446
|
+
}
|
1447
|
+
#line 1448 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1448
|
+
break;
|
1449
|
+
|
1450
|
+
case 47:
|
1451
|
+
#line 389 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1452
|
+
{
|
1453
|
+
VALUE args[] = {newLocation(filename, &(*yylocp))};
|
1454
|
+
((*yyvalp)) = rb_class_new_instance(sizeof(args)/sizeof(*args), args, cU8);
|
1455
|
+
}
|
1456
|
+
#line 1457 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1457
|
+
break;
|
1458
|
+
|
1459
|
+
case 48:
|
1460
|
+
#line 395 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1461
|
+
{
|
1462
|
+
VALUE args[] = {newLocation(filename, &(*yylocp))};
|
1463
|
+
((*yyvalp)) = rb_class_new_instance(sizeof(args)/sizeof(*args), args, cU16);
|
1464
|
+
}
|
1465
|
+
#line 1466 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1466
|
+
break;
|
1467
|
+
|
1468
|
+
case 49:
|
1469
|
+
#line 401 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1470
|
+
{
|
1471
|
+
VALUE args[] = {newLocation(filename, &(*yylocp))};
|
1472
|
+
((*yyvalp)) = rb_class_new_instance(sizeof(args)/sizeof(*args), args, cU32);
|
1473
|
+
}
|
1474
|
+
#line 1475 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1475
|
+
break;
|
1476
|
+
|
1477
|
+
case 50:
|
1478
|
+
#line 407 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1479
|
+
{
|
1480
|
+
VALUE args[] = {newLocation(filename, &(*yylocp))};
|
1481
|
+
((*yyvalp)) = rb_class_new_instance(sizeof(args)/sizeof(*args), args, cU64);
|
1482
|
+
}
|
1483
|
+
#line 1484 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1484
|
+
break;
|
1485
|
+
|
1486
|
+
case 51:
|
1487
|
+
#line 413 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1488
|
+
{
|
1489
|
+
VALUE args[] = {newLocation(filename, &(*yylocp))};
|
1490
|
+
((*yyvalp)) = rb_class_new_instance(sizeof(args)/sizeof(*args), args, cF64);
|
1491
|
+
}
|
1492
|
+
#line 1493 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1493
|
+
break;
|
1494
|
+
|
1495
|
+
case 52:
|
1496
|
+
#line 419 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1497
|
+
{
|
1498
|
+
VALUE args[] = {newLocation(filename, &(*yylocp))};
|
1499
|
+
((*yyvalp)) = rb_class_new_instance(sizeof(args)/sizeof(*args), args, cDECIMAL);
|
1500
|
+
}
|
1501
|
+
#line 1502 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1502
|
+
break;
|
1503
|
+
|
1504
|
+
case 53:
|
1505
|
+
#line 427 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1506
|
+
{
|
1507
|
+
VALUE args[] = {newLocation(filename, &(*yylocp))};
|
1508
|
+
((*yyvalp)) = rb_class_new_instance(sizeof(args)/sizeof(*args), args, cDATE);
|
1509
|
+
}
|
1510
|
+
#line 1511 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1511
|
+
break;
|
1512
|
+
|
1513
|
+
case 54:
|
1514
|
+
#line 433 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1515
|
+
{
|
1516
|
+
VALUE args[] = {newLocation(filename, &(*yylocp))};
|
1517
|
+
((*yyvalp)) = rb_class_new_instance(sizeof(args)/sizeof(*args), args, cTIME_OF_DAY_MILLI);
|
1518
|
+
}
|
1519
|
+
#line 1520 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1520
|
+
break;
|
1521
|
+
|
1522
|
+
case 55:
|
1523
|
+
#line 439 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1524
|
+
{
|
1525
|
+
VALUE args[] = {newLocation(filename, &(*yylocp))};
|
1526
|
+
((*yyvalp)) = rb_class_new_instance(sizeof(args)/sizeof(*args), args, cTIME_OF_DAY_NANO);
|
1527
|
+
}
|
1528
|
+
#line 1529 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1529
|
+
break;
|
1530
|
+
|
1531
|
+
case 56:
|
1532
|
+
#line 445 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1533
|
+
{
|
1534
|
+
VALUE args[] = {newLocation(filename, &(*yylocp))};
|
1535
|
+
((*yyvalp)) = rb_class_new_instance(sizeof(args)/sizeof(*args), args, cNANO_TIME);
|
1536
|
+
}
|
1537
|
+
#line 1538 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1538
|
+
break;
|
1539
|
+
|
1540
|
+
case 57:
|
1541
|
+
#line 451 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1542
|
+
{
|
1543
|
+
VALUE args[] = {newLocation(filename, &(*yylocp))};
|
1544
|
+
((*yyvalp)) = rb_class_new_instance(sizeof(args)/sizeof(*args), args, cMILLI_TIME);
|
1545
|
+
}
|
1546
|
+
#line 1547 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1547
|
+
break;
|
1548
|
+
|
1549
|
+
case 58:
|
1550
|
+
#line 460 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1551
|
+
{
|
1552
|
+
((*yyvalp)) = rb_ary_new_from_args(1, (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval));
|
1553
|
+
}
|
1554
|
+
#line 1555 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1555
|
+
break;
|
1556
|
+
|
1557
|
+
case 60:
|
1558
|
+
#line 469 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1559
|
+
{
|
1560
|
+
((*yyvalp)) = rb_ary_new_from_args(1, (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval));
|
1561
|
+
}
|
1562
|
+
#line 1563 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1563
|
+
break;
|
1564
|
+
|
1565
|
+
case 61:
|
1566
|
+
#line 474 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1567
|
+
{
|
1568
|
+
rb_ary_push(((*yyvalp)), (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval));
|
1569
|
+
}
|
1570
|
+
#line 1571 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1571
|
+
break;
|
1572
|
+
|
1573
|
+
case 62:
|
1574
|
+
#line 481 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1575
|
+
{
|
1576
|
+
VALUE args[] = {(((yyGLRStackItem const *)yyvsp)[YYFILL (-1)].yystate.yysemantics.yysval), (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval), newLocation(filename, &(((yyGLRStackItem const *)yyvsp)[YYFILL (-1)].yystate.yyloc))};
|
1577
|
+
((*yyvalp)) = rb_class_new_instance(sizeof(args)/sizeof(*args), args, cSym);
|
1578
|
+
rb_funcall(((*yyvalp)), rb_intern("annote"), 1, (((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval));
|
1579
|
+
}
|
1580
|
+
#line 1581 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1581
|
+
break;
|
1582
|
+
|
1583
|
+
case 64:
|
1584
|
+
#line 492 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1585
|
+
{
|
1586
|
+
((*yyvalp)) = (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval);
|
1587
|
+
}
|
1588
|
+
#line 1589 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1589
|
+
break;
|
1590
|
+
|
1591
|
+
case 65:
|
1592
|
+
#line 497 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1593
|
+
{
|
1594
|
+
((*yyvalp)) = (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval);
|
1595
|
+
}
|
1596
|
+
#line 1597 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1597
|
+
break;
|
1598
|
+
|
1599
|
+
case 66:
|
1600
|
+
#line 504 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1601
|
+
{
|
1602
|
+
((*yyvalp)) = rb_ary_new();
|
1603
|
+
}
|
1604
|
+
#line 1605 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1605
|
+
break;
|
1606
|
+
|
1607
|
+
case 68:
|
1608
|
+
#line 513 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1609
|
+
{
|
1610
|
+
((*yyvalp)) = rb_ary_new_from_args(1, (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval));
|
1611
|
+
}
|
1612
|
+
#line 1613 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1613
|
+
break;
|
1614
|
+
|
1615
|
+
case 69:
|
1616
|
+
#line 518 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1617
|
+
{
|
1618
|
+
rb_ary_push(((*yyvalp)), (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval));
|
1619
|
+
}
|
1620
|
+
#line 1621 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1621
|
+
break;
|
1622
|
+
|
1623
|
+
case 70:
|
1624
|
+
#line 524 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1625
|
+
{
|
1626
|
+
VALUE args[] = {(((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval), (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval), newLocation(filename, &(*yylocp))};
|
1627
|
+
((*yyvalp)) = rb_class_new_instance(sizeof(args)/sizeof(*args), args, cAnnotation);
|
1628
|
+
}
|
1629
|
+
#line 1630 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1630
|
+
break;
|
1631
|
+
|
1632
|
+
case 72:
|
1633
|
+
#line 534 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1634
|
+
{
|
1635
|
+
rb_str_append(((*yyvalp)), (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval));
|
1636
|
+
}
|
1637
|
+
#line 1638 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1638
|
+
break;
|
1639
|
+
|
1640
|
+
case 73:
|
1641
|
+
#line 541 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1642
|
+
{
|
1643
|
+
VALUE args[] = {(((yyGLRStackItem const *)yyvsp)[YYFILL (-1)].yystate.yysemantics.yysval), (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval)};
|
1644
|
+
((*yyvalp)) = rb_class_new_instance(sizeof(args)/sizeof(*args), args, cNameWithID);
|
1645
|
+
}
|
1646
|
+
#line 1647 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1647
|
+
break;
|
1648
|
+
|
1649
|
+
case 75:
|
1650
|
+
#line 551 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1651
|
+
{
|
1652
|
+
((*yyvalp)) = (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval);
|
1653
|
+
}
|
1654
|
+
#line 1655 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1655
|
+
break;
|
1656
|
+
|
1657
|
+
case 76:
|
1658
|
+
#line 556 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1659
|
+
{
|
1660
|
+
((*yyvalp)) = (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval);
|
1661
|
+
}
|
1662
|
+
#line 1663 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1663
|
+
break;
|
1664
|
+
|
1665
|
+
case 77:
|
1666
|
+
#line 563 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1667
|
+
{
|
1668
|
+
VALUE args[] = {(((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval), (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval), newLocation(filename, &(*yylocp))};
|
1669
|
+
((*yyvalp)) = rb_class_new_instance(sizeof(args)/sizeof(*args), args, cIncrementalAnnotation);
|
1670
|
+
}
|
1671
|
+
#line 1672 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1672
|
+
break;
|
1673
|
+
|
1674
|
+
case 78:
|
1675
|
+
#line 571 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1676
|
+
{
|
1677
|
+
VALUE args[] = {cSchema};
|
1678
|
+
((*yyvalp)) = rb_class_new_instance(sizeof(args)/sizeof(*args), args, cSchemaRef);
|
1679
|
+
}
|
1680
|
+
#line 1681 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1681
|
+
break;
|
1682
|
+
|
1683
|
+
case 79:
|
1684
|
+
#line 577 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1685
|
+
{
|
1686
|
+
VALUE args[] = {(((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval)};
|
1687
|
+
((*yyvalp)) = rb_class_new_instance(sizeof(args)/sizeof(*args), args, cDefinitionRef);
|
1688
|
+
}
|
1689
|
+
#line 1690 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1690
|
+
break;
|
1691
|
+
|
1692
|
+
case 80:
|
1693
|
+
#line 583 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1694
|
+
{
|
1695
|
+
VALUE args[] = {(((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval)};
|
1696
|
+
((*yyvalp)) = rb_class_new_instance(sizeof(args)/sizeof(*args), args, cDefinitionTypeRef);
|
1697
|
+
}
|
1698
|
+
#line 1699 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1699
|
+
break;
|
1700
|
+
|
1701
|
+
case 81:
|
1702
|
+
#line 589 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1703
|
+
{
|
1704
|
+
VALUE args[] = {(((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval), (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval)};
|
1705
|
+
((*yyvalp)) = rb_class_new_instance(sizeof(args)/sizeof(*args), args, cFieldRef);
|
1706
|
+
}
|
1707
|
+
#line 1708 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1708
|
+
break;
|
1709
|
+
|
1710
|
+
case 82:
|
1711
|
+
#line 595 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1712
|
+
{
|
1713
|
+
VALUE args[] = {(((yyGLRStackItem const *)yyvsp)[YYFILL (-4)].yystate.yysemantics.yysval), (((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval)};
|
1714
|
+
((*yyvalp)) = rb_class_new_instance(sizeof(args)/sizeof(*args), args, cFieldTypeRef);
|
1715
|
+
}
|
1716
|
+
#line 1717 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1717
|
+
break;
|
1718
|
+
|
1719
|
+
case 83:
|
1720
|
+
#line 603 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1721
|
+
{
|
1722
|
+
((*yyvalp)) = rb_ary_new_from_args(1, (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval));
|
1723
|
+
}
|
1724
|
+
#line 1725 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1725
|
+
break;
|
1726
|
+
|
1727
|
+
case 84:
|
1728
|
+
#line 608 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1729
|
+
{
|
1730
|
+
((*yyvalp)) = (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval);
|
1731
|
+
rb_ary_unshift(((*yyvalp)), (((yyGLRStackItem const *)yyvsp)[YYFILL (-2)].yystate.yysemantics.yysval));
|
1732
|
+
}
|
1733
|
+
#line 1734 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1734
|
+
break;
|
1735
|
+
|
1736
|
+
case 93:
|
1737
|
+
#line 638 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1738
|
+
{
|
1739
|
+
((*yyvalp)) = rb_str_new_cstr("i8");
|
1740
|
+
}
|
1741
|
+
#line 1742 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1742
|
+
break;
|
1743
|
+
|
1744
|
+
case 94:
|
1745
|
+
#line 643 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1746
|
+
{
|
1747
|
+
((*yyvalp)) = rb_str_new_cstr("i16");
|
1748
|
+
}
|
1749
|
+
#line 1750 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1750
|
+
break;
|
1751
|
+
|
1752
|
+
case 95:
|
1753
|
+
#line 648 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1754
|
+
{
|
1755
|
+
((*yyvalp)) = rb_str_new_cstr("i32");
|
1756
|
+
}
|
1757
|
+
#line 1758 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1758
|
+
break;
|
1759
|
+
|
1760
|
+
case 96:
|
1761
|
+
#line 653 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1762
|
+
{
|
1763
|
+
((*yyvalp)) = rb_str_new_cstr("i64");
|
1764
|
+
}
|
1765
|
+
#line 1766 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1766
|
+
break;
|
1767
|
+
|
1768
|
+
case 97:
|
1769
|
+
#line 658 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1770
|
+
{
|
1771
|
+
((*yyvalp)) = rb_str_new_cstr("u8");
|
1772
|
+
}
|
1773
|
+
#line 1774 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1774
|
+
break;
|
1775
|
+
|
1776
|
+
case 98:
|
1777
|
+
#line 663 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1778
|
+
{
|
1779
|
+
((*yyvalp)) = rb_str_new_cstr("u16");
|
1780
|
+
}
|
1781
|
+
#line 1782 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1782
|
+
break;
|
1783
|
+
|
1784
|
+
case 99:
|
1785
|
+
#line 668 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1786
|
+
{
|
1787
|
+
((*yyvalp)) = rb_str_new_cstr("u32");
|
1788
|
+
}
|
1789
|
+
#line 1790 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1790
|
+
break;
|
1791
|
+
|
1792
|
+
case 100:
|
1793
|
+
#line 673 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1794
|
+
{
|
1795
|
+
((*yyvalp)) = rb_str_new_cstr("u64");
|
1796
|
+
}
|
1797
|
+
#line 1798 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1798
|
+
break;
|
1799
|
+
|
1800
|
+
case 101:
|
1801
|
+
#line 678 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1802
|
+
{
|
1803
|
+
((*yyvalp)) = rb_str_new_cstr("f64");
|
1804
|
+
}
|
1805
|
+
#line 1806 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1806
|
+
break;
|
1807
|
+
|
1808
|
+
case 102:
|
1809
|
+
#line 683 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1810
|
+
{
|
1811
|
+
((*yyvalp)) = rb_str_new_cstr("decimal");
|
1812
|
+
}
|
1813
|
+
#line 1814 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1814
|
+
break;
|
1815
|
+
|
1816
|
+
case 103:
|
1817
|
+
#line 688 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1818
|
+
{
|
1819
|
+
((*yyvalp)) = rb_str_new_cstr("date");
|
1820
|
+
}
|
1821
|
+
#line 1822 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1822
|
+
break;
|
1823
|
+
|
1824
|
+
case 104:
|
1825
|
+
#line 693 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1826
|
+
{
|
1827
|
+
((*yyvalp)) = rb_str_new_cstr("timeOfDayMilli");
|
1828
|
+
}
|
1829
|
+
#line 1830 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1830
|
+
break;
|
1831
|
+
|
1832
|
+
case 105:
|
1833
|
+
#line 698 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1834
|
+
{
|
1835
|
+
((*yyvalp)) = rb_str_new_cstr("timeOfDayNano");
|
1836
|
+
}
|
1837
|
+
#line 1838 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1838
|
+
break;
|
1839
|
+
|
1840
|
+
case 106:
|
1841
|
+
#line 703 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1842
|
+
{
|
1843
|
+
((*yyvalp)) = rb_str_new_cstr("nanoTime");
|
1844
|
+
}
|
1845
|
+
#line 1846 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1846
|
+
break;
|
1847
|
+
|
1848
|
+
case 107:
|
1849
|
+
#line 708 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1850
|
+
{
|
1851
|
+
((*yyvalp)) = rb_str_new_cstr("milliTime");
|
1852
|
+
}
|
1853
|
+
#line 1854 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1854
|
+
break;
|
1855
|
+
|
1856
|
+
case 108:
|
1857
|
+
#line 713 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1858
|
+
{
|
1859
|
+
((*yyvalp)) = rb_str_new_cstr("boolean");
|
1860
|
+
}
|
1861
|
+
#line 1862 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1862
|
+
break;
|
1863
|
+
|
1864
|
+
case 109:
|
1865
|
+
#line 718 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1866
|
+
{
|
1867
|
+
((*yyvalp)) = rb_str_new_cstr("string");
|
1868
|
+
}
|
1869
|
+
#line 1870 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1870
|
+
break;
|
1871
|
+
|
1872
|
+
case 110:
|
1873
|
+
#line 723 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1874
|
+
{
|
1875
|
+
((*yyvalp)) = rb_str_new_cstr("binary");
|
1876
|
+
}
|
1877
|
+
#line 1878 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1878
|
+
break;
|
1879
|
+
|
1880
|
+
case 111:
|
1881
|
+
#line 728 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1882
|
+
{
|
1883
|
+
((*yyvalp)) = rb_str_new_cstr("fixed");
|
1884
|
+
}
|
1885
|
+
#line 1886 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1886
|
+
break;
|
1887
|
+
|
1888
|
+
case 112:
|
1889
|
+
#line 733 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1890
|
+
{
|
1891
|
+
((*yyvalp)) = rb_str_new_cstr("object");
|
1892
|
+
}
|
1893
|
+
#line 1894 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1894
|
+
break;
|
1895
|
+
|
1896
|
+
case 113:
|
1897
|
+
#line 738 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1898
|
+
{
|
1899
|
+
((*yyvalp)) = rb_str_new_cstr("namespace");
|
1900
|
+
}
|
1901
|
+
#line 1902 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1902
|
+
break;
|
1903
|
+
|
1904
|
+
case 114:
|
1905
|
+
#line 743 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1906
|
+
{
|
1907
|
+
((*yyvalp)) = rb_str_new_cstr("type");
|
1908
|
+
}
|
1909
|
+
#line 1910 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1910
|
+
break;
|
1911
|
+
|
1912
|
+
case 115:
|
1913
|
+
#line 748 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1914
|
+
{
|
1915
|
+
((*yyvalp)) = rb_str_new_cstr("schema");
|
1916
|
+
}
|
1917
|
+
#line 1918 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1918
|
+
break;
|
1919
|
+
|
1920
|
+
case 119:
|
1921
|
+
#line 765 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1922
|
+
{
|
1923
|
+
((*yyvalp)) = (((yyGLRStackItem const *)yyvsp)[YYFILL (0)].yystate.yysemantics.yysval);
|
1924
|
+
}
|
1925
|
+
#line 1926 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1926
|
+
break;
|
1927
|
+
|
1928
|
+
case 125:
|
1929
|
+
#line 790 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:783 */
|
1930
|
+
{
|
1931
|
+
((*yyvalp)) = Qnil;
|
1932
|
+
}
|
1933
|
+
#line 1934 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1934
|
+
break;
|
1935
|
+
|
1936
|
+
|
1937
|
+
#line 1938 "ext/slow_blink/ext_schema_parser/parser.c" /* glr.c:783 */
|
1938
|
+
default: break;
|
1939
|
+
}
|
1940
|
+
|
1941
|
+
return yyok;
|
1942
|
+
# undef yyerrok
|
1943
|
+
# undef YYABORT
|
1944
|
+
# undef YYACCEPT
|
1945
|
+
# undef YYERROR
|
1946
|
+
# undef YYBACKUP
|
1947
|
+
# undef yyclearin
|
1948
|
+
# undef YYRECOVERING
|
1949
|
+
}
|
1950
|
+
|
1951
|
+
|
1952
|
+
static void
|
1953
|
+
yyuserMerge (int yyn, YYSTYPE* yy0, YYSTYPE* yy1)
|
1954
|
+
{
|
1955
|
+
YYUSE (yy0);
|
1956
|
+
YYUSE (yy1);
|
1957
|
+
|
1958
|
+
switch (yyn)
|
1959
|
+
{
|
1960
|
+
|
1961
|
+
default: break;
|
1962
|
+
}
|
1963
|
+
}
|
1964
|
+
|
1965
|
+
/* Bison grammar-table manipulation. */
|
1966
|
+
|
1967
|
+
/*-----------------------------------------------.
|
1968
|
+
| Release the memory associated to this symbol. |
|
1969
|
+
`-----------------------------------------------*/
|
1970
|
+
|
1971
|
+
static void
|
1972
|
+
yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, yyscan_t scanner, VALUE filename, VALUE *tree)
|
1973
|
+
{
|
1974
|
+
YYUSE (yyvaluep);
|
1975
|
+
YYUSE (yylocationp);
|
1976
|
+
YYUSE (scanner);
|
1977
|
+
YYUSE (filename);
|
1978
|
+
YYUSE (tree);
|
1979
|
+
if (!yymsg)
|
1980
|
+
yymsg = "Deleting";
|
1981
|
+
YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
|
1982
|
+
|
1983
|
+
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
|
1984
|
+
YYUSE (yytype);
|
1985
|
+
YY_IGNORE_MAYBE_UNINITIALIZED_END
|
1986
|
+
}
|
1987
|
+
|
1988
|
+
/** Number of symbols composing the right hand side of rule #RULE. */
|
1989
|
+
static inline int
|
1990
|
+
yyrhsLength (yyRuleNum yyrule)
|
1991
|
+
{
|
1992
|
+
return yyr2[yyrule];
|
1993
|
+
}
|
1994
|
+
|
1995
|
+
static void
|
1996
|
+
yydestroyGLRState (char const *yymsg, yyGLRState *yys, yyscan_t scanner, VALUE filename, VALUE *tree)
|
1997
|
+
{
|
1998
|
+
if (yys->yyresolved)
|
1999
|
+
yydestruct (yymsg, yystos[yys->yylrState],
|
2000
|
+
&yys->yysemantics.yysval, &yys->yyloc, scanner, filename, tree);
|
2001
|
+
else
|
2002
|
+
{
|
2003
|
+
#if YYDEBUG
|
2004
|
+
if (yydebug)
|
2005
|
+
{
|
2006
|
+
if (yys->yysemantics.yyfirstVal)
|
2007
|
+
YYFPRINTF (stderr, "%s unresolved", yymsg);
|
2008
|
+
else
|
2009
|
+
YYFPRINTF (stderr, "%s incomplete", yymsg);
|
2010
|
+
YY_SYMBOL_PRINT ("", yystos[yys->yylrState], YY_NULLPTR, &yys->yyloc);
|
2011
|
+
}
|
2012
|
+
#endif
|
2013
|
+
|
2014
|
+
if (yys->yysemantics.yyfirstVal)
|
2015
|
+
{
|
2016
|
+
yySemanticOption *yyoption = yys->yysemantics.yyfirstVal;
|
2017
|
+
yyGLRState *yyrh;
|
2018
|
+
int yyn;
|
2019
|
+
for (yyrh = yyoption->yystate, yyn = yyrhsLength (yyoption->yyrule);
|
2020
|
+
yyn > 0;
|
2021
|
+
yyrh = yyrh->yypred, yyn -= 1)
|
2022
|
+
yydestroyGLRState (yymsg, yyrh, scanner, filename, tree);
|
2023
|
+
}
|
2024
|
+
}
|
2025
|
+
}
|
2026
|
+
|
2027
|
+
/** Left-hand-side symbol for rule #YYRULE. */
|
2028
|
+
static inline yySymbol
|
2029
|
+
yylhsNonterm (yyRuleNum yyrule)
|
2030
|
+
{
|
2031
|
+
return yyr1[yyrule];
|
2032
|
+
}
|
2033
|
+
|
2034
|
+
#define yypact_value_is_default(Yystate) \
|
2035
|
+
(!!((Yystate) == (-87)))
|
2036
|
+
|
2037
|
+
/** True iff LR state YYSTATE has only a default reduction (regardless
|
2038
|
+
* of token). */
|
2039
|
+
static inline yybool
|
2040
|
+
yyisDefaultedState (yyStateNum yystate)
|
2041
|
+
{
|
2042
|
+
return yypact_value_is_default (yypact[yystate]);
|
2043
|
+
}
|
2044
|
+
|
2045
|
+
/** The default reduction for YYSTATE, assuming it has one. */
|
2046
|
+
static inline yyRuleNum
|
2047
|
+
yydefaultAction (yyStateNum yystate)
|
2048
|
+
{
|
2049
|
+
return yydefact[yystate];
|
2050
|
+
}
|
2051
|
+
|
2052
|
+
#define yytable_value_is_error(Yytable_value) \
|
2053
|
+
0
|
2054
|
+
|
2055
|
+
/** Set *YYACTION to the action to take in YYSTATE on seeing YYTOKEN.
|
2056
|
+
* Result R means
|
2057
|
+
* R < 0: Reduce on rule -R.
|
2058
|
+
* R = 0: Error.
|
2059
|
+
* R > 0: Shift to state R.
|
2060
|
+
* Set *YYCONFLICTS to a pointer into yyconfl to a 0-terminated list
|
2061
|
+
* of conflicting reductions.
|
2062
|
+
*/
|
2063
|
+
static inline void
|
2064
|
+
yygetLRActions (yyStateNum yystate, int yytoken,
|
2065
|
+
int* yyaction, const short int** yyconflicts)
|
2066
|
+
{
|
2067
|
+
int yyindex = yypact[yystate] + yytoken;
|
2068
|
+
if (yypact_value_is_default (yypact[yystate])
|
2069
|
+
|| yyindex < 0 || YYLAST < yyindex || yycheck[yyindex] != yytoken)
|
2070
|
+
{
|
2071
|
+
*yyaction = -yydefact[yystate];
|
2072
|
+
*yyconflicts = yyconfl;
|
2073
|
+
}
|
2074
|
+
else if (! yytable_value_is_error (yytable[yyindex]))
|
2075
|
+
{
|
2076
|
+
*yyaction = yytable[yyindex];
|
2077
|
+
*yyconflicts = yyconfl + yyconflp[yyindex];
|
2078
|
+
}
|
2079
|
+
else
|
2080
|
+
{
|
2081
|
+
*yyaction = 0;
|
2082
|
+
*yyconflicts = yyconfl + yyconflp[yyindex];
|
2083
|
+
}
|
2084
|
+
}
|
2085
|
+
|
2086
|
+
/** Compute post-reduction state.
|
2087
|
+
* \param yystate the current state
|
2088
|
+
* \param yysym the nonterminal to push on the stack
|
2089
|
+
*/
|
2090
|
+
static inline yyStateNum
|
2091
|
+
yyLRgotoState (yyStateNum yystate, yySymbol yysym)
|
2092
|
+
{
|
2093
|
+
int yyr = yypgoto[yysym - YYNTOKENS] + yystate;
|
2094
|
+
if (0 <= yyr && yyr <= YYLAST && yycheck[yyr] == yystate)
|
2095
|
+
return yytable[yyr];
|
2096
|
+
else
|
2097
|
+
return yydefgoto[yysym - YYNTOKENS];
|
2098
|
+
}
|
2099
|
+
|
2100
|
+
static inline yybool
|
2101
|
+
yyisShiftAction (int yyaction)
|
2102
|
+
{
|
2103
|
+
return 0 < yyaction;
|
2104
|
+
}
|
2105
|
+
|
2106
|
+
static inline yybool
|
2107
|
+
yyisErrorAction (int yyaction)
|
2108
|
+
{
|
2109
|
+
return yyaction == 0;
|
2110
|
+
}
|
2111
|
+
|
2112
|
+
/* GLRStates */
|
2113
|
+
|
2114
|
+
/** Return a fresh GLRStackItem in YYSTACKP. The item is an LR state
|
2115
|
+
* if YYISSTATE, and otherwise a semantic option. Callers should call
|
2116
|
+
* YY_RESERVE_GLRSTACK afterwards to make sure there is sufficient
|
2117
|
+
* headroom. */
|
2118
|
+
|
2119
|
+
static inline yyGLRStackItem*
|
2120
|
+
yynewGLRStackItem (yyGLRStack* yystackp, yybool yyisState)
|
2121
|
+
{
|
2122
|
+
yyGLRStackItem* yynewItem = yystackp->yynextFree;
|
2123
|
+
yystackp->yyspaceLeft -= 1;
|
2124
|
+
yystackp->yynextFree += 1;
|
2125
|
+
yynewItem->yystate.yyisState = yyisState;
|
2126
|
+
return yynewItem;
|
2127
|
+
}
|
2128
|
+
|
2129
|
+
/** Add a new semantic action that will execute the action for rule
|
2130
|
+
* YYRULE on the semantic values in YYRHS to the list of
|
2131
|
+
* alternative actions for YYSTATE. Assumes that YYRHS comes from
|
2132
|
+
* stack #YYK of *YYSTACKP. */
|
2133
|
+
static void
|
2134
|
+
yyaddDeferredAction (yyGLRStack* yystackp, size_t yyk, yyGLRState* yystate,
|
2135
|
+
yyGLRState* yyrhs, yyRuleNum yyrule)
|
2136
|
+
{
|
2137
|
+
yySemanticOption* yynewOption =
|
2138
|
+
&yynewGLRStackItem (yystackp, yyfalse)->yyoption;
|
2139
|
+
YYASSERT (!yynewOption->yyisState);
|
2140
|
+
yynewOption->yystate = yyrhs;
|
2141
|
+
yynewOption->yyrule = yyrule;
|
2142
|
+
if (yystackp->yytops.yylookaheadNeeds[yyk])
|
2143
|
+
{
|
2144
|
+
yynewOption->yyrawchar = yychar;
|
2145
|
+
yynewOption->yyval = yylval;
|
2146
|
+
yynewOption->yyloc = yylloc;
|
2147
|
+
}
|
2148
|
+
else
|
2149
|
+
yynewOption->yyrawchar = YYEMPTY;
|
2150
|
+
yynewOption->yynext = yystate->yysemantics.yyfirstVal;
|
2151
|
+
yystate->yysemantics.yyfirstVal = yynewOption;
|
2152
|
+
|
2153
|
+
YY_RESERVE_GLRSTACK (yystackp);
|
2154
|
+
}
|
2155
|
+
|
2156
|
+
/* GLRStacks */
|
2157
|
+
|
2158
|
+
/** Initialize YYSET to a singleton set containing an empty stack. */
|
2159
|
+
static yybool
|
2160
|
+
yyinitStateSet (yyGLRStateSet* yyset)
|
2161
|
+
{
|
2162
|
+
yyset->yysize = 1;
|
2163
|
+
yyset->yycapacity = 16;
|
2164
|
+
yyset->yystates = (yyGLRState**) YYMALLOC (16 * sizeof yyset->yystates[0]);
|
2165
|
+
if (! yyset->yystates)
|
2166
|
+
return yyfalse;
|
2167
|
+
yyset->yystates[0] = YY_NULLPTR;
|
2168
|
+
yyset->yylookaheadNeeds =
|
2169
|
+
(yybool*) YYMALLOC (16 * sizeof yyset->yylookaheadNeeds[0]);
|
2170
|
+
if (! yyset->yylookaheadNeeds)
|
2171
|
+
{
|
2172
|
+
YYFREE (yyset->yystates);
|
2173
|
+
return yyfalse;
|
2174
|
+
}
|
2175
|
+
return yytrue;
|
2176
|
+
}
|
2177
|
+
|
2178
|
+
static void yyfreeStateSet (yyGLRStateSet* yyset)
|
2179
|
+
{
|
2180
|
+
YYFREE (yyset->yystates);
|
2181
|
+
YYFREE (yyset->yylookaheadNeeds);
|
2182
|
+
}
|
2183
|
+
|
2184
|
+
/** Initialize *YYSTACKP to a single empty stack, with total maximum
|
2185
|
+
* capacity for all stacks of YYSIZE. */
|
2186
|
+
static yybool
|
2187
|
+
yyinitGLRStack (yyGLRStack* yystackp, size_t yysize)
|
2188
|
+
{
|
2189
|
+
yystackp->yyerrState = 0;
|
2190
|
+
yynerrs = 0;
|
2191
|
+
yystackp->yyspaceLeft = yysize;
|
2192
|
+
yystackp->yyitems =
|
2193
|
+
(yyGLRStackItem*) YYMALLOC (yysize * sizeof yystackp->yynextFree[0]);
|
2194
|
+
if (!yystackp->yyitems)
|
2195
|
+
return yyfalse;
|
2196
|
+
yystackp->yynextFree = yystackp->yyitems;
|
2197
|
+
yystackp->yysplitPoint = YY_NULLPTR;
|
2198
|
+
yystackp->yylastDeleted = YY_NULLPTR;
|
2199
|
+
return yyinitStateSet (&yystackp->yytops);
|
2200
|
+
}
|
2201
|
+
|
2202
|
+
|
2203
|
+
#if YYSTACKEXPANDABLE
|
2204
|
+
# define YYRELOC(YYFROMITEMS,YYTOITEMS,YYX,YYTYPE) \
|
2205
|
+
&((YYTOITEMS) - ((YYFROMITEMS) - (yyGLRStackItem*) (YYX)))->YYTYPE
|
2206
|
+
|
2207
|
+
/** If *YYSTACKP is expandable, extend it. WARNING: Pointers into the
|
2208
|
+
stack from outside should be considered invalid after this call.
|
2209
|
+
We always expand when there are 1 or fewer items left AFTER an
|
2210
|
+
allocation, so that we can avoid having external pointers exist
|
2211
|
+
across an allocation. */
|
2212
|
+
static void
|
2213
|
+
yyexpandGLRStack (yyGLRStack* yystackp)
|
2214
|
+
{
|
2215
|
+
yyGLRStackItem* yynewItems;
|
2216
|
+
yyGLRStackItem* yyp0, *yyp1;
|
2217
|
+
size_t yynewSize;
|
2218
|
+
size_t yyn;
|
2219
|
+
size_t yysize = yystackp->yynextFree - yystackp->yyitems;
|
2220
|
+
if (YYMAXDEPTH - YYHEADROOM < yysize)
|
2221
|
+
yyMemoryExhausted (yystackp);
|
2222
|
+
yynewSize = 2*yysize;
|
2223
|
+
if (YYMAXDEPTH < yynewSize)
|
2224
|
+
yynewSize = YYMAXDEPTH;
|
2225
|
+
yynewItems = (yyGLRStackItem*) YYMALLOC (yynewSize * sizeof yynewItems[0]);
|
2226
|
+
if (! yynewItems)
|
2227
|
+
yyMemoryExhausted (yystackp);
|
2228
|
+
for (yyp0 = yystackp->yyitems, yyp1 = yynewItems, yyn = yysize;
|
2229
|
+
0 < yyn;
|
2230
|
+
yyn -= 1, yyp0 += 1, yyp1 += 1)
|
2231
|
+
{
|
2232
|
+
*yyp1 = *yyp0;
|
2233
|
+
if (*(yybool *) yyp0)
|
2234
|
+
{
|
2235
|
+
yyGLRState* yys0 = &yyp0->yystate;
|
2236
|
+
yyGLRState* yys1 = &yyp1->yystate;
|
2237
|
+
if (yys0->yypred != YY_NULLPTR)
|
2238
|
+
yys1->yypred =
|
2239
|
+
YYRELOC (yyp0, yyp1, yys0->yypred, yystate);
|
2240
|
+
if (! yys0->yyresolved && yys0->yysemantics.yyfirstVal != YY_NULLPTR)
|
2241
|
+
yys1->yysemantics.yyfirstVal =
|
2242
|
+
YYRELOC (yyp0, yyp1, yys0->yysemantics.yyfirstVal, yyoption);
|
2243
|
+
}
|
2244
|
+
else
|
2245
|
+
{
|
2246
|
+
yySemanticOption* yyv0 = &yyp0->yyoption;
|
2247
|
+
yySemanticOption* yyv1 = &yyp1->yyoption;
|
2248
|
+
if (yyv0->yystate != YY_NULLPTR)
|
2249
|
+
yyv1->yystate = YYRELOC (yyp0, yyp1, yyv0->yystate, yystate);
|
2250
|
+
if (yyv0->yynext != YY_NULLPTR)
|
2251
|
+
yyv1->yynext = YYRELOC (yyp0, yyp1, yyv0->yynext, yyoption);
|
2252
|
+
}
|
2253
|
+
}
|
2254
|
+
if (yystackp->yysplitPoint != YY_NULLPTR)
|
2255
|
+
yystackp->yysplitPoint = YYRELOC (yystackp->yyitems, yynewItems,
|
2256
|
+
yystackp->yysplitPoint, yystate);
|
2257
|
+
|
2258
|
+
for (yyn = 0; yyn < yystackp->yytops.yysize; yyn += 1)
|
2259
|
+
if (yystackp->yytops.yystates[yyn] != YY_NULLPTR)
|
2260
|
+
yystackp->yytops.yystates[yyn] =
|
2261
|
+
YYRELOC (yystackp->yyitems, yynewItems,
|
2262
|
+
yystackp->yytops.yystates[yyn], yystate);
|
2263
|
+
YYFREE (yystackp->yyitems);
|
2264
|
+
yystackp->yyitems = yynewItems;
|
2265
|
+
yystackp->yynextFree = yynewItems + yysize;
|
2266
|
+
yystackp->yyspaceLeft = yynewSize - yysize;
|
2267
|
+
}
|
2268
|
+
#endif
|
2269
|
+
|
2270
|
+
static void
|
2271
|
+
yyfreeGLRStack (yyGLRStack* yystackp)
|
2272
|
+
{
|
2273
|
+
YYFREE (yystackp->yyitems);
|
2274
|
+
yyfreeStateSet (&yystackp->yytops);
|
2275
|
+
}
|
2276
|
+
|
2277
|
+
/** Assuming that YYS is a GLRState somewhere on *YYSTACKP, update the
|
2278
|
+
* splitpoint of *YYSTACKP, if needed, so that it is at least as deep as
|
2279
|
+
* YYS. */
|
2280
|
+
static inline void
|
2281
|
+
yyupdateSplit (yyGLRStack* yystackp, yyGLRState* yys)
|
2282
|
+
{
|
2283
|
+
if (yystackp->yysplitPoint != YY_NULLPTR && yystackp->yysplitPoint > yys)
|
2284
|
+
yystackp->yysplitPoint = yys;
|
2285
|
+
}
|
2286
|
+
|
2287
|
+
/** Invalidate stack #YYK in *YYSTACKP. */
|
2288
|
+
static inline void
|
2289
|
+
yymarkStackDeleted (yyGLRStack* yystackp, size_t yyk)
|
2290
|
+
{
|
2291
|
+
if (yystackp->yytops.yystates[yyk] != YY_NULLPTR)
|
2292
|
+
yystackp->yylastDeleted = yystackp->yytops.yystates[yyk];
|
2293
|
+
yystackp->yytops.yystates[yyk] = YY_NULLPTR;
|
2294
|
+
}
|
2295
|
+
|
2296
|
+
/** Undelete the last stack in *YYSTACKP that was marked as deleted. Can
|
2297
|
+
only be done once after a deletion, and only when all other stacks have
|
2298
|
+
been deleted. */
|
2299
|
+
static void
|
2300
|
+
yyundeleteLastStack (yyGLRStack* yystackp)
|
2301
|
+
{
|
2302
|
+
if (yystackp->yylastDeleted == YY_NULLPTR || yystackp->yytops.yysize != 0)
|
2303
|
+
return;
|
2304
|
+
yystackp->yytops.yystates[0] = yystackp->yylastDeleted;
|
2305
|
+
yystackp->yytops.yysize = 1;
|
2306
|
+
YYDPRINTF ((stderr, "Restoring last deleted stack as stack #0.\n"));
|
2307
|
+
yystackp->yylastDeleted = YY_NULLPTR;
|
2308
|
+
}
|
2309
|
+
|
2310
|
+
static inline void
|
2311
|
+
yyremoveDeletes (yyGLRStack* yystackp)
|
2312
|
+
{
|
2313
|
+
size_t yyi, yyj;
|
2314
|
+
yyi = yyj = 0;
|
2315
|
+
while (yyj < yystackp->yytops.yysize)
|
2316
|
+
{
|
2317
|
+
if (yystackp->yytops.yystates[yyi] == YY_NULLPTR)
|
2318
|
+
{
|
2319
|
+
if (yyi == yyj)
|
2320
|
+
{
|
2321
|
+
YYDPRINTF ((stderr, "Removing dead stacks.\n"));
|
2322
|
+
}
|
2323
|
+
yystackp->yytops.yysize -= 1;
|
2324
|
+
}
|
2325
|
+
else
|
2326
|
+
{
|
2327
|
+
yystackp->yytops.yystates[yyj] = yystackp->yytops.yystates[yyi];
|
2328
|
+
/* In the current implementation, it's unnecessary to copy
|
2329
|
+
yystackp->yytops.yylookaheadNeeds[yyi] since, after
|
2330
|
+
yyremoveDeletes returns, the parser immediately either enters
|
2331
|
+
deterministic operation or shifts a token. However, it doesn't
|
2332
|
+
hurt, and the code might evolve to need it. */
|
2333
|
+
yystackp->yytops.yylookaheadNeeds[yyj] =
|
2334
|
+
yystackp->yytops.yylookaheadNeeds[yyi];
|
2335
|
+
if (yyj != yyi)
|
2336
|
+
{
|
2337
|
+
YYDPRINTF ((stderr, "Rename stack %lu -> %lu.\n",
|
2338
|
+
(unsigned long int) yyi, (unsigned long int) yyj));
|
2339
|
+
}
|
2340
|
+
yyj += 1;
|
2341
|
+
}
|
2342
|
+
yyi += 1;
|
2343
|
+
}
|
2344
|
+
}
|
2345
|
+
|
2346
|
+
/** Shift to a new state on stack #YYK of *YYSTACKP, corresponding to LR
|
2347
|
+
* state YYLRSTATE, at input position YYPOSN, with (resolved) semantic
|
2348
|
+
* value *YYVALP and source location *YYLOCP. */
|
2349
|
+
static inline void
|
2350
|
+
yyglrShift (yyGLRStack* yystackp, size_t yyk, yyStateNum yylrState,
|
2351
|
+
size_t yyposn,
|
2352
|
+
YYSTYPE* yyvalp, YYLTYPE* yylocp)
|
2353
|
+
{
|
2354
|
+
yyGLRState* yynewState = &yynewGLRStackItem (yystackp, yytrue)->yystate;
|
2355
|
+
|
2356
|
+
yynewState->yylrState = yylrState;
|
2357
|
+
yynewState->yyposn = yyposn;
|
2358
|
+
yynewState->yyresolved = yytrue;
|
2359
|
+
yynewState->yypred = yystackp->yytops.yystates[yyk];
|
2360
|
+
yynewState->yysemantics.yysval = *yyvalp;
|
2361
|
+
yynewState->yyloc = *yylocp;
|
2362
|
+
yystackp->yytops.yystates[yyk] = yynewState;
|
2363
|
+
|
2364
|
+
YY_RESERVE_GLRSTACK (yystackp);
|
2365
|
+
}
|
2366
|
+
|
2367
|
+
/** Shift stack #YYK of *YYSTACKP, to a new state corresponding to LR
|
2368
|
+
* state YYLRSTATE, at input position YYPOSN, with the (unresolved)
|
2369
|
+
* semantic value of YYRHS under the action for YYRULE. */
|
2370
|
+
static inline void
|
2371
|
+
yyglrShiftDefer (yyGLRStack* yystackp, size_t yyk, yyStateNum yylrState,
|
2372
|
+
size_t yyposn, yyGLRState* yyrhs, yyRuleNum yyrule)
|
2373
|
+
{
|
2374
|
+
yyGLRState* yynewState = &yynewGLRStackItem (yystackp, yytrue)->yystate;
|
2375
|
+
YYASSERT (yynewState->yyisState);
|
2376
|
+
|
2377
|
+
yynewState->yylrState = yylrState;
|
2378
|
+
yynewState->yyposn = yyposn;
|
2379
|
+
yynewState->yyresolved = yyfalse;
|
2380
|
+
yynewState->yypred = yystackp->yytops.yystates[yyk];
|
2381
|
+
yynewState->yysemantics.yyfirstVal = YY_NULLPTR;
|
2382
|
+
yystackp->yytops.yystates[yyk] = yynewState;
|
2383
|
+
|
2384
|
+
/* Invokes YY_RESERVE_GLRSTACK. */
|
2385
|
+
yyaddDeferredAction (yystackp, yyk, yynewState, yyrhs, yyrule);
|
2386
|
+
}
|
2387
|
+
|
2388
|
+
#if !YYDEBUG
|
2389
|
+
# define YY_REDUCE_PRINT(Args)
|
2390
|
+
#else
|
2391
|
+
# define YY_REDUCE_PRINT(Args) \
|
2392
|
+
do { \
|
2393
|
+
if (yydebug) \
|
2394
|
+
yy_reduce_print Args; \
|
2395
|
+
} while (0)
|
2396
|
+
|
2397
|
+
/*----------------------------------------------------------------------.
|
2398
|
+
| Report that stack #YYK of *YYSTACKP is going to be reduced by YYRULE. |
|
2399
|
+
`----------------------------------------------------------------------*/
|
2400
|
+
|
2401
|
+
static inline void
|
2402
|
+
yy_reduce_print (int yynormal, yyGLRStackItem* yyvsp, size_t yyk,
|
2403
|
+
yyRuleNum yyrule, yyscan_t scanner, VALUE filename, VALUE *tree)
|
2404
|
+
{
|
2405
|
+
int yynrhs = yyrhsLength (yyrule);
|
2406
|
+
int yylow = 1;
|
2407
|
+
int yyi;
|
2408
|
+
YYFPRINTF (stderr, "Reducing stack %lu by rule %d (line %lu):\n",
|
2409
|
+
(unsigned long int) yyk, yyrule - 1,
|
2410
|
+
(unsigned long int) yyrline[yyrule]);
|
2411
|
+
if (! yynormal)
|
2412
|
+
yyfillin (yyvsp, 1, -yynrhs);
|
2413
|
+
/* The symbols being reduced. */
|
2414
|
+
for (yyi = 0; yyi < yynrhs; yyi++)
|
2415
|
+
{
|
2416
|
+
YYFPRINTF (stderr, " $%d = ", yyi + 1);
|
2417
|
+
yy_symbol_print (stderr,
|
2418
|
+
yystos[yyvsp[yyi - yynrhs + 1].yystate.yylrState],
|
2419
|
+
&yyvsp[yyi - yynrhs + 1].yystate.yysemantics.yysval
|
2420
|
+
, &(((yyGLRStackItem const *)yyvsp)[YYFILL ((yyi + 1) - (yynrhs))].yystate.yyloc) , scanner, filename, tree);
|
2421
|
+
if (!yyvsp[yyi - yynrhs + 1].yystate.yyresolved)
|
2422
|
+
YYFPRINTF (stderr, " (unresolved)");
|
2423
|
+
YYFPRINTF (stderr, "\n");
|
2424
|
+
}
|
2425
|
+
}
|
2426
|
+
#endif
|
2427
|
+
|
2428
|
+
/** Pop the symbols consumed by reduction #YYRULE from the top of stack
|
2429
|
+
* #YYK of *YYSTACKP, and perform the appropriate semantic action on their
|
2430
|
+
* semantic values. Assumes that all ambiguities in semantic values
|
2431
|
+
* have been previously resolved. Set *YYVALP to the resulting value,
|
2432
|
+
* and *YYLOCP to the computed location (if any). Return value is as
|
2433
|
+
* for userAction. */
|
2434
|
+
static inline YYRESULTTAG
|
2435
|
+
yydoAction (yyGLRStack* yystackp, size_t yyk, yyRuleNum yyrule,
|
2436
|
+
YYSTYPE* yyvalp, YYLTYPE *yylocp, yyscan_t scanner, VALUE filename, VALUE *tree)
|
2437
|
+
{
|
2438
|
+
int yynrhs = yyrhsLength (yyrule);
|
2439
|
+
|
2440
|
+
if (yystackp->yysplitPoint == YY_NULLPTR)
|
2441
|
+
{
|
2442
|
+
/* Standard special case: single stack. */
|
2443
|
+
yyGLRStackItem* yyrhs = (yyGLRStackItem*) yystackp->yytops.yystates[yyk];
|
2444
|
+
YYASSERT (yyk == 0);
|
2445
|
+
yystackp->yynextFree -= yynrhs;
|
2446
|
+
yystackp->yyspaceLeft += yynrhs;
|
2447
|
+
yystackp->yytops.yystates[0] = & yystackp->yynextFree[-1].yystate;
|
2448
|
+
YY_REDUCE_PRINT ((1, yyrhs, yyk, yyrule, scanner, filename, tree));
|
2449
|
+
return yyuserAction (yyrule, yynrhs, yyrhs, yystackp,
|
2450
|
+
yyvalp, yylocp, scanner, filename, tree);
|
2451
|
+
}
|
2452
|
+
else
|
2453
|
+
{
|
2454
|
+
int yyi;
|
2455
|
+
yyGLRState* yys;
|
2456
|
+
yyGLRStackItem yyrhsVals[YYMAXRHS + YYMAXLEFT + 1];
|
2457
|
+
yys = yyrhsVals[YYMAXRHS + YYMAXLEFT].yystate.yypred
|
2458
|
+
= yystackp->yytops.yystates[yyk];
|
2459
|
+
if (yynrhs == 0)
|
2460
|
+
/* Set default location. */
|
2461
|
+
yyrhsVals[YYMAXRHS + YYMAXLEFT - 1].yystate.yyloc = yys->yyloc;
|
2462
|
+
for (yyi = 0; yyi < yynrhs; yyi += 1)
|
2463
|
+
{
|
2464
|
+
yys = yys->yypred;
|
2465
|
+
YYASSERT (yys);
|
2466
|
+
}
|
2467
|
+
yyupdateSplit (yystackp, yys);
|
2468
|
+
yystackp->yytops.yystates[yyk] = yys;
|
2469
|
+
YY_REDUCE_PRINT ((0, yyrhsVals + YYMAXRHS + YYMAXLEFT - 1, yyk, yyrule, scanner, filename, tree));
|
2470
|
+
return yyuserAction (yyrule, yynrhs, yyrhsVals + YYMAXRHS + YYMAXLEFT - 1,
|
2471
|
+
yystackp, yyvalp, yylocp, scanner, filename, tree);
|
2472
|
+
}
|
2473
|
+
}
|
2474
|
+
|
2475
|
+
/** Pop items off stack #YYK of *YYSTACKP according to grammar rule YYRULE,
|
2476
|
+
* and push back on the resulting nonterminal symbol. Perform the
|
2477
|
+
* semantic action associated with YYRULE and store its value with the
|
2478
|
+
* newly pushed state, if YYFORCEEVAL or if *YYSTACKP is currently
|
2479
|
+
* unambiguous. Otherwise, store the deferred semantic action with
|
2480
|
+
* the new state. If the new state would have an identical input
|
2481
|
+
* position, LR state, and predecessor to an existing state on the stack,
|
2482
|
+
* it is identified with that existing state, eliminating stack #YYK from
|
2483
|
+
* *YYSTACKP. In this case, the semantic value is
|
2484
|
+
* added to the options for the existing state's semantic value.
|
2485
|
+
*/
|
2486
|
+
static inline YYRESULTTAG
|
2487
|
+
yyglrReduce (yyGLRStack* yystackp, size_t yyk, yyRuleNum yyrule,
|
2488
|
+
yybool yyforceEval, yyscan_t scanner, VALUE filename, VALUE *tree)
|
2489
|
+
{
|
2490
|
+
size_t yyposn = yystackp->yytops.yystates[yyk]->yyposn;
|
2491
|
+
|
2492
|
+
if (yyforceEval || yystackp->yysplitPoint == YY_NULLPTR)
|
2493
|
+
{
|
2494
|
+
YYSTYPE yysval;
|
2495
|
+
YYLTYPE yyloc;
|
2496
|
+
|
2497
|
+
YYRESULTTAG yyflag = yydoAction (yystackp, yyk, yyrule, &yysval, &yyloc, scanner, filename, tree);
|
2498
|
+
if (yyflag == yyerr && yystackp->yysplitPoint != YY_NULLPTR)
|
2499
|
+
{
|
2500
|
+
YYDPRINTF ((stderr, "Parse on stack %lu rejected by rule #%d.\n",
|
2501
|
+
(unsigned long int) yyk, yyrule - 1));
|
2502
|
+
}
|
2503
|
+
if (yyflag != yyok)
|
2504
|
+
return yyflag;
|
2505
|
+
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyrule], &yysval, &yyloc);
|
2506
|
+
yyglrShift (yystackp, yyk,
|
2507
|
+
yyLRgotoState (yystackp->yytops.yystates[yyk]->yylrState,
|
2508
|
+
yylhsNonterm (yyrule)),
|
2509
|
+
yyposn, &yysval, &yyloc);
|
2510
|
+
}
|
2511
|
+
else
|
2512
|
+
{
|
2513
|
+
size_t yyi;
|
2514
|
+
int yyn;
|
2515
|
+
yyGLRState* yys, *yys0 = yystackp->yytops.yystates[yyk];
|
2516
|
+
yyStateNum yynewLRState;
|
2517
|
+
|
2518
|
+
for (yys = yystackp->yytops.yystates[yyk], yyn = yyrhsLength (yyrule);
|
2519
|
+
0 < yyn; yyn -= 1)
|
2520
|
+
{
|
2521
|
+
yys = yys->yypred;
|
2522
|
+
YYASSERT (yys);
|
2523
|
+
}
|
2524
|
+
yyupdateSplit (yystackp, yys);
|
2525
|
+
yynewLRState = yyLRgotoState (yys->yylrState, yylhsNonterm (yyrule));
|
2526
|
+
YYDPRINTF ((stderr,
|
2527
|
+
"Reduced stack %lu by rule #%d; action deferred. "
|
2528
|
+
"Now in state %d.\n",
|
2529
|
+
(unsigned long int) yyk, yyrule - 1, yynewLRState));
|
2530
|
+
for (yyi = 0; yyi < yystackp->yytops.yysize; yyi += 1)
|
2531
|
+
if (yyi != yyk && yystackp->yytops.yystates[yyi] != YY_NULLPTR)
|
2532
|
+
{
|
2533
|
+
yyGLRState *yysplit = yystackp->yysplitPoint;
|
2534
|
+
yyGLRState *yyp = yystackp->yytops.yystates[yyi];
|
2535
|
+
while (yyp != yys && yyp != yysplit && yyp->yyposn >= yyposn)
|
2536
|
+
{
|
2537
|
+
if (yyp->yylrState == yynewLRState && yyp->yypred == yys)
|
2538
|
+
{
|
2539
|
+
yyaddDeferredAction (yystackp, yyk, yyp, yys0, yyrule);
|
2540
|
+
yymarkStackDeleted (yystackp, yyk);
|
2541
|
+
YYDPRINTF ((stderr, "Merging stack %lu into stack %lu.\n",
|
2542
|
+
(unsigned long int) yyk,
|
2543
|
+
(unsigned long int) yyi));
|
2544
|
+
return yyok;
|
2545
|
+
}
|
2546
|
+
yyp = yyp->yypred;
|
2547
|
+
}
|
2548
|
+
}
|
2549
|
+
yystackp->yytops.yystates[yyk] = yys;
|
2550
|
+
yyglrShiftDefer (yystackp, yyk, yynewLRState, yyposn, yys0, yyrule);
|
2551
|
+
}
|
2552
|
+
return yyok;
|
2553
|
+
}
|
2554
|
+
|
2555
|
+
static size_t
|
2556
|
+
yysplitStack (yyGLRStack* yystackp, size_t yyk)
|
2557
|
+
{
|
2558
|
+
if (yystackp->yysplitPoint == YY_NULLPTR)
|
2559
|
+
{
|
2560
|
+
YYASSERT (yyk == 0);
|
2561
|
+
yystackp->yysplitPoint = yystackp->yytops.yystates[yyk];
|
2562
|
+
}
|
2563
|
+
if (yystackp->yytops.yysize >= yystackp->yytops.yycapacity)
|
2564
|
+
{
|
2565
|
+
yyGLRState** yynewStates;
|
2566
|
+
yybool* yynewLookaheadNeeds;
|
2567
|
+
|
2568
|
+
yynewStates = YY_NULLPTR;
|
2569
|
+
|
2570
|
+
if (yystackp->yytops.yycapacity
|
2571
|
+
> (YYSIZEMAX / (2 * sizeof yynewStates[0])))
|
2572
|
+
yyMemoryExhausted (yystackp);
|
2573
|
+
yystackp->yytops.yycapacity *= 2;
|
2574
|
+
|
2575
|
+
yynewStates =
|
2576
|
+
(yyGLRState**) YYREALLOC (yystackp->yytops.yystates,
|
2577
|
+
(yystackp->yytops.yycapacity
|
2578
|
+
* sizeof yynewStates[0]));
|
2579
|
+
if (yynewStates == YY_NULLPTR)
|
2580
|
+
yyMemoryExhausted (yystackp);
|
2581
|
+
yystackp->yytops.yystates = yynewStates;
|
2582
|
+
|
2583
|
+
yynewLookaheadNeeds =
|
2584
|
+
(yybool*) YYREALLOC (yystackp->yytops.yylookaheadNeeds,
|
2585
|
+
(yystackp->yytops.yycapacity
|
2586
|
+
* sizeof yynewLookaheadNeeds[0]));
|
2587
|
+
if (yynewLookaheadNeeds == YY_NULLPTR)
|
2588
|
+
yyMemoryExhausted (yystackp);
|
2589
|
+
yystackp->yytops.yylookaheadNeeds = yynewLookaheadNeeds;
|
2590
|
+
}
|
2591
|
+
yystackp->yytops.yystates[yystackp->yytops.yysize]
|
2592
|
+
= yystackp->yytops.yystates[yyk];
|
2593
|
+
yystackp->yytops.yylookaheadNeeds[yystackp->yytops.yysize]
|
2594
|
+
= yystackp->yytops.yylookaheadNeeds[yyk];
|
2595
|
+
yystackp->yytops.yysize += 1;
|
2596
|
+
return yystackp->yytops.yysize-1;
|
2597
|
+
}
|
2598
|
+
|
2599
|
+
/** True iff YYY0 and YYY1 represent identical options at the top level.
|
2600
|
+
* That is, they represent the same rule applied to RHS symbols
|
2601
|
+
* that produce the same terminal symbols. */
|
2602
|
+
static yybool
|
2603
|
+
yyidenticalOptions (yySemanticOption* yyy0, yySemanticOption* yyy1)
|
2604
|
+
{
|
2605
|
+
if (yyy0->yyrule == yyy1->yyrule)
|
2606
|
+
{
|
2607
|
+
yyGLRState *yys0, *yys1;
|
2608
|
+
int yyn;
|
2609
|
+
for (yys0 = yyy0->yystate, yys1 = yyy1->yystate,
|
2610
|
+
yyn = yyrhsLength (yyy0->yyrule);
|
2611
|
+
yyn > 0;
|
2612
|
+
yys0 = yys0->yypred, yys1 = yys1->yypred, yyn -= 1)
|
2613
|
+
if (yys0->yyposn != yys1->yyposn)
|
2614
|
+
return yyfalse;
|
2615
|
+
return yytrue;
|
2616
|
+
}
|
2617
|
+
else
|
2618
|
+
return yyfalse;
|
2619
|
+
}
|
2620
|
+
|
2621
|
+
/** Assuming identicalOptions (YYY0,YYY1), destructively merge the
|
2622
|
+
* alternative semantic values for the RHS-symbols of YYY1 and YYY0. */
|
2623
|
+
static void
|
2624
|
+
yymergeOptionSets (yySemanticOption* yyy0, yySemanticOption* yyy1)
|
2625
|
+
{
|
2626
|
+
yyGLRState *yys0, *yys1;
|
2627
|
+
int yyn;
|
2628
|
+
for (yys0 = yyy0->yystate, yys1 = yyy1->yystate,
|
2629
|
+
yyn = yyrhsLength (yyy0->yyrule);
|
2630
|
+
yyn > 0;
|
2631
|
+
yys0 = yys0->yypred, yys1 = yys1->yypred, yyn -= 1)
|
2632
|
+
{
|
2633
|
+
if (yys0 == yys1)
|
2634
|
+
break;
|
2635
|
+
else if (yys0->yyresolved)
|
2636
|
+
{
|
2637
|
+
yys1->yyresolved = yytrue;
|
2638
|
+
yys1->yysemantics.yysval = yys0->yysemantics.yysval;
|
2639
|
+
}
|
2640
|
+
else if (yys1->yyresolved)
|
2641
|
+
{
|
2642
|
+
yys0->yyresolved = yytrue;
|
2643
|
+
yys0->yysemantics.yysval = yys1->yysemantics.yysval;
|
2644
|
+
}
|
2645
|
+
else
|
2646
|
+
{
|
2647
|
+
yySemanticOption** yyz0p = &yys0->yysemantics.yyfirstVal;
|
2648
|
+
yySemanticOption* yyz1 = yys1->yysemantics.yyfirstVal;
|
2649
|
+
while (yytrue)
|
2650
|
+
{
|
2651
|
+
if (yyz1 == *yyz0p || yyz1 == YY_NULLPTR)
|
2652
|
+
break;
|
2653
|
+
else if (*yyz0p == YY_NULLPTR)
|
2654
|
+
{
|
2655
|
+
*yyz0p = yyz1;
|
2656
|
+
break;
|
2657
|
+
}
|
2658
|
+
else if (*yyz0p < yyz1)
|
2659
|
+
{
|
2660
|
+
yySemanticOption* yyz = *yyz0p;
|
2661
|
+
*yyz0p = yyz1;
|
2662
|
+
yyz1 = yyz1->yynext;
|
2663
|
+
(*yyz0p)->yynext = yyz;
|
2664
|
+
}
|
2665
|
+
yyz0p = &(*yyz0p)->yynext;
|
2666
|
+
}
|
2667
|
+
yys1->yysemantics.yyfirstVal = yys0->yysemantics.yyfirstVal;
|
2668
|
+
}
|
2669
|
+
}
|
2670
|
+
}
|
2671
|
+
|
2672
|
+
/** Y0 and Y1 represent two possible actions to take in a given
|
2673
|
+
* parsing state; return 0 if no combination is possible,
|
2674
|
+
* 1 if user-mergeable, 2 if Y0 is preferred, 3 if Y1 is preferred. */
|
2675
|
+
static int
|
2676
|
+
yypreference (yySemanticOption* y0, yySemanticOption* y1)
|
2677
|
+
{
|
2678
|
+
yyRuleNum r0 = y0->yyrule, r1 = y1->yyrule;
|
2679
|
+
int p0 = yydprec[r0], p1 = yydprec[r1];
|
2680
|
+
|
2681
|
+
if (p0 == p1)
|
2682
|
+
{
|
2683
|
+
if (yymerger[r0] == 0 || yymerger[r0] != yymerger[r1])
|
2684
|
+
return 0;
|
2685
|
+
else
|
2686
|
+
return 1;
|
2687
|
+
}
|
2688
|
+
if (p0 == 0 || p1 == 0)
|
2689
|
+
return 0;
|
2690
|
+
if (p0 < p1)
|
2691
|
+
return 3;
|
2692
|
+
if (p1 < p0)
|
2693
|
+
return 2;
|
2694
|
+
return 0;
|
2695
|
+
}
|
2696
|
+
|
2697
|
+
static YYRESULTTAG yyresolveValue (yyGLRState* yys,
|
2698
|
+
yyGLRStack* yystackp, yyscan_t scanner, VALUE filename, VALUE *tree);
|
2699
|
+
|
2700
|
+
|
2701
|
+
/** Resolve the previous YYN states starting at and including state YYS
|
2702
|
+
* on *YYSTACKP. If result != yyok, some states may have been left
|
2703
|
+
* unresolved possibly with empty semantic option chains. Regardless
|
2704
|
+
* of whether result = yyok, each state has been left with consistent
|
2705
|
+
* data so that yydestroyGLRState can be invoked if necessary. */
|
2706
|
+
static YYRESULTTAG
|
2707
|
+
yyresolveStates (yyGLRState* yys, int yyn,
|
2708
|
+
yyGLRStack* yystackp, yyscan_t scanner, VALUE filename, VALUE *tree)
|
2709
|
+
{
|
2710
|
+
if (0 < yyn)
|
2711
|
+
{
|
2712
|
+
YYASSERT (yys->yypred);
|
2713
|
+
YYCHK (yyresolveStates (yys->yypred, yyn-1, yystackp, scanner, filename, tree));
|
2714
|
+
if (! yys->yyresolved)
|
2715
|
+
YYCHK (yyresolveValue (yys, yystackp, scanner, filename, tree));
|
2716
|
+
}
|
2717
|
+
return yyok;
|
2718
|
+
}
|
2719
|
+
|
2720
|
+
/** Resolve the states for the RHS of YYOPT on *YYSTACKP, perform its
|
2721
|
+
* user action, and return the semantic value and location in *YYVALP
|
2722
|
+
* and *YYLOCP. Regardless of whether result = yyok, all RHS states
|
2723
|
+
* have been destroyed (assuming the user action destroys all RHS
|
2724
|
+
* semantic values if invoked). */
|
2725
|
+
static YYRESULTTAG
|
2726
|
+
yyresolveAction (yySemanticOption* yyopt, yyGLRStack* yystackp,
|
2727
|
+
YYSTYPE* yyvalp, YYLTYPE *yylocp, yyscan_t scanner, VALUE filename, VALUE *tree)
|
2728
|
+
{
|
2729
|
+
yyGLRStackItem yyrhsVals[YYMAXRHS + YYMAXLEFT + 1];
|
2730
|
+
int yynrhs = yyrhsLength (yyopt->yyrule);
|
2731
|
+
YYRESULTTAG yyflag =
|
2732
|
+
yyresolveStates (yyopt->yystate, yynrhs, yystackp, scanner, filename, tree);
|
2733
|
+
if (yyflag != yyok)
|
2734
|
+
{
|
2735
|
+
yyGLRState *yys;
|
2736
|
+
for (yys = yyopt->yystate; yynrhs > 0; yys = yys->yypred, yynrhs -= 1)
|
2737
|
+
yydestroyGLRState ("Cleanup: popping", yys, scanner, filename, tree);
|
2738
|
+
return yyflag;
|
2739
|
+
}
|
2740
|
+
|
2741
|
+
yyrhsVals[YYMAXRHS + YYMAXLEFT].yystate.yypred = yyopt->yystate;
|
2742
|
+
if (yynrhs == 0)
|
2743
|
+
/* Set default location. */
|
2744
|
+
yyrhsVals[YYMAXRHS + YYMAXLEFT - 1].yystate.yyloc = yyopt->yystate->yyloc;
|
2745
|
+
{
|
2746
|
+
int yychar_current = yychar;
|
2747
|
+
YYSTYPE yylval_current = yylval;
|
2748
|
+
YYLTYPE yylloc_current = yylloc;
|
2749
|
+
yychar = yyopt->yyrawchar;
|
2750
|
+
yylval = yyopt->yyval;
|
2751
|
+
yylloc = yyopt->yyloc;
|
2752
|
+
yyflag = yyuserAction (yyopt->yyrule, yynrhs,
|
2753
|
+
yyrhsVals + YYMAXRHS + YYMAXLEFT - 1,
|
2754
|
+
yystackp, yyvalp, yylocp, scanner, filename, tree);
|
2755
|
+
yychar = yychar_current;
|
2756
|
+
yylval = yylval_current;
|
2757
|
+
yylloc = yylloc_current;
|
2758
|
+
}
|
2759
|
+
return yyflag;
|
2760
|
+
}
|
2761
|
+
|
2762
|
+
#if YYDEBUG
|
2763
|
+
static void
|
2764
|
+
yyreportTree (yySemanticOption* yyx, int yyindent)
|
2765
|
+
{
|
2766
|
+
int yynrhs = yyrhsLength (yyx->yyrule);
|
2767
|
+
int yyi;
|
2768
|
+
yyGLRState* yys;
|
2769
|
+
yyGLRState* yystates[1 + YYMAXRHS];
|
2770
|
+
yyGLRState yyleftmost_state;
|
2771
|
+
|
2772
|
+
for (yyi = yynrhs, yys = yyx->yystate; 0 < yyi; yyi -= 1, yys = yys->yypred)
|
2773
|
+
yystates[yyi] = yys;
|
2774
|
+
if (yys == YY_NULLPTR)
|
2775
|
+
{
|
2776
|
+
yyleftmost_state.yyposn = 0;
|
2777
|
+
yystates[0] = &yyleftmost_state;
|
2778
|
+
}
|
2779
|
+
else
|
2780
|
+
yystates[0] = yys;
|
2781
|
+
|
2782
|
+
if (yyx->yystate->yyposn < yys->yyposn + 1)
|
2783
|
+
YYFPRINTF (stderr, "%*s%s -> <Rule %d, empty>\n",
|
2784
|
+
yyindent, "", yytokenName (yylhsNonterm (yyx->yyrule)),
|
2785
|
+
yyx->yyrule - 1);
|
2786
|
+
else
|
2787
|
+
YYFPRINTF (stderr, "%*s%s -> <Rule %d, tokens %lu .. %lu>\n",
|
2788
|
+
yyindent, "", yytokenName (yylhsNonterm (yyx->yyrule)),
|
2789
|
+
yyx->yyrule - 1, (unsigned long int) (yys->yyposn + 1),
|
2790
|
+
(unsigned long int) yyx->yystate->yyposn);
|
2791
|
+
for (yyi = 1; yyi <= yynrhs; yyi += 1)
|
2792
|
+
{
|
2793
|
+
if (yystates[yyi]->yyresolved)
|
2794
|
+
{
|
2795
|
+
if (yystates[yyi-1]->yyposn+1 > yystates[yyi]->yyposn)
|
2796
|
+
YYFPRINTF (stderr, "%*s%s <empty>\n", yyindent+2, "",
|
2797
|
+
yytokenName (yystos[yystates[yyi]->yylrState]));
|
2798
|
+
else
|
2799
|
+
YYFPRINTF (stderr, "%*s%s <tokens %lu .. %lu>\n", yyindent+2, "",
|
2800
|
+
yytokenName (yystos[yystates[yyi]->yylrState]),
|
2801
|
+
(unsigned long int) (yystates[yyi-1]->yyposn + 1),
|
2802
|
+
(unsigned long int) yystates[yyi]->yyposn);
|
2803
|
+
}
|
2804
|
+
else
|
2805
|
+
yyreportTree (yystates[yyi]->yysemantics.yyfirstVal, yyindent+2);
|
2806
|
+
}
|
2807
|
+
}
|
2808
|
+
#endif
|
2809
|
+
|
2810
|
+
static YYRESULTTAG
|
2811
|
+
yyreportAmbiguity (yySemanticOption* yyx0,
|
2812
|
+
yySemanticOption* yyx1, YYLTYPE *yylocp, yyscan_t scanner, VALUE filename, VALUE *tree)
|
2813
|
+
{
|
2814
|
+
YYUSE (yyx0);
|
2815
|
+
YYUSE (yyx1);
|
2816
|
+
|
2817
|
+
#if YYDEBUG
|
2818
|
+
YYFPRINTF (stderr, "Ambiguity detected.\n");
|
2819
|
+
YYFPRINTF (stderr, "Option 1,\n");
|
2820
|
+
yyreportTree (yyx0, 2);
|
2821
|
+
YYFPRINTF (stderr, "\nOption 2,\n");
|
2822
|
+
yyreportTree (yyx1, 2);
|
2823
|
+
YYFPRINTF (stderr, "\n");
|
2824
|
+
#endif
|
2825
|
+
|
2826
|
+
yyerror (yylocp, scanner, filename, tree, YY_("syntax is ambiguous"));
|
2827
|
+
return yyabort;
|
2828
|
+
}
|
2829
|
+
|
2830
|
+
/** Resolve the locations for each of the YYN1 states in *YYSTACKP,
|
2831
|
+
* ending at YYS1. Has no effect on previously resolved states.
|
2832
|
+
* The first semantic option of a state is always chosen. */
|
2833
|
+
static void
|
2834
|
+
yyresolveLocations (yyGLRState* yys1, int yyn1,
|
2835
|
+
yyGLRStack *yystackp, yyscan_t scanner, VALUE filename, VALUE *tree)
|
2836
|
+
{
|
2837
|
+
if (0 < yyn1)
|
2838
|
+
{
|
2839
|
+
yyresolveLocations (yys1->yypred, yyn1 - 1, yystackp, scanner, filename, tree);
|
2840
|
+
if (!yys1->yyresolved)
|
2841
|
+
{
|
2842
|
+
yyGLRStackItem yyrhsloc[1 + YYMAXRHS];
|
2843
|
+
int yynrhs;
|
2844
|
+
yySemanticOption *yyoption = yys1->yysemantics.yyfirstVal;
|
2845
|
+
YYASSERT (yyoption != YY_NULLPTR);
|
2846
|
+
yynrhs = yyrhsLength (yyoption->yyrule);
|
2847
|
+
if (yynrhs > 0)
|
2848
|
+
{
|
2849
|
+
yyGLRState *yys;
|
2850
|
+
int yyn;
|
2851
|
+
yyresolveLocations (yyoption->yystate, yynrhs,
|
2852
|
+
yystackp, scanner, filename, tree);
|
2853
|
+
for (yys = yyoption->yystate, yyn = yynrhs;
|
2854
|
+
yyn > 0;
|
2855
|
+
yys = yys->yypred, yyn -= 1)
|
2856
|
+
yyrhsloc[yyn].yystate.yyloc = yys->yyloc;
|
2857
|
+
}
|
2858
|
+
else
|
2859
|
+
{
|
2860
|
+
/* Both yyresolveAction and yyresolveLocations traverse the GSS
|
2861
|
+
in reverse rightmost order. It is only necessary to invoke
|
2862
|
+
yyresolveLocations on a subforest for which yyresolveAction
|
2863
|
+
would have been invoked next had an ambiguity not been
|
2864
|
+
detected. Thus the location of the previous state (but not
|
2865
|
+
necessarily the previous state itself) is guaranteed to be
|
2866
|
+
resolved already. */
|
2867
|
+
yyGLRState *yyprevious = yyoption->yystate;
|
2868
|
+
yyrhsloc[0].yystate.yyloc = yyprevious->yyloc;
|
2869
|
+
}
|
2870
|
+
{
|
2871
|
+
int yychar_current = yychar;
|
2872
|
+
YYSTYPE yylval_current = yylval;
|
2873
|
+
YYLTYPE yylloc_current = yylloc;
|
2874
|
+
yychar = yyoption->yyrawchar;
|
2875
|
+
yylval = yyoption->yyval;
|
2876
|
+
yylloc = yyoption->yyloc;
|
2877
|
+
YYLLOC_DEFAULT ((yys1->yyloc), yyrhsloc, yynrhs);
|
2878
|
+
yychar = yychar_current;
|
2879
|
+
yylval = yylval_current;
|
2880
|
+
yylloc = yylloc_current;
|
2881
|
+
}
|
2882
|
+
}
|
2883
|
+
}
|
2884
|
+
}
|
2885
|
+
|
2886
|
+
/** Resolve the ambiguity represented in state YYS in *YYSTACKP,
|
2887
|
+
* perform the indicated actions, and set the semantic value of YYS.
|
2888
|
+
* If result != yyok, the chain of semantic options in YYS has been
|
2889
|
+
* cleared instead or it has been left unmodified except that
|
2890
|
+
* redundant options may have been removed. Regardless of whether
|
2891
|
+
* result = yyok, YYS has been left with consistent data so that
|
2892
|
+
* yydestroyGLRState can be invoked if necessary. */
|
2893
|
+
static YYRESULTTAG
|
2894
|
+
yyresolveValue (yyGLRState* yys, yyGLRStack* yystackp, yyscan_t scanner, VALUE filename, VALUE *tree)
|
2895
|
+
{
|
2896
|
+
yySemanticOption* yyoptionList = yys->yysemantics.yyfirstVal;
|
2897
|
+
yySemanticOption* yybest = yyoptionList;
|
2898
|
+
yySemanticOption** yypp;
|
2899
|
+
yybool yymerge = yyfalse;
|
2900
|
+
YYSTYPE yysval;
|
2901
|
+
YYRESULTTAG yyflag;
|
2902
|
+
YYLTYPE *yylocp = &yys->yyloc;
|
2903
|
+
|
2904
|
+
for (yypp = &yyoptionList->yynext; *yypp != YY_NULLPTR; )
|
2905
|
+
{
|
2906
|
+
yySemanticOption* yyp = *yypp;
|
2907
|
+
|
2908
|
+
if (yyidenticalOptions (yybest, yyp))
|
2909
|
+
{
|
2910
|
+
yymergeOptionSets (yybest, yyp);
|
2911
|
+
*yypp = yyp->yynext;
|
2912
|
+
}
|
2913
|
+
else
|
2914
|
+
{
|
2915
|
+
switch (yypreference (yybest, yyp))
|
2916
|
+
{
|
2917
|
+
case 0:
|
2918
|
+
yyresolveLocations (yys, 1, yystackp, scanner, filename, tree);
|
2919
|
+
return yyreportAmbiguity (yybest, yyp, yylocp, scanner, filename, tree);
|
2920
|
+
break;
|
2921
|
+
case 1:
|
2922
|
+
yymerge = yytrue;
|
2923
|
+
break;
|
2924
|
+
case 2:
|
2925
|
+
break;
|
2926
|
+
case 3:
|
2927
|
+
yybest = yyp;
|
2928
|
+
yymerge = yyfalse;
|
2929
|
+
break;
|
2930
|
+
default:
|
2931
|
+
/* This cannot happen so it is not worth a YYASSERT (yyfalse),
|
2932
|
+
but some compilers complain if the default case is
|
2933
|
+
omitted. */
|
2934
|
+
break;
|
2935
|
+
}
|
2936
|
+
yypp = &yyp->yynext;
|
2937
|
+
}
|
2938
|
+
}
|
2939
|
+
|
2940
|
+
if (yymerge)
|
2941
|
+
{
|
2942
|
+
yySemanticOption* yyp;
|
2943
|
+
int yyprec = yydprec[yybest->yyrule];
|
2944
|
+
yyflag = yyresolveAction (yybest, yystackp, &yysval, yylocp, scanner, filename, tree);
|
2945
|
+
if (yyflag == yyok)
|
2946
|
+
for (yyp = yybest->yynext; yyp != YY_NULLPTR; yyp = yyp->yynext)
|
2947
|
+
{
|
2948
|
+
if (yyprec == yydprec[yyp->yyrule])
|
2949
|
+
{
|
2950
|
+
YYSTYPE yysval_other;
|
2951
|
+
YYLTYPE yydummy;
|
2952
|
+
yyflag = yyresolveAction (yyp, yystackp, &yysval_other, &yydummy, scanner, filename, tree);
|
2953
|
+
if (yyflag != yyok)
|
2954
|
+
{
|
2955
|
+
yydestruct ("Cleanup: discarding incompletely merged value for",
|
2956
|
+
yystos[yys->yylrState],
|
2957
|
+
&yysval, yylocp, scanner, filename, tree);
|
2958
|
+
break;
|
2959
|
+
}
|
2960
|
+
yyuserMerge (yymerger[yyp->yyrule], &yysval, &yysval_other);
|
2961
|
+
}
|
2962
|
+
}
|
2963
|
+
}
|
2964
|
+
else
|
2965
|
+
yyflag = yyresolveAction (yybest, yystackp, &yysval, yylocp, scanner, filename, tree);
|
2966
|
+
|
2967
|
+
if (yyflag == yyok)
|
2968
|
+
{
|
2969
|
+
yys->yyresolved = yytrue;
|
2970
|
+
yys->yysemantics.yysval = yysval;
|
2971
|
+
}
|
2972
|
+
else
|
2973
|
+
yys->yysemantics.yyfirstVal = YY_NULLPTR;
|
2974
|
+
return yyflag;
|
2975
|
+
}
|
2976
|
+
|
2977
|
+
static YYRESULTTAG
|
2978
|
+
yyresolveStack (yyGLRStack* yystackp, yyscan_t scanner, VALUE filename, VALUE *tree)
|
2979
|
+
{
|
2980
|
+
if (yystackp->yysplitPoint != YY_NULLPTR)
|
2981
|
+
{
|
2982
|
+
yyGLRState* yys;
|
2983
|
+
int yyn;
|
2984
|
+
|
2985
|
+
for (yyn = 0, yys = yystackp->yytops.yystates[0];
|
2986
|
+
yys != yystackp->yysplitPoint;
|
2987
|
+
yys = yys->yypred, yyn += 1)
|
2988
|
+
continue;
|
2989
|
+
YYCHK (yyresolveStates (yystackp->yytops.yystates[0], yyn, yystackp
|
2990
|
+
, scanner, filename, tree));
|
2991
|
+
}
|
2992
|
+
return yyok;
|
2993
|
+
}
|
2994
|
+
|
2995
|
+
static void
|
2996
|
+
yycompressStack (yyGLRStack* yystackp)
|
2997
|
+
{
|
2998
|
+
yyGLRState* yyp, *yyq, *yyr;
|
2999
|
+
|
3000
|
+
if (yystackp->yytops.yysize != 1 || yystackp->yysplitPoint == YY_NULLPTR)
|
3001
|
+
return;
|
3002
|
+
|
3003
|
+
for (yyp = yystackp->yytops.yystates[0], yyq = yyp->yypred, yyr = YY_NULLPTR;
|
3004
|
+
yyp != yystackp->yysplitPoint;
|
3005
|
+
yyr = yyp, yyp = yyq, yyq = yyp->yypred)
|
3006
|
+
yyp->yypred = yyr;
|
3007
|
+
|
3008
|
+
yystackp->yyspaceLeft += yystackp->yynextFree - yystackp->yyitems;
|
3009
|
+
yystackp->yynextFree = ((yyGLRStackItem*) yystackp->yysplitPoint) + 1;
|
3010
|
+
yystackp->yyspaceLeft -= yystackp->yynextFree - yystackp->yyitems;
|
3011
|
+
yystackp->yysplitPoint = YY_NULLPTR;
|
3012
|
+
yystackp->yylastDeleted = YY_NULLPTR;
|
3013
|
+
|
3014
|
+
while (yyr != YY_NULLPTR)
|
3015
|
+
{
|
3016
|
+
yystackp->yynextFree->yystate = *yyr;
|
3017
|
+
yyr = yyr->yypred;
|
3018
|
+
yystackp->yynextFree->yystate.yypred = &yystackp->yynextFree[-1].yystate;
|
3019
|
+
yystackp->yytops.yystates[0] = &yystackp->yynextFree->yystate;
|
3020
|
+
yystackp->yynextFree += 1;
|
3021
|
+
yystackp->yyspaceLeft -= 1;
|
3022
|
+
}
|
3023
|
+
}
|
3024
|
+
|
3025
|
+
static YYRESULTTAG
|
3026
|
+
yyprocessOneStack (yyGLRStack* yystackp, size_t yyk,
|
3027
|
+
size_t yyposn, YYLTYPE *yylocp, yyscan_t scanner, VALUE filename, VALUE *tree)
|
3028
|
+
{
|
3029
|
+
while (yystackp->yytops.yystates[yyk] != YY_NULLPTR)
|
3030
|
+
{
|
3031
|
+
yyStateNum yystate = yystackp->yytops.yystates[yyk]->yylrState;
|
3032
|
+
YYDPRINTF ((stderr, "Stack %lu Entering state %d\n",
|
3033
|
+
(unsigned long int) yyk, yystate));
|
3034
|
+
|
3035
|
+
YYASSERT (yystate != YYFINAL);
|
3036
|
+
|
3037
|
+
if (yyisDefaultedState (yystate))
|
3038
|
+
{
|
3039
|
+
YYRESULTTAG yyflag;
|
3040
|
+
yyRuleNum yyrule = yydefaultAction (yystate);
|
3041
|
+
if (yyrule == 0)
|
3042
|
+
{
|
3043
|
+
YYDPRINTF ((stderr, "Stack %lu dies.\n",
|
3044
|
+
(unsigned long int) yyk));
|
3045
|
+
yymarkStackDeleted (yystackp, yyk);
|
3046
|
+
return yyok;
|
3047
|
+
}
|
3048
|
+
yyflag = yyglrReduce (yystackp, yyk, yyrule, yyimmediate[yyrule], scanner, filename, tree);
|
3049
|
+
if (yyflag == yyerr)
|
3050
|
+
{
|
3051
|
+
YYDPRINTF ((stderr,
|
3052
|
+
"Stack %lu dies "
|
3053
|
+
"(predicate failure or explicit user error).\n",
|
3054
|
+
(unsigned long int) yyk));
|
3055
|
+
yymarkStackDeleted (yystackp, yyk);
|
3056
|
+
return yyok;
|
3057
|
+
}
|
3058
|
+
if (yyflag != yyok)
|
3059
|
+
return yyflag;
|
3060
|
+
}
|
3061
|
+
else
|
3062
|
+
{
|
3063
|
+
yySymbol yytoken;
|
3064
|
+
int yyaction;
|
3065
|
+
const short int* yyconflicts;
|
3066
|
+
|
3067
|
+
yystackp->yytops.yylookaheadNeeds[yyk] = yytrue;
|
3068
|
+
if (yychar == YYEMPTY)
|
3069
|
+
{
|
3070
|
+
YYDPRINTF ((stderr, "Reading a token: "));
|
3071
|
+
yychar = yylex (&yylval, &yylloc, scanner);
|
3072
|
+
}
|
3073
|
+
|
3074
|
+
if (yychar <= YYEOF)
|
3075
|
+
{
|
3076
|
+
yychar = yytoken = YYEOF;
|
3077
|
+
YYDPRINTF ((stderr, "Now at end of input.\n"));
|
3078
|
+
}
|
3079
|
+
else
|
3080
|
+
{
|
3081
|
+
yytoken = YYTRANSLATE (yychar);
|
3082
|
+
YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
|
3083
|
+
}
|
3084
|
+
|
3085
|
+
yygetLRActions (yystate, yytoken, &yyaction, &yyconflicts);
|
3086
|
+
|
3087
|
+
while (*yyconflicts != 0)
|
3088
|
+
{
|
3089
|
+
YYRESULTTAG yyflag;
|
3090
|
+
size_t yynewStack = yysplitStack (yystackp, yyk);
|
3091
|
+
YYDPRINTF ((stderr, "Splitting off stack %lu from %lu.\n",
|
3092
|
+
(unsigned long int) yynewStack,
|
3093
|
+
(unsigned long int) yyk));
|
3094
|
+
yyflag = yyglrReduce (yystackp, yynewStack,
|
3095
|
+
*yyconflicts,
|
3096
|
+
yyimmediate[*yyconflicts], scanner, filename, tree);
|
3097
|
+
if (yyflag == yyok)
|
3098
|
+
YYCHK (yyprocessOneStack (yystackp, yynewStack,
|
3099
|
+
yyposn, yylocp, scanner, filename, tree));
|
3100
|
+
else if (yyflag == yyerr)
|
3101
|
+
{
|
3102
|
+
YYDPRINTF ((stderr, "Stack %lu dies.\n",
|
3103
|
+
(unsigned long int) yynewStack));
|
3104
|
+
yymarkStackDeleted (yystackp, yynewStack);
|
3105
|
+
}
|
3106
|
+
else
|
3107
|
+
return yyflag;
|
3108
|
+
yyconflicts += 1;
|
3109
|
+
}
|
3110
|
+
|
3111
|
+
if (yyisShiftAction (yyaction))
|
3112
|
+
break;
|
3113
|
+
else if (yyisErrorAction (yyaction))
|
3114
|
+
{
|
3115
|
+
YYDPRINTF ((stderr, "Stack %lu dies.\n",
|
3116
|
+
(unsigned long int) yyk));
|
3117
|
+
yymarkStackDeleted (yystackp, yyk);
|
3118
|
+
break;
|
3119
|
+
}
|
3120
|
+
else
|
3121
|
+
{
|
3122
|
+
YYRESULTTAG yyflag = yyglrReduce (yystackp, yyk, -yyaction,
|
3123
|
+
yyimmediate[-yyaction], scanner, filename, tree);
|
3124
|
+
if (yyflag == yyerr)
|
3125
|
+
{
|
3126
|
+
YYDPRINTF ((stderr,
|
3127
|
+
"Stack %lu dies "
|
3128
|
+
"(predicate failure or explicit user error).\n",
|
3129
|
+
(unsigned long int) yyk));
|
3130
|
+
yymarkStackDeleted (yystackp, yyk);
|
3131
|
+
break;
|
3132
|
+
}
|
3133
|
+
else if (yyflag != yyok)
|
3134
|
+
return yyflag;
|
3135
|
+
}
|
3136
|
+
}
|
3137
|
+
}
|
3138
|
+
return yyok;
|
3139
|
+
}
|
3140
|
+
|
3141
|
+
static void
|
3142
|
+
yyreportSyntaxError (yyGLRStack* yystackp, yyscan_t scanner, VALUE filename, VALUE *tree)
|
3143
|
+
{
|
3144
|
+
if (yystackp->yyerrState != 0)
|
3145
|
+
return;
|
3146
|
+
#if ! YYERROR_VERBOSE
|
3147
|
+
yyerror (&yylloc, scanner, filename, tree, YY_("syntax error"));
|
3148
|
+
#else
|
3149
|
+
{
|
3150
|
+
yySymbol yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
|
3151
|
+
size_t yysize0 = yytnamerr (YY_NULLPTR, yytokenName (yytoken));
|
3152
|
+
size_t yysize = yysize0;
|
3153
|
+
yybool yysize_overflow = yyfalse;
|
3154
|
+
char* yymsg = YY_NULLPTR;
|
3155
|
+
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
|
3156
|
+
/* Internationalized format string. */
|
3157
|
+
const char *yyformat = YY_NULLPTR;
|
3158
|
+
/* Arguments of yyformat. */
|
3159
|
+
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
|
3160
|
+
/* Number of reported tokens (one for the "unexpected", one per
|
3161
|
+
"expected"). */
|
3162
|
+
int yycount = 0;
|
3163
|
+
|
3164
|
+
/* There are many possibilities here to consider:
|
3165
|
+
- If this state is a consistent state with a default action, then
|
3166
|
+
the only way this function was invoked is if the default action
|
3167
|
+
is an error action. In that case, don't check for expected
|
3168
|
+
tokens because there are none.
|
3169
|
+
- The only way there can be no lookahead present (in yychar) is if
|
3170
|
+
this state is a consistent state with a default action. Thus,
|
3171
|
+
detecting the absence of a lookahead is sufficient to determine
|
3172
|
+
that there is no unexpected or expected token to report. In that
|
3173
|
+
case, just report a simple "syntax error".
|
3174
|
+
- Don't assume there isn't a lookahead just because this state is a
|
3175
|
+
consistent state with a default action. There might have been a
|
3176
|
+
previous inconsistent state, consistent state with a non-default
|
3177
|
+
action, or user semantic action that manipulated yychar.
|
3178
|
+
- Of course, the expected token list depends on states to have
|
3179
|
+
correct lookahead information, and it depends on the parser not
|
3180
|
+
to perform extra reductions after fetching a lookahead from the
|
3181
|
+
scanner and before detecting a syntax error. Thus, state merging
|
3182
|
+
(from LALR or IELR) and default reductions corrupt the expected
|
3183
|
+
token list. However, the list is correct for canonical LR with
|
3184
|
+
one exception: it will still contain any token that will not be
|
3185
|
+
accepted due to an error action in a later state.
|
3186
|
+
*/
|
3187
|
+
if (yytoken != YYEMPTY)
|
3188
|
+
{
|
3189
|
+
int yyn = yypact[yystackp->yytops.yystates[0]->yylrState];
|
3190
|
+
yyarg[yycount++] = yytokenName (yytoken);
|
3191
|
+
if (!yypact_value_is_default (yyn))
|
3192
|
+
{
|
3193
|
+
/* Start YYX at -YYN if negative to avoid negative indexes in
|
3194
|
+
YYCHECK. In other words, skip the first -YYN actions for this
|
3195
|
+
state because they are default actions. */
|
3196
|
+
int yyxbegin = yyn < 0 ? -yyn : 0;
|
3197
|
+
/* Stay within bounds of both yycheck and yytname. */
|
3198
|
+
int yychecklim = YYLAST - yyn + 1;
|
3199
|
+
int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
|
3200
|
+
int yyx;
|
3201
|
+
for (yyx = yyxbegin; yyx < yyxend; ++yyx)
|
3202
|
+
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
|
3203
|
+
&& !yytable_value_is_error (yytable[yyx + yyn]))
|
3204
|
+
{
|
3205
|
+
if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
|
3206
|
+
{
|
3207
|
+
yycount = 1;
|
3208
|
+
yysize = yysize0;
|
3209
|
+
break;
|
3210
|
+
}
|
3211
|
+
yyarg[yycount++] = yytokenName (yyx);
|
3212
|
+
{
|
3213
|
+
size_t yysz = yysize + yytnamerr (YY_NULLPTR, yytokenName (yyx));
|
3214
|
+
yysize_overflow |= yysz < yysize;
|
3215
|
+
yysize = yysz;
|
3216
|
+
}
|
3217
|
+
}
|
3218
|
+
}
|
3219
|
+
}
|
3220
|
+
|
3221
|
+
switch (yycount)
|
3222
|
+
{
|
3223
|
+
#define YYCASE_(N, S) \
|
3224
|
+
case N: \
|
3225
|
+
yyformat = S; \
|
3226
|
+
break
|
3227
|
+
YYCASE_(0, YY_("syntax error"));
|
3228
|
+
YYCASE_(1, YY_("syntax error, unexpected %s"));
|
3229
|
+
YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
|
3230
|
+
YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
|
3231
|
+
YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
|
3232
|
+
YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
|
3233
|
+
#undef YYCASE_
|
3234
|
+
}
|
3235
|
+
|
3236
|
+
{
|
3237
|
+
size_t yysz = yysize + strlen (yyformat);
|
3238
|
+
yysize_overflow |= yysz < yysize;
|
3239
|
+
yysize = yysz;
|
3240
|
+
}
|
3241
|
+
|
3242
|
+
if (!yysize_overflow)
|
3243
|
+
yymsg = (char *) YYMALLOC (yysize);
|
3244
|
+
|
3245
|
+
if (yymsg)
|
3246
|
+
{
|
3247
|
+
char *yyp = yymsg;
|
3248
|
+
int yyi = 0;
|
3249
|
+
while ((*yyp = *yyformat))
|
3250
|
+
{
|
3251
|
+
if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
|
3252
|
+
{
|
3253
|
+
yyp += yytnamerr (yyp, yyarg[yyi++]);
|
3254
|
+
yyformat += 2;
|
3255
|
+
}
|
3256
|
+
else
|
3257
|
+
{
|
3258
|
+
yyp++;
|
3259
|
+
yyformat++;
|
3260
|
+
}
|
3261
|
+
}
|
3262
|
+
yyerror (&yylloc, scanner, filename, tree, yymsg);
|
3263
|
+
YYFREE (yymsg);
|
3264
|
+
}
|
3265
|
+
else
|
3266
|
+
{
|
3267
|
+
yyerror (&yylloc, scanner, filename, tree, YY_("syntax error"));
|
3268
|
+
yyMemoryExhausted (yystackp);
|
3269
|
+
}
|
3270
|
+
}
|
3271
|
+
#endif /* YYERROR_VERBOSE */
|
3272
|
+
yynerrs += 1;
|
3273
|
+
}
|
3274
|
+
|
3275
|
+
/* Recover from a syntax error on *YYSTACKP, assuming that *YYSTACKP->YYTOKENP,
|
3276
|
+
yylval, and yylloc are the syntactic category, semantic value, and location
|
3277
|
+
of the lookahead. */
|
3278
|
+
static void
|
3279
|
+
yyrecoverSyntaxError (yyGLRStack* yystackp, yyscan_t scanner, VALUE filename, VALUE *tree)
|
3280
|
+
{
|
3281
|
+
size_t yyk;
|
3282
|
+
int yyj;
|
3283
|
+
|
3284
|
+
if (yystackp->yyerrState == 3)
|
3285
|
+
/* We just shifted the error token and (perhaps) took some
|
3286
|
+
reductions. Skip tokens until we can proceed. */
|
3287
|
+
while (yytrue)
|
3288
|
+
{
|
3289
|
+
yySymbol yytoken;
|
3290
|
+
if (yychar == YYEOF)
|
3291
|
+
yyFail (yystackp, &yylloc, scanner, filename, tree, YY_NULLPTR);
|
3292
|
+
if (yychar != YYEMPTY)
|
3293
|
+
{
|
3294
|
+
/* We throw away the lookahead, but the error range
|
3295
|
+
of the shifted error token must take it into account. */
|
3296
|
+
yyGLRState *yys = yystackp->yytops.yystates[0];
|
3297
|
+
yyGLRStackItem yyerror_range[3];
|
3298
|
+
yyerror_range[1].yystate.yyloc = yys->yyloc;
|
3299
|
+
yyerror_range[2].yystate.yyloc = yylloc;
|
3300
|
+
YYLLOC_DEFAULT ((yys->yyloc), yyerror_range, 2);
|
3301
|
+
yytoken = YYTRANSLATE (yychar);
|
3302
|
+
yydestruct ("Error: discarding",
|
3303
|
+
yytoken, &yylval, &yylloc, scanner, filename, tree);
|
3304
|
+
}
|
3305
|
+
YYDPRINTF ((stderr, "Reading a token: "));
|
3306
|
+
yychar = yylex (&yylval, &yylloc, scanner);
|
3307
|
+
if (yychar <= YYEOF)
|
3308
|
+
{
|
3309
|
+
yychar = yytoken = YYEOF;
|
3310
|
+
YYDPRINTF ((stderr, "Now at end of input.\n"));
|
3311
|
+
}
|
3312
|
+
else
|
3313
|
+
{
|
3314
|
+
yytoken = YYTRANSLATE (yychar);
|
3315
|
+
YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
|
3316
|
+
}
|
3317
|
+
yyj = yypact[yystackp->yytops.yystates[0]->yylrState];
|
3318
|
+
if (yypact_value_is_default (yyj))
|
3319
|
+
return;
|
3320
|
+
yyj += yytoken;
|
3321
|
+
if (yyj < 0 || YYLAST < yyj || yycheck[yyj] != yytoken)
|
3322
|
+
{
|
3323
|
+
if (yydefact[yystackp->yytops.yystates[0]->yylrState] != 0)
|
3324
|
+
return;
|
3325
|
+
}
|
3326
|
+
else if (! yytable_value_is_error (yytable[yyj]))
|
3327
|
+
return;
|
3328
|
+
}
|
3329
|
+
|
3330
|
+
/* Reduce to one stack. */
|
3331
|
+
for (yyk = 0; yyk < yystackp->yytops.yysize; yyk += 1)
|
3332
|
+
if (yystackp->yytops.yystates[yyk] != YY_NULLPTR)
|
3333
|
+
break;
|
3334
|
+
if (yyk >= yystackp->yytops.yysize)
|
3335
|
+
yyFail (yystackp, &yylloc, scanner, filename, tree, YY_NULLPTR);
|
3336
|
+
for (yyk += 1; yyk < yystackp->yytops.yysize; yyk += 1)
|
3337
|
+
yymarkStackDeleted (yystackp, yyk);
|
3338
|
+
yyremoveDeletes (yystackp);
|
3339
|
+
yycompressStack (yystackp);
|
3340
|
+
|
3341
|
+
/* Now pop stack until we find a state that shifts the error token. */
|
3342
|
+
yystackp->yyerrState = 3;
|
3343
|
+
while (yystackp->yytops.yystates[0] != YY_NULLPTR)
|
3344
|
+
{
|
3345
|
+
yyGLRState *yys = yystackp->yytops.yystates[0];
|
3346
|
+
yyj = yypact[yys->yylrState];
|
3347
|
+
if (! yypact_value_is_default (yyj))
|
3348
|
+
{
|
3349
|
+
yyj += YYTERROR;
|
3350
|
+
if (0 <= yyj && yyj <= YYLAST && yycheck[yyj] == YYTERROR
|
3351
|
+
&& yyisShiftAction (yytable[yyj]))
|
3352
|
+
{
|
3353
|
+
/* Shift the error token. */
|
3354
|
+
/* First adjust its location.*/
|
3355
|
+
YYLTYPE yyerrloc;
|
3356
|
+
yystackp->yyerror_range[2].yystate.yyloc = yylloc;
|
3357
|
+
YYLLOC_DEFAULT (yyerrloc, (yystackp->yyerror_range), 2);
|
3358
|
+
YY_SYMBOL_PRINT ("Shifting", yystos[yytable[yyj]],
|
3359
|
+
&yylval, &yyerrloc);
|
3360
|
+
yyglrShift (yystackp, 0, yytable[yyj],
|
3361
|
+
yys->yyposn, &yylval, &yyerrloc);
|
3362
|
+
yys = yystackp->yytops.yystates[0];
|
3363
|
+
break;
|
3364
|
+
}
|
3365
|
+
}
|
3366
|
+
yystackp->yyerror_range[1].yystate.yyloc = yys->yyloc;
|
3367
|
+
if (yys->yypred != YY_NULLPTR)
|
3368
|
+
yydestroyGLRState ("Error: popping", yys, scanner, filename, tree);
|
3369
|
+
yystackp->yytops.yystates[0] = yys->yypred;
|
3370
|
+
yystackp->yynextFree -= 1;
|
3371
|
+
yystackp->yyspaceLeft += 1;
|
3372
|
+
}
|
3373
|
+
if (yystackp->yytops.yystates[0] == YY_NULLPTR)
|
3374
|
+
yyFail (yystackp, &yylloc, scanner, filename, tree, YY_NULLPTR);
|
3375
|
+
}
|
3376
|
+
|
3377
|
+
#define YYCHK1(YYE) \
|
3378
|
+
do { \
|
3379
|
+
switch (YYE) { \
|
3380
|
+
case yyok: \
|
3381
|
+
break; \
|
3382
|
+
case yyabort: \
|
3383
|
+
goto yyabortlab; \
|
3384
|
+
case yyaccept: \
|
3385
|
+
goto yyacceptlab; \
|
3386
|
+
case yyerr: \
|
3387
|
+
goto yyuser_error; \
|
3388
|
+
default: \
|
3389
|
+
goto yybuglab; \
|
3390
|
+
} \
|
3391
|
+
} while (0)
|
3392
|
+
|
3393
|
+
/*----------.
|
3394
|
+
| yyparse. |
|
3395
|
+
`----------*/
|
3396
|
+
|
3397
|
+
int
|
3398
|
+
yyparse (yyscan_t scanner, VALUE filename, VALUE *tree)
|
3399
|
+
{
|
3400
|
+
int yyresult;
|
3401
|
+
yyGLRStack yystack;
|
3402
|
+
yyGLRStack* const yystackp = &yystack;
|
3403
|
+
size_t yyposn;
|
3404
|
+
|
3405
|
+
YYDPRINTF ((stderr, "Starting parse\n"));
|
3406
|
+
|
3407
|
+
yychar = YYEMPTY;
|
3408
|
+
yylval = yyval_default;
|
3409
|
+
yylloc = yyloc_default;
|
3410
|
+
|
3411
|
+
if (! yyinitGLRStack (yystackp, YYINITDEPTH))
|
3412
|
+
goto yyexhaustedlab;
|
3413
|
+
switch (YYSETJMP (yystack.yyexception_buffer))
|
3414
|
+
{
|
3415
|
+
case 0: break;
|
3416
|
+
case 1: goto yyabortlab;
|
3417
|
+
case 2: goto yyexhaustedlab;
|
3418
|
+
default: goto yybuglab;
|
3419
|
+
}
|
3420
|
+
yyglrShift (&yystack, 0, 0, 0, &yylval, &yylloc);
|
3421
|
+
yyposn = 0;
|
3422
|
+
|
3423
|
+
while (yytrue)
|
3424
|
+
{
|
3425
|
+
/* For efficiency, we have two loops, the first of which is
|
3426
|
+
specialized to deterministic operation (single stack, no
|
3427
|
+
potential ambiguity). */
|
3428
|
+
/* Standard mode */
|
3429
|
+
while (yytrue)
|
3430
|
+
{
|
3431
|
+
yyRuleNum yyrule;
|
3432
|
+
int yyaction;
|
3433
|
+
const short int* yyconflicts;
|
3434
|
+
|
3435
|
+
yyStateNum yystate = yystack.yytops.yystates[0]->yylrState;
|
3436
|
+
YYDPRINTF ((stderr, "Entering state %d\n", yystate));
|
3437
|
+
if (yystate == YYFINAL)
|
3438
|
+
goto yyacceptlab;
|
3439
|
+
if (yyisDefaultedState (yystate))
|
3440
|
+
{
|
3441
|
+
yyrule = yydefaultAction (yystate);
|
3442
|
+
if (yyrule == 0)
|
3443
|
+
{
|
3444
|
+
yystack.yyerror_range[1].yystate.yyloc = yylloc;
|
3445
|
+
yyreportSyntaxError (&yystack, scanner, filename, tree);
|
3446
|
+
goto yyuser_error;
|
3447
|
+
}
|
3448
|
+
YYCHK1 (yyglrReduce (&yystack, 0, yyrule, yytrue, scanner, filename, tree));
|
3449
|
+
}
|
3450
|
+
else
|
3451
|
+
{
|
3452
|
+
yySymbol yytoken;
|
3453
|
+
if (yychar == YYEMPTY)
|
3454
|
+
{
|
3455
|
+
YYDPRINTF ((stderr, "Reading a token: "));
|
3456
|
+
yychar = yylex (&yylval, &yylloc, scanner);
|
3457
|
+
}
|
3458
|
+
|
3459
|
+
if (yychar <= YYEOF)
|
3460
|
+
{
|
3461
|
+
yychar = yytoken = YYEOF;
|
3462
|
+
YYDPRINTF ((stderr, "Now at end of input.\n"));
|
3463
|
+
}
|
3464
|
+
else
|
3465
|
+
{
|
3466
|
+
yytoken = YYTRANSLATE (yychar);
|
3467
|
+
YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
|
3468
|
+
}
|
3469
|
+
|
3470
|
+
yygetLRActions (yystate, yytoken, &yyaction, &yyconflicts);
|
3471
|
+
if (*yyconflicts != 0)
|
3472
|
+
break;
|
3473
|
+
if (yyisShiftAction (yyaction))
|
3474
|
+
{
|
3475
|
+
YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
|
3476
|
+
yychar = YYEMPTY;
|
3477
|
+
yyposn += 1;
|
3478
|
+
yyglrShift (&yystack, 0, yyaction, yyposn, &yylval, &yylloc);
|
3479
|
+
if (0 < yystack.yyerrState)
|
3480
|
+
yystack.yyerrState -= 1;
|
3481
|
+
}
|
3482
|
+
else if (yyisErrorAction (yyaction))
|
3483
|
+
{
|
3484
|
+
yystack.yyerror_range[1].yystate.yyloc = yylloc;
|
3485
|
+
yyreportSyntaxError (&yystack, scanner, filename, tree);
|
3486
|
+
goto yyuser_error;
|
3487
|
+
}
|
3488
|
+
else
|
3489
|
+
YYCHK1 (yyglrReduce (&yystack, 0, -yyaction, yytrue, scanner, filename, tree));
|
3490
|
+
}
|
3491
|
+
}
|
3492
|
+
|
3493
|
+
while (yytrue)
|
3494
|
+
{
|
3495
|
+
yySymbol yytoken_to_shift;
|
3496
|
+
size_t yys;
|
3497
|
+
|
3498
|
+
for (yys = 0; yys < yystack.yytops.yysize; yys += 1)
|
3499
|
+
yystackp->yytops.yylookaheadNeeds[yys] = yychar != YYEMPTY;
|
3500
|
+
|
3501
|
+
/* yyprocessOneStack returns one of three things:
|
3502
|
+
|
3503
|
+
- An error flag. If the caller is yyprocessOneStack, it
|
3504
|
+
immediately returns as well. When the caller is finally
|
3505
|
+
yyparse, it jumps to an error label via YYCHK1.
|
3506
|
+
|
3507
|
+
- yyok, but yyprocessOneStack has invoked yymarkStackDeleted
|
3508
|
+
(&yystack, yys), which sets the top state of yys to NULL. Thus,
|
3509
|
+
yyparse's following invocation of yyremoveDeletes will remove
|
3510
|
+
the stack.
|
3511
|
+
|
3512
|
+
- yyok, when ready to shift a token.
|
3513
|
+
|
3514
|
+
Except in the first case, yyparse will invoke yyremoveDeletes and
|
3515
|
+
then shift the next token onto all remaining stacks. This
|
3516
|
+
synchronization of the shift (that is, after all preceding
|
3517
|
+
reductions on all stacks) helps prevent double destructor calls
|
3518
|
+
on yylval in the event of memory exhaustion. */
|
3519
|
+
|
3520
|
+
for (yys = 0; yys < yystack.yytops.yysize; yys += 1)
|
3521
|
+
YYCHK1 (yyprocessOneStack (&yystack, yys, yyposn, &yylloc, scanner, filename, tree));
|
3522
|
+
yyremoveDeletes (&yystack);
|
3523
|
+
if (yystack.yytops.yysize == 0)
|
3524
|
+
{
|
3525
|
+
yyundeleteLastStack (&yystack);
|
3526
|
+
if (yystack.yytops.yysize == 0)
|
3527
|
+
yyFail (&yystack, &yylloc, scanner, filename, tree, YY_("syntax error"));
|
3528
|
+
YYCHK1 (yyresolveStack (&yystack, scanner, filename, tree));
|
3529
|
+
YYDPRINTF ((stderr, "Returning to deterministic operation.\n"));
|
3530
|
+
yystack.yyerror_range[1].yystate.yyloc = yylloc;
|
3531
|
+
yyreportSyntaxError (&yystack, scanner, filename, tree);
|
3532
|
+
goto yyuser_error;
|
3533
|
+
}
|
3534
|
+
|
3535
|
+
/* If any yyglrShift call fails, it will fail after shifting. Thus,
|
3536
|
+
a copy of yylval will already be on stack 0 in the event of a
|
3537
|
+
failure in the following loop. Thus, yychar is set to YYEMPTY
|
3538
|
+
before the loop to make sure the user destructor for yylval isn't
|
3539
|
+
called twice. */
|
3540
|
+
yytoken_to_shift = YYTRANSLATE (yychar);
|
3541
|
+
yychar = YYEMPTY;
|
3542
|
+
yyposn += 1;
|
3543
|
+
for (yys = 0; yys < yystack.yytops.yysize; yys += 1)
|
3544
|
+
{
|
3545
|
+
int yyaction;
|
3546
|
+
const short int* yyconflicts;
|
3547
|
+
yyStateNum yystate = yystack.yytops.yystates[yys]->yylrState;
|
3548
|
+
yygetLRActions (yystate, yytoken_to_shift, &yyaction,
|
3549
|
+
&yyconflicts);
|
3550
|
+
/* Note that yyconflicts were handled by yyprocessOneStack. */
|
3551
|
+
YYDPRINTF ((stderr, "On stack %lu, ", (unsigned long int) yys));
|
3552
|
+
YY_SYMBOL_PRINT ("shifting", yytoken_to_shift, &yylval, &yylloc);
|
3553
|
+
yyglrShift (&yystack, yys, yyaction, yyposn,
|
3554
|
+
&yylval, &yylloc);
|
3555
|
+
YYDPRINTF ((stderr, "Stack %lu now in state #%d\n",
|
3556
|
+
(unsigned long int) yys,
|
3557
|
+
yystack.yytops.yystates[yys]->yylrState));
|
3558
|
+
}
|
3559
|
+
|
3560
|
+
if (yystack.yytops.yysize == 1)
|
3561
|
+
{
|
3562
|
+
YYCHK1 (yyresolveStack (&yystack, scanner, filename, tree));
|
3563
|
+
YYDPRINTF ((stderr, "Returning to deterministic operation.\n"));
|
3564
|
+
yycompressStack (&yystack);
|
3565
|
+
break;
|
3566
|
+
}
|
3567
|
+
}
|
3568
|
+
continue;
|
3569
|
+
yyuser_error:
|
3570
|
+
yyrecoverSyntaxError (&yystack, scanner, filename, tree);
|
3571
|
+
yyposn = yystack.yytops.yystates[0]->yyposn;
|
3572
|
+
}
|
3573
|
+
|
3574
|
+
yyacceptlab:
|
3575
|
+
yyresult = 0;
|
3576
|
+
goto yyreturn;
|
3577
|
+
|
3578
|
+
yybuglab:
|
3579
|
+
YYASSERT (yyfalse);
|
3580
|
+
goto yyabortlab;
|
3581
|
+
|
3582
|
+
yyabortlab:
|
3583
|
+
yyresult = 1;
|
3584
|
+
goto yyreturn;
|
3585
|
+
|
3586
|
+
yyexhaustedlab:
|
3587
|
+
yyerror (&yylloc, scanner, filename, tree, YY_("memory exhausted"));
|
3588
|
+
yyresult = 2;
|
3589
|
+
goto yyreturn;
|
3590
|
+
|
3591
|
+
yyreturn:
|
3592
|
+
if (yychar != YYEMPTY)
|
3593
|
+
yydestruct ("Cleanup: discarding lookahead",
|
3594
|
+
YYTRANSLATE (yychar), &yylval, &yylloc, scanner, filename, tree);
|
3595
|
+
|
3596
|
+
/* If the stack is well-formed, pop the stack until it is empty,
|
3597
|
+
destroying its entries as we go. But free the stack regardless
|
3598
|
+
of whether it is well-formed. */
|
3599
|
+
if (yystack.yyitems)
|
3600
|
+
{
|
3601
|
+
yyGLRState** yystates = yystack.yytops.yystates;
|
3602
|
+
if (yystates)
|
3603
|
+
{
|
3604
|
+
size_t yysize = yystack.yytops.yysize;
|
3605
|
+
size_t yyk;
|
3606
|
+
for (yyk = 0; yyk < yysize; yyk += 1)
|
3607
|
+
if (yystates[yyk])
|
3608
|
+
{
|
3609
|
+
while (yystates[yyk])
|
3610
|
+
{
|
3611
|
+
yyGLRState *yys = yystates[yyk];
|
3612
|
+
yystack.yyerror_range[1].yystate.yyloc = yys->yyloc;
|
3613
|
+
if (yys->yypred != YY_NULLPTR)
|
3614
|
+
yydestroyGLRState ("Cleanup: popping", yys, scanner, filename, tree);
|
3615
|
+
yystates[yyk] = yys->yypred;
|
3616
|
+
yystack.yynextFree -= 1;
|
3617
|
+
yystack.yyspaceLeft += 1;
|
3618
|
+
}
|
3619
|
+
break;
|
3620
|
+
}
|
3621
|
+
}
|
3622
|
+
yyfreeGLRStack (&yystack);
|
3623
|
+
}
|
3624
|
+
|
3625
|
+
return yyresult;
|
3626
|
+
}
|
3627
|
+
|
3628
|
+
/* DEBUGGING ONLY */
|
3629
|
+
#if YYDEBUG
|
3630
|
+
static void
|
3631
|
+
yy_yypstack (yyGLRState* yys)
|
3632
|
+
{
|
3633
|
+
if (yys->yypred)
|
3634
|
+
{
|
3635
|
+
yy_yypstack (yys->yypred);
|
3636
|
+
YYFPRINTF (stderr, " -> ");
|
3637
|
+
}
|
3638
|
+
YYFPRINTF (stderr, "%d@%lu", yys->yylrState,
|
3639
|
+
(unsigned long int) yys->yyposn);
|
3640
|
+
}
|
3641
|
+
|
3642
|
+
static void
|
3643
|
+
yypstates (yyGLRState* yyst)
|
3644
|
+
{
|
3645
|
+
if (yyst == YY_NULLPTR)
|
3646
|
+
YYFPRINTF (stderr, "<null>");
|
3647
|
+
else
|
3648
|
+
yy_yypstack (yyst);
|
3649
|
+
YYFPRINTF (stderr, "\n");
|
3650
|
+
}
|
3651
|
+
|
3652
|
+
static void
|
3653
|
+
yypstack (yyGLRStack* yystackp, size_t yyk)
|
3654
|
+
{
|
3655
|
+
yypstates (yystackp->yytops.yystates[yyk]);
|
3656
|
+
}
|
3657
|
+
|
3658
|
+
#define YYINDEX(YYX) \
|
3659
|
+
((YYX) == YY_NULLPTR ? -1 : (yyGLRStackItem*) (YYX) - yystackp->yyitems)
|
3660
|
+
|
3661
|
+
|
3662
|
+
static void
|
3663
|
+
yypdumpstack (yyGLRStack* yystackp)
|
3664
|
+
{
|
3665
|
+
yyGLRStackItem* yyp;
|
3666
|
+
size_t yyi;
|
3667
|
+
for (yyp = yystackp->yyitems; yyp < yystackp->yynextFree; yyp += 1)
|
3668
|
+
{
|
3669
|
+
YYFPRINTF (stderr, "%3lu. ",
|
3670
|
+
(unsigned long int) (yyp - yystackp->yyitems));
|
3671
|
+
if (*(yybool *) yyp)
|
3672
|
+
{
|
3673
|
+
YYASSERT (yyp->yystate.yyisState);
|
3674
|
+
YYASSERT (yyp->yyoption.yyisState);
|
3675
|
+
YYFPRINTF (stderr, "Res: %d, LR State: %d, posn: %lu, pred: %ld",
|
3676
|
+
yyp->yystate.yyresolved, yyp->yystate.yylrState,
|
3677
|
+
(unsigned long int) yyp->yystate.yyposn,
|
3678
|
+
(long int) YYINDEX (yyp->yystate.yypred));
|
3679
|
+
if (! yyp->yystate.yyresolved)
|
3680
|
+
YYFPRINTF (stderr, ", firstVal: %ld",
|
3681
|
+
(long int) YYINDEX (yyp->yystate
|
3682
|
+
.yysemantics.yyfirstVal));
|
3683
|
+
}
|
3684
|
+
else
|
3685
|
+
{
|
3686
|
+
YYASSERT (!yyp->yystate.yyisState);
|
3687
|
+
YYASSERT (!yyp->yyoption.yyisState);
|
3688
|
+
YYFPRINTF (stderr, "Option. rule: %d, state: %ld, next: %ld",
|
3689
|
+
yyp->yyoption.yyrule - 1,
|
3690
|
+
(long int) YYINDEX (yyp->yyoption.yystate),
|
3691
|
+
(long int) YYINDEX (yyp->yyoption.yynext));
|
3692
|
+
}
|
3693
|
+
YYFPRINTF (stderr, "\n");
|
3694
|
+
}
|
3695
|
+
YYFPRINTF (stderr, "Tops:");
|
3696
|
+
for (yyi = 0; yyi < yystackp->yytops.yysize; yyi += 1)
|
3697
|
+
YYFPRINTF (stderr, "%lu: %ld; ", (unsigned long int) yyi,
|
3698
|
+
(long int) YYINDEX (yystackp->yytops.yystates[yyi]));
|
3699
|
+
YYFPRINTF (stderr, "\n");
|
3700
|
+
}
|
3701
|
+
#endif
|
3702
|
+
|
3703
|
+
#undef yylval
|
3704
|
+
#undef yychar
|
3705
|
+
#undef yynerrs
|
3706
|
+
#undef yylloc
|
3707
|
+
|
3708
|
+
|
3709
|
+
|
3710
|
+
#line 795 "ext/slow_blink/ext_schema_parser/parser.y" /* glr.c:2551 */
|
3711
|
+
|
3712
|
+
|
3713
|
+
/* functions **********************************************************/
|
3714
|
+
|
3715
|
+
|
3716
|
+
void Init_ext_schema_parser(void)
|
3717
|
+
{
|
3718
|
+
cSlowBlink = rb_define_module("SlowBlink");
|
3719
|
+
|
3720
|
+
cNameWithID = rb_const_get(cSlowBlink, rb_intern("NameWithID"));
|
3721
|
+
|
3722
|
+
cSchema = rb_const_get(cSlowBlink, rb_intern("Schema"));
|
3723
|
+
cGroup = rb_const_get(cSlowBlink, rb_intern("Group"));
|
3724
|
+
cField = rb_const_get(cSlowBlink, rb_intern("Field"));
|
3725
|
+
cDefinition = rb_const_get(cSlowBlink, rb_intern("Field"));
|
3726
|
+
|
3727
|
+
cAnnotation = rb_const_get(cSlowBlink, rb_intern("Annotation"));
|
3728
|
+
cIncrementalAnnotation = rb_const_get(cSlowBlink, rb_intern("IncrementalAnnotation"));
|
3729
|
+
|
3730
|
+
cDefinition = rb_const_get(cSlowBlink, rb_intern("Definition"));
|
3731
|
+
cEnumeration = rb_const_get(cSlowBlink, rb_intern("Enumeration"));
|
3732
|
+
cSym = rb_const_get(cSlowBlink, rb_intern("Sym"));
|
3733
|
+
|
3734
|
+
cU8 = rb_const_get(cSlowBlink, rb_intern("U8"));
|
3735
|
+
cU16 = rb_const_get(cSlowBlink, rb_intern("U16"));
|
3736
|
+
cU32 = rb_const_get(cSlowBlink, rb_intern("U32"));
|
3737
|
+
cU64 = rb_const_get(cSlowBlink, rb_intern("U64"));
|
3738
|
+
cI8 = rb_const_get(cSlowBlink, rb_intern("I8"));
|
3739
|
+
cI16 = rb_const_get(cSlowBlink, rb_intern("I16"));
|
3740
|
+
cI32 = rb_const_get(cSlowBlink, rb_intern("I32"));
|
3741
|
+
cI64 = rb_const_get(cSlowBlink, rb_intern("I64"));
|
3742
|
+
cF64 = rb_const_get(cSlowBlink, rb_intern("F64"));
|
3743
|
+
cDECIMAL = rb_const_get(cSlowBlink, rb_intern("DECIMAL"));
|
3744
|
+
cFIXED = rb_const_get(cSlowBlink, rb_intern("FIXED"));
|
3745
|
+
cBINARY = rb_const_get(cSlowBlink, rb_intern("BINARY"));
|
3746
|
+
cSTRING = rb_const_get(cSlowBlink, rb_intern("STRING"));
|
3747
|
+
cBOOLEAN = rb_const_get(cSlowBlink, rb_intern("BOOLEAN"));
|
3748
|
+
cDATE = rb_const_get(cSlowBlink, rb_intern("DATE"));
|
3749
|
+
cMILLI_TIME = rb_const_get(cSlowBlink, rb_intern("MILLI_TIME"));
|
3750
|
+
cNANO_TIME = rb_const_get(cSlowBlink, rb_intern("NANO_TIME"));
|
3751
|
+
cTIME_OF_DAY_MILLI = rb_const_get(cSlowBlink, rb_intern("TIME_OF_DAY_MILLI"));
|
3752
|
+
cTIME_OF_DAY_NANO = rb_const_get(cSlowBlink, rb_intern("TIME_OF_DAY_NANO"));
|
3753
|
+
cSEQUENCE = rb_const_get(cSlowBlink, rb_intern("SEQUENCE"));
|
3754
|
+
cREF = rb_const_get(cSlowBlink, rb_intern("REF"));
|
3755
|
+
cOBJECT = rb_const_get(cSlowBlink, rb_intern("OBJECT"));
|
3756
|
+
|
3757
|
+
cSchemaRef = rb_const_get(cSlowBlink, rb_intern("SchemaRef"));
|
3758
|
+
cDefinitionRef = rb_const_get(cSlowBlink, rb_intern("DefinitionRef"));
|
3759
|
+
cDefinitionTypeRef = rb_const_get(cSlowBlink, rb_intern("DefinitionTypeRef"));
|
3760
|
+
cFieldRef = rb_const_get(cSlowBlink, rb_intern("FieldRef"));
|
3761
|
+
cFieldTypeRef = rb_const_get(cSlowBlink, rb_intern("FieldTypeRef"));
|
3762
|
+
|
3763
|
+
rb_define_singleton_method(cSchema, "parse", parseFileBuffer, -1);
|
3764
|
+
}
|
3765
|
+
|
3766
|
+
void yyerror(YYLTYPE *locp, yyscan_t scanner, VALUE filename, VALUE *tree, char const *msg, ... )
|
3767
|
+
{
|
3768
|
+
int retval;
|
3769
|
+
VALUE rbString;
|
3770
|
+
char error[500];
|
3771
|
+
|
3772
|
+
int hdrLen;
|
3773
|
+
|
3774
|
+
hdrLen = snprintf(error, sizeof(error), "%s:%i:%i: error: ", (const char *)RSTRING_PTR(filename), locp->first_line, locp->first_column);
|
3775
|
+
|
3776
|
+
if((hdrLen > 0) && (hdrLen <= sizeof(error))){
|
3777
|
+
|
3778
|
+
va_list argptr;
|
3779
|
+
va_start(argptr, msg);
|
3780
|
+
retval = vsnprintf(&error[hdrLen], sizeof(error) - hdrLen, msg, argptr);
|
3781
|
+
va_end(argptr);
|
3782
|
+
|
3783
|
+
if((retval > 0) && ((hdrLen + retval) <= sizeof(error))){
|
3784
|
+
|
3785
|
+
rbString = rb_str_new((const char *)error, (hdrLen + retval));
|
3786
|
+
rb_io_puts(1, &rbString, rb_stderr);
|
3787
|
+
}
|
3788
|
+
else{
|
3789
|
+
|
3790
|
+
rb_bug("yyerror buffer is too short to contain error message");
|
3791
|
+
}
|
3792
|
+
}
|
3793
|
+
else{
|
3794
|
+
|
3795
|
+
rb_bug("yyerror buffer is too short to contain error message");
|
3796
|
+
}
|
3797
|
+
}
|
3798
|
+
|
3799
|
+
/* static functions ***************************************************/
|
3800
|
+
|
3801
|
+
static VALUE parseFileBuffer(int argc, VALUE* argv, VALUE self)
|
3802
|
+
{
|
3803
|
+
yyscan_t scanner;
|
3804
|
+
VALUE tree = Qnil;
|
3805
|
+
VALUE buffer;
|
3806
|
+
VALUE opts;
|
3807
|
+
|
3808
|
+
rb_scan_args(argc, argv, "10:", &buffer, &opts);
|
3809
|
+
|
3810
|
+
if(opts == Qnil){
|
3811
|
+
opts = rb_hash_new();
|
3812
|
+
}
|
3813
|
+
|
3814
|
+
VALUE filename = rb_hash_aref(opts, ID2SYM(rb_intern("filename")));
|
3815
|
+
|
3816
|
+
if(yylex_init(&scanner) == 0){
|
3817
|
+
|
3818
|
+
if(yy_scan_bytes((const char *)RSTRING_PTR(buffer), RSTRING_LEN(buffer), scanner)){
|
3819
|
+
|
3820
|
+
yyparse(scanner, filename, &tree);
|
3821
|
+
}
|
3822
|
+
|
3823
|
+
yylex_destroy(scanner);
|
3824
|
+
}
|
3825
|
+
|
3826
|
+
return tree;
|
3827
|
+
}
|
3828
|
+
|
3829
|
+
static VALUE newLocation(VALUE filename, const YYLTYPE *location)
|
3830
|
+
{
|
3831
|
+
char msg[500];
|
3832
|
+
int pos = 0;
|
3833
|
+
|
3834
|
+
if(filename != Qnil){
|
3835
|
+
|
3836
|
+
if(RSTRING_LEN(filename) < sizeof(msg)){
|
3837
|
+
memcpy(msg, RSTRING_PTR(filename), RSTRING_LEN(filename));
|
3838
|
+
pos = RSTRING_LEN(filename);
|
3839
|
+
}
|
3840
|
+
else{
|
3841
|
+
return rb_str_new("...", strlen("..."));
|
3842
|
+
}
|
3843
|
+
}
|
3844
|
+
|
3845
|
+
int len = snprintf(&msg[pos], sizeof(msg) - pos, ":%i:%i:", location->first_line, location->first_column);
|
3846
|
+
|
3847
|
+
return rb_str_new(msg, len);
|
3848
|
+
}
|