GCC Code Coverage Report


Directory: ./
File: openvdb_ax/openvdb_ax/grammar/generated/axparser.cc
Date: 2022-07-25 17:40:05
Exec Total Coverage
Lines: 643 763 84.3%
Functions: 42 42 100.0%
Branches: 265 424 62.5%

Line Branch Exec Source
1 /* A Bison parser, made by GNU Bison 3.8.2. */
2
3 /* Bison implementation for Yacc-like parsers in C
4
5 Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
6 Inc.
7
8 This program is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <https://www.gnu.org/licenses/>. */
20
21 /* As a special exception, you may create a larger work that contains
22 part or all of the Bison parser skeleton and distribute that work
23 under terms of your choice, so long as that work isn't itself a
24 parser generator using the skeleton or a modified version thereof
25 as a parser skeleton. Alternatively, if you modify or redistribute
26 the parser skeleton itself, you may (at your option) remove this
27 special exception, which will cause the skeleton and the resulting
28 Bison output files to be licensed under the GNU General Public
29 License without this special exception.
30
31 This special exception was added by the Free Software Foundation in
32 version 2.2 of Bison. */
33
34 /* C LALR(1) parser skeleton written by Richard Stallman, by
35 simplifying the original so-called "semantic" parser. */
36
37 /* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
38 especially those whose name start with YY_ or yy_. They are
39 private implementation details that can be changed or removed. */
40
41 /* All symbols defined below should begin with yy or YY, to avoid
42 infringing on user name space. This should be done even for local
43 variables, as they might otherwise be expanded by user macros.
44 There are some unavoidable exceptions within include files to
45 define necessary library symbols; they are noted "INFRINGES ON
46 USER NAME SPACE" below. */
47
48 /* Identify Bison output, and Bison version. */
49 #define YYBISON 30802
50
51 /* Bison version string. */
52 #define YYBISON_VERSION "3.8.2"
53
54 /* Skeleton name. */
55 #define YYSKELETON_NAME "yacc.c"
56
57 /* Pure parsers. */
58 #define YYPURE 0
59
60 /* Push parsers. */
61 #define YYPUSH 0
62
63 /* Pull parsers. */
64 #define YYPULL 1
65
66 /* "%code top" blocks. */
67
68 #include "openvdb_ax/ast/AST.h"
69 #include "openvdb_ax/ast/Parse.h"
70 #include "openvdb_ax/ast/Tokens.h"
71 #include "openvdb_ax/compiler/Logger.h"
72 #include <openvdb/Platform.h> // for OPENVDB_NO_TYPE_CONVERSION_WARNING_BEGIN
73 #include <vector>
74
75 /// @note Bypasses bison conversion warnings in yyparse
76 OPENVDB_NO_TYPE_CONVERSION_WARNING_BEGIN
77
78 extern int axlex();
79 extern openvdb::ax::Logger* axlog;
80
81 using namespace openvdb::ax::ast;
82 using namespace openvdb::ax;
83
84 void axerror(Tree** tree, const char* s);
85
86 using ExpList = std::vector<openvdb::ax::ast::Expression*>;
87
88 /* Substitute the type names. */
89 #define YYSTYPE AXSTYPE
90 #define YYLTYPE AXLTYPE
91 /* Substitute the variable and function names. */
92 #define yyparse axparse
93 #define yylex axlex
94 #define yyerror axerror
95 #define yydebug axdebug
96 #define yynerrs axnerrs
97 #define yylval axlval
98 #define yychar axchar
99 #define yylloc axlloc
100
101
102 # ifndef YY_CAST
103 # ifdef __cplusplus
104 # define YY_CAST(Type, Val) static_cast<Type> (Val)
105 # define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
106 # else
107 # define YY_CAST(Type, Val) ((Type) (Val))
108 # define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
109 # endif
110 # endif
111 # ifndef YY_NULLPTR
112 # if defined __cplusplus
113 # if 201103L <= __cplusplus
114 # define YY_NULLPTR nullptr
115 # else
116 # define YY_NULLPTR 0
117 # endif
118 # else
119 # define YY_NULLPTR ((void*)0)
120 # endif
121 # endif
122
123 #include "axparser.h"
124 /* Symbol kind. */
125 enum yysymbol_kind_t
126 {
127 YYSYMBOL_YYEMPTY = -2,
128 YYSYMBOL_YYEOF = 0, /* "end of file" */
129 YYSYMBOL_YYerror = 1, /* error */
130 YYSYMBOL_YYUNDEF = 2, /* "invalid token" */
131 YYSYMBOL_TRUE = 3, /* TRUE */
132 YYSYMBOL_FALSE = 4, /* FALSE */
133 YYSYMBOL_SEMICOLON = 5, /* SEMICOLON */
134 YYSYMBOL_AT = 6, /* AT */
135 YYSYMBOL_DOLLAR = 7, /* DOLLAR */
136 YYSYMBOL_IF = 8, /* IF */
137 YYSYMBOL_ELSE = 9, /* ELSE */
138 YYSYMBOL_FOR = 10, /* FOR */
139 YYSYMBOL_DO = 11, /* DO */
140 YYSYMBOL_WHILE = 12, /* WHILE */
141 YYSYMBOL_RETURN = 13, /* RETURN */
142 YYSYMBOL_BREAK = 14, /* BREAK */
143 YYSYMBOL_CONTINUE = 15, /* CONTINUE */
144 YYSYMBOL_LCURLY = 16, /* LCURLY */
145 YYSYMBOL_RCURLY = 17, /* RCURLY */
146 YYSYMBOL_LSQUARE = 18, /* LSQUARE */
147 YYSYMBOL_RSQUARE = 19, /* RSQUARE */
148 YYSYMBOL_STRING = 20, /* STRING */
149 YYSYMBOL_DOUBLE = 21, /* DOUBLE */
150 YYSYMBOL_FLOAT = 22, /* FLOAT */
151 YYSYMBOL_INT32 = 23, /* INT32 */
152 YYSYMBOL_INT64 = 24, /* INT64 */
153 YYSYMBOL_BOOL = 25, /* BOOL */
154 YYSYMBOL_VEC2I = 26, /* VEC2I */
155 YYSYMBOL_VEC2F = 27, /* VEC2F */
156 YYSYMBOL_VEC2D = 28, /* VEC2D */
157 YYSYMBOL_VEC3I = 29, /* VEC3I */
158 YYSYMBOL_VEC3F = 30, /* VEC3F */
159 YYSYMBOL_VEC3D = 31, /* VEC3D */
160 YYSYMBOL_VEC4I = 32, /* VEC4I */
161 YYSYMBOL_VEC4F = 33, /* VEC4F */
162 YYSYMBOL_VEC4D = 34, /* VEC4D */
163 YYSYMBOL_F_AT = 35, /* F_AT */
164 YYSYMBOL_I_AT = 36, /* I_AT */
165 YYSYMBOL_V_AT = 37, /* V_AT */
166 YYSYMBOL_S_AT = 38, /* S_AT */
167 YYSYMBOL_I16_AT = 39, /* I16_AT */
168 YYSYMBOL_MAT3F = 40, /* MAT3F */
169 YYSYMBOL_MAT3D = 41, /* MAT3D */
170 YYSYMBOL_MAT4F = 42, /* MAT4F */
171 YYSYMBOL_MAT4D = 43, /* MAT4D */
172 YYSYMBOL_M3F_AT = 44, /* M3F_AT */
173 YYSYMBOL_M4F_AT = 45, /* M4F_AT */
174 YYSYMBOL_F_DOLLAR = 46, /* F_DOLLAR */
175 YYSYMBOL_I_DOLLAR = 47, /* I_DOLLAR */
176 YYSYMBOL_V_DOLLAR = 48, /* V_DOLLAR */
177 YYSYMBOL_S_DOLLAR = 49, /* S_DOLLAR */
178 YYSYMBOL_DOT_X = 50, /* DOT_X */
179 YYSYMBOL_DOT_Y = 51, /* DOT_Y */
180 YYSYMBOL_DOT_Z = 52, /* DOT_Z */
181 YYSYMBOL_L_INT32 = 53, /* L_INT32 */
182 YYSYMBOL_L_INT64 = 54, /* L_INT64 */
183 YYSYMBOL_L_FLOAT = 55, /* L_FLOAT */
184 YYSYMBOL_L_DOUBLE = 56, /* L_DOUBLE */
185 YYSYMBOL_L_STRING = 57, /* L_STRING */
186 YYSYMBOL_IDENTIFIER = 58, /* IDENTIFIER */
187 YYSYMBOL_COMMA = 59, /* COMMA */
188 YYSYMBOL_QUESTION = 60, /* QUESTION */
189 YYSYMBOL_COLON = 61, /* COLON */
190 YYSYMBOL_EQUALS = 62, /* EQUALS */
191 YYSYMBOL_PLUSEQUALS = 63, /* PLUSEQUALS */
192 YYSYMBOL_MINUSEQUALS = 64, /* MINUSEQUALS */
193 YYSYMBOL_MULTIPLYEQUALS = 65, /* MULTIPLYEQUALS */
194 YYSYMBOL_DIVIDEEQUALS = 66, /* DIVIDEEQUALS */
195 YYSYMBOL_MODULOEQUALS = 67, /* MODULOEQUALS */
196 YYSYMBOL_BITANDEQUALS = 68, /* BITANDEQUALS */
197 YYSYMBOL_BITXOREQUALS = 69, /* BITXOREQUALS */
198 YYSYMBOL_BITOREQUALS = 70, /* BITOREQUALS */
199 YYSYMBOL_SHIFTLEFTEQUALS = 71, /* SHIFTLEFTEQUALS */
200 YYSYMBOL_SHIFTRIGHTEQUALS = 72, /* SHIFTRIGHTEQUALS */
201 YYSYMBOL_OR = 73, /* OR */
202 YYSYMBOL_AND = 74, /* AND */
203 YYSYMBOL_BITOR = 75, /* BITOR */
204 YYSYMBOL_BITXOR = 76, /* BITXOR */
205 YYSYMBOL_BITAND = 77, /* BITAND */
206 YYSYMBOL_EQUALSEQUALS = 78, /* EQUALSEQUALS */
207 YYSYMBOL_NOTEQUALS = 79, /* NOTEQUALS */
208 YYSYMBOL_MORETHAN = 80, /* MORETHAN */
209 YYSYMBOL_LESSTHAN = 81, /* LESSTHAN */
210 YYSYMBOL_MORETHANOREQUAL = 82, /* MORETHANOREQUAL */
211 YYSYMBOL_LESSTHANOREQUAL = 83, /* LESSTHANOREQUAL */
212 YYSYMBOL_SHIFTLEFT = 84, /* SHIFTLEFT */
213 YYSYMBOL_SHIFTRIGHT = 85, /* SHIFTRIGHT */
214 YYSYMBOL_PLUS = 86, /* PLUS */
215 YYSYMBOL_MINUS = 87, /* MINUS */
216 YYSYMBOL_MULTIPLY = 88, /* MULTIPLY */
217 YYSYMBOL_DIVIDE = 89, /* DIVIDE */
218 YYSYMBOL_MODULO = 90, /* MODULO */
219 YYSYMBOL_UMINUS = 91, /* UMINUS */
220 YYSYMBOL_NOT = 92, /* NOT */
221 YYSYMBOL_BITNOT = 93, /* BITNOT */
222 YYSYMBOL_PLUSPLUS = 94, /* PLUSPLUS */
223 YYSYMBOL_MINUSMINUS = 95, /* MINUSMINUS */
224 YYSYMBOL_LPARENS = 96, /* LPARENS */
225 YYSYMBOL_RPARENS = 97, /* RPARENS */
226 YYSYMBOL_LOWER_THAN_ELSE = 98, /* LOWER_THAN_ELSE */
227 YYSYMBOL_YYACCEPT = 99, /* $accept */
228 YYSYMBOL_tree = 100, /* tree */
229 YYSYMBOL_body = 101, /* body */
230 YYSYMBOL_block = 102, /* block */
231 YYSYMBOL_statement = 103, /* statement */
232 YYSYMBOL_expressions = 104, /* expressions */
233 YYSYMBOL_comma_operator = 105, /* comma_operator */
234 YYSYMBOL_expression = 106, /* expression */
235 YYSYMBOL_declaration = 107, /* declaration */
236 YYSYMBOL_declaration_list = 108, /* declaration_list */
237 YYSYMBOL_declarations = 109, /* declarations */
238 YYSYMBOL_block_or_statement = 110, /* block_or_statement */
239 YYSYMBOL_conditional_statement = 111, /* conditional_statement */
240 YYSYMBOL_loop_condition = 112, /* loop_condition */
241 YYSYMBOL_loop_condition_optional = 113, /* loop_condition_optional */
242 YYSYMBOL_loop_init = 114, /* loop_init */
243 YYSYMBOL_loop_iter = 115, /* loop_iter */
244 YYSYMBOL_loop = 116, /* loop */
245 YYSYMBOL_function_start_expression = 117, /* function_start_expression */
246 YYSYMBOL_function_call_expression = 118, /* function_call_expression */
247 YYSYMBOL_assign_expression = 119, /* assign_expression */
248 YYSYMBOL_binary_expression = 120, /* binary_expression */
249 YYSYMBOL_ternary_expression = 121, /* ternary_expression */
250 YYSYMBOL_unary_expression = 122, /* unary_expression */
251 YYSYMBOL_pre_crement = 123, /* pre_crement */
252 YYSYMBOL_post_crement = 124, /* post_crement */
253 YYSYMBOL_variable_reference = 125, /* variable_reference */
254 YYSYMBOL_array = 126, /* array */
255 YYSYMBOL_variable = 127, /* variable */
256 YYSYMBOL_attribute = 128, /* attribute */
257 YYSYMBOL_external = 129, /* external */
258 YYSYMBOL_local = 130, /* local */
259 YYSYMBOL_literal = 131, /* literal */
260 YYSYMBOL_type = 132, /* type */
261 YYSYMBOL_matrix_type = 133, /* matrix_type */
262 YYSYMBOL_scalar_type = 134, /* scalar_type */
263 YYSYMBOL_vector_type = 135 /* vector_type */
264 };
265 typedef enum yysymbol_kind_t yysymbol_kind_t;
266
267
268
269 /* Unqualified %code blocks. */
270
271 template<typename T, typename... Args>
272 202220 T* newNode(AXLTYPE* loc, const Args&... args) {
273
4/7
✓ Branch 1 taken 29875 times.
✓ Branch 2 taken 67344 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 29875 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 17807 times.
✗ Branch 8 not taken.
202220 T* ptr = new T(args...);
274
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 101110 times.
202220 assert(axlog);
275 202220 axlog->addNodeLocation(ptr, {loc->first_line, loc->first_column});
276 202220 return ptr;
277 }
278
279
280 #ifdef short
281 # undef short
282 #endif
283
284 /* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
285 <limits.h> and (if available) <stdint.h> are included
286 so that the code can choose integer types of a good width. */
287
288 #ifndef __PTRDIFF_MAX__
289 # include <limits.h> /* INFRINGES ON USER NAME SPACE */
290 # if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
291 # include <stdint.h> /* INFRINGES ON USER NAME SPACE */
292 # define YY_STDINT_H
293 # endif
294 #endif
295
296 /* Narrow types that promote to a signed type and that can represent a
297 signed or unsigned integer of at least N bits. In tables they can
298 save space and decrease cache pressure. Promoting to a signed type
299 helps avoid bugs in integer arithmetic. */
300
301 #ifdef __INT_LEAST8_MAX__
302 typedef __INT_LEAST8_TYPE__ yytype_int8;
303 #elif defined YY_STDINT_H
304 typedef int_least8_t yytype_int8;
305 #else
306 typedef signed char yytype_int8;
307 #endif
308
309 #ifdef __INT_LEAST16_MAX__
310 typedef __INT_LEAST16_TYPE__ yytype_int16;
311 #elif defined YY_STDINT_H
312 typedef int_least16_t yytype_int16;
313 #else
314 typedef short yytype_int16;
315 #endif
316
317 /* Work around bug in HP-UX 11.23, which defines these macros
318 incorrectly for preprocessor constants. This workaround can likely
319 be removed in 2023, as HPE has promised support for HP-UX 11.23
320 (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
321 <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>. */
322 #ifdef __hpux
323 # undef UINT_LEAST8_MAX
324 # undef UINT_LEAST16_MAX
325 # define UINT_LEAST8_MAX 255
326 # define UINT_LEAST16_MAX 65535
327 #endif
328
329 #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
330 typedef __UINT_LEAST8_TYPE__ yytype_uint8;
331 #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
332 && UINT_LEAST8_MAX <= INT_MAX)
333 typedef uint_least8_t yytype_uint8;
334 #elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
335 typedef unsigned char yytype_uint8;
336 #else
337 typedef short yytype_uint8;
338 #endif
339
340 #if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
341 typedef __UINT_LEAST16_TYPE__ yytype_uint16;
342 #elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
343 && UINT_LEAST16_MAX <= INT_MAX)
344 typedef uint_least16_t yytype_uint16;
345 #elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
346 typedef unsigned short yytype_uint16;
347 #else
348 typedef int yytype_uint16;
349 #endif
350
351 #ifndef YYPTRDIFF_T
352 # if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
353 # define YYPTRDIFF_T __PTRDIFF_TYPE__
354 # define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
355 # elif defined PTRDIFF_MAX
356 # ifndef ptrdiff_t
357 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
358 # endif
359 # define YYPTRDIFF_T ptrdiff_t
360 # define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
361 # else
362 # define YYPTRDIFF_T long
363 # define YYPTRDIFF_MAXIMUM LONG_MAX
364 # endif
365 #endif
366
367 #ifndef YYSIZE_T
368 # ifdef __SIZE_TYPE__
369 # define YYSIZE_T __SIZE_TYPE__
370 # elif defined size_t
371 # define YYSIZE_T size_t
372 # elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
373 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
374 # define YYSIZE_T size_t
375 # else
376 # define YYSIZE_T unsigned
377 # endif
378 #endif
379
380 #define YYSIZE_MAXIMUM \
381 YY_CAST (YYPTRDIFF_T, \
382 (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
383 ? YYPTRDIFF_MAXIMUM \
384 : YY_CAST (YYSIZE_T, -1)))
385
386 #define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
387
388
389 /* Stored state numbers (used for stacks). */
390 typedef yytype_int16 yy_state_t;
391
392 /* State numbers in computations. */
393 typedef int yy_state_fast_t;
394
395 #ifndef YY_
396 # if defined YYENABLE_NLS && YYENABLE_NLS
397 # if ENABLE_NLS
398 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
399 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
400 # endif
401 # endif
402 # ifndef YY_
403 # define YY_(Msgid) Msgid
404 # endif
405 #endif
406
407
408 #ifndef YY_ATTRIBUTE_PURE
409 # if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
410 # define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
411 # else
412 # define YY_ATTRIBUTE_PURE
413 # endif
414 #endif
415
416 #ifndef YY_ATTRIBUTE_UNUSED
417 # if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
418 # define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
419 # else
420 # define YY_ATTRIBUTE_UNUSED
421 # endif
422 #endif
423
424 /* Suppress unused-variable warnings by "using" E. */
425 #if ! defined lint || defined __GNUC__
426 # define YY_USE(E) ((void) (E))
427 #else
428 # define YY_USE(E) /* empty */
429 #endif
430
431 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
432 #if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
433 # if __GNUC__ * 100 + __GNUC_MINOR__ < 407
434 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
435 _Pragma ("GCC diagnostic push") \
436 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
437 # else
438 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
439 _Pragma ("GCC diagnostic push") \
440 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
441 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
442 # endif
443 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
444 _Pragma ("GCC diagnostic pop")
445 #else
446 # define YY_INITIAL_VALUE(Value) Value
447 #endif
448 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
449 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
450 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
451 #endif
452 #ifndef YY_INITIAL_VALUE
453 # define YY_INITIAL_VALUE(Value) /* Nothing. */
454 #endif
455
456 #if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
457 # define YY_IGNORE_USELESS_CAST_BEGIN \
458 _Pragma ("GCC diagnostic push") \
459 _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
460 # define YY_IGNORE_USELESS_CAST_END \
461 _Pragma ("GCC diagnostic pop")
462 #endif
463 #ifndef YY_IGNORE_USELESS_CAST_BEGIN
464 # define YY_IGNORE_USELESS_CAST_BEGIN
465 # define YY_IGNORE_USELESS_CAST_END
466 #endif
467
468
469 #define YY_ASSERT(E) ((void) (0 && (E)))
470
471 #if 1
472
473 /* The parser invokes alloca or malloc; define the necessary symbols. */
474
475 # ifdef YYSTACK_USE_ALLOCA
476 # if YYSTACK_USE_ALLOCA
477 # ifdef __GNUC__
478 # define YYSTACK_ALLOC __builtin_alloca
479 # elif defined __BUILTIN_VA_ARG_INCR
480 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
481 # elif defined _AIX
482 # define YYSTACK_ALLOC __alloca
483 # elif defined _MSC_VER
484 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
485 # define alloca _alloca
486 # else
487 # define YYSTACK_ALLOC alloca
488 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
489 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
490 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
491 # ifndef EXIT_SUCCESS
492 # define EXIT_SUCCESS 0
493 # endif
494 # endif
495 # endif
496 # endif
497 # endif
498
499 # ifdef YYSTACK_ALLOC
500 /* Pacify GCC's 'empty if-body' warning. */
501 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
502 # ifndef YYSTACK_ALLOC_MAXIMUM
503 /* The OS might guarantee only one guard page at the bottom of the stack,
504 and a page size can be as small as 4096 bytes. So we cannot safely
505 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
506 to allow for a few compiler-allocated temporary stack slots. */
507 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
508 # endif
509 # else
510 # define YYSTACK_ALLOC YYMALLOC
511 # define YYSTACK_FREE YYFREE
512 # ifndef YYSTACK_ALLOC_MAXIMUM
513 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
514 # endif
515 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
516 && ! ((defined YYMALLOC || defined malloc) \
517 && (defined YYFREE || defined free)))
518 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
519 # ifndef EXIT_SUCCESS
520 # define EXIT_SUCCESS 0
521 # endif
522 # endif
523 # ifndef YYMALLOC
524 # define YYMALLOC malloc
525 # if ! defined malloc && ! defined EXIT_SUCCESS
526 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
527 # endif
528 # endif
529 # ifndef YYFREE
530 # define YYFREE free
531 # if ! defined free && ! defined EXIT_SUCCESS
532 void free (void *); /* INFRINGES ON USER NAME SPACE */
533 # endif
534 # endif
535 # endif
536 #endif /* 1 */
537
538 #if (! defined yyoverflow \
539 && (! defined __cplusplus \
540 || (defined AXLTYPE_IS_TRIVIAL && AXLTYPE_IS_TRIVIAL \
541 && defined AXSTYPE_IS_TRIVIAL && AXSTYPE_IS_TRIVIAL)))
542
543 /* A type that is properly aligned for any stack member. */
544 union yyalloc
545 {
546 yy_state_t yyss_alloc;
547 YYSTYPE yyvs_alloc;
548 YYLTYPE yyls_alloc;
549 };
550
551 /* The size of the maximum gap between one aligned stack and the next. */
552 # define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
553
554 /* The size of an array large to enough to hold all stacks, each with
555 N elements. */
556 # define YYSTACK_BYTES(N) \
557 ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE) \
558 + YYSIZEOF (YYLTYPE)) \
559 + 2 * YYSTACK_GAP_MAXIMUM)
560
561 # define YYCOPY_NEEDED 1
562
563 /* Relocate STACK from its old location to the new one. The
564 local variables YYSIZE and YYSTACKSIZE give the old and new number of
565 elements in the stack, and YYPTR gives the new location of the
566 stack. Advance YYPTR to a properly aligned location for the next
567 stack. */
568 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
569 do \
570 { \
571 YYPTRDIFF_T yynewbytes; \
572 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
573 Stack = &yyptr->Stack_alloc; \
574 yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
575 yyptr += yynewbytes / YYSIZEOF (*yyptr); \
576 } \
577 while (0)
578
579 #endif
580
581 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
582 /* Copy COUNT objects from SRC to DST. The source and destination do
583 not overlap. */
584 # ifndef YYCOPY
585 # if defined __GNUC__ && 1 < __GNUC__
586 # define YYCOPY(Dst, Src, Count) \
587 __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
588 # else
589 # define YYCOPY(Dst, Src, Count) \
590 do \
591 { \
592 YYPTRDIFF_T yyi; \
593 for (yyi = 0; yyi < (Count); yyi++) \
594 (Dst)[yyi] = (Src)[yyi]; \
595 } \
596 while (0)
597 # endif
598 # endif
599 #endif /* !YYCOPY_NEEDED */
600
601 /* YYFINAL -- State number of the termination state. */
602 #define YYFINAL 126
603 /* YYLAST -- Last index in YYTABLE. */
604 #define YYLAST 898
605
606 /* YYNTOKENS -- Number of terminals. */
607 #define YYNTOKENS 99
608 /* YYNNTS -- Number of nonterminals. */
609 #define YYNNTS 37
610 /* YYNRULES -- Number of rules. */
611 #define YYNRULES 155
612 /* YYNSTATES -- Number of states. */
613 #define YYNSTATES 263
614
615 /* YYMAXUTOK -- Last valid token kind. */
616 #define YYMAXUTOK 353
617
618
619 /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
620 as returned by yylex, with out-of-bounds checking. */
621 #define YYTRANSLATE(YYX) \
622 (0 <= (YYX) && (YYX) <= YYMAXUTOK \
623 ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \
624 : YYSYMBOL_YYUNDEF)
625
626 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
627 as returned by yylex. */
628 static const yytype_int8 yytranslate[] =
629 {
630 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
631 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
632 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
633 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
634 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
635 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
636 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
637 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
638 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
639 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
640 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
641 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
642 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
643 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
644 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
645 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
646 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
647 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
648 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
649 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
650 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
651 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
652 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
653 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
654 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
655 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
656 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
657 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
658 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
659 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
660 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
661 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
662 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
663 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
664 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
665 95, 96, 97, 98
666 };
667
668 #if AXDEBUG
669 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
670 static const yytype_int16 yyrline[] =
671 {
672 0, 211, 211, 214, 220, 221, 222, 225, 231, 232,
673 238, 239, 240, 241, 242, 243, 244, 245, 248, 250,
674 255, 256, 262, 263, 264, 265, 266, 267, 268, 269,
675 270, 271, 272, 277, 279, 285, 290, 295, 302, 313,
676 314, 319, 320, 326, 327, 332, 333, 337, 338, 343,
677 344, 345, 350, 351, 356, 358, 359, 364, 365, 370,
678 371, 372, 377, 378, 379, 380, 381, 382, 383, 384,
679 385, 386, 387, 393, 394, 395, 396, 397, 398, 399,
680 400, 401, 402, 403, 404, 405, 406, 407, 408, 409,
681 410, 414, 415, 420, 421, 422, 423, 427, 428, 432,
682 433, 438, 439, 440, 441, 442, 443, 444, 458, 464,
683 465, 470, 471, 472, 473, 474, 475, 476, 477, 478,
684 483, 484, 485, 486, 487, 488, 495, 502, 503, 504,
685 505, 506, 507, 508, 512, 513, 514, 515, 520, 521,
686 522, 523, 528, 529, 530, 531, 532, 537, 538, 539,
687 540, 541, 542, 543, 544, 545
688 };
689 #endif
690
691 /** Accessing symbol of state STATE. */
692 #define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
693
694 #if 1
695 /* The user-facing name of the symbol whose (internal) number is
696 YYSYMBOL. No bounds checking. */
697 static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
698
699 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
700 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
701 static const char *const yytname[] =
702 {
703 "\"end of file\"", "error", "\"invalid token\"", "TRUE", "FALSE",
704 "SEMICOLON", "AT", "DOLLAR", "IF", "ELSE", "FOR", "DO", "WHILE",
705 "RETURN", "BREAK", "CONTINUE", "LCURLY", "RCURLY", "LSQUARE", "RSQUARE",
706 "STRING", "DOUBLE", "FLOAT", "INT32", "INT64", "BOOL", "VEC2I", "VEC2F",
707 "VEC2D", "VEC3I", "VEC3F", "VEC3D", "VEC4I", "VEC4F", "VEC4D", "F_AT",
708 "I_AT", "V_AT", "S_AT", "I16_AT", "MAT3F", "MAT3D", "MAT4F", "MAT4D",
709 "M3F_AT", "M4F_AT", "F_DOLLAR", "I_DOLLAR", "V_DOLLAR", "S_DOLLAR",
710 "DOT_X", "DOT_Y", "DOT_Z", "L_INT32", "L_INT64", "L_FLOAT", "L_DOUBLE",
711 "L_STRING", "IDENTIFIER", "COMMA", "QUESTION", "COLON", "EQUALS",
712 "PLUSEQUALS", "MINUSEQUALS", "MULTIPLYEQUALS", "DIVIDEEQUALS",
713 "MODULOEQUALS", "BITANDEQUALS", "BITXOREQUALS", "BITOREQUALS",
714 "SHIFTLEFTEQUALS", "SHIFTRIGHTEQUALS", "OR", "AND", "BITOR", "BITXOR",
715 "BITAND", "EQUALSEQUALS", "NOTEQUALS", "MORETHAN", "LESSTHAN",
716 "MORETHANOREQUAL", "LESSTHANOREQUAL", "SHIFTLEFT", "SHIFTRIGHT", "PLUS",
717 "MINUS", "MULTIPLY", "DIVIDE", "MODULO", "UMINUS", "NOT", "BITNOT",
718 "PLUSPLUS", "MINUSMINUS", "LPARENS", "RPARENS", "LOWER_THAN_ELSE",
719 "$accept", "tree", "body", "block", "statement", "expressions",
720 "comma_operator", "expression", "declaration", "declaration_list",
721 "declarations", "block_or_statement", "conditional_statement",
722 "loop_condition", "loop_condition_optional", "loop_init", "loop_iter",
723 "loop", "function_start_expression", "function_call_expression",
724 "assign_expression", "binary_expression", "ternary_expression",
725 "unary_expression", "pre_crement", "post_crement", "variable_reference",
726 "array", "variable", "attribute", "external", "local", "literal", "type",
727 "matrix_type", "scalar_type", "vector_type", YY_NULLPTR
728 };
729
730 static const char *
731 yysymbol_name (yysymbol_kind_t yysymbol)
732 {
733 return yytname[yysymbol];
734 }
735 #endif
736
737 #define YYPACT_NINF (-225)
738
739 #define yypact_value_is_default(Yyn) \
740 ((Yyn) == YYPACT_NINF)
741
742 #define YYTABLE_NINF (-1)
743
744 #define yytable_value_is_error(Yyn) \
745 0
746
747 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
748 STATE-NUM. */
749 static const yytype_int16 yypact[] =
750 {
751 525, -225, -225, -225, -54, -51, -85, -62, 525, -49,
752 48, 72, 83, 337, -225, -225, -225, -225, -225, -225,
753 -225, -225, -225, -225, -225, -225, -225, -225, -225, 31,
754 34, 35, 36, 40, -225, -225, -225, -225, 41, 64,
755 65, 66, 85, 86, -225, -225, -225, -225, -225, -6,
756 713, 713, 713, 713, 790, 790, 713, 145, 525, -225,
757 -225, 154, 87, 233, 102, 103, 158, -225, -225, -56,
758 -225, -225, -225, -225, -225, -225, -225, 533, -225, -8,
759 -225, -225, -225, -225, 20, -225, 70, -225, -225, -225,
760 713, 713, -225, -225, 152, 713, -225, -225, -225, -225,
761 431, -11, -225, -225, -225, -225, -225, -225, -225, -225,
762 -225, -225, -225, 242, 713, -57, 22, -225, -225, -225,
763 -225, -225, 161, -225, -225, 73, -225, -225, -225, -225,
764 713, 713, 619, 713, 713, 713, 713, 713, 713, 713,
765 713, 713, 713, 713, 713, 713, 713, 713, 713, 713,
766 713, 111, 113, -225, 713, -225, 713, 713, 713, 713,
767 713, 713, 713, 713, 713, 713, 713, -225, -225, 713,
768 -225, -225, -225, 114, 115, 112, 713, 78, -225, -225,
769 171, 81, -225, -225, 106, -225, -225, -225, 421, -11,
770 233, -225, 421, 421, 713, 327, 607, 697, 773, 787,
771 808, 68, 68, -70, -70, -70, -70, -7, -7, -57,
772 -57, -225, -225, -225, 116, 137, 421, 421, 421, 421,
773 421, 421, 421, 421, 421, 421, 421, 421, -14, -225,
774 -225, 713, 108, 525, 713, 713, 525, 421, 713, 713,
775 713, -225, 713, 421, -225, 195, -225, 201, 110, -225,
776 421, 421, 421, 141, 525, 713, -225, -225, -225, -225,
777 135, 525, -225
778 };
779
780 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
781 Performed when YYTABLE does not specify something else to do. Zero
782 means the default is an error. */
783 static const yytype_uint8 yydefact[] =
784 {
785 2, 132, 133, 17, 0, 0, 0, 0, 0, 0,
786 0, 0, 0, 0, 137, 146, 145, 143, 144, 142,
787 147, 148, 149, 150, 151, 152, 153, 154, 155, 0,
788 0, 0, 0, 0, 138, 139, 140, 141, 0, 0,
789 0, 0, 0, 0, 127, 128, 129, 130, 131, 126,
790 0, 0, 0, 0, 0, 0, 0, 0, 3, 7,
791 6, 0, 19, 18, 39, 40, 0, 12, 13, 0,
792 26, 25, 22, 24, 23, 102, 29, 31, 30, 101,
793 109, 28, 110, 27, 0, 136, 134, 135, 119, 125,
794 0, 51, 41, 42, 0, 0, 14, 15, 16, 9,
795 0, 19, 114, 113, 115, 116, 112, 117, 118, 122,
796 121, 123, 124, 0, 0, 93, 0, 94, 96, 95,
797 126, 97, 0, 134, 98, 0, 1, 5, 4, 10,
798 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
799 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
800 0, 0, 0, 11, 0, 60, 0, 0, 0, 0,
801 0, 0, 0, 0, 0, 0, 0, 99, 100, 0,
802 103, 104, 105, 0, 0, 33, 0, 0, 49, 50,
803 0, 0, 45, 46, 0, 8, 108, 59, 57, 0,
804 0, 32, 21, 20, 0, 0, 84, 83, 81, 82,
805 80, 85, 86, 87, 88, 89, 90, 78, 79, 73,
806 74, 75, 76, 77, 36, 38, 58, 62, 63, 64,
807 65, 66, 67, 68, 69, 70, 71, 72, 0, 111,
808 120, 0, 0, 0, 48, 0, 0, 92, 0, 0,
809 0, 106, 0, 34, 61, 43, 47, 0, 0, 56,
810 91, 35, 37, 0, 0, 53, 55, 107, 44, 52,
811 0, 0, 54
812 };
813
814 /* YYPGOTO[NTERM-NUM]. */
815 static const yytype_int16 yypgoto[] =
816 {
817 -225, -225, 199, 38, 39, -55, 12, -29, -93, -225,
818 117, -224, -225, -185, -225, -225, -225, -225, -225, -225,
819 -225, -225, -225, -225, -225, -225, 2, -225, -225, -225,
820 -225, -225, -225, 0, -225, 32, -225
821 };
822
823 /* YYDEFGOTO[NTERM-NUM]. */
824 static const yytype_int16 yydefgoto[] =
825 {
826 0, 57, 58, 92, 93, 61, 62, 63, 64, 65,
827 66, 94, 67, 184, 247, 180, 260, 68, 69, 70,
828 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
829 81, 82, 83, 116, 85, 86, 87
830 };
831
832 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
833 positive, shift that token. If negative, reduce the rule whose
834 number is the opposite. If YYTABLE_NINF, syntax error. */
835 static const yytype_int16 yytable[] =
836 {
837 84, 125, 183, 154, 88, 241, 186, 89, 84, 245,
838 169, 90, 249, 84, 144, 145, 146, 147, 148, 149,
839 150, 115, 117, 118, 119, 101, 173, 174, 173, 174,
840 258, 148, 149, 150, 91, 177, 178, 262, 59, 60,
841 182, 155, 170, 171, 172, 242, 132, 95, 130, 246,
842 248, 59, 60, 96, 122, 122, 121, 124, 84, 133,
843 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
844 144, 145, 146, 147, 148, 149, 150, 97, 175, 146,
845 147, 148, 149, 150, 188, 190, 123, 123, 98, 102,
846 113, 84, 103, 104, 105, 84, 127, 128, 106, 107,
847 84, 192, 193, 195, 196, 197, 198, 199, 200, 201,
848 202, 203, 204, 205, 206, 207, 208, 209, 210, 211,
849 212, 213, 108, 109, 110, 216, 189, 217, 218, 219,
850 220, 221, 222, 223, 224, 225, 226, 227, 127, 128,
851 228, 183, 183, 111, 112, 126, 130, 232, 140, 141,
852 142, 143, 144, 145, 146, 147, 148, 149, 150, 129,
853 257, 151, 152, 153, 181, 237, 176, 173, 132, 214,
854 191, 215, 229, 230, 231, 233, 234, 235, 239, 182,
855 182, 133, 134, 135, 136, 137, 138, 139, 140, 141,
856 142, 143, 144, 145, 146, 147, 148, 149, 150, 240,
857 259, 132, 243, 236, 254, 244, 255, 256, 179, 250,
858 251, 252, 100, 253, 133, 134, 135, 136, 137, 138,
859 139, 140, 141, 142, 143, 144, 145, 146, 147, 148,
860 149, 150, 261, 84, 84, 84, 84, 0, 0, 0,
861 0, 0, 0, 0, 0, 1, 2, 0, 4, 5,
862 0, 0, 0, 0, 84, 0, 0, 0, 114, 0,
863 0, 84, 14, 15, 16, 17, 18, 19, 20, 21,
864 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
865 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
866 42, 43, 131, 132, 0, 44, 45, 46, 47, 48,
867 49, 0, 0, 0, 0, 0, 133, 134, 135, 136,
868 137, 138, 139, 140, 141, 142, 143, 144, 145, 146,
869 147, 148, 149, 150, 0, 0, 0, 0, 50, 51,
870 0, 0, 0, 0, 52, 53, 54, 55, 56, 187,
871 1, 2, 3, 4, 5, 6, 0, 7, 8, 9,
872 10, 11, 12, 13, 99, 0, 0, 14, 15, 16,
873 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
874 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
875 37, 38, 39, 40, 41, 42, 43, 132, 238, 0,
876 44, 45, 46, 47, 48, 49, 0, 0, 0, 0,
877 133, 134, 135, 136, 137, 138, 139, 140, 141, 142,
878 143, 144, 145, 146, 147, 148, 149, 150, 0, 0,
879 0, 0, 0, 50, 51, 0, 0, 0, 0, 52,
880 53, 54, 55, 56, 1, 2, 3, 4, 5, 6,
881 0, 7, 8, 9, 10, 11, 12, 13, 185, 0,
882 0, 14, 15, 16, 17, 18, 19, 20, 21, 22,
883 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
884 33, 34, 35, 36, 37, 38, 39, 40, 41, 42,
885 43, 132, 0, 0, 44, 45, 46, 47, 48, 49,
886 0, 0, 0, 0, 133, 134, 135, 136, 137, 138,
887 139, 140, 141, 142, 143, 144, 145, 146, 147, 148,
888 149, 150, 0, 0, 0, 0, 0, 50, 51, 0,
889 0, 0, 0, 52, 53, 54, 55, 56, 1, 2,
890 3, 4, 5, 6, 0, 7, 8, 9, 10, 11,
891 12, 13, 0, 0, 0, 14, 15, 16, 17, 18,
892 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
893 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
894 39, 40, 41, 42, 43, 0, 0, 0, 44, 45,
895 46, 47, 48, 49, 0, 0, 0, 0, 0, 0,
896 0, 0, 0, 0, 0, 156, 157, 158, 159, 160,
897 161, 162, 163, 164, 165, 166, 0, 0, 0, 0,
898 0, 50, 51, 0, 0, 0, 0, 52, 53, 54,
899 55, 56, 1, 2, 0, 4, 5, 167, 168, 0,
900 0, 0, 0, 0, 0, 114, 0, 0, 0, 14,
901 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
902 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
903 35, 36, 37, 38, 39, 40, 41, 42, 43, 0,
904 0, 0, 44, 45, 46, 47, 48, 49, 0, 0,
905 194, 134, 135, 136, 137, 138, 139, 140, 141, 142,
906 143, 144, 145, 146, 147, 148, 149, 150, 0, 0,
907 0, 0, 0, 0, 0, 50, 51, 0, 0, 0,
908 0, 52, 53, 54, 55, 56, 1, 2, 0, 4,
909 5, 0, 0, 0, 0, 0, 0, 0, 0, 114,
910 0, 0, 0, 14, 15, 16, 17, 18, 19, 20,
911 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
912 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
913 41, 42, 43, 0, 0, 0, 44, 45, 46, 47,
914 48, 49, 135, 136, 137, 138, 139, 140, 141, 142,
915 143, 144, 145, 146, 147, 148, 149, 150, 0, 0,
916 0, 0, 0, 0, 0, 0, 4, 0, 0, 50,
917 51, 0, 0, 0, 0, 52, 53, 54, 55, 56,
918 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
919 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
920 34, 35, 36, 37, 38, 39, 0, 0, 0, 0,
921 0, 0, 0, 0, 0, 0, 0, 0, 120, 136,
922 137, 138, 139, 140, 141, 142, 143, 144, 145, 146,
923 147, 148, 149, 150, 137, 138, 139, 140, 141, 142,
924 143, 144, 145, 146, 147, 148, 149, 150, 0, 0,
925 0, 0, 0, 0, 54, 55, 138, 139, 140, 141,
926 142, 143, 144, 145, 146, 147, 148, 149, 150
927 };
928
929 static const yytype_int16 yycheck[] =
930 {
931 0, 56, 95, 59, 58, 19, 17, 58, 8, 233,
932 18, 96, 236, 13, 84, 85, 86, 87, 88, 89,
933 90, 50, 51, 52, 53, 13, 6, 7, 6, 7,
934 254, 88, 89, 90, 96, 90, 91, 261, 0, 0,
935 95, 97, 50, 51, 52, 59, 60, 96, 59, 234,
936 235, 13, 13, 5, 54, 55, 54, 55, 58, 73,
937 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
938 84, 85, 86, 87, 88, 89, 90, 5, 58, 86,
939 87, 88, 89, 90, 113, 114, 54, 55, 5, 58,
940 96, 91, 58, 58, 58, 95, 58, 58, 58, 58,
941 100, 130, 131, 132, 133, 134, 135, 136, 137, 138,
942 139, 140, 141, 142, 143, 144, 145, 146, 147, 148,
943 149, 150, 58, 58, 58, 154, 114, 156, 157, 158,
944 159, 160, 161, 162, 163, 164, 165, 166, 100, 100,
945 169, 234, 235, 58, 58, 0, 59, 176, 80, 81,
946 82, 83, 84, 85, 86, 87, 88, 89, 90, 5,
947 19, 59, 59, 5, 12, 194, 96, 6, 60, 58,
948 97, 58, 58, 58, 62, 97, 5, 96, 62, 234,
949 235, 73, 74, 75, 76, 77, 78, 79, 80, 81,
950 82, 83, 84, 85, 86, 87, 88, 89, 90, 62,
951 255, 60, 231, 97, 9, 97, 5, 97, 91, 238,
952 239, 240, 13, 242, 73, 74, 75, 76, 77, 78,
953 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
954 89, 90, 97, 233, 234, 235, 236, -1, -1, -1,
955 -1, -1, -1, -1, -1, 3, 4, -1, 6, 7,
956 -1, -1, -1, -1, 254, -1, -1, -1, 16, -1,
957 -1, 261, 20, 21, 22, 23, 24, 25, 26, 27,
958 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
959 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
960 48, 49, 59, 60, -1, 53, 54, 55, 56, 57,
961 58, -1, -1, -1, -1, -1, 73, 74, 75, 76,
962 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
963 87, 88, 89, 90, -1, -1, -1, -1, 86, 87,
964 -1, -1, -1, -1, 92, 93, 94, 95, 96, 97,
965 3, 4, 5, 6, 7, 8, -1, 10, 11, 12,
966 13, 14, 15, 16, 17, -1, -1, 20, 21, 22,
967 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
968 33, 34, 35, 36, 37, 38, 39, 40, 41, 42,
969 43, 44, 45, 46, 47, 48, 49, 60, 61, -1,
970 53, 54, 55, 56, 57, 58, -1, -1, -1, -1,
971 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
972 83, 84, 85, 86, 87, 88, 89, 90, -1, -1,
973 -1, -1, -1, 86, 87, -1, -1, -1, -1, 92,
974 93, 94, 95, 96, 3, 4, 5, 6, 7, 8,
975 -1, 10, 11, 12, 13, 14, 15, 16, 17, -1,
976 -1, 20, 21, 22, 23, 24, 25, 26, 27, 28,
977 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
978 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
979 49, 60, -1, -1, 53, 54, 55, 56, 57, 58,
980 -1, -1, -1, -1, 73, 74, 75, 76, 77, 78,
981 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
982 89, 90, -1, -1, -1, -1, -1, 86, 87, -1,
983 -1, -1, -1, 92, 93, 94, 95, 96, 3, 4,
984 5, 6, 7, 8, -1, 10, 11, 12, 13, 14,
985 15, 16, -1, -1, -1, 20, 21, 22, 23, 24,
986 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
987 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
988 45, 46, 47, 48, 49, -1, -1, -1, 53, 54,
989 55, 56, 57, 58, -1, -1, -1, -1, -1, -1,
990 -1, -1, -1, -1, -1, 62, 63, 64, 65, 66,
991 67, 68, 69, 70, 71, 72, -1, -1, -1, -1,
992 -1, 86, 87, -1, -1, -1, -1, 92, 93, 94,
993 95, 96, 3, 4, -1, 6, 7, 94, 95, -1,
994 -1, -1, -1, -1, -1, 16, -1, -1, -1, 20,
995 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
996 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
997 41, 42, 43, 44, 45, 46, 47, 48, 49, -1,
998 -1, -1, 53, 54, 55, 56, 57, 58, -1, -1,
999 61, 74, 75, 76, 77, 78, 79, 80, 81, 82,
1000 83, 84, 85, 86, 87, 88, 89, 90, -1, -1,
1001 -1, -1, -1, -1, -1, 86, 87, -1, -1, -1,
1002 -1, 92, 93, 94, 95, 96, 3, 4, -1, 6,
1003 7, -1, -1, -1, -1, -1, -1, -1, -1, 16,
1004 -1, -1, -1, 20, 21, 22, 23, 24, 25, 26,
1005 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
1006 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
1007 47, 48, 49, -1, -1, -1, 53, 54, 55, 56,
1008 57, 58, 75, 76, 77, 78, 79, 80, 81, 82,
1009 83, 84, 85, 86, 87, 88, 89, 90, -1, -1,
1010 -1, -1, -1, -1, -1, -1, 6, -1, -1, 86,
1011 87, -1, -1, -1, -1, 92, 93, 94, 95, 96,
1012 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
1013 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
1014 40, 41, 42, 43, 44, 45, -1, -1, -1, -1,
1015 -1, -1, -1, -1, -1, -1, -1, -1, 58, 76,
1016 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
1017 87, 88, 89, 90, 77, 78, 79, 80, 81, 82,
1018 83, 84, 85, 86, 87, 88, 89, 90, -1, -1,
1019 -1, -1, -1, -1, 94, 95, 78, 79, 80, 81,
1020 82, 83, 84, 85, 86, 87, 88, 89, 90
1021 };
1022
1023 /* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
1024 state STATE-NUM. */
1025 static const yytype_uint8 yystos[] =
1026 {
1027 0, 3, 4, 5, 6, 7, 8, 10, 11, 12,
1028 13, 14, 15, 16, 20, 21, 22, 23, 24, 25,
1029 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
1030 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
1031 46, 47, 48, 49, 53, 54, 55, 56, 57, 58,
1032 86, 87, 92, 93, 94, 95, 96, 100, 101, 102,
1033 103, 104, 105, 106, 107, 108, 109, 111, 116, 117,
1034 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
1035 128, 129, 130, 131, 132, 133, 134, 135, 58, 58,
1036 96, 96, 102, 103, 110, 96, 5, 5, 5, 17,
1037 101, 105, 58, 58, 58, 58, 58, 58, 58, 58,
1038 58, 58, 58, 96, 16, 106, 132, 106, 106, 106,
1039 58, 125, 132, 134, 125, 104, 0, 102, 103, 5,
1040 59, 59, 60, 73, 74, 75, 76, 77, 78, 79,
1041 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
1042 90, 59, 59, 5, 59, 97, 62, 63, 64, 65,
1043 66, 67, 68, 69, 70, 71, 72, 94, 95, 18,
1044 50, 51, 52, 6, 7, 58, 96, 104, 104, 109,
1045 114, 12, 104, 107, 112, 17, 17, 97, 106, 105,
1046 106, 97, 106, 106, 61, 106, 106, 106, 106, 106,
1047 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,
1048 106, 106, 106, 106, 58, 58, 106, 106, 106, 106,
1049 106, 106, 106, 106, 106, 106, 106, 106, 106, 58,
1050 58, 62, 106, 97, 5, 96, 97, 106, 61, 62,
1051 62, 19, 59, 106, 97, 110, 112, 113, 112, 110,
1052 106, 106, 106, 106, 9, 5, 97, 19, 110, 104,
1053 115, 97, 110
1054 };
1055
1056 /* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */
1057 static const yytype_uint8 yyr1[] =
1058 {
1059 0, 99, 100, 100, 101, 101, 101, 101, 102, 102,
1060 103, 103, 103, 103, 103, 103, 103, 103, 104, 104,
1061 105, 105, 106, 106, 106, 106, 106, 106, 106, 106,
1062 106, 106, 106, 107, 107, 108, 108, 108, 108, 109,
1063 109, 110, 110, 111, 111, 112, 112, 113, 113, 114,
1064 114, 114, 115, 115, 116, 116, 116, 117, 117, 118,
1065 118, 118, 119, 119, 119, 119, 119, 119, 119, 119,
1066 119, 119, 119, 120, 120, 120, 120, 120, 120, 120,
1067 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
1068 120, 121, 121, 122, 122, 122, 122, 123, 123, 124,
1069 124, 125, 125, 125, 125, 125, 125, 125, 126, 127,
1070 127, 128, 128, 128, 128, 128, 128, 128, 128, 128,
1071 129, 129, 129, 129, 129, 129, 130, 131, 131, 131,
1072 131, 131, 131, 131, 132, 132, 132, 132, 133, 133,
1073 133, 133, 134, 134, 134, 134, 134, 135, 135, 135,
1074 135, 135, 135, 135, 135, 135
1075 };
1076
1077 /* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */
1078 static const yytype_int8 yyr2[] =
1079 {
1080 0, 2, 0, 1, 2, 2, 1, 1, 3, 2,
1081 2, 2, 1, 1, 2, 2, 2, 1, 1, 1,
1082 3, 3, 1, 1, 1, 1, 1, 1, 1, 1,
1083 1, 1, 3, 2, 4, 5, 3, 5, 3, 1,
1084 1, 1, 1, 5, 7, 1, 1, 1, 0, 1,
1085 1, 0, 1, 0, 9, 6, 5, 3, 3, 3,
1086 2, 4, 3, 3, 3, 3, 3, 3, 3, 3,
1087 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
1088 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
1089 3, 5, 4, 2, 2, 2, 2, 2, 2, 2,
1090 2, 1, 1, 2, 2, 2, 4, 6, 3, 1,
1091 1, 3, 2, 2, 2, 2, 2, 2, 2, 2,
1092 3, 2, 2, 2, 2, 2, 1, 1, 1, 1,
1093 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1094 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1095 1, 1, 1, 1, 1, 1
1096 };
1097
1098
1099 enum { YYENOMEM = -2 };
1100
1101 #define yyerrok (yyerrstatus = 0)
1102 #define yyclearin (yychar = AXEMPTY)
1103
1104 #define YYACCEPT goto yyacceptlab
1105 #define YYABORT goto yyabortlab
1106 #define YYERROR goto yyerrorlab
1107 #define YYNOMEM goto yyexhaustedlab
1108
1109
1110 #define YYRECOVERING() (!!yyerrstatus)
1111
1112 #define YYBACKUP(Token, Value) \
1113 do \
1114 if (yychar == AXEMPTY) \
1115 { \
1116 yychar = (Token); \
1117 yylval = (Value); \
1118 YYPOPSTACK (yylen); \
1119 yystate = *yyssp; \
1120 goto yybackup; \
1121 } \
1122 else \
1123 { \
1124 yyerror (tree, YY_("syntax error: cannot back up")); \
1125 YYERROR; \
1126 } \
1127 while (0)
1128
1129 /* Backward compatibility with an undocumented macro.
1130 Use AXerror or AXUNDEF. */
1131 #define YYERRCODE AXUNDEF
1132
1133 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
1134 If N is 0, then set CURRENT to the empty location which ends
1135 the previous symbol: RHS[0] (always defined). */
1136
1137 #ifndef YYLLOC_DEFAULT
1138 # define YYLLOC_DEFAULT(Current, Rhs, N) \
1139 do \
1140 if (N) \
1141 { \
1142 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
1143 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
1144 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
1145 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
1146 } \
1147 else \
1148 { \
1149 (Current).first_line = (Current).last_line = \
1150 YYRHSLOC (Rhs, 0).last_line; \
1151 (Current).first_column = (Current).last_column = \
1152 YYRHSLOC (Rhs, 0).last_column; \
1153 } \
1154 while (0)
1155 #endif
1156
1157 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
1158
1159
1160 /* Enable debugging if requested. */
1161 #if AXDEBUG
1162
1163 # ifndef YYFPRINTF
1164 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1165 # define YYFPRINTF fprintf
1166 # endif
1167
1168 # define YYDPRINTF(Args) \
1169 do { \
1170 if (yydebug) \
1171 YYFPRINTF Args; \
1172 } while (0)
1173
1174
1175 /* YYLOCATION_PRINT -- Print the location on the stream.
1176 This macro was not mandated originally: define only if we know
1177 we won't break user code: when these are the locations we know. */
1178
1179 # ifndef YYLOCATION_PRINT
1180
1181 # if defined YY_LOCATION_PRINT
1182
1183 /* Temporary convenience wrapper in case some people defined the
1184 undocumented and private YY_LOCATION_PRINT macros. */
1185 # define YYLOCATION_PRINT(File, Loc) YY_LOCATION_PRINT(File, *(Loc))
1186
1187 # elif defined AXLTYPE_IS_TRIVIAL && AXLTYPE_IS_TRIVIAL
1188
1189 /* Print *YYLOCP on YYO. Private, do not rely on its existence. */
1190
1191 YY_ATTRIBUTE_UNUSED
1192 static int
1193 yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp)
1194 {
1195 int res = 0;
1196 int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
1197 if (0 <= yylocp->first_line)
1198 {
1199 res += YYFPRINTF (yyo, "%d", yylocp->first_line);
1200 if (0 <= yylocp->first_column)
1201 res += YYFPRINTF (yyo, ".%d", yylocp->first_column);
1202 }
1203 if (0 <= yylocp->last_line)
1204 {
1205 if (yylocp->first_line < yylocp->last_line)
1206 {
1207 res += YYFPRINTF (yyo, "-%d", yylocp->last_line);
1208 if (0 <= end_col)
1209 res += YYFPRINTF (yyo, ".%d", end_col);
1210 }
1211 else if (0 <= end_col && yylocp->first_column < end_col)
1212 res += YYFPRINTF (yyo, "-%d", end_col);
1213 }
1214 return res;
1215 }
1216
1217 # define YYLOCATION_PRINT yy_location_print_
1218
1219 /* Temporary convenience wrapper in case some people defined the
1220 undocumented and private YY_LOCATION_PRINT macros. */
1221 # define YY_LOCATION_PRINT(File, Loc) YYLOCATION_PRINT(File, &(Loc))
1222
1223 # else
1224
1225 # define YYLOCATION_PRINT(File, Loc) ((void) 0)
1226 /* Temporary convenience wrapper in case some people defined the
1227 undocumented and private YY_LOCATION_PRINT macros. */
1228 # define YY_LOCATION_PRINT YYLOCATION_PRINT
1229
1230 # endif
1231 # endif /* !defined YYLOCATION_PRINT */
1232
1233
1234 # define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \
1235 do { \
1236 if (yydebug) \
1237 { \
1238 YYFPRINTF (stderr, "%s ", Title); \
1239 yy_symbol_print (stderr, \
1240 Kind, Value, Location, tree); \
1241 YYFPRINTF (stderr, "\n"); \
1242 } \
1243 } while (0)
1244
1245
1246 /*-----------------------------------.
1247 | Print this symbol's value on YYO. |
1248 `-----------------------------------*/
1249
1250 static void
1251 yy_symbol_value_print (FILE *yyo,
1252 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, openvdb::ax::ast::Tree** tree)
1253 {
1254 FILE *yyoutput = yyo;
1255 YY_USE (yyoutput);
1256 YY_USE (yylocationp);
1257 YY_USE (tree);
1258 if (!yyvaluep)
1259 return;
1260 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1261 YY_USE (yykind);
1262 YY_IGNORE_MAYBE_UNINITIALIZED_END
1263 }
1264
1265
1266 /*---------------------------.
1267 | Print this symbol on YYO. |
1268 `---------------------------*/
1269
1270 static void
1271 yy_symbol_print (FILE *yyo,
1272 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, openvdb::ax::ast::Tree** tree)
1273 {
1274 YYFPRINTF (yyo, "%s %s (",
1275 yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
1276
1277 YYLOCATION_PRINT (yyo, yylocationp);
1278 YYFPRINTF (yyo, ": ");
1279 yy_symbol_value_print (yyo, yykind, yyvaluep, yylocationp, tree);
1280 YYFPRINTF (yyo, ")");
1281 }
1282
1283 /*------------------------------------------------------------------.
1284 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1285 | TOP (included). |
1286 `------------------------------------------------------------------*/
1287
1288 static void
1289 yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
1290 {
1291 YYFPRINTF (stderr, "Stack now");
1292 for (; yybottom <= yytop; yybottom++)
1293 {
1294 int yybot = *yybottom;
1295 YYFPRINTF (stderr, " %d", yybot);
1296 }
1297 YYFPRINTF (stderr, "\n");
1298 }
1299
1300 # define YY_STACK_PRINT(Bottom, Top) \
1301 do { \
1302 if (yydebug) \
1303 yy_stack_print ((Bottom), (Top)); \
1304 } while (0)
1305
1306
1307 /*------------------------------------------------.
1308 | Report that the YYRULE is going to be reduced. |
1309 `------------------------------------------------*/
1310
1311 static void
1312 yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp,
1313 int yyrule, openvdb::ax::ast::Tree** tree)
1314 {
1315 int yylno = yyrline[yyrule];
1316 int yynrhs = yyr2[yyrule];
1317 int yyi;
1318 YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
1319 yyrule - 1, yylno);
1320 /* The symbols being reduced. */
1321 for (yyi = 0; yyi < yynrhs; yyi++)
1322 {
1323 YYFPRINTF (stderr, " $%d = ", yyi + 1);
1324 yy_symbol_print (stderr,
1325 YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
1326 &yyvsp[(yyi + 1) - (yynrhs)],
1327 &(yylsp[(yyi + 1) - (yynrhs)]), tree);
1328 YYFPRINTF (stderr, "\n");
1329 }
1330 }
1331
1332 # define YY_REDUCE_PRINT(Rule) \
1333 do { \
1334 if (yydebug) \
1335 yy_reduce_print (yyssp, yyvsp, yylsp, Rule, tree); \
1336 } while (0)
1337
1338 /* Nonzero means print parse trace. It is left uninitialized so that
1339 multiple parsers can coexist. */
1340 int yydebug;
1341 #else /* !AXDEBUG */
1342 # define YYDPRINTF(Args) ((void) 0)
1343 # define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
1344 # define YY_STACK_PRINT(Bottom, Top)
1345 # define YY_REDUCE_PRINT(Rule)
1346 #endif /* !AXDEBUG */
1347
1348
1349 /* YYINITDEPTH -- initial size of the parser's stacks. */
1350 #ifndef YYINITDEPTH
1351 # define YYINITDEPTH 200
1352 #endif
1353
1354 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1355 if the built-in stack extension method is used).
1356
1357 Do not make this value too large; the results are undefined if
1358 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1359 evaluated with infinite-precision integer arithmetic. */
1360
1361 #ifndef YYMAXDEPTH
1362 # define YYMAXDEPTH 10000
1363 #endif
1364
1365
1366 /* Context of a parse error. */
1367 typedef struct
1368 {
1369 yy_state_t *yyssp;
1370 yysymbol_kind_t yytoken;
1371 YYLTYPE *yylloc;
1372 } yypcontext_t;
1373
1374 /* Put in YYARG at most YYARGN of the expected tokens given the
1375 current YYCTX, and return the number of tokens stored in YYARG. If
1376 YYARG is null, return the number of expected tokens (guaranteed to
1377 be less than YYNTOKENS). Return YYENOMEM on memory exhaustion.
1378 Return 0 if there are more than YYARGN expected tokens, yet fill
1379 YYARG up to YYARGN. */
1380 static int
1381 505 yypcontext_expected_tokens (const yypcontext_t *yyctx,
1382 yysymbol_kind_t yyarg[], int yyargn)
1383 {
1384 /* Actual size of YYARG. */
1385 int yycount = 0;
1386 505 int yyn = yypact[+*yyctx->yyssp];
1387
1/2
✓ Branch 0 taken 505 times.
✗ Branch 1 not taken.
505 if (!yypact_value_is_default (yyn))
1388 {
1389 /* Start YYX at -YYN if negative to avoid negative indexes in
1390 YYCHECK. In other words, skip the first -YYN actions for
1391 this state because they are default actions. */
1392
2/2
✓ Branch 0 taken 13 times.
✓ Branch 1 taken 492 times.
505 int yyxbegin = yyn < 0 ? -yyn : 0;
1393 /* Stay within bounds of both yycheck and yytname. */
1394 505 int yychecklim = YYLAST - yyn + 1;
1395 505 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1396 int yyx;
1397
2/2
✓ Branch 0 taken 38225 times.
✓ Branch 1 taken 366 times.
38591 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1398
3/4
✓ Branch 0 taken 1109 times.
✓ Branch 1 taken 37116 times.
✓ Branch 2 taken 1109 times.
✗ Branch 3 not taken.
38225 if (yycheck[yyx + yyn] == yyx && yyx != YYSYMBOL_YYerror
1399 && !yytable_value_is_error (yytable[yyx + yyn]))
1400 {
1401
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 1109 times.
1109 if (!yyarg)
1402 ++yycount;
1403
2/2
✓ Branch 0 taken 970 times.
✓ Branch 1 taken 139 times.
1109 else if (yycount == yyargn)
1404 return 0;
1405 else
1406 970 yyarg[yycount++] = YY_CAST (yysymbol_kind_t, yyx);
1407 }
1408 }
1409
1/4
✗ Branch 0 not taken.
✓ Branch 1 taken 366 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
366 if (yyarg && yycount == 0 && 0 < yyargn)
1410 yyarg[0] = YYSYMBOL_YYEMPTY;
1411 return yycount;
1412 }
1413
1414
1415
1416
1417 #ifndef yystrlen
1418 # if defined __GLIBC__ && defined _STRING_H
1419 # define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S)))
1420 # else
1421 /* Return the length of YYSTR. */
1422 static YYPTRDIFF_T
1423 yystrlen (const char *yystr)
1424 {
1425 YYPTRDIFF_T yylen;
1426 for (yylen = 0; yystr[yylen]; yylen++)
1427 continue;
1428 return yylen;
1429 }
1430 # endif
1431 #endif
1432
1433 #ifndef yystpcpy
1434 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1435 # define yystpcpy stpcpy
1436 # else
1437 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1438 YYDEST. */
1439 static char *
1440 yystpcpy (char *yydest, const char *yysrc)
1441 {
1442 char *yyd = yydest;
1443 const char *yys = yysrc;
1444
1445 while ((*yyd++ = *yys++) != '\0')
1446 continue;
1447
1448 return yyd - 1;
1449 }
1450 # endif
1451 #endif
1452
1453 #ifndef yytnamerr
1454 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1455 quotes and backslashes, so that it's suitable for yyerror. The
1456 heuristic is that double-quoting is unnecessary unless the string
1457 contains an apostrophe, a comma, or backslash (other than
1458 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1459 null, do not copy; instead, return the length of what the result
1460 would have been. */
1461 static YYPTRDIFF_T
1462 1838 yytnamerr (char *yyres, const char *yystr)
1463 {
1464
2/2
✓ Branch 0 taken 236 times.
✓ Branch 1 taken 1602 times.
1838 if (*yystr == '"')
1465 {
1466 YYPTRDIFF_T yyn = 0;
1467 char const *yyp = yystr;
1468 for (;;)
1469
2/4
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✓ Branch 2 taken 2596 times.
✓ Branch 3 taken 236 times.
2832 switch (*++yyp)
1470 {
1471 case '\'':
1472 case ',':
1473 goto do_not_strip_quotes;
1474
1475 case '\\':
1476 if (*++yyp != '\\')
1477 goto do_not_strip_quotes;
1478 else
1479 goto append;
1480
1481 2596 append:
1482 default:
1483
2/2
✓ Branch 0 taken 1298 times.
✓ Branch 1 taken 1298 times.
2596 if (yyres)
1484 1298 yyres[yyn] = *yyp;
1485 2596 yyn++;
1486 break;
1487
1488 236 case '"':
1489
2/2
✓ Branch 0 taken 118 times.
✓ Branch 1 taken 118 times.
236 if (yyres)
1490 118 yyres[yyn] = '\0';
1491 236 return yyn;
1492 }
1493 1602 do_not_strip_quotes: ;
1494 }
1495
1496
2/2
✓ Branch 0 taken 801 times.
✓ Branch 1 taken 801 times.
1602 if (yyres)
1497 801 return yystpcpy (yyres, yystr) - yyres;
1498 else
1499 801 return yystrlen (yystr);
1500 }
1501 #endif
1502
1503
1504 static int
1505 505 yy_syntax_error_arguments (const yypcontext_t *yyctx,
1506 yysymbol_kind_t yyarg[], int yyargn)
1507 {
1508 /* Actual size of YYARG. */
1509 int yycount = 0;
1510 /* There are many possibilities here to consider:
1511 - If this state is a consistent state with a default action, then
1512 the only way this function was invoked is if the default action
1513 is an error action. In that case, don't check for expected
1514 tokens because there are none.
1515 - The only way there can be no lookahead present (in yychar) is if
1516 this state is a consistent state with a default action. Thus,
1517 detecting the absence of a lookahead is sufficient to determine
1518 that there is no unexpected or expected token to report. In that
1519 case, just report a simple "syntax error".
1520 - Don't assume there isn't a lookahead just because this state is a
1521 consistent state with a default action. There might have been a
1522 previous inconsistent state, consistent state with a non-default
1523 action, or user semantic action that manipulated yychar.
1524 - Of course, the expected token list depends on states to have
1525 correct lookahead information, and it depends on the parser not
1526 to perform extra reductions after fetching a lookahead from the
1527 scanner and before detecting a syntax error. Thus, state merging
1528 (from LALR or IELR) and default reductions corrupt the expected
1529 token list. However, the list is correct for canonical LR with
1530 one exception: it will still contain any token that will not be
1531 accepted due to an error action in a later state.
1532 */
1533
1/2
✓ Branch 0 taken 505 times.
✗ Branch 1 not taken.
505 if (yyctx->yytoken != YYSYMBOL_YYEMPTY)
1534 {
1535 int yyn;
1536
1/2
✓ Branch 0 taken 505 times.
✗ Branch 1 not taken.
505 if (yyarg)
1537 505 yyarg[yycount] = yyctx->yytoken;
1538 ++yycount;
1539
1/2
✓ Branch 0 taken 505 times.
✗ Branch 1 not taken.
505 yyn = yypcontext_expected_tokens (yyctx,
1540 yyarg ? yyarg + 1 : yyarg, yyargn - 1);
1541
1/2
✓ Branch 0 taken 505 times.
✗ Branch 1 not taken.
505 if (yyn == YYENOMEM)
1542 return YYENOMEM;
1543 else
1544 505 yycount += yyn;
1545 }
1546 return yycount;
1547 }
1548
1549 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1550 about the unexpected token YYTOKEN for the state stack whose top is
1551 YYSSP.
1552
1553 Return 0 if *YYMSG was successfully written. Return -1 if *YYMSG is
1554 not large enough to hold the message. In that case, also set
1555 *YYMSG_ALLOC to the required number of bytes. Return YYENOMEM if the
1556 required number of bytes is too large to store. */
1557 static int
1558 505 yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg,
1559 const yypcontext_t *yyctx)
1560 {
1561 enum { YYARGS_MAX = 5 };
1562 /* Internationalized format string. */
1563 const char *yyformat = YY_NULLPTR;
1564 /* Arguments of yyformat: reported tokens (one for the "unexpected",
1565 one per "expected"). */
1566 yysymbol_kind_t yyarg[YYARGS_MAX];
1567 /* Cumulated lengths of YYARG. */
1568 YYPTRDIFF_T yysize = 0;
1569
1570 /* Actual size of YYARG. */
1571 505 int yycount = yy_syntax_error_arguments (yyctx, yyarg, YYARGS_MAX);
1572
1/2
✓ Branch 0 taken 505 times.
✗ Branch 1 not taken.
505 if (yycount == YYENOMEM)
1573 return YYENOMEM;
1574
1575
4/6
✓ Branch 0 taken 139 times.
✓ Branch 1 taken 339 times.
✓ Branch 2 taken 6 times.
✓ Branch 3 taken 21 times.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
505 switch (yycount)
1576 {
1577 #define YYCASE_(N, S) \
1578 case N: \
1579 yyformat = S; \
1580 break
1581 default: /* Avoid compiler warnings. */
1582 YYCASE_(0, YY_("syntax error"));
1583 139 YYCASE_(1, YY_("syntax error, unexpected %s"));
1584 339 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1585 6 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1586 21 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1587 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1588 #undef YYCASE_
1589 }
1590
1591 /* Compute error message size. Don't count the "%s"s, but reserve
1592 room for the terminator. */
1593 505 yysize = yystrlen (yyformat) - 2 * yycount + 1;
1594 {
1595 int yyi;
1596
2/2
✓ Branch 0 taken 919 times.
✓ Branch 1 taken 505 times.
1424 for (yyi = 0; yyi < yycount; ++yyi)
1597 {
1598 YYPTRDIFF_T yysize1
1599 919 = yysize + yytnamerr (YY_NULLPTR, yytname[yyarg[yyi]]);
1600
1/2
✓ Branch 0 taken 919 times.
✗ Branch 1 not taken.
919 if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
1601 yysize = yysize1;
1602 else
1603 return YYENOMEM;
1604 }
1605 }
1606
1607
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 505 times.
505 if (*yymsg_alloc < yysize)
1608 {
1609 *yymsg_alloc = 2 * yysize;
1610 if (! (yysize <= *yymsg_alloc
1611 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1612 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1613 return -1;
1614 }
1615
1616 /* Avoid sprintf, as that infringes on the user's name space.
1617 Don't have undefined behavior even if the translation
1618 produced a string with the wrong number of "%s"s. */
1619 {
1620 505 char *yyp = *yymsg;
1621 int yyi = 0;
1622
2/2
✓ Branch 0 taken 18128 times.
✓ Branch 1 taken 505 times.
18633 while ((*yyp = *yyformat) != '\0')
1623
4/6
✓ Branch 0 taken 919 times.
✓ Branch 1 taken 17209 times.
✓ Branch 2 taken 919 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 919 times.
✗ Branch 5 not taken.
18128 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1624 {
1625 919 yyp += yytnamerr (yyp, yytname[yyarg[yyi++]]);
1626 919 yyformat += 2;
1627 }
1628 else
1629 {
1630 17209 ++yyp;
1631 17209 ++yyformat;
1632 }
1633 }
1634 return 0;
1635 }
1636
1637
1638 /*-----------------------------------------------.
1639 | Release the memory associated to this symbol. |
1640 `-----------------------------------------------*/
1641
1642 static void
1643 6941 yydestruct (const char *yymsg,
1644 yysymbol_kind_t yykind, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, openvdb::ax::ast::Tree** tree)
1645 {
1646 YY_USE (yyvaluep);
1647 YY_USE (yylocationp);
1648 YY_USE (tree);
1649 if (!yymsg)
1650 yymsg = "Deleting";
1651 YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
1652
1653 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1654
9/34
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 47 times.
✓ Branch 2 taken 8 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 188 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 22 times.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✓ Branch 10 taken 4 times.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
✗ Branch 23 not taken.
✗ Branch 24 not taken.
✗ Branch 25 not taken.
✓ Branch 26 taken 46 times.
✗ Branch 27 not taken.
✓ Branch 28 taken 1 times.
✗ Branch 29 not taken.
✗ Branch 30 not taken.
✗ Branch 31 not taken.
✗ Branch 32 not taken.
✓ Branch 33 taken 6623 times.
6941 switch (yykind)
1655 {
1656 case YYSYMBOL_L_INT32: /* L_INT32 */
1657 { }
1658 break;
1659
1660 case YYSYMBOL_L_INT64: /* L_INT64 */
1661 { }
1662 break;
1663
1664 case YYSYMBOL_L_FLOAT: /* L_FLOAT */
1665 { }
1666 break;
1667
1668 case YYSYMBOL_L_DOUBLE: /* L_DOUBLE */
1669 { }
1670 break;
1671
1672 2 case YYSYMBOL_L_STRING: /* L_STRING */
1673 2 { free(const_cast<char*>(((*yyvaluep).string))); }
1674 2 break;
1675
1676 47 case YYSYMBOL_IDENTIFIER: /* IDENTIFIER */
1677 47 { free(const_cast<char*>(((*yyvaluep).string))); }
1678 47 break;
1679
1680 case YYSYMBOL_tree: /* tree */
1681 { }
1682 break;
1683
1684 8 case YYSYMBOL_body: /* body */
1685
1/2
✓ Branch 0 taken 8 times.
✗ Branch 1 not taken.
8 { delete ((*yyvaluep).block); }
1686 break;
1687
1688 case YYSYMBOL_block: /* block */
1689 { delete ((*yyvaluep).block); }
1690 break;
1691
1692 case YYSYMBOL_statement: /* statement */
1693 { delete ((*yyvaluep).statement); }
1694 break;
1695
1696 188 case YYSYMBOL_expressions: /* expressions */
1697
1/2
✓ Branch 0 taken 188 times.
✗ Branch 1 not taken.
188 { delete ((*yyvaluep).expression); }
1698 break;
1699
1700 case YYSYMBOL_comma_operator: /* comma_operator */
1701 { for (auto& ptr : *((*yyvaluep).explist)) delete ptr; delete ((*yyvaluep).explist); }
1702 break;
1703
1704 22 case YYSYMBOL_expression: /* expression */
1705
1/2
✓ Branch 0 taken 22 times.
✗ Branch 1 not taken.
22 { delete ((*yyvaluep).expression); }
1706 break;
1707
1708 case YYSYMBOL_declaration: /* declaration */
1709 { delete ((*yyvaluep).declare_local); }
1710 break;
1711
1712 case YYSYMBOL_declaration_list: /* declaration_list */
1713 { delete ((*yyvaluep).statementlist); }
1714 break;
1715
1716 4 case YYSYMBOL_declarations: /* declarations */
1717
1/2
✓ Branch 0 taken 4 times.
✗ Branch 1 not taken.
4 { delete ((*yyvaluep).statement); }
1718 break;
1719
1720 case YYSYMBOL_block_or_statement: /* block_or_statement */
1721 { delete ((*yyvaluep).block); }
1722 break;
1723
1724 case YYSYMBOL_conditional_statement: /* conditional_statement */
1725 { delete ((*yyvaluep).statement); }
1726 break;
1727
1728 case YYSYMBOL_loop_condition: /* loop_condition */
1729 { delete ((*yyvaluep).statement); }
1730 break;
1731
1732 case YYSYMBOL_loop_condition_optional: /* loop_condition_optional */
1733 { delete ((*yyvaluep).statement); }
1734 break;
1735
1736 case YYSYMBOL_loop_init: /* loop_init */
1737 { delete ((*yyvaluep).statement); }
1738 break;
1739
1740 case YYSYMBOL_loop_iter: /* loop_iter */
1741 { delete ((*yyvaluep).expression); }
1742 break;
1743
1744 case YYSYMBOL_loop: /* loop */
1745 { delete ((*yyvaluep).statement); }
1746 break;
1747
1748 case YYSYMBOL_function_start_expression: /* function_start_expression */
1749 { delete ((*yyvaluep).function); }
1750 break;
1751
1752 case YYSYMBOL_function_call_expression: /* function_call_expression */
1753 { delete ((*yyvaluep).expression); }
1754 break;
1755
1756 case YYSYMBOL_assign_expression: /* assign_expression */
1757 { delete ((*yyvaluep).expression); }
1758 break;
1759
1760 case YYSYMBOL_binary_expression: /* binary_expression */
1761 { delete ((*yyvaluep).expression); }
1762 break;
1763
1764 case YYSYMBOL_ternary_expression: /* ternary_expression */
1765 { delete ((*yyvaluep).expression); }
1766 break;
1767
1768 case YYSYMBOL_unary_expression: /* unary_expression */
1769 { delete ((*yyvaluep).expression); }
1770 break;
1771
1772 case YYSYMBOL_pre_crement: /* pre_crement */
1773 { delete ((*yyvaluep).expression); }
1774 break;
1775
1776 case YYSYMBOL_post_crement: /* post_crement */
1777 { delete ((*yyvaluep).expression); }
1778 break;
1779
1780 46 case YYSYMBOL_variable_reference: /* variable_reference */
1781
1/2
✓ Branch 0 taken 46 times.
✗ Branch 1 not taken.
46 { delete ((*yyvaluep).expression); }
1782 break;
1783
1784 case YYSYMBOL_array: /* array */
1785 { delete ((*yyvaluep).expression); }
1786 break;
1787
1788 1 case YYSYMBOL_variable: /* variable */
1789
1/2
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
1 { delete ((*yyvaluep).variable); }
1790 break;
1791
1792 case YYSYMBOL_attribute: /* attribute */
1793 { delete ((*yyvaluep).attribute); }
1794 break;
1795
1796 case YYSYMBOL_external: /* external */
1797 { delete ((*yyvaluep).external); }
1798 break;
1799
1800 case YYSYMBOL_local: /* local */
1801 { delete ((*yyvaluep).local); }
1802 break;
1803
1804 case YYSYMBOL_literal: /* literal */
1805 { delete ((*yyvaluep).value); }
1806 break;
1807
1808 case YYSYMBOL_type: /* type */
1809 { }
1810 break;
1811
1812 case YYSYMBOL_matrix_type: /* matrix_type */
1813 { }
1814 break;
1815
1816 case YYSYMBOL_scalar_type: /* scalar_type */
1817 { }
1818 break;
1819
1820 case YYSYMBOL_vector_type: /* vector_type */
1821 { }
1822 break;
1823
1824 default:
1825 break;
1826 }
1827 YY_IGNORE_MAYBE_UNINITIALIZED_END
1828 6941 }
1829
1830
1831 /* Lookahead token kind. */
1832 int yychar;
1833
1834 /* The semantic value of the lookahead symbol. */
1835 YYSTYPE yylval;
1836 /* Location data for the lookahead symbol. */
1837 YYLTYPE yylloc
1838 # if defined AXLTYPE_IS_TRIVIAL && AXLTYPE_IS_TRIVIAL
1839 = { 1, 1, 1, 1 }
1840 # endif
1841 ;
1842 /* Number of syntax errors so far. */
1843 int yynerrs;
1844
1845
1846
1847
1848 /*----------.
1849 | yyparse. |
1850 `----------*/
1851
1852 int
1853 3380 yyparse (openvdb::ax::ast::Tree** tree)
1854 {
1855 yy_state_fast_t yystate = 0;
1856 /* Number of tokens to shift before error messages enabled. */
1857 int yyerrstatus = 0;
1858
1859 /* Refer to the stacks through separate pointers, to allow yyoverflow
1860 to reallocate them elsewhere. */
1861
1862 /* Their size. */
1863 YYPTRDIFF_T yystacksize = YYINITDEPTH;
1864
1865 /* The state stack: array, bottom, top. */
1866 yy_state_t yyssa[YYINITDEPTH];
1867 yy_state_t *yyss = yyssa;
1868 yy_state_t *yyssp = yyss;
1869
1870 /* The semantic value stack: array, bottom, top. */
1871 YYSTYPE yyvsa[YYINITDEPTH];
1872 YYSTYPE *yyvs = yyvsa;
1873 YYSTYPE *yyvsp = yyvs;
1874
1875 /* The location stack: array, bottom, top. */
1876 YYLTYPE yylsa[YYINITDEPTH];
1877 YYLTYPE *yyls = yylsa;
1878 YYLTYPE *yylsp = yyls;
1879
1880 int yyn;
1881 /* The return value of yyparse. */
1882 int yyresult;
1883 /* Lookahead symbol kind. */
1884 yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
1885 /* The variables used to return semantic value and location from the
1886 action routines. */
1887 YYSTYPE yyval;
1888 YYLTYPE yyloc;
1889
1890 /* The locations where the error started and ended. */
1891 YYLTYPE yyerror_range[3];
1892
1893 /* Buffer for error messages, and its allocated size. */
1894 char yymsgbuf[128];
1895 3380 char *yymsg = yymsgbuf;
1896 3380 YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf;
1897
1898 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1899
1900 /* The number of symbols on the RHS of the reduced rule.
1901 Keep to zero when no symbol should be popped. */
1902 int yylen = 0;
1903
1904 YYDPRINTF ((stderr, "Starting parse\n"));
1905
1906 3380 yychar = AXEMPTY; /* Cause a token to be read. */
1907
1908 3380 yylsp[0] = yylloc;
1909 3380 goto yysetstate;
1910
1911
1912 /*------------------------------------------------------------.
1913 | yynewstate -- push a new state, which is found in yystate. |
1914 `------------------------------------------------------------*/
1915 490434 yynewstate:
1916 /* In all cases, when you get here, the value and location stacks
1917 have just been pushed. So pushing a state here evens the stacks. */
1918 490434 yyssp++;
1919
1920
1921 /*--------------------------------------------------------------------.
1922 | yysetstate -- set current state (the top of the stack) to yystate. |
1923 `--------------------------------------------------------------------*/
1924 493814 yysetstate:
1925 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1926 YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
1927 YY_IGNORE_USELESS_CAST_BEGIN
1928 493814 *yyssp = YY_CAST (yy_state_t, yystate);
1929 YY_IGNORE_USELESS_CAST_END
1930 YY_STACK_PRINT (yyss, yyssp);
1931
1932
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 493814 times.
493814 if (yyss + yystacksize - 1 <= yyssp)
1933 #if !defined yyoverflow && !defined YYSTACK_RELOCATE
1934 YYNOMEM;
1935 #else
1936 {
1937 /* Get the current used size of the three stacks, in elements. */
1938 YYPTRDIFF_T yysize = yyssp - yyss + 1;
1939
1940 # if defined yyoverflow
1941 {
1942 /* Give user a chance to reallocate the stack. Use copies of
1943 these so that the &'s don't force the real ones into
1944 memory. */
1945 yy_state_t *yyss1 = yyss;
1946 YYSTYPE *yyvs1 = yyvs;
1947 YYLTYPE *yyls1 = yyls;
1948
1949 /* Each stack pointer address is followed by the size of the
1950 data in use in that stack, in bytes. This used to be a
1951 conditional around just the two extra args, but that might
1952 be undefined if yyoverflow is a macro. */
1953 yyoverflow (YY_("memory exhausted"),
1954 &yyss1, yysize * YYSIZEOF (*yyssp),
1955 &yyvs1, yysize * YYSIZEOF (*yyvsp),
1956 &yyls1, yysize * YYSIZEOF (*yylsp),
1957 &yystacksize);
1958 yyss = yyss1;
1959 yyvs = yyvs1;
1960 yyls = yyls1;
1961 }
1962 # else /* defined YYSTACK_RELOCATE */
1963 /* Extend the stack our own way. */
1964 if (YYMAXDEPTH <= yystacksize)
1965 YYNOMEM;
1966 yystacksize *= 2;
1967 if (YYMAXDEPTH < yystacksize)
1968 yystacksize = YYMAXDEPTH;
1969
1970 {
1971 yy_state_t *yyss1 = yyss;
1972 union yyalloc *yyptr =
1973 YY_CAST (union yyalloc *,
1974 YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
1975 if (! yyptr)
1976 YYNOMEM;
1977 YYSTACK_RELOCATE (yyss_alloc, yyss);
1978 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1979 YYSTACK_RELOCATE (yyls_alloc, yyls);
1980 # undef YYSTACK_RELOCATE
1981 if (yyss1 != yyssa)
1982 YYSTACK_FREE (yyss1);
1983 }
1984 # endif
1985
1986 yyssp = yyss + yysize - 1;
1987 yyvsp = yyvs + yysize - 1;
1988 yylsp = yyls + yysize - 1;
1989
1990 YY_IGNORE_USELESS_CAST_BEGIN
1991 YYDPRINTF ((stderr, "Stack size increased to %ld\n",
1992 YY_CAST (long, yystacksize)));
1993 YY_IGNORE_USELESS_CAST_END
1994
1995 if (yyss + yystacksize - 1 <= yyssp)
1996 YYABORT;
1997 }
1998 #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
1999
2000
2001
2/2
✓ Branch 0 taken 2875 times.
✓ Branch 1 taken 490939 times.
493814 if (yystate == YYFINAL)
2002 2875 YYACCEPT;
2003
2004 490939 goto yybackup;
2005
2006
2007 /*-----------.
2008 | yybackup. |
2009 `-----------*/
2010 yybackup:
2011 /* Do appropriate processing given the current state. Read a
2012 lookahead token if we need one and don't already have one. */
2013
2014 /* First try to decide what to do without reference to lookahead token. */
2015 490939 yyn = yypact[yystate];
2016
2/2
✓ Branch 0 taken 205423 times.
✓ Branch 1 taken 285516 times.
490939 if (yypact_value_is_default (yyn))
2017 205423 goto yydefault;
2018
2019 /* Not known => get a lookahead token if don't already have one. */
2020
2021 /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */
2022
2/2
✓ Branch 0 taken 182015 times.
✓ Branch 1 taken 103501 times.
285516 if (yychar == AXEMPTY)
2023 {
2024 YYDPRINTF ((stderr, "Reading a token\n"));
2025 182015 yychar = yylex ();
2026 }
2027
2028
2/2
✓ Branch 0 taken 5897 times.
✓ Branch 1 taken 279619 times.
285516 if (yychar <= AXEOF)
2029 {
2030 5897 yychar = AXEOF;
2031 yytoken = YYSYMBOL_YYEOF;
2032 YYDPRINTF ((stderr, "Now at end of input.\n"));
2033 }
2034
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 279619 times.
279619 else if (yychar == AXerror)
2035 {
2036 /* The scanner already issued an error message, process directly
2037 to error recovery. But do not keep the error token as
2038 lookahead, it is too special and may lead us to an endless
2039 loop in error recovery. */
2040 yychar = AXUNDEF;
2041 yytoken = YYSYMBOL_YYerror;
2042 yyerror_range[1] = yylloc;
2043 goto yyerrlab1;
2044 }
2045 else
2046 {
2047
1/2
✓ Branch 0 taken 279619 times.
✗ Branch 1 not taken.
279619 yytoken = YYTRANSLATE (yychar);
2048 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
2049 }
2050
2051 /* If the proper action on seeing token YYTOKEN is to reduce or to
2052 detect an error, take that action. */
2053 285516 yyn += yytoken;
2054
4/4
✓ Branch 0 taken 279645 times.
✓ Branch 1 taken 5871 times.
✓ Branch 2 taken 98135 times.
✓ Branch 3 taken 181510 times.
285516 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
2055 104006 goto yydefault;
2056 181510 yyn = yytable[yyn];
2057
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 181510 times.
181510 if (yyn <= 0)
2058 {
2059 if (yytable_value_is_error (yyn))
2060 goto yyerrlab;
2061 yyn = -yyn;
2062 goto yyreduce;
2063 }
2064
2065 /* Count tokens shifted since error; after three, turn off error
2066 status. */
2067
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 181510 times.
181510 if (yyerrstatus)
2068 yyerrstatus--;
2069
2070 /* Shift the lookahead token. */
2071 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
2072 yystate = yyn;
2073 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2074 181510 *++yyvsp = yylval;
2075 YY_IGNORE_MAYBE_UNINITIALIZED_END
2076 181510 *++yylsp = yylloc;
2077
2078 /* Discard the shifted token. */
2079 181510 yychar = AXEMPTY;
2080 181510 goto yynewstate;
2081
2082
2083 /*-----------------------------------------------------------.
2084 | yydefault -- do the default action for the current state. |
2085 `-----------------------------------------------------------*/
2086 309429 yydefault:
2087 309429 yyn = yydefact[yystate];
2088
2/2
✓ Branch 0 taken 505 times.
✓ Branch 1 taken 308924 times.
309429 if (yyn == 0)
2089 505 goto yyerrlab;
2090 308924 goto yyreduce;
2091
2092
2093 /*-----------------------------.
2094 | yyreduce -- do a reduction. |
2095 `-----------------------------*/
2096 308924 yyreduce:
2097 /* yyn is the number of a rule to reduce with. */
2098 308924 yylen = yyr2[yyn];
2099
2100 /* If YYLEN is nonzero, implement the default value of the action:
2101 '$$ = $1'.
2102
2103 Otherwise, the following line sets YYVAL to garbage.
2104 This behavior is undocumented and Bison
2105 users should not rely upon it. Assigning to YYVAL
2106 unconditionally makes the parser a bit smaller, and it avoids a
2107 GCC warning that YYVAL may be used uninitialized. */
2108 308924 yyval = yyvsp[1-yylen];
2109
2110 /* Default location. */
2111
2/2
✓ Branch 0 taken 308733 times.
✓ Branch 1 taken 191 times.
308924 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
2112 yyerror_range[1] = yyloc;
2113 YY_REDUCE_PRINT (yyn);
2114
152/155
✓ Branch 0 taken 93 times.
✓ Branch 1 taken 2884 times.
✓ Branch 2 taken 13177 times.
✓ Branch 3 taken 144 times.
✓ Branch 4 taken 3275 times.
✓ Branch 5 taken 48 times.
✓ Branch 6 taken 431 times.
✓ Branch 7 taken 127 times.
✓ Branch 8 taken 12707 times.
✓ Branch 9 taken 3244 times.
✓ Branch 10 taken 299 times.
✓ Branch 11 taken 316 times.
✓ Branch 12 taken 35 times.
✓ Branch 13 taken 44 times.
✓ Branch 14 taken 20 times.
✓ Branch 15 taken 135 times.
✓ Branch 16 taken 13600 times.
✓ Branch 17 taken 288 times.
✓ Branch 18 taken 4320 times.
✓ Branch 19 taken 14560 times.
✓ Branch 20 taken 2042 times.
✓ Branch 21 taken 3772 times.
✓ Branch 22 taken 245 times.
✓ Branch 23 taken 11718 times.
✓ Branch 24 taken 5192 times.
✓ Branch 25 taken 33986 times.
✓ Branch 26 taken 181 times.
✓ Branch 27 taken 372 times.
✓ Branch 28 taken 4032 times.
✓ Branch 29 taken 8123 times.
✓ Branch 30 taken 214 times.
✓ Branch 31 taken 698 times.
✓ Branch 32 taken 2686 times.
✓ Branch 33 taken 245 times.
✓ Branch 34 taken 102 times.
✓ Branch 35 taken 6 times.
✓ Branch 36 taken 6 times.
✓ Branch 37 taken 3017 times.
✓ Branch 38 taken 347 times.
✓ Branch 39 taken 366 times.
✓ Branch 40 taken 348 times.
✓ Branch 41 taken 200 times.
✓ Branch 42 taken 99 times.
✓ Branch 43 taken 274 times.
✓ Branch 44 taken 20 times.
✓ Branch 45 taken 177 times.
✓ Branch 46 taken 22 times.
✓ Branch 47 taken 43 times.
✓ Branch 48 taken 116 times.
✓ Branch 49 taken 40 times.
✓ Branch 50 taken 163 times.
✓ Branch 51 taken 36 times.
✓ Branch 52 taken 199 times.
✓ Branch 53 taken 55 times.
✓ Branch 54 taken 62 times.
✓ Branch 55 taken 4776 times.
✓ Branch 56 taken 2237 times.
✓ Branch 57 taken 261 times.
✓ Branch 58 taken 4776 times.
✓ Branch 59 taken 155 times.
✓ Branch 60 taken 10104 times.
✓ Branch 61 taken 656 times.
✓ Branch 62 taken 152 times.
✓ Branch 63 taken 151 times.
✓ Branch 64 taken 403 times.
✓ Branch 65 taken 117 times.
✓ Branch 66 taken 27 times.
✓ Branch 67 taken 27 times.
✓ Branch 68 taken 27 times.
✓ Branch 69 taken 27 times.
✓ Branch 70 taken 27 times.
✓ Branch 71 taken 335 times.
✓ Branch 72 taken 91 times.
✓ Branch 73 taken 116 times.
✓ Branch 74 taken 67 times.
✓ Branch 75 taken 211 times.
✓ Branch 76 taken 51 times.
✓ Branch 77 taken 51 times.
✓ Branch 78 taken 36 times.
✓ Branch 79 taken 31 times.
✓ Branch 80 taken 36 times.
✓ Branch 81 taken 66 times.
✓ Branch 82 taken 57 times.
✓ Branch 83 taken 242 times.
✓ Branch 84 taken 163 times.
✓ Branch 85 taken 92 times.
✓ Branch 86 taken 247 times.
✓ Branch 87 taken 75 times.
✓ Branch 88 taken 75 times.
✓ Branch 89 taken 219 times.
✓ Branch 90 taken 26 times.
✓ Branch 91 taken 88 times.
✓ Branch 92 taken 3572 times.
✓ Branch 93 taken 52 times.
✓ Branch 94 taken 60 times.
✓ Branch 95 taken 362 times.
✓ Branch 96 taken 170 times.
✓ Branch 97 taken 220 times.
✓ Branch 98 taken 152 times.
✓ Branch 99 taken 17586 times.
✓ Branch 100 taken 532 times.
✓ Branch 101 taken 203 times.
✓ Branch 102 taken 157 times.
✓ Branch 103 taken 113 times.
✓ Branch 104 taken 1733 times.
✓ Branch 105 taken 467 times.
✓ Branch 106 taken 4032 times.
✓ Branch 107 taken 12589 times.
✓ Branch 108 taken 7671 times.
✓ Branch 109 taken 11353 times.
✓ Branch 110 taken 180 times.
✓ Branch 111 taken 355 times.
✓ Branch 112 taken 35 times.
✓ Branch 113 taken 111 times.
✓ Branch 114 taken 20 times.
✗ Branch 115 not taken.
✗ Branch 116 not taken.
✓ Branch 117 taken 535 times.
✓ Branch 118 taken 99 times.
✓ Branch 119 taken 4 times.
✓ Branch 120 taken 3 times.
✓ Branch 121 taken 6 times.
✓ Branch 122 taken 3 times.
✓ Branch 123 taken 66 times.
✓ Branch 124 taken 7671 times.
✓ Branch 125 taken 8662 times.
✓ Branch 126 taken 417 times.
✓ Branch 127 taken 11531 times.
✓ Branch 128 taken 11905 times.
✓ Branch 129 taken 654 times.
✓ Branch 130 taken 523 times.
✓ Branch 131 taken 294 times.
✓ Branch 132 taken 6638 times.
✓ Branch 133 taken 5063 times.
✓ Branch 134 taken 2847 times.
✓ Branch 135 taken 320 times.
✓ Branch 136 taken 652 times.
✓ Branch 137 taken 706 times.
✓ Branch 138 taken 706 times.
✓ Branch 139 taken 783 times.
✓ Branch 140 taken 1906 times.
✓ Branch 141 taken 1376 times.
✓ Branch 142 taken 505 times.
✓ Branch 143 taken 1236 times.
✓ Branch 144 taken 1776 times.
✓ Branch 145 taken 314 times.
✓ Branch 146 taken 354 times.
✓ Branch 147 taken 349 times.
✓ Branch 148 taken 603 times.
✓ Branch 149 taken 946 times.
✓ Branch 150 taken 916 times.
✓ Branch 151 taken 510 times.
✓ Branch 152 taken 531 times.
✓ Branch 153 taken 540 times.
✗ Branch 154 not taken.
308924 switch (yyn)
2115 {
2116 93 case 2: /* tree: %empty */
2117 93 { *tree = newNode<Tree>(&(yyloc));
2118 93 (yyval.tree) = *tree;
2119 }
2120 93 break;
2121
2122 2884 case 3: /* tree: body */
2123 2884 { *tree = newNode<Tree>(&(yylsp[0]), (yyvsp[0].block));
2124 2884 (yyval.tree) = *tree;
2125 }
2126 2884 break;
2127
2128 13177 case 4: /* body: body statement */
2129 13177 { (yyvsp[-1].block)->addStatement((yyvsp[0].statement)); (yyval.block) = (yyvsp[-1].block); }
2130 13177 break;
2131
2132 144 case 5: /* body: body block */
2133 144 { (yyvsp[-1].block)->addStatement((yyvsp[0].block)); (yyval.block) = (yyvsp[-1].block); }
2134 144 break;
2135
2136 3275 case 6: /* body: statement */
2137 3275 { (yyval.block) = newNode<Block>(&(yyloc));
2138 3275 (yyval.block)->addStatement((yyvsp[0].statement));
2139 }
2140 break;
2141
2142 48 case 7: /* body: block */
2143 48 { (yyval.block) = newNode<Block>(&(yyloc));
2144 48 (yyval.block)->addStatement((yyvsp[0].block));
2145 }
2146 break;
2147
2148 431 case 8: /* block: LCURLY body RCURLY */
2149 431 { (yyval.block) = (yyvsp[-1].block); }
2150 431 break;
2151
2152 127 case 9: /* block: LCURLY RCURLY */
2153 127 { (yyval.block) = newNode<Block>(&(yyloc)); }
2154 127 break;
2155
2156 12707 case 10: /* statement: expressions SEMICOLON */
2157 12707 { (yyval.statement) = (yyvsp[-1].expression); }
2158 12707 break;
2159
2160 3244 case 11: /* statement: declarations SEMICOLON */
2161 3244 { (yyval.statement) = (yyvsp[-1].statement); }
2162 3244 break;
2163
2164 299 case 12: /* statement: conditional_statement */
2165 299 { (yyval.statement) = (yyvsp[0].statement); }
2166 299 break;
2167
2168 316 case 13: /* statement: loop */
2169 316 { (yyval.statement) = (yyvsp[0].statement); }
2170 316 break;
2171
2172 35 case 14: /* statement: RETURN SEMICOLON */
2173 35 { (yyval.statement) = newNode<Keyword>(&(yyloc), tokens::RETURN); }
2174 35 break;
2175
2176 44 case 15: /* statement: BREAK SEMICOLON */
2177 44 { (yyval.statement) = newNode<Keyword>(&(yyloc), tokens::BREAK); }
2178 44 break;
2179
2180 20 case 16: /* statement: CONTINUE SEMICOLON */
2181 20 { (yyval.statement) = newNode<Keyword>(&(yyloc), tokens::CONTINUE); }
2182 20 break;
2183
2184 135 case 17: /* statement: SEMICOLON */
2185 135 { (yyval.statement) = nullptr; }
2186 135 break;
2187
2188 13600 case 18: /* expressions: expression */
2189 13600 { (yyval.expression) = (yyvsp[0].expression); }
2190 13600 break;
2191
2192 288 case 19: /* expressions: comma_operator */
2193
1/2
✓ Branch 1 taken 288 times.
✗ Branch 2 not taken.
576 { (yyval.expression) = newNode<CommaOperator>(&(yyloc), *static_cast<ExpList*>((yyvsp[0].explist))); delete (yyvsp[0].explist); }
2194 break;
2195
2196 4320 case 20: /* comma_operator: expression COMMA expression */
2197 4320 { (yyval.explist) = new ExpList(); (yyval.explist)->assign({(yyvsp[-2].expression), (yyvsp[0].expression)}); }
2198 4320 break;
2199
2200 14560 case 21: /* comma_operator: comma_operator COMMA expression */
2201 14560 { (yyvsp[-2].explist)->emplace_back((yyvsp[0].expression)); (yyval.explist) = (yyvsp[-2].explist); }
2202 14560 break;
2203
2204 2042 case 22: /* expression: binary_expression */
2205 2042 { (yyval.expression) = (yyvsp[0].expression); }
2206 2042 break;
2207
2208 3772 case 23: /* expression: unary_expression */
2209 3772 { (yyval.expression) = (yyvsp[0].expression); }
2210 3772 break;
2211
2212 245 case 24: /* expression: ternary_expression */
2213 245 { (yyval.expression) = (yyvsp[0].expression); }
2214 245 break;
2215
2216 11718 case 25: /* expression: assign_expression */
2217 11718 { (yyval.expression) = (yyvsp[0].expression); }
2218 11718 break;
2219
2220 5192 case 26: /* expression: function_call_expression */
2221 5192 { (yyval.expression) = (yyvsp[0].expression); }
2222 5192 break;
2223
2224 33986 case 27: /* expression: literal */
2225 33986 { (yyval.expression) = (yyvsp[0].value); }
2226 33986 break;
2227
2228 181 case 28: /* expression: external */
2229 181 { (yyval.expression) = (yyvsp[0].external); }
2230 181 break;
2231
2232 372 case 29: /* expression: post_crement */
2233 372 { (yyval.expression) = (yyvsp[0].expression); }
2234 372 break;
2235
2236 4032 case 30: /* expression: array */
2237 4032 { (yyval.expression) = (yyvsp[0].expression); }
2238 4032 break;
2239
2240 8123 case 31: /* expression: variable_reference */
2241 8123 { (yyval.expression) = (yyvsp[0].expression); }
2242 8123 break;
2243
2244 214 case 32: /* expression: LPARENS expressions RPARENS */
2245 214 { (yyval.expression) = (yyvsp[-1].expression); }
2246 214 break;
2247
2248 698 case 33: /* declaration: type IDENTIFIER */
2249 698 { (yyval.declare_local) = newNode<DeclareLocal>(&(yylsp[-1]), static_cast<tokens::CoreType>((yyvsp[-1].index)), newNode<Local>(&(yylsp[0]), (yyvsp[0].string)));
2250 698 free(const_cast<char*>((yyvsp[0].string))); }
2251 698 break;
2252
2253 2686 case 34: /* declaration: type IDENTIFIER EQUALS expression */
2254 2686 { (yyval.declare_local) = newNode<DeclareLocal>(&(yylsp[-3]), static_cast<tokens::CoreType>((yyvsp[-3].index)), newNode<Local>(&(yylsp[-2]), (yyvsp[-2].string)), (yyvsp[0].expression));
2255 2686 free(const_cast<char*>((yyvsp[-2].string))); }
2256 2686 break;
2257
2258 245 case 35: /* declaration_list: declaration COMMA IDENTIFIER EQUALS expression */
2259 245 { (yyval.statementlist) = newNode<StatementList>(&(yyloc), (yyvsp[-4].declare_local));
2260 245 const tokens::CoreType type = static_cast<const DeclareLocal*>((yyvsp[-4].declare_local))->type();
2261 245 (yyval.statementlist)->addStatement(newNode<DeclareLocal>(&(yylsp[-4]), type, newNode<Local>(&(yylsp[-2]), (yyvsp[-2].string)), (yyvsp[0].expression)));
2262 245 free(const_cast<char*>((yyvsp[-2].string)));
2263 }
2264 245 break;
2265
2266 102 case 36: /* declaration_list: declaration COMMA IDENTIFIER */
2267 102 { (yyval.statementlist) = newNode<StatementList>(&(yyloc), (yyvsp[-2].declare_local));
2268 102 const tokens::CoreType type = static_cast<const DeclareLocal*>((yyvsp[-2].declare_local))->type();
2269 102 (yyval.statementlist)->addStatement(newNode<DeclareLocal>(&(yylsp[-2]), type, newNode<Local>(&(yylsp[0]), (yyvsp[0].string))));
2270 102 free(const_cast<char*>((yyvsp[0].string)));
2271 }
2272 102 break;
2273
2274 6 case 37: /* declaration_list: declaration_list COMMA IDENTIFIER EQUALS expression */
2275
1/2
✓ Branch 0 taken 6 times.
✗ Branch 1 not taken.
6 { const auto firstNode = (yyvsp[-4].statementlist)->child(0);
2276
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 6 times.
6 assert(firstNode);
2277 6 const tokens::CoreType type = static_cast<const DeclareLocal*>(firstNode)->type();
2278 6 (yyval.statementlist)->addStatement(newNode<DeclareLocal>(&(yylsp[-4]), type, newNode<Local>(&(yylsp[-2]), (yyvsp[-2].string)), (yyvsp[0].expression)));
2279 6 (yyval.statementlist) = (yyvsp[-4].statementlist);
2280 6 free(const_cast<char*>((yyvsp[-2].string)));
2281 }
2282 6 break;
2283
2284 6 case 38: /* declaration_list: declaration_list COMMA IDENTIFIER */
2285
1/2
✓ Branch 0 taken 6 times.
✗ Branch 1 not taken.
6 { const auto firstNode = (yyvsp[-2].statementlist)->child(0);
2286
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 6 times.
6 assert(firstNode);
2287 6 const tokens::CoreType type = static_cast<const DeclareLocal*>(firstNode)->type();
2288 6 (yyval.statementlist)->addStatement(newNode<DeclareLocal>(&(yylsp[-2]), type, newNode<Local>(&(yylsp[0]), (yyvsp[0].string))));
2289 6 free(const_cast<char*>((yyvsp[0].string)));
2290 6 (yyval.statementlist) = (yyvsp[-2].statementlist);
2291 }
2292 6 break;
2293
2294 3017 case 39: /* declarations: declaration */
2295 3017 { (yyval.statement) = (yyvsp[0].declare_local); }
2296 3017 break;
2297
2298 347 case 40: /* declarations: declaration_list */
2299 347 { (yyval.statement) = (yyvsp[0].statementlist); }
2300 347 break;
2301
2302 366 case 41: /* block_or_statement: block */
2303 366 { (yyval.block) = (yyvsp[0].block); }
2304 366 break;
2305
2306 348 case 42: /* block_or_statement: statement */
2307 348 { (yyval.block) = newNode<Block>(&(yyloc)); (yyval.block)->addStatement((yyvsp[0].statement)); }
2308 break;
2309
2310 200 case 43: /* conditional_statement: IF LPARENS expressions RPARENS block_or_statement */
2311 200 { (yyval.statement) = newNode<ConditionalStatement>(&(yyloc), (yyvsp[-2].expression), (yyvsp[0].block)); }
2312 200 break;
2313
2314 99 case 44: /* conditional_statement: IF LPARENS expressions RPARENS block_or_statement ELSE block_or_statement */
2315 99 { (yyval.statement) = newNode<ConditionalStatement>(&(yyloc), (yyvsp[-4].expression), (yyvsp[-2].block), (yyvsp[0].block)); }
2316 99 break;
2317
2318 274 case 45: /* loop_condition: expressions */
2319 274 { (yyval.statement) = (yyvsp[0].expression); }
2320 274 break;
2321
2322 20 case 46: /* loop_condition: declaration */
2323 20 { (yyval.statement) = (yyvsp[0].declare_local); }
2324 20 break;
2325
2326 177 case 47: /* loop_condition_optional: loop_condition */
2327 177 { (yyval.statement) = (yyvsp[0].statement); }
2328 177 break;
2329
2330 22 case 48: /* loop_condition_optional: %empty */
2331 22 { (yyval.statement) = nullptr; }
2332 22 break;
2333
2334 43 case 49: /* loop_init: expressions */
2335 43 { (yyval.statement) = (yyvsp[0].expression); }
2336 43 break;
2337
2338 116 case 50: /* loop_init: declarations */
2339 116 { (yyval.statement) = (yyvsp[0].statement); }
2340 116 break;
2341
2342 40 case 51: /* loop_init: %empty */
2343 40 { (yyval.statement) = nullptr; }
2344 40 break;
2345
2346 163 case 52: /* loop_iter: expressions */
2347 163 { (yyval.expression) = (yyvsp[0].expression); }
2348 163 break;
2349
2350 36 case 53: /* loop_iter: %empty */
2351 36 { (yyval.expression) = nullptr; }
2352 36 break;
2353
2354 199 case 54: /* loop: FOR LPARENS loop_init SEMICOLON loop_condition_optional SEMICOLON loop_iter RPARENS block_or_statement */
2355
2/2
✓ Branch 0 taken 22 times.
✓ Branch 1 taken 177 times.
199 { (yyval.statement) = newNode<Loop>(&(yyloc), tokens::FOR, ((yyvsp[-4].statement) ? (yyvsp[-4].statement) : newNode<Value<bool>>(&(yyloc), true)), (yyvsp[0].block), (yyvsp[-6].statement), (yyvsp[-2].expression)); }
2356 199 break;
2357
2358 55 case 55: /* loop: DO block_or_statement WHILE LPARENS loop_condition RPARENS */
2359 55 { (yyval.statement) = newNode<Loop>(&(yyloc), tokens::DO, (yyvsp[-1].statement), (yyvsp[-4].block)); }
2360 55 break;
2361
2362 62 case 56: /* loop: WHILE LPARENS loop_condition RPARENS block_or_statement */
2363 62 { (yyval.statement) = newNode<Loop>(&(yyloc), tokens::WHILE, (yyvsp[-2].statement), (yyvsp[0].block)); }
2364 62 break;
2365
2366 4776 case 57: /* function_start_expression: IDENTIFIER LPARENS expression */
2367 4776 { (yyval.function) = newNode<FunctionCall>(&(yylsp[-2]), (yyvsp[-2].string)); (yyval.function)->append((yyvsp[0].expression)); free(const_cast<char*>((yyvsp[-2].string))); }
2368 4776 break;
2369
2370 2237 case 58: /* function_start_expression: function_start_expression COMMA expression */
2371 2237 { (yyvsp[-2].function)->append((yyvsp[0].expression)); (yyval.function) = (yyvsp[-2].function); }
2372 2237 break;
2373
2374 261 case 59: /* function_call_expression: IDENTIFIER LPARENS RPARENS */
2375 261 { (yyval.expression) = newNode<FunctionCall>(&(yylsp[-2]), (yyvsp[-2].string)); free(const_cast<char*>((yyvsp[-2].string))); }
2376 261 break;
2377
2378 4776 case 60: /* function_call_expression: function_start_expression RPARENS */
2379 4776 { (yyval.expression) = (yyvsp[-1].function); }
2380 4776 break;
2381
2382 155 case 61: /* function_call_expression: scalar_type LPARENS expression RPARENS */
2383 155 { (yyval.expression) = newNode<Cast>(&(yylsp[-3]), (yyvsp[-1].expression), static_cast<tokens::CoreType>((yyvsp[-3].index))); }
2384 155 break;
2385
2386 10104 case 62: /* assign_expression: variable_reference EQUALS expression */
2387 10104 { (yyval.expression) = newNode<AssignExpression>(&(yylsp[-2]), (yyvsp[-2].expression), (yyvsp[0].expression)); }
2388 10104 break;
2389
2390 656 case 63: /* assign_expression: variable_reference PLUSEQUALS expression */
2391 656 { (yyval.expression) = newNode<AssignExpression>(&(yylsp[-2]), (yyvsp[-2].expression), (yyvsp[0].expression), tokens::PLUS); }
2392 656 break;
2393
2394 152 case 64: /* assign_expression: variable_reference MINUSEQUALS expression */
2395 152 { (yyval.expression) = newNode<AssignExpression>(&(yylsp[-2]), (yyvsp[-2].expression), (yyvsp[0].expression), tokens::MINUS); }
2396 152 break;
2397
2398 151 case 65: /* assign_expression: variable_reference MULTIPLYEQUALS expression */
2399 151 { (yyval.expression) = newNode<AssignExpression>(&(yylsp[-2]), (yyvsp[-2].expression), (yyvsp[0].expression), tokens::MULTIPLY); }
2400 151 break;
2401
2402 403 case 66: /* assign_expression: variable_reference DIVIDEEQUALS expression */
2403 403 { (yyval.expression) = newNode<AssignExpression>(&(yylsp[-2]), (yyvsp[-2].expression), (yyvsp[0].expression), tokens::DIVIDE); }
2404 403 break;
2405
2406 117 case 67: /* assign_expression: variable_reference MODULOEQUALS expression */
2407 117 { (yyval.expression) = newNode<AssignExpression>(&(yylsp[-2]), (yyvsp[-2].expression), (yyvsp[0].expression), tokens::MODULO); }
2408 117 break;
2409
2410 27 case 68: /* assign_expression: variable_reference BITANDEQUALS expression */
2411 27 { (yyval.expression) = newNode<AssignExpression>(&(yylsp[-2]), (yyvsp[-2].expression), (yyvsp[0].expression), tokens::BITAND); }
2412 27 break;
2413
2414 27 case 69: /* assign_expression: variable_reference BITXOREQUALS expression */
2415 27 { (yyval.expression) = newNode<AssignExpression>(&(yylsp[-2]), (yyvsp[-2].expression), (yyvsp[0].expression), tokens::BITXOR); }
2416 27 break;
2417
2418 27 case 70: /* assign_expression: variable_reference BITOREQUALS expression */
2419 27 { (yyval.expression) = newNode<AssignExpression>(&(yylsp[-2]), (yyvsp[-2].expression), (yyvsp[0].expression), tokens::BITOR); }
2420 27 break;
2421
2422 27 case 71: /* assign_expression: variable_reference SHIFTLEFTEQUALS expression */
2423 27 { (yyval.expression) = newNode<AssignExpression>(&(yylsp[-2]), (yyvsp[-2].expression), (yyvsp[0].expression), tokens::SHIFTLEFT); }
2424 27 break;
2425
2426 27 case 72: /* assign_expression: variable_reference SHIFTRIGHTEQUALS expression */
2427 27 { (yyval.expression) = newNode<AssignExpression>(&(yylsp[-2]), (yyvsp[-2].expression), (yyvsp[0].expression), tokens::SHIFTRIGHT); }
2428 27 break;
2429
2430 335 case 73: /* binary_expression: expression PLUS expression */
2431 335 { (yyval.expression) = newNode<BinaryOperator>(&(yylsp[-2]), (yyvsp[-2].expression), (yyvsp[0].expression), tokens::PLUS); }
2432 335 break;
2433
2434 91 case 74: /* binary_expression: expression MINUS expression */
2435 91 { (yyval.expression) = newNode<BinaryOperator>(&(yylsp[-2]), (yyvsp[-2].expression), (yyvsp[0].expression), tokens::MINUS); }
2436 91 break;
2437
2438 116 case 75: /* binary_expression: expression MULTIPLY expression */
2439 116 { (yyval.expression) = newNode<BinaryOperator>(&(yylsp[-2]), (yyvsp[-2].expression), (yyvsp[0].expression), tokens::MULTIPLY); }
2440 116 break;
2441
2442 67 case 76: /* binary_expression: expression DIVIDE expression */
2443 67 { (yyval.expression) = newNode<BinaryOperator>(&(yylsp[-2]), (yyvsp[-2].expression), (yyvsp[0].expression), tokens::DIVIDE); }
2444 67 break;
2445
2446 211 case 77: /* binary_expression: expression MODULO expression */
2447 211 { (yyval.expression) = newNode<BinaryOperator>(&(yylsp[-2]), (yyvsp[-2].expression), (yyvsp[0].expression), tokens::MODULO); }
2448 211 break;
2449
2450 51 case 78: /* binary_expression: expression SHIFTLEFT expression */
2451 51 { (yyval.expression) = newNode<BinaryOperator>(&(yylsp[-2]), (yyvsp[-2].expression), (yyvsp[0].expression), tokens::SHIFTLEFT); }
2452 51 break;
2453
2454 51 case 79: /* binary_expression: expression SHIFTRIGHT expression */
2455 51 { (yyval.expression) = newNode<BinaryOperator>(&(yylsp[-2]), (yyvsp[-2].expression), (yyvsp[0].expression), tokens::SHIFTRIGHT); }
2456 51 break;
2457
2458 36 case 80: /* binary_expression: expression BITAND expression */
2459 36 { (yyval.expression) = newNode<BinaryOperator>(&(yylsp[-2]), (yyvsp[-2].expression), (yyvsp[0].expression), tokens::BITAND); }
2460 36 break;
2461
2462 31 case 81: /* binary_expression: expression BITOR expression */
2463 31 { (yyval.expression) = newNode<BinaryOperator>(&(yylsp[-2]), (yyvsp[-2].expression), (yyvsp[0].expression), tokens::BITOR); }
2464 31 break;
2465
2466 36 case 82: /* binary_expression: expression BITXOR expression */
2467 36 { (yyval.expression) = newNode<BinaryOperator>(&(yylsp[-2]), (yyvsp[-2].expression), (yyvsp[0].expression), tokens::BITXOR); }
2468 36 break;
2469
2470 66 case 83: /* binary_expression: expression AND expression */
2471 66 { (yyval.expression) = newNode<BinaryOperator>(&(yylsp[-2]), (yyvsp[-2].expression), (yyvsp[0].expression), tokens::AND); }
2472 66 break;
2473
2474 57 case 84: /* binary_expression: expression OR expression */
2475 57 { (yyval.expression) = newNode<BinaryOperator>(&(yylsp[-2]), (yyvsp[-2].expression), (yyvsp[0].expression), tokens::OR); }
2476 57 break;
2477
2478 242 case 85: /* binary_expression: expression EQUALSEQUALS expression */
2479 242 { (yyval.expression) = newNode<BinaryOperator>(&(yylsp[-2]), (yyvsp[-2].expression), (yyvsp[0].expression), tokens::EQUALSEQUALS); }
2480 242 break;
2481
2482 163 case 86: /* binary_expression: expression NOTEQUALS expression */
2483 163 { (yyval.expression) = newNode<BinaryOperator>(&(yylsp[-2]), (yyvsp[-2].expression), (yyvsp[0].expression), tokens::NOTEQUALS); }
2484 163 break;
2485
2486 92 case 87: /* binary_expression: expression MORETHAN expression */
2487 92 { (yyval.expression) = newNode<BinaryOperator>(&(yylsp[-2]), (yyvsp[-2].expression), (yyvsp[0].expression), tokens::MORETHAN); }
2488 92 break;
2489
2490 247 case 88: /* binary_expression: expression LESSTHAN expression */
2491 247 { (yyval.expression) = newNode<BinaryOperator>(&(yylsp[-2]), (yyvsp[-2].expression), (yyvsp[0].expression), tokens::LESSTHAN); }
2492 247 break;
2493
2494 75 case 89: /* binary_expression: expression MORETHANOREQUAL expression */
2495 75 { (yyval.expression) = newNode<BinaryOperator>(&(yylsp[-2]), (yyvsp[-2].expression), (yyvsp[0].expression), tokens::MORETHANOREQUAL); }
2496 75 break;
2497
2498 75 case 90: /* binary_expression: expression LESSTHANOREQUAL expression */
2499 75 { (yyval.expression) = newNode<BinaryOperator>(&(yylsp[-2]), (yyvsp[-2].expression), (yyvsp[0].expression), tokens::LESSTHANOREQUAL); }
2500 75 break;
2501
2502 219 case 91: /* ternary_expression: expression QUESTION expression COLON expression */
2503 219 { (yyval.expression) = newNode<TernaryOperator>(&(yylsp[-4]), (yyvsp[-4].expression), (yyvsp[-2].expression), (yyvsp[0].expression)); }
2504 219 break;
2505
2506 26 case 92: /* ternary_expression: expression QUESTION COLON expression */
2507 26 { (yyval.expression) = newNode<TernaryOperator>(&(yylsp[-3]), (yyvsp[-3].expression), nullptr, (yyvsp[0].expression)); }
2508 26 break;
2509
2510 88 case 93: /* unary_expression: PLUS expression */
2511 88 { (yyval.expression) = newNode<UnaryOperator>(&(yylsp[-1]), (yyvsp[0].expression), tokens::PLUS); }
2512 88 break;
2513
2514 3572 case 94: /* unary_expression: MINUS expression */
2515 3572 { (yyval.expression) = newNode<UnaryOperator>(&(yylsp[-1]), (yyvsp[0].expression), tokens::MINUS); }
2516 3572 break;
2517
2518 52 case 95: /* unary_expression: BITNOT expression */
2519 52 { (yyval.expression) = newNode<UnaryOperator>(&(yylsp[-1]), (yyvsp[0].expression), tokens::BITNOT); }
2520 52 break;
2521
2522 60 case 96: /* unary_expression: NOT expression */
2523 60 { (yyval.expression) = newNode<UnaryOperator>(&(yylsp[-1]), (yyvsp[0].expression), tokens::NOT); }
2524 60 break;
2525
2526 362 case 97: /* pre_crement: PLUSPLUS variable_reference */
2527 362 { (yyval.expression) = newNode<Crement>(&(yylsp[-1]), (yyvsp[0].expression), Crement::Increment, /*post*/false); }
2528 362 break;
2529
2530 170 case 98: /* pre_crement: MINUSMINUS variable_reference */
2531 170 { (yyval.expression) = newNode<Crement>(&(yylsp[-1]), (yyvsp[0].expression), Crement::Decrement, /*post*/false); }
2532 170 break;
2533
2534 220 case 99: /* post_crement: variable_reference PLUSPLUS */
2535 220 { (yyval.expression) = newNode<Crement>(&(yylsp[-1]), (yyvsp[-1].expression), Crement::Increment, /*post*/true); }
2536 220 break;
2537
2538 152 case 100: /* post_crement: variable_reference MINUSMINUS */
2539 152 { (yyval.expression) = newNode<Crement>(&(yylsp[-1]), (yyvsp[-1].expression), Crement::Decrement, /*post*/true); }
2540 152 break;
2541
2542 17586 case 101: /* variable_reference: variable */
2543 17586 { (yyval.expression) = (yyvsp[0].variable); }
2544 17586 break;
2545
2546 532 case 102: /* variable_reference: pre_crement */
2547 532 { (yyval.expression) = (yyvsp[0].expression); }
2548 532 break;
2549
2550 203 case 103: /* variable_reference: variable DOT_X */
2551 203 { (yyval.expression) = newNode<ArrayUnpack>(&(yylsp[-1]), (yyvsp[-1].variable), newNode<Value<int32_t>>(&(yylsp[0]), 0)); }
2552 203 break;
2553
2554 157 case 104: /* variable_reference: variable DOT_Y */
2555 157 { (yyval.expression) = newNode<ArrayUnpack>(&(yylsp[-1]), (yyvsp[-1].variable), newNode<Value<int32_t>>(&(yylsp[0]), 1)); }
2556 157 break;
2557
2558 113 case 105: /* variable_reference: variable DOT_Z */
2559 113 { (yyval.expression) = newNode<ArrayUnpack>(&(yylsp[-1]), (yyvsp[-1].variable), newNode<Value<int32_t>>(&(yylsp[0]), 2)); }
2560 113 break;
2561
2562 1733 case 106: /* variable_reference: variable LSQUARE expression RSQUARE */
2563 1733 { (yyval.expression) = newNode<ArrayUnpack>(&(yylsp[-3]), (yyvsp[-3].variable), (yyvsp[-1].expression)); }
2564 1733 break;
2565
2566 467 case 107: /* variable_reference: variable LSQUARE expression COMMA expression RSQUARE */
2567 467 { (yyval.expression) = newNode<ArrayUnpack>(&(yylsp[-5]), (yyvsp[-5].variable), (yyvsp[-3].expression), (yyvsp[-1].expression)); }
2568 467 break;
2569
2570 4032 case 108: /* array: LCURLY comma_operator RCURLY */
2571
1/2
✓ Branch 1 taken 4032 times.
✗ Branch 2 not taken.
8064 { (yyval.expression) = newNode<ArrayPack>(&(yylsp[-2]), *(yyvsp[-1].explist)); delete (yyvsp[-1].explist); }
2572 break;
2573
2574 12589 case 109: /* variable: attribute */
2575 12589 { (yyval.variable) = (yyvsp[0].attribute); }
2576 12589 break;
2577
2578 7671 case 110: /* variable: local */
2579 7671 { (yyval.variable) = (yyvsp[0].local); }
2580 7671 break;
2581
2582 11353 case 111: /* attribute: type AT IDENTIFIER */
2583 11353 { (yyval.attribute) = newNode<Attribute>(&(yyloc), (yyvsp[0].string), static_cast<tokens::CoreType>((yyvsp[-2].index))); free(const_cast<char*>((yyvsp[0].string))); }
2584 11353 break;
2585
2586 180 case 112: /* attribute: I16_AT IDENTIFIER */
2587 180 { (yyval.attribute) = newNode<Attribute>(&(yyloc), (yyvsp[0].string), tokens::INT16); free(const_cast<char*>((yyvsp[0].string))); }
2588 180 break;
2589
2590 355 case 113: /* attribute: I_AT IDENTIFIER */
2591 355 { (yyval.attribute) = newNode<Attribute>(&(yyloc), (yyvsp[0].string), tokens::INT32); free(const_cast<char*>((yyvsp[0].string))); }
2592 355 break;
2593
2594 35 case 114: /* attribute: F_AT IDENTIFIER */
2595 35 { (yyval.attribute) = newNode<Attribute>(&(yyloc), (yyvsp[0].string), tokens::FLOAT); free(const_cast<char*>((yyvsp[0].string))); }
2596 35 break;
2597
2598 111 case 115: /* attribute: V_AT IDENTIFIER */
2599 111 { (yyval.attribute) = newNode<Attribute>(&(yyloc), (yyvsp[0].string), tokens::VEC3F); free(const_cast<char*>((yyvsp[0].string))); }
2600 111 break;
2601
2602 20 case 116: /* attribute: S_AT IDENTIFIER */
2603 20 { (yyval.attribute) = newNode<Attribute>(&(yyloc), (yyvsp[0].string), tokens::STRING); free(const_cast<char*>((yyvsp[0].string))); }
2604 20 break;
2605
2606 case 117: /* attribute: M3F_AT IDENTIFIER */
2607 { (yyval.attribute) = newNode<Attribute>(&(yyloc), (yyvsp[0].string), tokens::MAT3F); free(const_cast<char*>((yyvsp[0].string))); }
2608 break;
2609
2610 case 118: /* attribute: M4F_AT IDENTIFIER */
2611 { (yyval.attribute) = newNode<Attribute>(&(yyloc), (yyvsp[0].string), tokens::MAT4F); free(const_cast<char*>((yyvsp[0].string))); }
2612 break;
2613
2614 535 case 119: /* attribute: AT IDENTIFIER */
2615 535 { (yyval.attribute) = newNode<Attribute>(&(yyloc), (yyvsp[0].string), tokens::FLOAT, true); free(const_cast<char*>((yyvsp[0].string))); }
2616 535 break;
2617
2618 99 case 120: /* external: type DOLLAR IDENTIFIER */
2619 99 { (yyval.external) = newNode<ExternalVariable>(&(yyloc), (yyvsp[0].string), static_cast<tokens::CoreType>((yyvsp[-2].index))); free(const_cast<char*>((yyvsp[0].string))); }
2620 99 break;
2621
2622 4 case 121: /* external: I_DOLLAR IDENTIFIER */
2623 4 { (yyval.external) = newNode<ExternalVariable>(&(yyloc), (yyvsp[0].string), tokens::INT32); free(const_cast<char*>((yyvsp[0].string))); }
2624 4 break;
2625
2626 3 case 122: /* external: F_DOLLAR IDENTIFIER */
2627 3 { (yyval.external) = newNode<ExternalVariable>(&(yyloc), (yyvsp[0].string), tokens::FLOAT); free(const_cast<char*>((yyvsp[0].string))); }
2628 3 break;
2629
2630 6 case 123: /* external: V_DOLLAR IDENTIFIER */
2631 6 { (yyval.external) = newNode<ExternalVariable>(&(yyloc), (yyvsp[0].string), tokens::VEC3F); free(const_cast<char*>((yyvsp[0].string))); }
2632 6 break;
2633
2634 3 case 124: /* external: S_DOLLAR IDENTIFIER */
2635 3 { (yyval.external) = newNode<ExternalVariable>(&(yyloc), (yyvsp[0].string), tokens::STRING); free(const_cast<char*>((yyvsp[0].string))); }
2636 3 break;
2637
2638 66 case 125: /* external: DOLLAR IDENTIFIER */
2639 66 { (yyval.external) = newNode<ExternalVariable>(&(yyloc), (yyvsp[0].string), tokens::FLOAT); free(const_cast<char*>((yyvsp[0].string))); }
2640 66 break;
2641
2642 7671 case 126: /* local: IDENTIFIER */
2643 7671 { (yyval.local) = newNode<Local>(&(yyloc), (yyvsp[0].string)); free(const_cast<char*>((yyvsp[0].string))); }
2644 7671 break;
2645
2646 8662 case 127: /* literal: L_INT32 */
2647 8662 { (yyval.value) = newNode<Value<int32_t>>(&(yylsp[0]), (yyvsp[0].index)); }
2648 8662 break;
2649
2650 417 case 128: /* literal: L_INT64 */
2651 417 { (yyval.value) = newNode<Value<int64_t>>(&(yylsp[0]), (yyvsp[0].index)); }
2652 417 break;
2653
2654 11531 case 129: /* literal: L_FLOAT */
2655 11531 { (yyval.value) = newNode<Value<float>>(&(yylsp[0]), static_cast<float>((yyvsp[0].flt))); }
2656 11531 break;
2657
2658 11905 case 130: /* literal: L_DOUBLE */
2659 11905 { (yyval.value) = newNode<Value<double>>(&(yylsp[0]), (yyvsp[0].flt)); }
2660 11905 break;
2661
2662 654 case 131: /* literal: L_STRING */
2663 654 { (yyval.value) = newNode<Value<std::string>>(&(yylsp[0]), (yyvsp[0].string)); free(const_cast<char*>((yyvsp[0].string))); }
2664 654 break;
2665
2666 523 case 132: /* literal: TRUE */
2667 523 { (yyval.value) = newNode<Value<bool>>(&(yylsp[0]), true); }
2668 523 break;
2669
2670 294 case 133: /* literal: FALSE */
2671 294 { (yyval.value) = newNode<Value<bool>>(&(yylsp[0]), false); }
2672 294 break;
2673
2674 6638 case 134: /* type: scalar_type */
2675 6638 { (yyval.index) = (yyvsp[0].index); }
2676 6638 break;
2677
2678 5063 case 135: /* type: vector_type */
2679 5063 { (yyval.index) = (yyvsp[0].index); }
2680 5063 break;
2681
2682 2847 case 136: /* type: matrix_type */
2683 2847 { (yyval.index) = (yyvsp[0].index); }
2684 2847 break;
2685
2686 320 case 137: /* type: STRING */
2687 320 { (yyval.index) = tokens::STRING; }
2688 320 break;
2689
2690 652 case 138: /* matrix_type: MAT3F */
2691 652 { (yyval.index) = tokens::MAT3F; }
2692 652 break;
2693
2694 706 case 139: /* matrix_type: MAT3D */
2695 706 { (yyval.index) = tokens::MAT3D; }
2696 706 break;
2697
2698 706 case 140: /* matrix_type: MAT4F */
2699 706 { (yyval.index) = tokens::MAT4F; }
2700 706 break;
2701
2702 783 case 141: /* matrix_type: MAT4D */
2703 783 { (yyval.index) = tokens::MAT4D; }
2704 783 break;
2705
2706 1906 case 142: /* scalar_type: BOOL */
2707 1906 { (yyval.index) = tokens::BOOL; }
2708 1906 break;
2709
2710 1376 case 143: /* scalar_type: INT32 */
2711 1376 { (yyval.index) = tokens::INT32; }
2712 1376 break;
2713
2714 505 case 144: /* scalar_type: INT64 */
2715 505 { (yyval.index) = tokens::INT64; }
2716 505 break;
2717
2718 1236 case 145: /* scalar_type: FLOAT */
2719 1236 { (yyval.index) = tokens::FLOAT; }
2720 1236 break;
2721
2722 1776 case 146: /* scalar_type: DOUBLE */
2723 1776 { (yyval.index) = tokens::DOUBLE; }
2724 1776 break;
2725
2726 314 case 147: /* vector_type: VEC2I */
2727 314 { (yyval.index) = tokens::VEC2I; }
2728 314 break;
2729
2730 354 case 148: /* vector_type: VEC2F */
2731 354 { (yyval.index) = tokens::VEC2F; }
2732 354 break;
2733
2734 349 case 149: /* vector_type: VEC2D */
2735 349 { (yyval.index) = tokens::VEC2D; }
2736 349 break;
2737
2738 603 case 150: /* vector_type: VEC3I */
2739 603 { (yyval.index) = tokens::VEC3I; }
2740 603 break;
2741
2742 946 case 151: /* vector_type: VEC3F */
2743 946 { (yyval.index) = tokens::VEC3F; }
2744 946 break;
2745
2746 916 case 152: /* vector_type: VEC3D */
2747 916 { (yyval.index) = tokens::VEC3D; }
2748 916 break;
2749
2750 510 case 153: /* vector_type: VEC4I */
2751 510 { (yyval.index) = tokens::VEC4I; }
2752 510 break;
2753
2754 531 case 154: /* vector_type: VEC4F */
2755 531 { (yyval.index) = tokens::VEC4F; }
2756 531 break;
2757
2758 540 case 155: /* vector_type: VEC4D */
2759 540 { (yyval.index) = tokens::VEC4D; }
2760 540 break;
2761
2762
2763
2764 default: break;
2765 }
2766 /* User semantic actions sometimes alter yychar, and that requires
2767 that yytoken be updated with the new translation. We take the
2768 approach of translating immediately before every use of yytoken.
2769 One alternative is translating here after every semantic action,
2770 but that translation would be missed if the semantic action invokes
2771 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2772 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2773 incorrect destructor might then be invoked immediately. In the
2774 case of YYERROR or YYBACKUP, subsequent parser actions might lead
2775 to an incorrect destructor call or verbose syntax error message
2776 before the lookahead is translated. */
2777 YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
2778
2779 308924 YYPOPSTACK (yylen);
2780 yylen = 0;
2781
2782 308924 *++yyvsp = yyval;
2783 308924 *++yylsp = yyloc;
2784
2785 /* Now 'shift' the result of the reduction. Determine what state
2786 that goes to, based on the state we popped back to and the rule
2787 number reduced by. */
2788 {
2789 308924 const int yylhs = yyr1[yyn] - YYNTOKENS;
2790 308924 const int yyi = yypgoto[yylhs] + *yyssp;
2791
2/2
✓ Branch 0 taken 107341 times.
✓ Branch 1 taken 76832 times.
184173 yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
2792
2/2
✓ Branch 0 taken 184173 times.
✓ Branch 1 taken 124751 times.
416265 ? yytable[yyi]
2793 201583 : yydefgoto[yylhs]);
2794 }
2795
2796 308924 goto yynewstate;
2797
2798
2799 /*--------------------------------------.
2800 | yyerrlab -- here on detecting error. |
2801 `--------------------------------------*/
2802 yyerrlab:
2803 /* Make sure we have latest lookahead translation. See comments at
2804 user semantic actions for why this is necessary. */
2805
2/4
✓ Branch 0 taken 505 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 505 times.
✗ Branch 3 not taken.
505 yytoken = yychar == AXEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
2806 /* If not already recovering from an error, report this error. */
2807
1/2
✓ Branch 0 taken 505 times.
✗ Branch 1 not taken.
505 if (!yyerrstatus)
2808 {
2809 505 ++yynerrs;
2810 {
2811 505 yypcontext_t yyctx
2812 505 = {yyssp, yytoken, &yylloc};
2813 char const *yymsgp = YY_("syntax error");
2814 int yysyntax_error_status;
2815 505 yysyntax_error_status = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx);
2816
1/2
✓ Branch 0 taken 505 times.
✗ Branch 1 not taken.
505 if (yysyntax_error_status == 0)
2817 505 yymsgp = yymsg;
2818 else if (yysyntax_error_status == -1)
2819 {
2820 if (yymsg != yymsgbuf)
2821 YYSTACK_FREE (yymsg);
2822 yymsg = YY_CAST (char *,
2823 YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc)));
2824 if (yymsg)
2825 {
2826 yysyntax_error_status
2827 = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx);
2828 yymsgp = yymsg;
2829 }
2830 else
2831 {
2832 yymsg = yymsgbuf;
2833 yymsg_alloc = sizeof yymsgbuf;
2834 yysyntax_error_status = YYENOMEM;
2835 }
2836 }
2837 505 yyerror (tree, yymsgp);
2838
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 505 times.
505 if (yysyntax_error_status == YYENOMEM)
2839 YYNOMEM;
2840 }
2841 }
2842
2843 505 yyerror_range[1] = yylloc;
2844
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 505 times.
505 if (yyerrstatus == 3)
2845 {
2846 /* If just tried and failed to reuse lookahead token after an
2847 error, discard it. */
2848
2849 if (yychar <= AXEOF)
2850 {
2851 /* Return failure if at end of input. */
2852 if (yychar == AXEOF)
2853 YYABORT;
2854 }
2855 else
2856 {
2857 yydestruct ("Error: discarding",
2858 yytoken, &yylval, &yylloc, tree);
2859 yychar = AXEMPTY;
2860 }
2861 }
2862
2863 /* Else will try to reuse lookahead token after shifting the error
2864 token. */
2865 505 goto yyerrlab1;
2866
2867
2868 /*---------------------------------------------------.
2869 | yyerrorlab -- error raised explicitly by YYERROR. |
2870 `---------------------------------------------------*/
2871 yyerrorlab:
2872 /* Pacify compilers when the user code never invokes YYERROR and the
2873 label yyerrorlab therefore never appears in user code. */
2874 if (0)
2875 YYERROR;
2876 ++yynerrs;
2877
2878 /* Do not reclaim the symbols of the rule whose action triggered
2879 this YYERROR. */
2880 YYPOPSTACK (yylen);
2881 yylen = 0;
2882 YY_STACK_PRINT (yyss, yyssp);
2883 yystate = *yyssp;
2884 goto yyerrlab1;
2885
2886
2887 /*-------------------------------------------------------------.
2888 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2889 `-------------------------------------------------------------*/
2890 yyerrlab1:
2891 yyerrstatus = 3; /* Each real token shifted decrements this. */
2892
2893 /* Pop stack until we find a state that shifts the error token. */
2894 for (;;)
2895 {
2896 1191 yyn = yypact[yystate];
2897
1/2
✓ Branch 0 taken 1191 times.
✗ Branch 1 not taken.
1191 if (!yypact_value_is_default (yyn))
2898 {
2899 1191 yyn += YYSYMBOL_YYerror;
2900
3/4
✓ Branch 0 taken 1162 times.
✓ Branch 1 taken 29 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1162 times.
1191 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
2901 {
2902 yyn = yytable[yyn];
2903 if (0 < yyn)
2904 break;
2905 }
2906 }
2907
2908 /* Pop the current state because it cannot handle the error token. */
2909
2/2
✓ Branch 0 taken 505 times.
✓ Branch 1 taken 686 times.
1191 if (yyssp == yyss)
2910 505 YYABORT;
2911
2912 686 yyerror_range[1] = *yylsp;
2913 686 yydestruct ("Error: popping",
2914 686 YY_ACCESSING_SYMBOL (yystate), yyvsp, yylsp, tree);
2915 686 YYPOPSTACK (1);
2916 686 yystate = *yyssp;
2917 YY_STACK_PRINT (yyss, yyssp);
2918 }
2919
2920 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2921 *++yyvsp = yylval;
2922 YY_IGNORE_MAYBE_UNINITIALIZED_END
2923
2924 yyerror_range[2] = yylloc;
2925 ++yylsp;
2926 YYLLOC_DEFAULT (*yylsp, yyerror_range, 2);
2927
2928 /* Shift the error token. */
2929 YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
2930
2931 yystate = yyn;
2932 goto yynewstate;
2933
2934
2935 /*-------------------------------------.
2936 | yyacceptlab -- YYACCEPT comes here. |
2937 `-------------------------------------*/
2938 yyacceptlab:
2939 yyresult = 0;
2940 2875 goto yyreturnlab;
2941
2942
2943 /*-----------------------------------.
2944 | yyabortlab -- YYABORT comes here. |
2945 `-----------------------------------*/
2946 505 yyabortlab:
2947 yyresult = 1;
2948 505 goto yyreturnlab;
2949
2950
2951 /*-----------------------------------------------------------.
2952 | yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. |
2953 `-----------------------------------------------------------*/
2954 yyexhaustedlab:
2955 yyerror (tree, YY_("memory exhausted"));
2956 yyresult = 2;
2957 goto yyreturnlab;
2958
2959
2960 /*----------------------------------------------------------.
2961 | yyreturnlab -- parsing is finished, clean up and return. |
2962 `----------------------------------------------------------*/
2963 3380 yyreturnlab:
2964
2/2
✓ Branch 0 taken 505 times.
✓ Branch 1 taken 2875 times.
3380 if (yychar != AXEMPTY)
2965 {
2966 /* Make sure we have latest lookahead translation. See comments at
2967 user semantic actions for why this is necessary. */
2968
1/2
✓ Branch 0 taken 505 times.
✗ Branch 1 not taken.
505 yytoken = YYTRANSLATE (yychar);
2969 505 yydestruct ("Cleanup: discarding lookahead",
2970 yytoken, &yylval, &yylloc, tree);
2971 }
2972 /* Do not reclaim the symbols of the rule whose action triggered
2973 this YYABORT or YYACCEPT. */
2974 YYPOPSTACK (yylen);
2975 YY_STACK_PRINT (yyss, yyssp);
2976
2/2
✓ Branch 0 taken 5750 times.
✓ Branch 1 taken 3380 times.
9130 while (yyssp != yyss)
2977 {
2978 5750 yydestruct ("Cleanup: popping",
2979 5750 YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, yylsp, tree);
2980 5750 YYPOPSTACK (1);
2981 }
2982 #ifndef yyoverflow
2983
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 3380 times.
3380 if (yyss != yyssa)
2984 YYSTACK_FREE (yyss);
2985 #endif
2986
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 3380 times.
3380 if (yymsg != yymsgbuf)
2987 YYSTACK_FREE (yymsg);
2988 3380 return yyresult;
2989 }
2990
2991
2992
2993 OPENVDB_NO_TYPE_CONVERSION_WARNING_END
2994
2995