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