Block-Structured AMR Software Framework
 
Loading...
Searching...
No Matches
amrex_iparser.tab.nolint.H
Go to the documentation of this file.
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/* Substitute the type names. */
67#define YYSTYPE AMREX_IPARSERSTYPE
68/* Substitute the variable and function names. */
69#define yyparse amrex_iparserparse
70#define yylex amrex_iparserlex
71#define yyerror amrex_iparsererror
72#define yydebug amrex_iparserdebug
73#define yynerrs amrex_iparsernerrs
74#define yylval amrex_iparserlval
75#define yychar amrex_iparserchar
76
77/* First part of user prologue. */
78
79#include <AMReX_IParser_Y.H>
80#include <stdio.h>
81#include <stdlib.h>
82#include <string.h>
84/* Bison seems to have a bug. yyalloc etc. do not have the api.prefix. */
85#ifndef yyalloc
86# define yyalloc amrex_iparseralloc
87#endif
88#ifndef yysymbol_kind_t
89# define yysymbol_kind_t amrex_iparsersymbol_kind_t
90#endif
91
92
93# ifndef YY_CAST
94# ifdef __cplusplus
95# define YY_CAST(Type, Val) static_cast<Type> (Val)
96# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
97# else
98# define YY_CAST(Type, Val) ((Type) (Val))
99# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
100# endif
101# endif
102# ifndef YY_NULLPTR
103# if defined __cplusplus
104# if 201103L <= __cplusplus
105# define YY_NULLPTR nullptr
106# else
107# define YY_NULLPTR 0
108# endif
109# else
110# define YY_NULLPTR ((void*)0)
111# endif
112# endif
113
114#include "amrex_iparser.tab.h"
115/* Symbol kind. */
117{
119 YYSYMBOL_YYEOF = 0, /* "end of file" */
120 YYSYMBOL_YYerror = 1, /* error */
121 YYSYMBOL_YYUNDEF = 2, /* "invalid token" */
122 YYSYMBOL_NODE = 3, /* NODE */
123 YYSYMBOL_NUMBER = 4, /* NUMBER */
124 YYSYMBOL_SYMBOL = 5, /* SYMBOL */
125 YYSYMBOL_F1 = 6, /* F1 */
126 YYSYMBOL_F2 = 7, /* F2 */
127 YYSYMBOL_F3 = 8, /* F3 */
128 YYSYMBOL_EOL = 9, /* EOL */
129 YYSYMBOL_FLRDIV = 10, /* "//" */
130 YYSYMBOL_POW = 11, /* "**" */
131 YYSYMBOL_12_ = 12, /* '^' */
132 YYSYMBOL_GEQ = 13, /* ">=" */
133 YYSYMBOL_LEQ = 14, /* "<=" */
134 YYSYMBOL_EQ = 15, /* "==" */
135 YYSYMBOL_NEQ = 16, /* "!=" */
136 YYSYMBOL_AND = 17, /* "and" */
137 YYSYMBOL_OR = 18, /* "or" */
138 YYSYMBOL_19_ = 19, /* ';' */
139 YYSYMBOL_20_ = 20, /* '=' */
140 YYSYMBOL_21_ = 21, /* '<' */
141 YYSYMBOL_22_ = 22, /* '>' */
142 YYSYMBOL_23_ = 23, /* '+' */
143 YYSYMBOL_24_ = 24, /* '-' */
144 YYSYMBOL_25_ = 25, /* '*' */
145 YYSYMBOL_26_ = 26, /* '/' */
146 YYSYMBOL_NEG = 27, /* NEG */
147 YYSYMBOL_UPLUS = 28, /* UPLUS */
148 YYSYMBOL_29_ = 29, /* '(' */
149 YYSYMBOL_30_ = 30, /* ')' */
150 YYSYMBOL_31_ = 31, /* ',' */
151 YYSYMBOL_YYACCEPT = 32, /* $accept */
152 YYSYMBOL_input = 33, /* input */
153 YYSYMBOL_exp = 34, /* exp */
154 YYSYMBOL_stmt = 35, /* stmt */
155 YYSYMBOL_or_exp = 36, /* or_exp */
156 YYSYMBOL_and_exp = 37, /* and_exp */
157 YYSYMBOL_cmp_exp = 38, /* cmp_exp */
158 YYSYMBOL_add_exp = 39, /* add_exp */
159 YYSYMBOL_mul_exp = 40, /* mul_exp */
160 YYSYMBOL_unary_exp = 41, /* unary_exp */
161 YYSYMBOL_pow_exp = 42, /* pow_exp */
162 YYSYMBOL_primary_exp = 43 /* primary_exp */
165
166
167
168
169#ifdef short
170# undef short
171#endif
172
173/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
174 <limits.h> and (if available) <stdint.h> are included
175 so that the code can choose integer types of a good width. */
176
177#ifndef __PTRDIFF_MAX__
178# include <limits.h> /* INFRINGES ON USER NAME SPACE */
179# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
180# include <stdint.h> /* INFRINGES ON USER NAME SPACE */
181# define YY_STDINT_H
182# endif
183#endif
184
185/* Narrow types that promote to a signed type and that can represent a
186 signed or unsigned integer of at least N bits. In tables they can
187 save space and decrease cache pressure. Promoting to a signed type
188 helps avoid bugs in integer arithmetic. */
189
190#ifdef __INT_LEAST8_MAX__
191typedef __INT_LEAST8_TYPE__ yytype_int8;
192#elif defined YY_STDINT_H
193typedef int_least8_t yytype_int8;
194#else
195typedef signed char yytype_int8;
196#endif
197
198#ifdef __INT_LEAST16_MAX__
199typedef __INT_LEAST16_TYPE__ yytype_int16;
200#elif defined YY_STDINT_H
201typedef int_least16_t yytype_int16;
202#else
203typedef short yytype_int16;
204#endif
205
206/* Work around bug in HP-UX 11.23, which defines these macros
207 incorrectly for preprocessor constants. This workaround can likely
208 be removed in 2023, as HPE has promised support for HP-UX 11.23
209 (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
210 <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>. */
211#ifdef __hpux
212# undef UINT_LEAST8_MAX
213# undef UINT_LEAST16_MAX
214# define UINT_LEAST8_MAX 255
215# define UINT_LEAST16_MAX 65535
216#endif
217
218#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
219typedef __UINT_LEAST8_TYPE__ yytype_uint8;
220#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
221 && UINT_LEAST8_MAX <= INT_MAX)
222typedef uint_least8_t yytype_uint8;
223#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
224typedef unsigned char yytype_uint8;
225#else
226typedef short yytype_uint8;
227#endif
228
229#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
230typedef __UINT_LEAST16_TYPE__ yytype_uint16;
231#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
232 && UINT_LEAST16_MAX <= INT_MAX)
233typedef uint_least16_t yytype_uint16;
234#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
235typedef unsigned short yytype_uint16;
236#else
237typedef int yytype_uint16;
238#endif
239
240#ifndef YYPTRDIFF_T
241# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
242# define YYPTRDIFF_T __PTRDIFF_TYPE__
243# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
244# elif defined PTRDIFF_MAX
245# ifndef ptrdiff_t
246# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
247# endif
248# define YYPTRDIFF_T ptrdiff_t
249# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
250# else
251# define YYPTRDIFF_T long
252# define YYPTRDIFF_MAXIMUM LONG_MAX
253# endif
254#endif
255
256#ifndef YYSIZE_T
257# ifdef __SIZE_TYPE__
258# define YYSIZE_T __SIZE_TYPE__
259# elif defined size_t
260# define YYSIZE_T size_t
261# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
262# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
263# define YYSIZE_T size_t
264# else
265# define YYSIZE_T unsigned
266# endif
267#endif
268
269#define YYSIZE_MAXIMUM \
270 YY_CAST (YYPTRDIFF_T, \
271 (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
272 ? YYPTRDIFF_MAXIMUM \
273 : YY_CAST (YYSIZE_T, -1)))
274
275#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
276
277
278/* Stored state numbers (used for stacks). */
280
281/* State numbers in computations. */
282typedef int yy_state_fast_t;
283
284#ifndef YY_
285# if defined YYENABLE_NLS && YYENABLE_NLS
286# if ENABLE_NLS
287# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
288# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
289# endif
290# endif
291# ifndef YY_
292# define YY_(Msgid) Msgid
293# endif
294#endif
295
296
297#ifndef YY_ATTRIBUTE_PURE
298# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
299# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
300# else
301# define YY_ATTRIBUTE_PURE
302# endif
303#endif
304
305#ifndef YY_ATTRIBUTE_UNUSED
306# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
307# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
308# else
309# define YY_ATTRIBUTE_UNUSED
310# endif
311#endif
312
313/* Suppress unused-variable warnings by "using" E. */
314#if ! defined lint || defined __GNUC__
315# define YY_USE(E) ((void) (E))
316#else
317# define YY_USE(E) /* empty */
318#endif
319
320/* Suppress an incorrect diagnostic about yylval being uninitialized. */
321#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
322# if __GNUC__ * 100 + __GNUC_MINOR__ < 407
323# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
324 _Pragma ("GCC diagnostic push") \
325 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
326# else
327# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
328 _Pragma ("GCC diagnostic push") \
329 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
330 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
331# endif
332# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
333 _Pragma ("GCC diagnostic pop")
334#else
335# define YY_INITIAL_VALUE(Value) Value
336#endif
337#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
338# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
339# define YY_IGNORE_MAYBE_UNINITIALIZED_END
340#endif
341#ifndef YY_INITIAL_VALUE
342# define YY_INITIAL_VALUE(Value) /* Nothing. */
343#endif
344
345#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
346# define YY_IGNORE_USELESS_CAST_BEGIN \
347 _Pragma ("GCC diagnostic push") \
348 _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
349# define YY_IGNORE_USELESS_CAST_END \
350 _Pragma ("GCC diagnostic pop")
351#endif
352#ifndef YY_IGNORE_USELESS_CAST_BEGIN
353# define YY_IGNORE_USELESS_CAST_BEGIN
354# define YY_IGNORE_USELESS_CAST_END
355#endif
356
357
358#define YY_ASSERT(E) ((void) (0 && (E)))
359
360#if !defined yyoverflow
361
362/* The parser invokes alloca or malloc; define the necessary symbols. */
363
364# ifdef YYSTACK_USE_ALLOCA
365# if YYSTACK_USE_ALLOCA
366# ifdef __GNUC__
367# define YYSTACK_ALLOC __builtin_alloca
368# elif defined __BUILTIN_VA_ARG_INCR
369# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
370# elif defined _AIX
371# define YYSTACK_ALLOC __alloca
372# elif defined _MSC_VER
373# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
374# define alloca _alloca
375# else
376# define YYSTACK_ALLOC alloca
377# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
378# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
379 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
380# ifndef EXIT_SUCCESS
381# define EXIT_SUCCESS 0
382# endif
383# endif
384# endif
385# endif
386# endif
387
388# ifdef YYSTACK_ALLOC
389 /* Pacify GCC's 'empty if-body' warning. */
390# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
391# ifndef YYSTACK_ALLOC_MAXIMUM
392 /* The OS might guarantee only one guard page at the bottom of the stack,
393 and a page size can be as small as 4096 bytes. So we cannot safely
394 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
395 to allow for a few compiler-allocated temporary stack slots. */
396# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
397# endif
398# else
399# define YYSTACK_ALLOC YYMALLOC
400# define YYSTACK_FREE YYFREE
401# ifndef YYSTACK_ALLOC_MAXIMUM
402# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
403# endif
404# if (defined __cplusplus && ! defined EXIT_SUCCESS \
405 && ! ((defined YYMALLOC || defined malloc) \
406 && (defined YYFREE || defined free)))
407# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
408# ifndef EXIT_SUCCESS
409# define EXIT_SUCCESS 0
410# endif
411# endif
412# ifndef YYMALLOC
413# define YYMALLOC malloc
414# if ! defined malloc && ! defined EXIT_SUCCESS
415void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
416# endif
417# endif
418# ifndef YYFREE
419# define YYFREE free
420# if ! defined free && ! defined EXIT_SUCCESS
421void free (void *); /* INFRINGES ON USER NAME SPACE */
422# endif
423# endif
424# endif
425#endif /* !defined yyoverflow */
426
427#if (! defined yyoverflow \
428 && (! defined __cplusplus \
429 || (defined AMREX_IPARSERSTYPE_IS_TRIVIAL && AMREX_IPARSERSTYPE_IS_TRIVIAL)))
430
431/* A type that is properly aligned for any stack member. */
437
438/* The size of the maximum gap between one aligned stack and the next. */
439# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
440
441/* The size of an array large to enough to hold all stacks, each with
442 N elements. */
443# define YYSTACK_BYTES(N) \
444 ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
445 + YYSTACK_GAP_MAXIMUM)
446
447# define YYCOPY_NEEDED 1
448
449/* Relocate STACK from its old location to the new one. The
450 local variables YYSIZE and YYSTACKSIZE give the old and new number of
451 elements in the stack, and YYPTR gives the new location of the
452 stack. Advance YYPTR to a properly aligned location for the next
453 stack. */
454# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
455 do \
456 { \
457 YYPTRDIFF_T yynewbytes; \
458 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
459 Stack = &yyptr->Stack_alloc; \
460 yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
461 yyptr += yynewbytes / YYSIZEOF (*yyptr); \
462 } \
463 while (0)
464
465#endif
466
467#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
468/* Copy COUNT objects from SRC to DST. The source and destination do
469 not overlap. */
470# ifndef YYCOPY
471# if defined __GNUC__ && 1 < __GNUC__
472# define YYCOPY(Dst, Src, Count) \
473 __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
474# else
475# define YYCOPY(Dst, Src, Count) \
476 do \
477 { \
478 YYPTRDIFF_T yyi; \
479 for (yyi = 0; yyi < (Count); yyi++) \
480 (Dst)[yyi] = (Src)[yyi]; \
481 } \
482 while (0)
483# endif
484# endif
485#endif /* !YYCOPY_NEEDED */
486
487/* YYFINAL -- State number of the termination state. */
488#define YYFINAL 2
489/* YYLAST -- Last index in YYTABLE. */
490#define YYLAST 86
491
492/* YYNTOKENS -- Number of terminals. */
493#define YYNTOKENS 32
494/* YYNNTS -- Number of nonterminals. */
495#define YYNNTS 12
496/* YYNRULES -- Number of rules. */
497#define YYNRULES 37
498/* YYNSTATES -- Number of states. */
499#define YYNSTATES 74
500
501/* YYMAXUTOK -- Last valid token kind. */
502#define YYMAXUTOK 274
503
504
505/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
506 as returned by yylex, with out-of-bounds checking. */
507#define YYTRANSLATE(YYX) \
508 (0 <= (YYX) && (YYX) <= YYMAXUTOK \
509 ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \
510 : YYSYMBOL_YYUNDEF)
511
512/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
513 as returned by yylex. */
514static const yytype_int8 yytranslate[] =
515{
516 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
517 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
518 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
519 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
520 29, 30, 25, 23, 31, 24, 2, 26, 2, 2,
521 2, 2, 2, 2, 2, 2, 2, 2, 2, 19,
522 21, 20, 22, 2, 2, 2, 2, 2, 2, 2,
523 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
524 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
525 2, 2, 2, 2, 12, 2, 2, 2, 2, 2,
526 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
527 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
528 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
529 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
530 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
531 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
532 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
533 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
534 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
535 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
536 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
537 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
538 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
539 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
540 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
541 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
542 5, 6, 7, 8, 9, 10, 11, 13, 14, 15,
543 16, 17, 18, 27, 28
544};
545
546#if AMREX_IPARSERDEBUG
547/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
548static const yytype_uint8 yyrline[] =
549{
550 0, 76, 76, 77, 84, 85, 86, 91, 92, 96,
551 97, 102, 103, 108, 109, 110, 111, 112, 113, 114,
552 119, 120, 121, 126, 127, 128, 129, 133, 134, 135,
553 140, 141, 146, 147, 148, 149, 150, 151
554};
555#endif
556
558#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
559
560#if AMREX_IPARSERDEBUG || 0
561/* The user-facing name of the symbol whose (internal) number is
562 YYSYMBOL. No bounds checking. */
563static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
564
565/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
566 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
567static const char *const yytname[] =
568{
569 "\"end of file\"", "error", "\"invalid token\"", "NODE", "NUMBER",
570 "SYMBOL", "F1", "F2", "F3", "EOL", "\"//\"", "\"**\"", "'^'", "\">=\"",
571 "\"<=\"", "\"==\"", "\"!=\"", "\"and\"", "\"or\"", "';'", "'='", "'<'",
572 "'>'", "'+'", "'-'", "'*'", "'/'", "NEG", "UPLUS", "'('", "')'", "','",
573 "$accept", "input", "exp", "stmt", "or_exp", "and_exp", "cmp_exp",
574 "add_exp", "mul_exp", "unary_exp", "pow_exp", "primary_exp", YY_NULLPTR
575};
576
577static const char *
578yysymbol_name (yysymbol_kind_t yysymbol)
579{
580 return yytname[yysymbol];
581}
582#endif
583
584#define YYPACT_NINF (-20)
585
586#define yypact_value_is_default(Yyn) \
587 ((Yyn) == YYPACT_NINF)
588
589#define YYTABLE_NINF (-1)
590
591#define yytable_value_is_error(Yyn) \
592 0
593
594/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
595 STATE-NUM. */
596static const yytype_int8 yypact[] =
597{
598 -20, 15, -20, -20, -17, -19, -11, -3, 1, 1,
599 1, 49, -20, 11, 16, 58, 29, 6, -20, -20,
600 55, 1, 1, 1, 1, -20, -20, -20, 24, -20,
601 41, 1, 1, 1, 1, 1, 1, 1, 1, 1,
602 1, 1, 1, 1, 1, 11, 25, -14, 9, -20,
603 -20, 16, 58, 29, 29, 29, 29, 29, 29, 6,
604 6, -20, -20, -20, -20, -20, 1, 1, 32, 10,
605 -20, 1, 33, -20
606};
607
608/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
609 Performed when YYTABLE does not specify something else to do. Zero
610 means the default is an error. */
611static const yytype_int8 yydefact[] =
612{
613 2, 0, 1, 32, 33, 0, 0, 0, 0, 0,
614 0, 0, 4, 7, 9, 11, 13, 20, 23, 27,
615 30, 0, 0, 0, 0, 33, 29, 28, 0, 3,
616 6, 0, 0, 0, 0, 0, 0, 0, 0, 0,
617 0, 0, 0, 0, 0, 8, 0, 0, 0, 34,
618 5, 10, 12, 17, 16, 18, 19, 14, 15, 21,
619 22, 26, 24, 25, 31, 35, 0, 0, 0, 0,
620 36, 0, 0, 37
621};
622
623/* YYPGOTO[NTERM-NUM]. */
624static const yytype_int8 yypgoto[] =
625{
626 -20, -20, -20, 37, -10, 38, 43, 48, 20, -7,
627 -20, -20
628};
629
630/* YYDEFGOTO[NTERM-NUM]. */
631static const yytype_int8 yydefgoto[] =
632{
633 0, 1, 11, 12, 13, 14, 15, 16, 17, 18,
634 19, 20
635};
636
637/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
638 positive, shift that token. If negative, reduce the rule whose
639 number is the opposite. If YYTABLE_NINF, syntax error. */
640static const yytype_int8 yytable[] =
641{
642 28, 26, 27, 21, 31, 3, 25, 5, 6, 7,
643 22, 45, 46, 47, 48, 2, 41, 66, 23, 3,
644 4, 5, 6, 7, 8, 9, 24, 31, 31, 31,
645 10, 42, 43, 32, 61, 62, 63, 64, 8, 9,
646 67, 71, 31, 31, 10, 3, 4, 5, 6, 7,
647 31, 31, 39, 40, 49, 65, 68, 69, 29, 59,
648 60, 72, 70, 73, 8, 9, 44, 50, 30, 51,
649 10, 33, 34, 35, 36, 52, 0, 0, 0, 37,
650 38, 53, 54, 55, 56, 57, 58
651};
652
653static const yytype_int8 yycheck[] =
654{
655 10, 8, 9, 20, 18, 4, 5, 6, 7, 8,
656 29, 21, 22, 23, 24, 0, 10, 31, 29, 4,
657 5, 6, 7, 8, 23, 24, 29, 18, 18, 18,
658 29, 25, 26, 17, 41, 42, 43, 44, 23, 24,
659 31, 31, 18, 18, 29, 4, 5, 6, 7, 8,
660 18, 18, 23, 24, 30, 30, 66, 67, 9, 39,
661 40, 71, 30, 30, 23, 24, 11, 30, 19, 31,
662 29, 13, 14, 15, 16, 32, -1, -1, -1, 21,
663 22, 33, 34, 35, 36, 37, 38
664};
665
666/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
667 state STATE-NUM. */
668static const yytype_int8 yystos[] =
669{
670 0, 33, 0, 4, 5, 6, 7, 8, 23, 24,
671 29, 34, 35, 36, 37, 38, 39, 40, 41, 42,
672 43, 20, 29, 29, 29, 5, 41, 41, 36, 9,
673 19, 18, 17, 13, 14, 15, 16, 21, 22, 23,
674 24, 10, 25, 26, 11, 36, 36, 36, 36, 30,
675 35, 37, 38, 39, 39, 39, 39, 39, 39, 40,
676 40, 41, 41, 41, 41, 30, 31, 31, 36, 36,
677 30, 31, 36, 30
678};
679
680/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */
681static const yytype_int8 yyr1[] =
682{
683 0, 32, 33, 33, 34, 34, 34, 35, 35, 36,
684 36, 37, 37, 38, 38, 38, 38, 38, 38, 38,
685 39, 39, 39, 40, 40, 40, 40, 41, 41, 41,
686 42, 42, 43, 43, 43, 43, 43, 43
687};
688
689/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */
690static const yytype_int8 yyr2[] =
691{
692 0, 2, 0, 3, 1, 3, 2, 1, 3, 1,
693 3, 1, 3, 1, 3, 3, 3, 3, 3, 3,
694 1, 3, 3, 1, 3, 3, 3, 1, 2, 2,
695 1, 3, 1, 1, 3, 4, 6, 8
696};
697
698
699enum { YYENOMEM = -2 };
700
701#define yyerrok (yyerrstatus = 0)
702#define yyclearin (yychar = AMREX_IPARSEREMPTY)
703
704#define YYACCEPT goto yyacceptlab
705#define YYABORT goto yyabortlab
706#define YYERROR goto yyerrorlab
707#define YYNOMEM goto yyexhaustedlab
708
709
710#define YYRECOVERING() (!!yyerrstatus)
711
712#define YYBACKUP(Token, Value) \
713 do \
714 if (yychar == AMREX_IPARSEREMPTY) \
715 { \
716 yychar = (Token); \
717 yylval = (Value); \
718 YYPOPSTACK (yylen); \
719 yystate = *yyssp; \
720 goto yybackup; \
721 } \
722 else \
723 { \
724 yyerror (YY_("syntax error: cannot back up")); \
725 YYERROR; \
726 } \
727 while (0)
728
729/* Backward compatibility with an undocumented macro.
730 Use AMREX_IPARSERerror or AMREX_IPARSERUNDEF. */
731#define YYERRCODE AMREX_IPARSERUNDEF
732
733
734/* Enable debugging if requested. */
735#if AMREX_IPARSERDEBUG
736
737# ifndef YYFPRINTF
738# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
739# define YYFPRINTF fprintf
740# endif
741
742# define YYDPRINTF(Args) \
743do { \
744 if (yydebug) \
745 YYFPRINTF Args; \
746} while (0)
747
748
749
750
751# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \
752do { \
753 if (yydebug) \
754 { \
755 YYFPRINTF (stderr, "%s ", Title); \
756 yy_symbol_print (stderr, \
757 Kind, Value); \
758 YYFPRINTF (stderr, "\n"); \
759 } \
760} while (0)
761
762
763/*-----------------------------------.
764| Print this symbol's value on YYO. |
765`-----------------------------------*/
766
767static void
768yy_symbol_value_print (FILE *yyo,
769 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
770{
771 FILE *yyoutput = yyo;
772 YY_USE (yyoutput);
773 if (!yyvaluep)
774 return;
776 YY_USE (yykind);
778}
779
780
781/*---------------------------.
782| Print this symbol on YYO. |
783`---------------------------*/
784
785static void
786yy_symbol_print (FILE *yyo,
787 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
788{
789 YYFPRINTF (yyo, "%s %s (",
790 yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
791
792 yy_symbol_value_print (yyo, yykind, yyvaluep);
793 YYFPRINTF (yyo, ")");
794}
795
796/*------------------------------------------------------------------.
797| yy_stack_print -- Print the state stack from its BOTTOM up to its |
798| TOP (included). |
799`------------------------------------------------------------------*/
800
801static void
802yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
803{
804 YYFPRINTF (stderr, "Stack now");
805 for (; yybottom <= yytop; yybottom++)
806 {
807 int yybot = *yybottom;
808 YYFPRINTF (stderr, " %d", yybot);
809 }
810 YYFPRINTF (stderr, "\n");
811}
812
813# define YY_STACK_PRINT(Bottom, Top) \
814do { \
815 if (yydebug) \
816 yy_stack_print ((Bottom), (Top)); \
817} while (0)
818
819
820/*------------------------------------------------.
821| Report that the YYRULE is going to be reduced. |
822`------------------------------------------------*/
823
824static void
825yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp,
826 int yyrule)
827{
828 int yylno = yyrline[yyrule];
829 int yynrhs = yyr2[yyrule];
830 int yyi;
831 YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
832 yyrule - 1, yylno);
833 /* The symbols being reduced. */
834 for (yyi = 0; yyi < yynrhs; yyi++)
835 {
836 YYFPRINTF (stderr, " $%d = ", yyi + 1);
837 yy_symbol_print (stderr,
838 YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
839 &yyvsp[(yyi + 1) - (yynrhs)]);
840 YYFPRINTF (stderr, "\n");
841 }
842}
843
844# define YY_REDUCE_PRINT(Rule) \
845do { \
846 if (yydebug) \
847 yy_reduce_print (yyssp, yyvsp, Rule); \
848} while (0)
849
850/* Nonzero means print parse trace. It is left uninitialized so that
851 multiple parsers can coexist. */
852int yydebug;
853#else /* !AMREX_IPARSERDEBUG */
854# define YYDPRINTF(Args) ((void) 0)
855# define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
856# define YY_STACK_PRINT(Bottom, Top)
857# define YY_REDUCE_PRINT(Rule)
858#endif /* !AMREX_IPARSERDEBUG */
859
860
861/* YYINITDEPTH -- initial size of the parser's stacks. */
862#ifndef YYINITDEPTH
863# define YYINITDEPTH 200
864#endif
865
866/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
867 if the built-in stack extension method is used).
868
869 Do not make this value too large; the results are undefined if
870 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
871 evaluated with infinite-precision integer arithmetic. */
872
873#ifndef YYMAXDEPTH
874# define YYMAXDEPTH 10000
875#endif
876
877
878
879
880
881
882/*-----------------------------------------------.
883| Release the memory associated to this symbol. |
884`-----------------------------------------------*/
885
886static void
887yydestruct (const char *yymsg,
888 yysymbol_kind_t yykind, YYSTYPE *yyvaluep)
889{
890 YY_USE (yyvaluep);
891 if (!yymsg)
892 yymsg = "Deleting";
893 YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
894
896 YY_USE (yykind);
898}
899
900
901/* Lookahead token kind. */
903
904/* The semantic value of the lookahead symbol. */
906/* Number of syntax errors so far. */
908
909
910
911
912/*----------.
913| yyparse. |
914`----------*/
915
916int
918{
919 yy_state_fast_t yystate = 0;
920 /* Number of tokens to shift before error messages enabled. */
921 int yyerrstatus = 0;
922
923 /* Refer to the stacks through separate pointers, to allow yyoverflow
924 to reallocate them elsewhere. */
925
926 /* Their size. */
927 YYPTRDIFF_T yystacksize = YYINITDEPTH;
928
929 /* The state stack: array, bottom, top. */
930 yy_state_t yyssa[YYINITDEPTH];
931 yy_state_t *yyss = yyssa;
932 yy_state_t *yyssp = yyss;
933
934 /* The semantic value stack: array, bottom, top. */
935 YYSTYPE yyvsa[YYINITDEPTH];
936 YYSTYPE *yyvs = yyvsa;
937 YYSTYPE *yyvsp = yyvs;
938
939 int yyn;
940 /* The return value of yyparse. */
941 int yyresult;
942 /* Lookahead symbol kind. */
944 /* The variables used to return semantic value and location from the
945 action routines. */
946 YYSTYPE yyval;
947
948
949
950#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
951
952 /* The number of symbols on the RHS of the reduced rule.
953 Keep to zero when no symbol should be popped. */
954 int yylen = 0;
955
956 YYDPRINTF ((stderr, "Starting parse\n"));
957
958 yychar = AMREX_IPARSEREMPTY; /* Cause a token to be read. */
959
960 goto yysetstate;
961
962
963/*------------------------------------------------------------.
964| yynewstate -- push a new state, which is found in yystate. |
965`------------------------------------------------------------*/
966yynewstate:
967 /* In all cases, when you get here, the value and location stacks
968 have just been pushed. So pushing a state here evens the stacks. */
969 yyssp++;
970
971
972/*--------------------------------------------------------------------.
973| yysetstate -- set current state (the top of the stack) to yystate. |
974`--------------------------------------------------------------------*/
975yysetstate:
976 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
977 YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
979 *yyssp = YY_CAST (yy_state_t, yystate);
981 YY_STACK_PRINT (yyss, yyssp);
982
983 if (yyss + yystacksize - 1 <= yyssp)
984#if !defined yyoverflow && !defined YYSTACK_RELOCATE
985 YYNOMEM;
986#else
987 {
988 /* Get the current used size of the three stacks, in elements. */
989 YYPTRDIFF_T yysize = yyssp - yyss + 1;
990
991# if defined yyoverflow
992 {
993 /* Give user a chance to reallocate the stack. Use copies of
994 these so that the &'s don't force the real ones into
995 memory. */
996 yy_state_t *yyss1 = yyss;
997 YYSTYPE *yyvs1 = yyvs;
998
999 /* Each stack pointer address is followed by the size of the
1000 data in use in that stack, in bytes. This used to be a
1001 conditional around just the two extra args, but that might
1002 be undefined if yyoverflow is a macro. */
1003 yyoverflow (YY_("memory exhausted"),
1004 &yyss1, yysize * YYSIZEOF (*yyssp),
1005 &yyvs1, yysize * YYSIZEOF (*yyvsp),
1006 &yystacksize);
1007 yyss = yyss1;
1008 yyvs = yyvs1;
1009 }
1010# else /* defined YYSTACK_RELOCATE */
1011 /* Extend the stack our own way. */
1012 if (YYMAXDEPTH <= yystacksize)
1013 YYNOMEM;
1014 yystacksize *= 2;
1015 if (YYMAXDEPTH < yystacksize)
1016 yystacksize = YYMAXDEPTH;
1017
1018 {
1019 yy_state_t *yyss1 = yyss;
1020 union yyalloc *yyptr =
1021 YY_CAST (union yyalloc *,
1022 YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
1023 if (! yyptr)
1024 YYNOMEM;
1025 YYSTACK_RELOCATE (yyss_alloc, yyss);
1026 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1027# undef YYSTACK_RELOCATE
1028 if (yyss1 != yyssa)
1029 YYSTACK_FREE (yyss1);
1030 }
1031# endif
1032
1033 yyssp = yyss + yysize - 1;
1034 yyvsp = yyvs + yysize - 1;
1035
1037 YYDPRINTF ((stderr, "Stack size increased to %ld\n",
1038 YY_CAST (long, yystacksize)));
1040
1041 if (yyss + yystacksize - 1 <= yyssp)
1042 YYABORT;
1043 }
1044#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
1045
1046
1047 if (yystate == YYFINAL)
1048 YYACCEPT;
1049
1050 goto yybackup;
1051
1052
1053/*-----------.
1054| yybackup. |
1055`-----------*/
1056yybackup:
1057 /* Do appropriate processing given the current state. Read a
1058 lookahead token if we need one and don't already have one. */
1059
1060 /* First try to decide what to do without reference to lookahead token. */
1061 yyn = yypact[yystate];
1062 if (yypact_value_is_default (yyn))
1063 goto yydefault;
1064
1065 /* Not known => get a lookahead token if don't already have one. */
1066
1067 /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */
1069 {
1070 YYDPRINTF ((stderr, "Reading a token\n"));
1071 yychar = yylex ();
1072 }
1073
1074 if (yychar <= AMREX_IPARSEREOF)
1075 {
1077 yytoken = YYSYMBOL_YYEOF;
1078 YYDPRINTF ((stderr, "Now at end of input.\n"));
1079 }
1080 else if (yychar == AMREX_IPARSERerror)
1081 {
1082 /* The scanner already issued an error message, process directly
1083 to error recovery. But do not keep the error token as
1084 lookahead, it is too special and may lead us to an endless
1085 loop in error recovery. */
1087 yytoken = YYSYMBOL_YYerror;
1088 goto yyerrlab1;
1089 }
1090 else
1091 {
1092 yytoken = YYTRANSLATE (yychar);
1093 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1094 }
1095
1096 /* If the proper action on seeing token YYTOKEN is to reduce or to
1097 detect an error, take that action. */
1098 yyn += yytoken;
1099 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1100 goto yydefault;
1101 yyn = yytable[yyn];
1102 if (yyn <= 0)
1103 {
1104 if (yytable_value_is_error (yyn))
1105 goto yyerrlab;
1106 yyn = -yyn;
1107 goto yyreduce;
1108 }
1109
1110 /* Count tokens shifted since error; after three, turn off error
1111 status. */
1112 if (yyerrstatus)
1113 yyerrstatus--;
1114
1115 /* Shift the lookahead token. */
1116 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1117 yystate = yyn;
1119 *++yyvsp = yylval;
1121
1122 /* Discard the shifted token. */
1124 goto yynewstate;
1125
1126
1127/*-----------------------------------------------------------.
1128| yydefault -- do the default action for the current state. |
1129`-----------------------------------------------------------*/
1130yydefault:
1131 yyn = yydefact[yystate];
1132 if (yyn == 0)
1133 goto yyerrlab;
1134 goto yyreduce;
1135
1136
1137/*-----------------------------.
1138| yyreduce -- do a reduction. |
1139`-----------------------------*/
1140yyreduce:
1141 /* yyn is the number of a rule to reduce with. */
1142 yylen = yyr2[yyn];
1143
1144 /* If YYLEN is nonzero, implement the default value of the action:
1145 '$$ = $1'.
1146
1147 Otherwise, the following line sets YYVAL to garbage.
1148 This behavior is undocumented and Bison
1149 users should not rely upon it. Assigning to YYVAL
1150 unconditionally makes the parser a bit smaller, and it avoids a
1151 GCC warning that YYVAL may be used uninitialized. */
1152 yyval = yyvsp[1-yylen];
1153
1154
1155 YY_REDUCE_PRINT (yyn);
1156 switch (yyn)
1157 {
1158 case 3: /* input: input exp EOL */
1159 {
1160 amrex::iparser_defexpr((yyvsp[-1].n));
1161 }
1162 break;
1163
1164 case 4: /* exp: stmt */
1165 { (yyval.n) = (yyvsp[0].n); }
1166 break;
1167
1168 case 5: /* exp: exp ';' stmt */
1169 { (yyval.n) = amrex::iparser_newlist((yyvsp[-2].n), (yyvsp[0].n)); }
1170 break;
1171
1172 case 6: /* exp: exp ';' */
1173 { (yyval.n) = amrex::iparser_newlist((yyvsp[-1].n), nullptr); }
1174 break;
1175
1176 case 7: /* stmt: or_exp */
1177 { (yyval.n) = (yyvsp[0].n); }
1178 break;
1179
1180 case 8: /* stmt: SYMBOL '=' or_exp */
1181 { (yyval.n) = amrex::iparser_newassign((yyvsp[-2].s), (yyvsp[0].n)); }
1182 break;
1183
1184 case 9: /* or_exp: and_exp */
1185 { (yyval.n) = (yyvsp[0].n); }
1186 break;
1187
1188 case 10: /* or_exp: or_exp "or" and_exp */
1189 { (yyval.n) = amrex::iparser_newf2(amrex::IPARSER_OR, (yyvsp[-2].n), (yyvsp[0].n)); }
1190 break;
1191
1192 case 11: /* and_exp: cmp_exp */
1193 { (yyval.n) = (yyvsp[0].n); }
1194 break;
1195
1196 case 12: /* and_exp: and_exp "and" cmp_exp */
1197 { (yyval.n) = amrex::iparser_newf2(amrex::IPARSER_AND, (yyvsp[-2].n), (yyvsp[0].n)); }
1198 break;
1199
1200 case 13: /* cmp_exp: add_exp */
1201 { (yyval.n) = (yyvsp[0].n); }
1202 break;
1203
1204 case 14: /* cmp_exp: cmp_exp '<' add_exp */
1205 { (yyval.n) = amrex::iparser_newcmpchain((yyvsp[-2].n), amrex::IPARSER_LT, (yyvsp[0].n)); }
1206 break;
1207
1208 case 15: /* cmp_exp: cmp_exp '>' add_exp */
1209 { (yyval.n) = amrex::iparser_newcmpchain((yyvsp[-2].n), amrex::IPARSER_GT, (yyvsp[0].n)); }
1210 break;
1211
1212 case 16: /* cmp_exp: cmp_exp "<=" add_exp */
1213 { (yyval.n) = amrex::iparser_newcmpchain((yyvsp[-2].n), amrex::IPARSER_LEQ,(yyvsp[0].n)); }
1214 break;
1215
1216 case 17: /* cmp_exp: cmp_exp ">=" add_exp */
1217 { (yyval.n) = amrex::iparser_newcmpchain((yyvsp[-2].n), amrex::IPARSER_GEQ,(yyvsp[0].n)); }
1218 break;
1219
1220 case 18: /* cmp_exp: cmp_exp "==" add_exp */
1221 { (yyval.n) = amrex::iparser_newcmpchain((yyvsp[-2].n), amrex::IPARSER_EQ ,(yyvsp[0].n)); }
1222 break;
1223
1224 case 19: /* cmp_exp: cmp_exp "!=" add_exp */
1225 { (yyval.n) = amrex::iparser_newcmpchain((yyvsp[-2].n), amrex::IPARSER_NEQ,(yyvsp[0].n)); }
1226 break;
1227
1228 case 20: /* add_exp: mul_exp */
1229 { (yyval.n) = (yyvsp[0].n); }
1230 break;
1231
1232 case 21: /* add_exp: add_exp '+' mul_exp */
1233 { (yyval.n) = amrex::iparser_newnode(amrex::IPARSER_ADD, (yyvsp[-2].n), (yyvsp[0].n)); }
1234 break;
1235
1236 case 22: /* add_exp: add_exp '-' mul_exp */
1237 { (yyval.n) = amrex::iparser_newnode(amrex::IPARSER_SUB, (yyvsp[-2].n), (yyvsp[0].n)); }
1238 break;
1239
1240 case 23: /* mul_exp: unary_exp */
1241 { (yyval.n) = (yyvsp[0].n); }
1242 break;
1243
1244 case 24: /* mul_exp: mul_exp '*' unary_exp */
1245 { (yyval.n) = amrex::iparser_newnode(amrex::IPARSER_MUL, (yyvsp[-2].n), (yyvsp[0].n)); }
1246 break;
1247
1248 case 25: /* mul_exp: mul_exp '/' unary_exp */
1249 { (yyval.n) = amrex::iparser_newnode(amrex::IPARSER_DIV, (yyvsp[-2].n), (yyvsp[0].n)); }
1250 break;
1251
1252 case 26: /* mul_exp: mul_exp "//" unary_exp */
1253 { (yyval.n) = amrex::iparser_newf2(amrex::IPARSER_FLRDIV, (yyvsp[-2].n), (yyvsp[0].n)); }
1254 break;
1255
1256 case 27: /* unary_exp: pow_exp */
1257 { (yyval.n) = (yyvsp[0].n); }
1258 break;
1259
1260 case 28: /* unary_exp: '-' unary_exp */
1261 { (yyval.n) = amrex::iparser_newnode(amrex::IPARSER_NEG, (yyvsp[0].n), nullptr); }
1262 break;
1263
1264 case 29: /* unary_exp: '+' unary_exp */
1265 { (yyval.n) = (yyvsp[0].n); }
1266 break;
1267
1268 case 30: /* pow_exp: primary_exp */
1269 { (yyval.n) = (yyvsp[0].n); }
1270 break;
1271
1272 case 31: /* pow_exp: primary_exp "**" unary_exp */
1273 { (yyval.n) = amrex::iparser_newf2(amrex::IPARSER_POW, (yyvsp[-2].n), (yyvsp[0].n)); }
1274 break;
1275
1276 case 32: /* primary_exp: NUMBER */
1277 { (yyval.n) = amrex::iparser_newnumber((yyvsp[0].d)); }
1278 break;
1279
1280 case 33: /* primary_exp: SYMBOL */
1281 { (yyval.n) = amrex::iparser_newsymbol((yyvsp[0].s)); }
1282 break;
1283
1284 case 34: /* primary_exp: '(' or_exp ')' */
1285 { (yyval.n) = (yyvsp[-1].n); }
1286 break;
1287
1288 case 35: /* primary_exp: F1 '(' or_exp ')' */
1289 { (yyval.n) = amrex::iparser_newf1((yyvsp[-3].f1), (yyvsp[-1].n)); }
1290 break;
1291
1292 case 36: /* primary_exp: F2 '(' or_exp ',' or_exp ')' */
1293 { (yyval.n) = amrex::iparser_newf2((yyvsp[-5].f2), (yyvsp[-3].n), (yyvsp[-1].n)); }
1294 break;
1295
1296 case 37: /* primary_exp: F3 '(' or_exp ',' or_exp ',' or_exp ')' */
1297 { (yyval.n) = amrex::iparser_newf3((yyvsp[-7].f3), (yyvsp[-5].n), (yyvsp[-3].n), (yyvsp[-1].n)); }
1298 break;
1299
1300
1301
1302 default: break;
1303 }
1304 /* User semantic actions sometimes alter yychar, and that requires
1305 that yytoken be updated with the new translation. We take the
1306 approach of translating immediately before every use of yytoken.
1307 One alternative is translating here after every semantic action,
1308 but that translation would be missed if the semantic action invokes
1309 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1310 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1311 incorrect destructor might then be invoked immediately. In the
1312 case of YYERROR or YYBACKUP, subsequent parser actions might lead
1313 to an incorrect destructor call or verbose syntax error message
1314 before the lookahead is translated. */
1315 YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
1316
1317 YYPOPSTACK (yylen);
1318 yylen = 0;
1319
1320 *++yyvsp = yyval;
1321
1322 /* Now 'shift' the result of the reduction. Determine what state
1323 that goes to, based on the state we popped back to and the rule
1324 number reduced by. */
1325 {
1326 const int yylhs = yyr1[yyn] - YYNTOKENS;
1327 const int yyi = yypgoto[yylhs] + *yyssp;
1328 yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
1329 ? yytable[yyi]
1330 : yydefgoto[yylhs]);
1331 }
1332
1333 goto yynewstate;
1334
1335
1336/*--------------------------------------.
1337| yyerrlab -- here on detecting error. |
1338`--------------------------------------*/
1339yyerrlab:
1340 /* Make sure we have latest lookahead translation. See comments at
1341 user semantic actions for why this is necessary. */
1343 /* If not already recovering from an error, report this error. */
1344 if (!yyerrstatus)
1345 {
1346 ++yynerrs;
1347 yyerror (YY_("syntax error"));
1348 }
1349
1350 if (yyerrstatus == 3)
1351 {
1352 /* If just tried and failed to reuse lookahead token after an
1353 error, discard it. */
1354
1355 if (yychar <= AMREX_IPARSEREOF)
1356 {
1357 /* Return failure if at end of input. */
1358 if (yychar == AMREX_IPARSEREOF)
1359 YYABORT;
1360 }
1361 else
1362 {
1363 yydestruct ("Error: discarding",
1364 yytoken, &yylval);
1366 }
1367 }
1368
1369 /* Else will try to reuse lookahead token after shifting the error
1370 token. */
1371 goto yyerrlab1;
1372
1373
1374/*---------------------------------------------------.
1375| yyerrorlab -- error raised explicitly by YYERROR. |
1376`---------------------------------------------------*/
1377yyerrorlab:
1378 /* Pacify compilers when the user code never invokes YYERROR and the
1379 label yyerrorlab therefore never appears in user code. */
1380 if (0)
1381 YYERROR;
1382 ++yynerrs;
1383
1384 /* Do not reclaim the symbols of the rule whose action triggered
1385 this YYERROR. */
1386 YYPOPSTACK (yylen);
1387 yylen = 0;
1388 YY_STACK_PRINT (yyss, yyssp);
1389 yystate = *yyssp;
1390 goto yyerrlab1;
1391
1392
1393/*-------------------------------------------------------------.
1394| yyerrlab1 -- common code for both syntax error and YYERROR. |
1395`-------------------------------------------------------------*/
1396yyerrlab1:
1397 yyerrstatus = 3; /* Each real token shifted decrements this. */
1398
1399 /* Pop stack until we find a state that shifts the error token. */
1400 for (;;)
1401 {
1402 yyn = yypact[yystate];
1403 if (!yypact_value_is_default (yyn))
1404 {
1405 yyn += YYSYMBOL_YYerror;
1406 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
1407 {
1408 yyn = yytable[yyn];
1409 if (0 < yyn)
1410 break;
1411 }
1412 }
1413
1414 /* Pop the current state because it cannot handle the error token. */
1415 if (yyssp == yyss)
1416 YYABORT;
1417
1418
1419 yydestruct ("Error: popping",
1420 YY_ACCESSING_SYMBOL (yystate), yyvsp);
1421 YYPOPSTACK (1);
1422 yystate = *yyssp;
1423 YY_STACK_PRINT (yyss, yyssp);
1424 }
1425
1427 *++yyvsp = yylval;
1429
1430
1431 /* Shift the error token. */
1432 YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
1433
1434 yystate = yyn;
1435 goto yynewstate;
1436
1437
1438/*-------------------------------------.
1439| yyacceptlab -- YYACCEPT comes here. |
1440`-------------------------------------*/
1441yyacceptlab:
1442 yyresult = 0;
1443 goto yyreturnlab;
1444
1445
1446/*-----------------------------------.
1447| yyabortlab -- YYABORT comes here. |
1448`-----------------------------------*/
1449yyabortlab:
1450 yyresult = 1;
1451 goto yyreturnlab;
1452
1453
1454/*-----------------------------------------------------------.
1455| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. |
1456`-----------------------------------------------------------*/
1457yyexhaustedlab:
1458 yyerror (YY_("memory exhausted"));
1459 yyresult = 2;
1460 goto yyreturnlab;
1461
1462
1463/*----------------------------------------------------------.
1464| yyreturnlab -- parsing is finished, clean up and return. |
1465`----------------------------------------------------------*/
1466yyreturnlab:
1468 {
1469 /* Make sure we have latest lookahead translation. See comments at
1470 user semantic actions for why this is necessary. */
1471 yytoken = YYTRANSLATE (yychar);
1472 yydestruct ("Cleanup: discarding lookahead",
1473 yytoken, &yylval);
1474 }
1475 /* Do not reclaim the symbols of the rule whose action triggered
1476 this YYABORT or YYACCEPT. */
1477 YYPOPSTACK (yylen);
1478 YY_STACK_PRINT (yyss, yyssp);
1479 while (yyssp != yyss)
1480 {
1481 yydestruct ("Cleanup: popping",
1482 YY_ACCESSING_SYMBOL (+*yyssp), yyvsp);
1483 YYPOPSTACK (1);
1484 }
1485#ifndef yyoverflow
1486 if (yyss != yyssa)
1487 YYSTACK_FREE (yyss);
1488#endif
1489
1490 return yyresult;
1491}
1492
1493
@ AMREX_IPARSERUNDEF
Definition amrex_iparser.tab.h:64
@ AMREX_IPARSEREOF
Definition amrex_iparser.tab.h:62
@ AMREX_IPARSERerror
Definition amrex_iparser.tab.h:63
@ AMREX_IPARSEREMPTY
Definition amrex_iparser.tab.h:61
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
Definition amrex_iparser.tab.nolint.H:338
#define YYMAXDEPTH
Definition amrex_iparser.tab.nolint.H:874
#define YYSTACK_FREE
Definition amrex_iparser.tab.nolint.H:400
static const yytype_int8 yytranslate[]
Definition amrex_iparser.tab.nolint.H:514
yysymbol_kind_t
Definition amrex_iparser.tab.nolint.H:117
@ YYSYMBOL_POW
Definition amrex_iparser.tab.nolint.H:130
@ YYSYMBOL_or_exp
Definition amrex_iparser.tab.nolint.H:155
@ YYSYMBOL_25_
Definition amrex_iparser.tab.nolint.H:144
@ YYSYMBOL_stmt
Definition amrex_iparser.tab.nolint.H:154
@ YYSYMBOL_YYUNDEF
Definition amrex_iparser.tab.nolint.H:121
@ YYSYMBOL_EOL
Definition amrex_iparser.tab.nolint.H:128
@ YYSYMBOL_19_
Definition amrex_iparser.tab.nolint.H:138
@ YYSYMBOL_EQ
Definition amrex_iparser.tab.nolint.H:134
@ YYSYMBOL_26_
Definition amrex_iparser.tab.nolint.H:145
@ YYSYMBOL_F3
Definition amrex_iparser.tab.nolint.H:127
@ YYSYMBOL_primary_exp
Definition amrex_iparser.tab.nolint.H:162
@ YYSYMBOL_pow_exp
Definition amrex_iparser.tab.nolint.H:161
@ YYSYMBOL_NUMBER
Definition amrex_iparser.tab.nolint.H:123
@ YYSYMBOL_LEQ
Definition amrex_iparser.tab.nolint.H:133
@ YYSYMBOL_YYerror
Definition amrex_iparser.tab.nolint.H:120
@ YYSYMBOL_GEQ
Definition amrex_iparser.tab.nolint.H:132
@ YYSYMBOL_12_
Definition amrex_iparser.tab.nolint.H:131
@ YYSYMBOL_exp
Definition amrex_iparser.tab.nolint.H:153
@ YYSYMBOL_F2
Definition amrex_iparser.tab.nolint.H:126
@ YYSYMBOL_29_
Definition amrex_iparser.tab.nolint.H:148
@ YYSYMBOL_cmp_exp
Definition amrex_iparser.tab.nolint.H:157
@ YYSYMBOL_and_exp
Definition amrex_iparser.tab.nolint.H:156
@ YYSYMBOL_NODE
Definition amrex_iparser.tab.nolint.H:122
@ YYSYMBOL_AND
Definition amrex_iparser.tab.nolint.H:136
@ YYSYMBOL_UPLUS
Definition amrex_iparser.tab.nolint.H:147
@ YYSYMBOL_FLRDIV
Definition amrex_iparser.tab.nolint.H:129
@ YYSYMBOL_NEG
Definition amrex_iparser.tab.nolint.H:146
@ YYSYMBOL_NEQ
Definition amrex_iparser.tab.nolint.H:135
@ YYSYMBOL_21_
Definition amrex_iparser.tab.nolint.H:140
@ YYSYMBOL_20_
Definition amrex_iparser.tab.nolint.H:139
@ YYSYMBOL_SYMBOL
Definition amrex_iparser.tab.nolint.H:124
@ YYSYMBOL_add_exp
Definition amrex_iparser.tab.nolint.H:158
@ YYSYMBOL_YYACCEPT
Definition amrex_iparser.tab.nolint.H:151
@ YYSYMBOL_F1
Definition amrex_iparser.tab.nolint.H:125
@ YYSYMBOL_30_
Definition amrex_iparser.tab.nolint.H:149
@ YYSYMBOL_OR
Definition amrex_iparser.tab.nolint.H:137
@ YYSYMBOL_unary_exp
Definition amrex_iparser.tab.nolint.H:160
@ YYSYMBOL_23_
Definition amrex_iparser.tab.nolint.H:142
@ YYSYMBOL_YYEOF
Definition amrex_iparser.tab.nolint.H:119
@ YYSYMBOL_22_
Definition amrex_iparser.tab.nolint.H:141
@ YYSYMBOL_24_
Definition amrex_iparser.tab.nolint.H:143
@ YYSYMBOL_input
Definition amrex_iparser.tab.nolint.H:152
@ YYSYMBOL_YYEMPTY
Definition amrex_iparser.tab.nolint.H:118
@ YYSYMBOL_mul_exp
Definition amrex_iparser.tab.nolint.H:159
@ YYSYMBOL_31_
Definition amrex_iparser.tab.nolint.H:150
#define YY_ASSERT(E)
Definition amrex_iparser.tab.nolint.H:358
#define YY_(Msgid)
Definition amrex_iparser.tab.nolint.H:292
#define YYNOMEM
Definition amrex_iparser.tab.nolint.H:707
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
Definition amrex_iparser.tab.nolint.H:339
static const yytype_int8 yydefact[]
Definition amrex_iparser.tab.nolint.H:611
#define YYNSTATES
Definition amrex_iparser.tab.nolint.H:499
#define YYSTYPE
Definition amrex_iparser.tab.nolint.H:67
#define YY_IGNORE_USELESS_CAST_END
Definition amrex_iparser.tab.nolint.H:354
short yytype_int16
Definition amrex_iparser.tab.nolint.H:203
#define yychar
Definition amrex_iparser.tab.nolint.H:75
#define YYABORT
Definition amrex_iparser.tab.nolint.H:705
#define YYSTACK_BYTES(N)
Definition amrex_iparser.tab.nolint.H:443
static const yytype_int8 yycheck[]
Definition amrex_iparser.tab.nolint.H:653
#define YY_REDUCE_PRINT(Rule)
Definition amrex_iparser.tab.nolint.H:857
#define YY_CAST(Type, Val)
Definition amrex_iparser.tab.nolint.H:98
static void yydestruct(const char *yymsg, yysymbol_kind_t yykind, YYSTYPE *yyvaluep)
Definition amrex_iparser.tab.nolint.H:887
#define yylex
Definition amrex_iparser.tab.nolint.H:70
#define YY_NULLPTR
Definition amrex_iparser.tab.nolint.H:110
static const yytype_int8 yypact[]
Definition amrex_iparser.tab.nolint.H:596
#define YYFINAL
Definition amrex_iparser.tab.nolint.H:488
#define YY_ACCESSING_SYMBOL(State)
Definition amrex_iparser.tab.nolint.H:558
#define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
Definition amrex_iparser.tab.nolint.H:855
#define yylval
Definition amrex_iparser.tab.nolint.H:74
#define YYNTOKENS
Definition amrex_iparser.tab.nolint.H:493
unsigned char yytype_uint8
Definition amrex_iparser.tab.nolint.H:224
#define YY_STACK_PRINT(Bottom, Top)
Definition amrex_iparser.tab.nolint.H:856
#define YYSIZE_T
Definition amrex_iparser.tab.nolint.H:265
#define yydebug
Definition amrex_iparser.tab.nolint.H:72
#define YY_IGNORE_USELESS_CAST_BEGIN
Definition amrex_iparser.tab.nolint.H:353
static const yytype_int8 yyr2[]
Definition amrex_iparser.tab.nolint.H:690
void * malloc(YYSIZE_T)
static const yytype_int8 yytable[]
Definition amrex_iparser.tab.nolint.H:640
#define YYPTRDIFF_T
Definition amrex_iparser.tab.nolint.H:251
#define yynerrs
Definition amrex_iparser.tab.nolint.H:73
@ YYENOMEM
Definition amrex_iparser.tab.nolint.H:699
#define yyparse
Definition amrex_iparser.tab.nolint.H:917
#define YYACCEPT
Definition amrex_iparser.tab.nolint.H:704
#define yytable_value_is_error(Yyn)
Definition amrex_iparser.tab.nolint.H:591
#define yysymbol_kind_t
Definition amrex_iparser.tab.nolint.H:89
#define YYTRANSLATE(YYX)
Definition amrex_iparser.tab.nolint.H:507
static const yytype_int8 yystos[]
Definition amrex_iparser.tab.nolint.H:668
#define YY_ATTRIBUTE_UNUSED
Definition amrex_iparser.tab.nolint.H:309
static const yytype_int8 yypgoto[]
Definition amrex_iparser.tab.nolint.H:624
static const yytype_int8 yyr1[]
Definition amrex_iparser.tab.nolint.H:681
#define YYPOPSTACK(N)
int yy_state_fast_t
Definition amrex_iparser.tab.nolint.H:282
unsigned short yytype_uint16
Definition amrex_iparser.tab.nolint.H:235
static const yytype_int8 yydefgoto[]
Definition amrex_iparser.tab.nolint.H:631
#define YYLAST
Definition amrex_iparser.tab.nolint.H:490
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
Definition amrex_iparser.tab.nolint.H:454
#define yypact_value_is_default(Yyn)
Definition amrex_iparser.tab.nolint.H:586
#define YYINITDEPTH
Definition amrex_iparser.tab.nolint.H:863
signed char yytype_int8
Definition amrex_iparser.tab.nolint.H:195
void free(void *)
#define YYERROR
Definition amrex_iparser.tab.nolint.H:706
#define YYSIZEOF(X)
Definition amrex_iparser.tab.nolint.H:275
#define YYSTACK_ALLOC
Definition amrex_iparser.tab.nolint.H:399
yytype_int8 yy_state_t
Definition amrex_iparser.tab.nolint.H:279
#define YYDPRINTF(Args)
Definition amrex_iparser.tab.nolint.H:854
int amrex_iparserlex(void)
#define YY_USE(E)
Definition amrex_iparser.tab.nolint.H:315
#define yyerror
Definition amrex_iparser.tab.nolint.H:71
yytype_int8 yy_state_t
Definition amrex_parser.tab.nolint.H:278
struct iparser_node * iparser_newf3(enum iparser_f3_t ftype, struct iparser_node *n1, struct iparser_node *n2, struct iparser_node *n3)
Definition AMReX_IParser_Y.cpp:97
struct iparser_node * iparser_newnumber(long long d)
Definition AMReX_IParser_Y.cpp:58
struct iparser_node * iparser_newcmpchain(struct iparser_node *nl, enum iparser_f2_t cmp, struct iparser_node *nr)
Definition AMReX_IParser_Y.cpp:166
struct iparser_node * iparser_newf2(enum iparser_f2_t ftype, struct iparser_node *l, struct iparser_node *r)
Definition AMReX_IParser_Y.cpp:85
struct iparser_node * iparser_newf1(enum iparser_f1_t ftype, struct iparser_node *l)
Definition AMReX_IParser_Y.cpp:74
struct iparser_node * iparser_newnode(enum iparser_node_t type, struct iparser_node *l, struct iparser_node *r)
Definition AMReX_IParser_Y.cpp:47
struct iparser_node * iparser_newlist(struct iparser_node *nl, struct iparser_node *nr)
Definition AMReX_IParser_Y.cpp:122
@ IPARSER_LT
Definition AMReX_IParser_Y.H:30
@ IPARSER_GT
Definition AMReX_IParser_Y.H:29
@ IPARSER_POW
Definition AMReX_IParser_Y.H:28
@ IPARSER_FLRDIV
Definition AMReX_IParser_Y.H:27
@ IPARSER_AND
Definition AMReX_IParser_Y.H:36
@ IPARSER_OR
Definition AMReX_IParser_Y.H:37
@ IPARSER_EQ
Definition AMReX_IParser_Y.H:33
@ IPARSER_GEQ
Definition AMReX_IParser_Y.H:31
@ IPARSER_LEQ
Definition AMReX_IParser_Y.H:32
@ IPARSER_NEQ
Definition AMReX_IParser_Y.H:34
struct iparser_node * iparser_newassign(struct iparser_symbol *sym, struct iparser_node *v)
Definition AMReX_IParser_Y.cpp:111
void iparser_defexpr(struct iparser_node *body)
Definition AMReX_IParser_Y.cpp:29
@ IPARSER_SUB
Definition AMReX_IParser_Y.H:50
@ IPARSER_NEG
Definition AMReX_IParser_Y.H:53
@ IPARSER_ADD
Definition AMReX_IParser_Y.H:49
@ IPARSER_DIV
Definition AMReX_IParser_Y.H:52
@ IPARSER_MUL
Definition AMReX_IParser_Y.H:51
struct iparser_node * iparser_newsymbol(struct iparser_symbol *symbol)
Definition AMReX_IParser_Y.cpp:68
Definition amrex_iparser.tab.nolint.H:433
YYSTYPE yyvs_alloc
Definition amrex_iparser.tab.nolint.H:435
yy_state_t yyss_alloc
Definition amrex_iparser.tab.nolint.H:434