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