Graphviz 13.0.0~dev.20250607.1528
Loading...
Searching...
No Matches
exparse.c
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 EX_STYPE
68/* Substitute the variable and function names. */
69#define yyparse ex_parse
70#define yylex ex_lex
71#define yyerror ex_error
72#define yydebug ex_debug
73#define yynerrs ex_nerrs
74#define yylval ex_lval
75#define yychar ex_char
76
77/* First part of user prologue. */
78#line 19 "../../lib/expr/exparse.y"
79
80
81/*
82 * Glenn Fowler
83 * AT&T Research
84 *
85 * expression library grammar and compiler
86 */
87
88#include <assert.h>
89#include <expr/exop.h>
90#include <stdbool.h>
91#include <stdio.h>
92#include <stdlib.h>
93#include <string.h>
94#include <ast/ast.h>
95#include <util/gv_ctype.h>
96#include <util/streq.h>
97
98
99#line 100 "exparse.c"
100
101# ifndef YY_CAST
102# ifdef __cplusplus
103# define YY_CAST(Type, Val) static_cast<Type> (Val)
104# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
105# else
106# define YY_CAST(Type, Val) ((Type) (Val))
107# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
108# endif
109# endif
110# ifndef YY_NULLPTR
111# if defined __cplusplus
112# if 201103L <= __cplusplus
113# define YY_NULLPTR nullptr
114# else
115# define YY_NULLPTR 0
116# endif
117# else
118# define YY_NULLPTR ((void*)0)
119# endif
120# endif
121
122#include "exparse.h"
123/* Symbol kind. */
125{
127 YYSYMBOL_YYEOF = 0, /* "end of file" */
128 YYSYMBOL_YYerror = 1, /* error */
129 YYSYMBOL_YYUNDEF = 2, /* "invalid token" */
130 YYSYMBOL_MINTOKEN = 3, /* MINTOKEN */
131 YYSYMBOL_INTEGER = 4, /* INTEGER */
132 YYSYMBOL_UNSIGNED = 5, /* UNSIGNED */
133 YYSYMBOL_CHARACTER = 6, /* CHARACTER */
134 YYSYMBOL_FLOATING = 7, /* FLOATING */
135 YYSYMBOL_STRING = 8, /* STRING */
136 YYSYMBOL_VOIDTYPE = 9, /* VOIDTYPE */
137 YYSYMBOL_ADDRESS = 10, /* ADDRESS */
138 YYSYMBOL_ARRAY = 11, /* ARRAY */
139 YYSYMBOL_BREAK = 12, /* BREAK */
140 YYSYMBOL_CALL = 13, /* CALL */
141 YYSYMBOL_CASE = 14, /* CASE */
142 YYSYMBOL_CONSTANT = 15, /* CONSTANT */
143 YYSYMBOL_CONTINUE = 16, /* CONTINUE */
144 YYSYMBOL_DECLARE = 17, /* DECLARE */
145 YYSYMBOL_DEFAULT = 18, /* DEFAULT */
146 YYSYMBOL_DYNAMIC = 19, /* DYNAMIC */
147 YYSYMBOL_ELSE = 20, /* ELSE */
148 YYSYMBOL_EXIT = 21, /* EXIT */
149 YYSYMBOL_FOR = 22, /* FOR */
150 YYSYMBOL_FUNCTION = 23, /* FUNCTION */
151 YYSYMBOL_GSUB = 24, /* GSUB */
152 YYSYMBOL_ITERATE = 25, /* ITERATE */
153 YYSYMBOL_ITERATOR = 26, /* ITERATOR */
154 YYSYMBOL_ID = 27, /* ID */
155 YYSYMBOL_IF = 28, /* IF */
156 YYSYMBOL_LABEL = 29, /* LABEL */
157 YYSYMBOL_MEMBER = 30, /* MEMBER */
158 YYSYMBOL_NAME = 31, /* NAME */
159 YYSYMBOL_POS = 32, /* POS */
160 YYSYMBOL_PRAGMA = 33, /* PRAGMA */
161 YYSYMBOL_PRE = 34, /* PRE */
162 YYSYMBOL_PRINT = 35, /* PRINT */
163 YYSYMBOL_PRINTF = 36, /* PRINTF */
164 YYSYMBOL_PROCEDURE = 37, /* PROCEDURE */
165 YYSYMBOL_QUERY = 38, /* QUERY */
166 YYSYMBOL_RAND = 39, /* RAND */
167 YYSYMBOL_RETURN = 40, /* RETURN */
168 YYSYMBOL_SCANF = 41, /* SCANF */
169 YYSYMBOL_SPLIT = 42, /* SPLIT */
170 YYSYMBOL_SPRINTF = 43, /* SPRINTF */
171 YYSYMBOL_SRAND = 44, /* SRAND */
172 YYSYMBOL_SSCANF = 45, /* SSCANF */
173 YYSYMBOL_SUB = 46, /* SUB */
174 YYSYMBOL_SUBSTR = 47, /* SUBSTR */
175 YYSYMBOL_SWITCH = 48, /* SWITCH */
176 YYSYMBOL_TOKENS = 49, /* TOKENS */
177 YYSYMBOL_UNSET = 50, /* UNSET */
178 YYSYMBOL_WHILE = 51, /* WHILE */
179 YYSYMBOL_F2I = 52, /* F2I */
180 YYSYMBOL_F2S = 53, /* F2S */
181 YYSYMBOL_I2F = 54, /* I2F */
182 YYSYMBOL_I2S = 55, /* I2S */
183 YYSYMBOL_S2B = 56, /* S2B */
184 YYSYMBOL_S2F = 57, /* S2F */
185 YYSYMBOL_S2I = 58, /* S2I */
186 YYSYMBOL_F2X = 59, /* F2X */
187 YYSYMBOL_I2X = 60, /* I2X */
188 YYSYMBOL_S2X = 61, /* S2X */
189 YYSYMBOL_X2F = 62, /* X2F */
190 YYSYMBOL_X2I = 63, /* X2I */
191 YYSYMBOL_X2S = 64, /* X2S */
192 YYSYMBOL_X2X = 65, /* X2X */
193 YYSYMBOL_XPRINT = 66, /* XPRINT */
194 YYSYMBOL_67_ = 67, /* ',' */
195 YYSYMBOL_68_ = 68, /* '=' */
196 YYSYMBOL_69_ = 69, /* '?' */
197 YYSYMBOL_70_ = 70, /* ':' */
198 YYSYMBOL_OR = 71, /* OR */
199 YYSYMBOL_AND = 72, /* AND */
200 YYSYMBOL_73_ = 73, /* '|' */
201 YYSYMBOL_74_ = 74, /* '^' */
202 YYSYMBOL_75_ = 75, /* '&' */
203 YYSYMBOL_EQ = 76, /* EQ */
204 YYSYMBOL_NE = 77, /* NE */
205 YYSYMBOL_78_ = 78, /* '<' */
206 YYSYMBOL_79_ = 79, /* '>' */
207 YYSYMBOL_LE = 80, /* LE */
208 YYSYMBOL_GE = 81, /* GE */
209 YYSYMBOL_LSH = 82, /* LSH */
210 YYSYMBOL_RSH = 83, /* RSH */
211 YYSYMBOL_84_ = 84, /* '+' */
212 YYSYMBOL_85_ = 85, /* '-' */
213 YYSYMBOL_IN_OP = 86, /* IN_OP */
214 YYSYMBOL_87_ = 87, /* '*' */
215 YYSYMBOL_88_ = 88, /* '/' */
216 YYSYMBOL_89_ = 89, /* '%' */
217 YYSYMBOL_90_ = 90, /* '!' */
218 YYSYMBOL_91_ = 91, /* '~' */
219 YYSYMBOL_92_ = 92, /* '#' */
220 YYSYMBOL_UNARY = 93, /* UNARY */
221 YYSYMBOL_INC = 94, /* INC */
222 YYSYMBOL_DEC = 95, /* DEC */
223 YYSYMBOL_CAST = 96, /* CAST */
224 YYSYMBOL_97_ = 97, /* '(' */
225 YYSYMBOL_MAXTOKEN = 98, /* MAXTOKEN */
226 YYSYMBOL_99_ = 99, /* '{' */
227 YYSYMBOL_100_ = 100, /* '}' */
228 YYSYMBOL_101_ = 101, /* ';' */
229 YYSYMBOL_102_ = 102, /* ')' */
230 YYSYMBOL_103_ = 103, /* '[' */
231 YYSYMBOL_104_ = 104, /* ']' */
232 YYSYMBOL_105_ = 105, /* '.' */
233 YYSYMBOL_YYACCEPT = 106, /* $accept */
234 YYSYMBOL_program = 107, /* program */
235 YYSYMBOL_action_list = 108, /* action_list */
236 YYSYMBOL_action = 109, /* action */
237 YYSYMBOL_110_1 = 110, /* $@1 */
238 YYSYMBOL_statement_list = 111, /* statement_list */
239 YYSYMBOL_statement = 112, /* statement */
240 YYSYMBOL_113_2 = 113, /* $@2 */
241 YYSYMBOL_114_3 = 114, /* $@3 */
242 YYSYMBOL_switch_list = 115, /* switch_list */
243 YYSYMBOL_switch_item = 116, /* switch_item */
244 YYSYMBOL_case_list = 117, /* case_list */
245 YYSYMBOL_case_item = 118, /* case_item */
246 YYSYMBOL_dcl_list = 119, /* dcl_list */
247 YYSYMBOL_dcl_item = 120, /* dcl_item */
248 YYSYMBOL_121_4 = 121, /* $@4 */
249 YYSYMBOL_dcl_name = 122, /* dcl_name */
250 YYSYMBOL_name = 123, /* name */
251 YYSYMBOL_else_opt = 124, /* else_opt */
252 YYSYMBOL_expr_opt = 125, /* expr_opt */
253 YYSYMBOL_expr = 126, /* expr */
254 YYSYMBOL_127_5 = 127, /* $@5 */
255 YYSYMBOL_128_6 = 128, /* $@6 */
256 YYSYMBOL_splitop = 129, /* splitop */
257 YYSYMBOL_constant = 130, /* constant */
258 YYSYMBOL_print = 131, /* print */
259 YYSYMBOL_scan = 132, /* scan */
260 YYSYMBOL_variable = 133, /* variable */
261 YYSYMBOL_array = 134, /* array */
262 YYSYMBOL_index = 135, /* index */
263 YYSYMBOL_args = 136, /* args */
264 YYSYMBOL_arg_list = 137, /* arg_list */
265 YYSYMBOL_formals = 138, /* formals */
266 YYSYMBOL_formal_list = 139, /* formal_list */
267 YYSYMBOL_formal_item = 140, /* formal_item */
268 YYSYMBOL_141_7 = 141, /* $@7 */
269 YYSYMBOL_members = 142, /* members */
270 YYSYMBOL_member = 143, /* member */
271 YYSYMBOL_assign = 144, /* assign */
272 YYSYMBOL_initialize = 145, /* initialize */
273 YYSYMBOL_146_8 = 146, /* $@8 */
274 YYSYMBOL_147_9 = 147 /* $@9 */
277
278
279/* Second part of user prologue. */
280#line 169 "../../lib/expr/exparse.y"
281
282
283#include <expr/exgram.h>
284
285void ex_error(const char *message);
286
287
288#line 289 "exparse.c"
289
290
291#ifdef short
292# undef short
293#endif
294
295/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
296 <limits.h> and (if available) <stdint.h> are included
297 so that the code can choose integer types of a good width. */
298
299#ifndef __PTRDIFF_MAX__
300# include <limits.h> /* INFRINGES ON USER NAME SPACE */
301# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
302# include <stdint.h> /* INFRINGES ON USER NAME SPACE */
303# define YY_STDINT_H
304# endif
305#endif
306
307/* Narrow types that promote to a signed type and that can represent a
308 signed or unsigned integer of at least N bits. In tables they can
309 save space and decrease cache pressure. Promoting to a signed type
310 helps avoid bugs in integer arithmetic. */
311
312#ifdef __INT_LEAST8_MAX__
313typedef __INT_LEAST8_TYPE__ yytype_int8;
314#elif defined YY_STDINT_H
315typedef int_least8_t yytype_int8;
316#else
317typedef signed char yytype_int8;
318#endif
319
320#ifdef __INT_LEAST16_MAX__
321typedef __INT_LEAST16_TYPE__ yytype_int16;
322#elif defined YY_STDINT_H
323typedef int_least16_t yytype_int16;
324#else
325typedef short yytype_int16;
326#endif
327
328/* Work around bug in HP-UX 11.23, which defines these macros
329 incorrectly for preprocessor constants. This workaround can likely
330 be removed in 2023, as HPE has promised support for HP-UX 11.23
331 (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
332 <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>. */
333#ifdef __hpux
334# undef UINT_LEAST8_MAX
335# undef UINT_LEAST16_MAX
336# define UINT_LEAST8_MAX 255
337# define UINT_LEAST16_MAX 65535
338#endif
339
340#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
341typedef __UINT_LEAST8_TYPE__ yytype_uint8;
342#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
343 && UINT_LEAST8_MAX <= INT_MAX)
344typedef uint_least8_t yytype_uint8;
345#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
346typedef unsigned char yytype_uint8;
347#else
348typedef short yytype_uint8;
349#endif
350
351#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
352typedef __UINT_LEAST16_TYPE__ yytype_uint16;
353#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
354 && UINT_LEAST16_MAX <= INT_MAX)
355typedef uint_least16_t yytype_uint16;
356#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
357typedef unsigned short yytype_uint16;
358#else
359typedef int yytype_uint16;
360#endif
361
362#ifndef YYPTRDIFF_T
363# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
364# define YYPTRDIFF_T __PTRDIFF_TYPE__
365# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
366# elif defined PTRDIFF_MAX
367# ifndef ptrdiff_t
368# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
369# endif
370# define YYPTRDIFF_T ptrdiff_t
371# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
372# else
373# define YYPTRDIFF_T long
374# define YYPTRDIFF_MAXIMUM LONG_MAX
375# endif
376#endif
377
378#ifndef YYSIZE_T
379# ifdef __SIZE_TYPE__
380# define YYSIZE_T __SIZE_TYPE__
381# elif defined size_t
382# define YYSIZE_T size_t
383# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
384# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
385# define YYSIZE_T size_t
386# else
387# define YYSIZE_T unsigned
388# endif
389#endif
390
391#define YYSIZE_MAXIMUM \
392 YY_CAST (YYPTRDIFF_T, \
393 (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
394 ? YYPTRDIFF_MAXIMUM \
395 : YY_CAST (YYSIZE_T, -1)))
396
397#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
398
399
400/* Stored state numbers (used for stacks). */
402
403/* State numbers in computations. */
404typedef int yy_state_fast_t;
405
406#ifndef YY_
407# if defined YYENABLE_NLS && YYENABLE_NLS
408# if ENABLE_NLS
409# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
410# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
411# endif
412# endif
413# ifndef YY_
414# define YY_(Msgid) Msgid
415# endif
416#endif
417
418
419#ifndef YY_ATTRIBUTE_PURE
420# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
421# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
422# else
423# define YY_ATTRIBUTE_PURE
424# endif
425#endif
426
427#ifndef YY_ATTRIBUTE_UNUSED
428# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
429# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
430# else
431# define YY_ATTRIBUTE_UNUSED
432# endif
433#endif
434
435/* Suppress unused-variable warnings by "using" E. */
436#if ! defined lint || defined __GNUC__
437# define YY_USE(E) ((void) (E))
438#else
439# define YY_USE(E) /* empty */
440#endif
441
442/* Suppress an incorrect diagnostic about yylval being uninitialized. */
443#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
444# if __GNUC__ * 100 + __GNUC_MINOR__ < 407
445# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
446 _Pragma ("GCC diagnostic push") \
447 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
448# else
449# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
450 _Pragma ("GCC diagnostic push") \
451 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
452 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
453# endif
454# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
455 _Pragma ("GCC diagnostic pop")
456#else
457# define YY_INITIAL_VALUE(Value) Value
458#endif
459#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
460# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
461# define YY_IGNORE_MAYBE_UNINITIALIZED_END
462#endif
463#ifndef YY_INITIAL_VALUE
464# define YY_INITIAL_VALUE(Value) /* Nothing. */
465#endif
466
467#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
468# define YY_IGNORE_USELESS_CAST_BEGIN \
469 _Pragma ("GCC diagnostic push") \
470 _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
471# define YY_IGNORE_USELESS_CAST_END \
472 _Pragma ("GCC diagnostic pop")
473#endif
474#ifndef YY_IGNORE_USELESS_CAST_BEGIN
475# define YY_IGNORE_USELESS_CAST_BEGIN
476# define YY_IGNORE_USELESS_CAST_END
477#endif
478
479
480#define YY_ASSERT(E) ((void) (0 && (E)))
481
482#if !defined yyoverflow
483
484/* The parser invokes alloca or malloc; define the necessary symbols. */
485
486# ifdef YYSTACK_USE_ALLOCA
487# if YYSTACK_USE_ALLOCA
488# ifdef __GNUC__
489# define YYSTACK_ALLOC __builtin_alloca
490# elif defined __BUILTIN_VA_ARG_INCR
491# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
492# elif defined _AIX
493# define YYSTACK_ALLOC __alloca
494# elif defined _MSC_VER
495# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
496# define alloca _alloca
497# else
498# define YYSTACK_ALLOC alloca
499# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
500# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
501 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
502# ifndef EXIT_SUCCESS
503# define EXIT_SUCCESS 0
504# endif
505# endif
506# endif
507# endif
508# endif
509
510# ifdef YYSTACK_ALLOC
511 /* Pacify GCC's 'empty if-body' warning. */
512# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
513# ifndef YYSTACK_ALLOC_MAXIMUM
514 /* The OS might guarantee only one guard page at the bottom of the stack,
515 and a page size can be as small as 4096 bytes. So we cannot safely
516 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
517 to allow for a few compiler-allocated temporary stack slots. */
518# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
519# endif
520# else
521# define YYSTACK_ALLOC YYMALLOC
522# define YYSTACK_FREE YYFREE
523# ifndef YYSTACK_ALLOC_MAXIMUM
524# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
525# endif
526# if (defined __cplusplus && ! defined EXIT_SUCCESS \
527 && ! ((defined YYMALLOC || defined malloc) \
528 && (defined YYFREE || defined free)))
529# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
530# ifndef EXIT_SUCCESS
531# define EXIT_SUCCESS 0
532# endif
533# endif
534# ifndef YYMALLOC
535# define YYMALLOC malloc
536# if ! defined malloc && ! defined EXIT_SUCCESS
537void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
538# endif
539# endif
540# ifndef YYFREE
541# define YYFREE free
542# if ! defined free && ! defined EXIT_SUCCESS
543void free (void *); /* INFRINGES ON USER NAME SPACE */
544# endif
545# endif
546# endif
547#endif /* !defined yyoverflow */
548
549#if (! defined yyoverflow \
550 && (! defined __cplusplus \
551 || (defined EX_STYPE_IS_TRIVIAL && EX_STYPE_IS_TRIVIAL)))
552
553/* A type that is properly aligned for any stack member. */
554union yyalloc
555{
556 yy_state_t yyss_alloc;
557 YYSTYPE yyvs_alloc;
558};
559
560/* The size of the maximum gap between one aligned stack and the next. */
561# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
562
563/* The size of an array large to enough to hold all stacks, each with
564 N elements. */
565# define YYSTACK_BYTES(N) \
566 ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
567 + YYSTACK_GAP_MAXIMUM)
568
569# define YYCOPY_NEEDED 1
570
571/* Relocate STACK from its old location to the new one. The
572 local variables YYSIZE and YYSTACKSIZE give the old and new number of
573 elements in the stack, and YYPTR gives the new location of the
574 stack. Advance YYPTR to a properly aligned location for the next
575 stack. */
576# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
577 do \
578 { \
579 YYPTRDIFF_T yynewbytes; \
580 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
581 Stack = &yyptr->Stack_alloc; \
582 yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
583 yyptr += yynewbytes / YYSIZEOF (*yyptr); \
584 } \
585 while (0)
586
587#endif
588
589#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
590/* Copy COUNT objects from SRC to DST. The source and destination do
591 not overlap. */
592# ifndef YYCOPY
593# if defined __GNUC__ && 1 < __GNUC__
594# define YYCOPY(Dst, Src, Count) \
595 __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
596# else
597# define YYCOPY(Dst, Src, Count) \
598 do \
599 { \
600 YYPTRDIFF_T yyi; \
601 for (yyi = 0; yyi < (Count); yyi++) \
602 (Dst)[yyi] = (Src)[yyi]; \
603 } \
604 while (0)
605# endif
606# endif
607#endif /* !YYCOPY_NEEDED */
608
609/* YYFINAL -- State number of the termination state. */
610#define YYFINAL 3
611/* YYLAST -- Last index in YYTABLE. */
612#define YYLAST 1120
613
614/* YYNTOKENS -- Number of terminals. */
615#define YYNTOKENS 106
616/* YYNNTS -- Number of nonterminals. */
617#define YYNNTS 42
618/* YYNRULES -- Number of rules. */
619#define YYNRULES 141
620/* YYNSTATES -- Number of states. */
621#define YYNSTATES 285
622
623/* YYMAXUTOK -- Last valid token kind. */
624#define YYMAXUTOK 335
625
626
627/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
628 as returned by yylex, with out-of-bounds checking. */
629#define YYTRANSLATE(YYX) \
630 (0 <= (YYX) && (YYX) <= YYMAXUTOK \
631 ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \
632 : YYSYMBOL_YYUNDEF)
633
634/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
635 as returned by yylex. */
636static const yytype_int8 yytranslate[] =
637{
638 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
639 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
640 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
641 2, 2, 2, 90, 2, 92, 2, 89, 75, 2,
642 97, 102, 87, 84, 67, 85, 105, 88, 2, 2,
643 2, 2, 2, 2, 2, 2, 2, 2, 70, 101,
644 78, 68, 79, 69, 2, 2, 2, 2, 2, 2,
645 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
646 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
647 2, 103, 2, 104, 74, 2, 2, 2, 2, 2,
648 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
649 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
650 2, 2, 2, 99, 73, 100, 91, 2, 2, 2,
651 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
652 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
653 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
654 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
655 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
656 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
657 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
658 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
659 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
660 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
661 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
662 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
663 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
664 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
665 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
666 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
667 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
668 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
669 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
670 65, 66, 71, 72, 76, 77, 80, 81, 82, 83,
671 86, 93, 94, 95, 96, 98
672};
673
674#if EX_DEBUG
675/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
676static const yytype_int16 yyrline[] =
677{
678 0, 179, 179, 197, 198, 201, 201, 236, 239, 254,
679 258, 262, 262, 267, 277, 290, 305, 318, 326, 337,
680 347, 347, 357, 369, 373, 386, 402, 405, 436, 437,
681 440, 458, 464, 465, 472, 472, 524, 525, 526, 527,
682 530, 531, 535, 538, 545, 548, 551, 555, 559, 612,
683 616, 620, 624, 628, 632, 636, 640, 644, 648, 652,
684 656, 660, 664, 668, 672, 685, 689, 699, 699, 699,
685 740, 760, 767, 772, 776, 780, 784, 788, 792, 796,
686 800, 804, 808, 812, 816, 822, 826, 830, 836, 841,
687 845, 870, 906, 926, 934, 942, 953, 962, 966, 970,
688 973, 974, 976, 984, 989, 994, 999, 1006, 1007, 1008,
689 1011, 1012, 1015, 1019, 1037, 1050, 1053, 1057, 1071, 1074,
690 1081, 1084, 1092, 1097, 1104, 1107, 1113, 1116, 1120, 1131,
691 1131, 1147, 1150, 1162, 1182, 1186, 1192, 1195, 1202, 1203,
692 1215, 1203
693};
694#endif
695
697#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
698
699#if EX_DEBUG || 1
700/* The user-facing name of the symbol whose (internal) number is
701 YYSYMBOL. No bounds checking. */
702static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
703
704/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
705 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
706static const char *const yytname[] =
707{
708 "\"end of file\"", "error", "\"invalid token\"", "MINTOKEN", "INTEGER",
709 "UNSIGNED", "CHARACTER", "FLOATING", "STRING", "VOIDTYPE", "ADDRESS",
710 "ARRAY", "BREAK", "CALL", "CASE", "CONSTANT", "CONTINUE", "DECLARE",
711 "DEFAULT", "DYNAMIC", "ELSE", "EXIT", "FOR", "FUNCTION", "GSUB",
712 "ITERATE", "ITERATOR", "ID", "IF", "LABEL", "MEMBER", "NAME", "POS",
713 "PRAGMA", "PRE", "PRINT", "PRINTF", "PROCEDURE", "QUERY", "RAND",
714 "RETURN", "SCANF", "SPLIT", "SPRINTF", "SRAND", "SSCANF", "SUB",
715 "SUBSTR", "SWITCH", "TOKENS", "UNSET", "WHILE", "F2I", "F2S", "I2F",
716 "I2S", "S2B", "S2F", "S2I", "F2X", "I2X", "S2X", "X2F", "X2I", "X2S",
717 "X2X", "XPRINT", "','", "'='", "'?'", "':'", "OR", "AND", "'|'", "'^'",
718 "'&'", "EQ", "NE", "'<'", "'>'", "LE", "GE", "LSH", "RSH", "'+'", "'-'",
719 "IN_OP", "'*'", "'/'", "'%'", "'!'", "'~'", "'#'", "UNARY", "INC", "DEC",
720 "CAST", "'('", "MAXTOKEN", "'{'", "'}'", "';'", "')'", "'['", "']'",
721 "'.'", "$accept", "program", "action_list", "action", "$@1",
722 "statement_list", "statement", "$@2", "$@3", "switch_list",
723 "switch_item", "case_list", "case_item", "dcl_list", "dcl_item", "$@4",
724 "dcl_name", "name", "else_opt", "expr_opt", "expr", "$@5", "$@6",
725 "splitop", "constant", "print", "scan", "variable", "array", "index",
726 "args", "arg_list", "formals", "formal_list", "formal_item", "$@7",
727 "members", "member", "assign", "initialize", "$@8", "$@9", YY_NULLPTR
728};
729
730static const char *
732{
733 return yytname[yysymbol];
734}
735#endif
736
737#define YYPACT_NINF (-181)
738
739#define yypact_value_is_default(Yyn) \
740 ((Yyn) == YYPACT_NINF)
741
742#define YYTABLE_NINF (-126)
743
744#define yytable_value_is_error(Yyn) \
745 ((Yyn) == YYTABLE_NINF)
746
747/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
748 STATE-NUM. */
749static const yytype_int16 yypact[] =
750{
751 -181, 9, 231, -181, -181, -181, -181, -181, -71, 713,
752 -181, 713, -181, -69, -62, -44, -41, -39, -34, -17,
753 1, -181, 8, -181, 11, -181, 14, 713, -181, -181,
754 -181, 21, -181, 28, 30, 31, -181, 33, 36, 73,
755 713, 713, 713, 713, 101, 73, 73, 619, -181, 64,
756 -181, 35, 893, 40, -181, 46, 47, -55, 713, 44,
757 48, 72, 713, -17, 713, 713, 713, 713, 73, -11,
758 -181, -181, 713, 713, 713, 45, 55, 127, 713, 713,
759 713, 133, 713, -181, -181, -181, -181, -181, -181, -181,
760 -181, -181, 57, 314, 329, 83, -181, -181, 713, -181,
761 713, 713, 713, 713, 713, 713, 713, 713, 713, 713,
762 713, 713, 713, 713, 713, 104, 713, 713, 713, 713,
763 713, 713, 713, -181, -181, -181, 937, 53, 93, -181,
764 -181, -181, -181, -181, -181, -50, -181, -181, 216, -181,
765 411, 60, 19, 75, 76, 77, 99, -181, 508, 78,
766 86, -181, -181, -181, 600, 103, 105, 893, -57, 694,
767 713, -181, -181, -181, 937, 713, 955, 972, 988, 1003,
768 1017, 1031, 1031, 112, 112, 112, 112, 98, 98, 52,
769 52, -181, -181, -181, -181, -181, 916, 106, 111, 937,
770 -181, 713, 72, -181, 100, -181, -181, 713, 523, -181,
771 -181, 523, -2, -181, 523, -181, -181, -181, -181, -181,
772 113, 713, -181, 523, -181, -181, 870, 807, -181, -181,
773 937, -181, -15, -45, 119, -181, -181, -181, 186, 115,
774 788, -181, 231, -181, -53, 121, -181, -181, -181, -181,
775 713, 523, -181, -181, -181, 713, 713, -181, -181, 206,
776 124, -181, -6, 937, 836, 125, -181, 161, -181, 523,
777 102, 160, -181, -181, 108, -181, -181, -4, 129, 220,
778 -181, 163, -181, 231, -181, -181, -181, -181, 141, -181,
779 -181, -181, -181, 426, -181
780};
781
782/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
783 Performed when YYTABLE does not specify something else to do. Zero
784 means the default is an error. */
785static const yytype_uint8 yydefact[] =
786{
787 7, 0, 3, 1, 104, 106, 103, 105, 0, 44,
788 102, 44, 11, 118, 0, 0, 0, 0, 0, 131,
789 0, 114, 0, 107, 0, 108, 0, 44, 110, 100,
790 109, 0, 111, 0, 0, 0, 101, 0, 0, 0,
791 0, 0, 0, 0, 0, 0, 0, 0, 7, 2,
792 8, 0, 45, 0, 99, 0, 0, 136, 120, 0,
793 0, 0, 0, 131, 0, 44, 120, 120, 0, 0,
794 112, 132, 0, 120, 120, 0, 0, 0, 120, 120,
795 0, 0, 0, 76, 75, 74, 70, 73, 72, 71,
796 93, 97, 0, 0, 44, 0, 4, 10, 0, 67,
797 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
798 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
799 120, 120, 0, 94, 98, 92, 122, 0, 121, 22,
800 23, 37, 39, 38, 36, 0, 32, 34, 0, 113,
801 0, 0, 136, 0, 0, 0, 134, 135, 0, 0,
802 0, 85, 24, 86, 0, 0, 0, 20, 0, 0,
803 0, 46, 9, 5, 66, 0, 65, 64, 61, 62,
804 60, 58, 59, 48, 55, 56, 57, 53, 54, 63,
805 49, 96, 95, 50, 51, 52, 0, 0, 0, 137,
806 77, 0, 0, 12, 115, 119, 84, 44, 44, 78,
807 79, 44, 0, 133, 44, 89, 88, 87, 80, 81,
808 0, 0, 17, 44, 47, 7, 0, 0, 90, 91,
809 123, 33, 0, 136, 0, 14, 16, 134, 42, 0,
810 0, 19, 6, 68, 118, 0, 116, 139, 138, 35,
811 44, 44, 13, 25, 18, 0, 0, 82, 117, 124,
812 0, 43, 0, 69, 0, 129, 140, 126, 127, 44,
813 0, 0, 21, 26, 7, 28, 83, 0, 0, 0,
814 15, 0, 31, 27, 29, 41, 40, 130, 0, 129,
815 128, 30, 7, 44, 141
816};
817
818/* YYPGOTO[NTERM-NUM]. */
819static const yytype_int16 yypgoto[] =
820{
821 -181, -181, -181, -181, -181, -48, -180, -181, -181, -181,
822 -181, -181, -23, -181, 59, -181, -181, -181, -181, -8,
823 -36, -181, -181, -181, -16, -181, -181, 51, -181, -181,
824 -19, -181, -181, -181, -24, -181, 193, 114, 26, -181,
825 -181, -181
826};
827
828/* YYDEFGOTO[NTERM-NUM]. */
829static const yytype_int16 yydefgoto[] =
830{
831 0, 1, 49, 96, 215, 2, 50, 61, 210, 252,
832 263, 264, 265, 135, 136, 194, 137, 277, 242, 51,
833 52, 165, 245, 53, 54, 55, 56, 57, 223, 63,
834 127, 128, 256, 257, 258, 267, 70, 71, 125, 239,
835 249, 268
836};
837
838/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
839 positive, shift that token. If negative, reduce the rule whose
840 number is the opposite. If YYTABLE_NINF, syntax error. */
841static const yytype_int16 yytable[] =
842{
843 94, 59, 235, 60, 84, 85, 86, 87, 260, 3,
844 211, 93, 261, 122, 246, 275, 146, 192, 225, 76,
845 147, 226, 126, 122, 228, 227, 138, 276, 140, 147,
846 126, 126, 58, 231, 62, 64, 148, 126, 126, 123,
847 124, 154, 126, 126, 157, 212, 159, 143, 144, 247,
848 62, 193, 237, 65, 149, 150, 66, 141, 67, 155,
849 156, 251, 164, 68, 166, 167, 168, 169, 170, 171,
850 172, 173, 174, 175, 176, 177, 178, 179, 180, 270,
851 183, 184, 185, 186, 126, 126, 189, 122, 69, 236,
852 83, 131, 13, 95, 262, 132, 90, 91, 72, 133,
853 19, 187, 188, 134, 21, 73, 4, 5, 74, 6,
854 7, 75, 88, 123, 124, 181, 142, 10, 77, 145,
855 89, 198, 260, 182, 214, 78, 261, 79, 80, 216,
856 81, 4, 5, 82, 6, 7, 97, 119, 8, 116,
857 117, 118, 10, 120, 121, 129, 13, 151, 14, 130,
858 16, 17, 158, 163, 19, 220, 152, 190, 21, 160,
859 191, 197, 22, 23, 24, 25, 26, 232, 28, 29,
860 30, 31, 32, 33, 34, 230, 36, 199, 200, 201,
861 205, 164, 113, 114, 115, 116, 117, 118, 206, 224,
862 -126, -126, -126, -126, 111, 112, 113, 114, 115, 116,
863 117, 118, 39, 222, 202, 208, 241, 209, 218, 253,
864 254, 40, 41, 219, 243, 229, 273, 42, 43, 44,
865 240, 45, 46, 255, 47, 248, 259, -125, 269, 153,
866 272, 278, 250, 281, 283, 4, 5, 279, 6, 7,
867 282, 274, 8, 9, 271, 280, 10, 11, 12, 238,
868 13, 221, 14, 15, 16, 17, 139, 18, 19, 20,
869 203, 0, 21, 0, 0, 0, 22, 23, 24, 25,
870 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
871 36, 37, 38, 98, 0, 99, 0, 100, 101, 102,
872 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
873 113, 114, 115, 116, 117, 118, 39, 0, 0, 0,
874 0, 0, 0, 0, 0, 40, 41, 0, 0, 0,
875 195, 42, 43, 44, 0, 45, 46, 0, 47, 0,
876 48, 0, -44, 4, 5, 0, 6, 7, 0, 0,
877 8, 9, 0, 0, 10, 11, 12, 0, 13, 0,
878 14, 15, 16, 17, 0, 18, 19, 20, 0, 0,
879 21, 0, 0, 0, 22, 23, 24, 25, 26, 27,
880 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
881 38, 98, 0, 99, 0, 100, 101, 102, 103, 104,
882 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
883 115, 116, 117, 118, 39, 0, 0, 0, 0, 0,
884 0, 0, 0, 40, 41, 0, 161, 0, 0, 42,
885 43, 44, 0, 45, 46, 0, 47, 0, 48, 162,
886 4, 5, 0, 6, 7, 0, 0, 8, 9, 0,
887 0, 10, 11, 12, 0, 13, 0, 14, 15, 16,
888 17, 0, 18, 19, 20, 0, 0, 21, 0, 0,
889 0, 22, 23, 24, 25, 26, 27, 28, 29, 30,
890 31, 32, 33, 34, 35, 36, 37, 38, 98, 0,
891 99, 0, 100, 101, 102, 103, 104, 105, 106, 107,
892 108, 109, 110, 111, 112, 113, 114, 115, 116, 117,
893 118, 39, 0, 0, 0, 0, 0, 0, 0, 0,
894 40, 41, 0, 196, 0, 0, 42, 43, 44, 0,
895 45, 46, 0, 47, 0, 48, 284, 4, 5, 0,
896 6, 7, 0, 0, 8, 9, 0, 0, 10, 11,
897 12, 0, 13, 0, 14, 15, 16, 17, 0, 18,
898 19, 20, 0, 0, 21, 0, 0, 0, 22, 23,
899 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
900 34, 35, 36, 37, 38, 98, 0, 99, 0, 100,
901 101, 102, 103, 104, 105, 106, 107, 108, 109, 110,
902 111, 112, 113, 114, 115, 116, 117, 118, 39, 0,
903 0, 0, 0, 0, 0, 0, 0, 40, 41, 0,
904 204, 0, 0, 42, 43, 44, 0, 45, 46, 0,
905 47, 0, 48, 4, 5, 0, 6, 7, 0, 0,
906 8, 0, 0, 0, 10, 0, 92, 0, 13, 0,
907 14, 0, 16, 17, 0, 0, 19, 0, 0, 0,
908 21, 0, 0, 0, 22, 23, 24, 25, 26, 0,
909 28, 29, 30, 31, 32, 33, 34, 98, 36, 99,
910 0, 100, 101, 102, 103, 104, 105, 106, 107, 108,
911 109, 110, 111, 112, 113, 114, 115, 116, 117, 118,
912 0, 0, 0, 0, 39, 0, 0, 0, 0, 0,
913 0, 0, 207, 40, 41, 0, 0, 0, 0, 42,
914 43, 44, 0, 45, 46, 0, 47, 4, 5, 0,
915 6, 7, 0, 0, 8, 0, 0, 0, 10, 0,
916 0, 0, 13, 0, 14, 0, 16, 17, 0, 0,
917 19, 0, 0, 0, 21, 0, 0, 0, 22, 23,
918 24, 25, 26, 0, 28, 29, 30, 31, 32, 33,
919 34, 98, 36, 99, 0, 100, 101, 102, 103, 104,
920 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
921 115, 116, 117, 118, 0, 0, 0, 0, 39, 0,
922 0, 0, 0, 0, 0, 0, 213, 40, 41, 0,
923 0, 0, 0, 42, 43, 44, 0, 45, 46, 0,
924 47, 4, 5, 0, 6, 7, 0, 0, 8, 0,
925 0, 0, 10, 0, 0, 0, 234, 0, 14, 0,
926 16, 17, 0, 0, 19, 0, 0, 0, 21, 0,
927 0, 0, 22, 23, 24, 25, 26, 0, 28, 29,
928 30, 31, 32, 33, 34, 98, 36, 99, 0, 100,
929 101, 102, 103, 104, 105, 106, 107, 108, 109, 110,
930 111, 112, 113, 114, 115, 116, 117, 118, 0, 0,
931 0, 0, 39, 0, 0, 0, 0, 0, 0, 0,
932 244, 40, 41, 0, 0, 0, 0, 42, 43, 44,
933 0, 45, 46, 98, 47, 99, 0, 100, 101, 102,
934 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
935 113, 114, 115, 116, 117, 118, 0, 0, 0, 0,
936 0, 0, 0, 0, 0, 0, 0, 98, 266, 99,
937 233, 100, 101, 102, 103, 104, 105, 106, 107, 108,
938 109, 110, 111, 112, 113, 114, 115, 116, 117, 118,
939 98, 0, 99, 0, 100, 101, 102, 103, 104, 105,
940 106, 107, 108, 109, 110, 111, 112, 113, 114, 115,
941 116, 117, 118, 217, 0, 99, 0, 100, 101, 102,
942 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
943 113, 114, 115, 116, 117, 118, 99, 0, 100, 101,
944 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
945 112, 113, 114, 115, 116, 117, 118, 101, 102, 103,
946 104, 105, 106, 107, 108, 109, 110, 111, 112, 113,
947 114, 115, 116, 117, 118, 102, 103, 104, 105, 106,
948 107, 108, 109, 110, 111, 112, 113, 114, 115, 116,
949 117, 118, 103, 104, 105, 106, 107, 108, 109, 110,
950 111, 112, 113, 114, 115, 116, 117, 118, 104, 105,
951 106, 107, 108, 109, 110, 111, 112, 113, 114, 115,
952 116, 117, 118, 105, 106, 107, 108, 109, 110, 111,
953 112, 113, 114, 115, 116, 117, 118, -126, -126, 107,
954 108, 109, 110, 111, 112, 113, 114, 115, 116, 117,
955 118
956};
957
958static const yytype_int16 yycheck[] =
959{
960 48, 9, 17, 11, 40, 41, 42, 43, 14, 0,
961 67, 47, 18, 68, 67, 19, 27, 67, 198, 27,
962 31, 201, 58, 68, 204, 27, 62, 31, 64, 31,
963 66, 67, 103, 213, 103, 97, 72, 73, 74, 94,
964 95, 77, 78, 79, 80, 102, 82, 66, 67, 102,
965 103, 101, 97, 97, 73, 74, 97, 65, 97, 78,
966 79, 241, 98, 97, 100, 101, 102, 103, 104, 105,
967 106, 107, 108, 109, 110, 111, 112, 113, 114, 259,
968 116, 117, 118, 119, 120, 121, 122, 68, 105, 104,
969 39, 19, 19, 29, 100, 23, 45, 46, 97, 27,
970 27, 120, 121, 31, 31, 97, 4, 5, 97, 7,
971 8, 97, 11, 94, 95, 11, 65, 15, 97, 68,
972 19, 102, 14, 19, 160, 97, 18, 97, 97, 165,
973 97, 4, 5, 97, 7, 8, 101, 97, 11, 87,
974 88, 89, 15, 97, 97, 101, 19, 102, 21, 101,
975 23, 24, 19, 70, 27, 191, 101, 104, 31, 102,
976 67, 101, 35, 36, 37, 38, 39, 215, 41, 42,
977 43, 44, 45, 46, 47, 211, 49, 102, 102, 102,
978 102, 217, 84, 85, 86, 87, 88, 89, 102, 197,
979 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
980 88, 89, 75, 103, 105, 102, 20, 102, 102, 245,
981 246, 84, 85, 102, 99, 102, 264, 90, 91, 92,
982 101, 94, 95, 17, 97, 104, 102, 102, 67, 102,
983 70, 102, 240, 70, 282, 4, 5, 17, 7, 8,
984 99, 264, 11, 12, 260, 269, 15, 16, 17, 223,
985 19, 192, 21, 22, 23, 24, 63, 26, 27, 28,
986 146, -1, 31, -1, -1, -1, 35, 36, 37, 38,
987 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
988 49, 50, 51, 67, -1, 69, -1, 71, 72, 73,
989 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
990 84, 85, 86, 87, 88, 89, 75, -1, -1, -1,
991 -1, -1, -1, -1, -1, 84, 85, -1, -1, -1,
992 104, 90, 91, 92, -1, 94, 95, -1, 97, -1,
993 99, -1, 101, 4, 5, -1, 7, 8, -1, -1,
994 11, 12, -1, -1, 15, 16, 17, -1, 19, -1,
995 21, 22, 23, 24, -1, 26, 27, 28, -1, -1,
996 31, -1, -1, -1, 35, 36, 37, 38, 39, 40,
997 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
998 51, 67, -1, 69, -1, 71, 72, 73, 74, 75,
999 76, 77, 78, 79, 80, 81, 82, 83, 84, 85,
1000 86, 87, 88, 89, 75, -1, -1, -1, -1, -1,
1001 -1, -1, -1, 84, 85, -1, 102, -1, -1, 90,
1002 91, 92, -1, 94, 95, -1, 97, -1, 99, 100,
1003 4, 5, -1, 7, 8, -1, -1, 11, 12, -1,
1004 -1, 15, 16, 17, -1, 19, -1, 21, 22, 23,
1005 24, -1, 26, 27, 28, -1, -1, 31, -1, -1,
1006 -1, 35, 36, 37, 38, 39, 40, 41, 42, 43,
1007 44, 45, 46, 47, 48, 49, 50, 51, 67, -1,
1008 69, -1, 71, 72, 73, 74, 75, 76, 77, 78,
1009 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
1010 89, 75, -1, -1, -1, -1, -1, -1, -1, -1,
1011 84, 85, -1, 102, -1, -1, 90, 91, 92, -1,
1012 94, 95, -1, 97, -1, 99, 100, 4, 5, -1,
1013 7, 8, -1, -1, 11, 12, -1, -1, 15, 16,
1014 17, -1, 19, -1, 21, 22, 23, 24, -1, 26,
1015 27, 28, -1, -1, 31, -1, -1, -1, 35, 36,
1016 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
1017 47, 48, 49, 50, 51, 67, -1, 69, -1, 71,
1018 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
1019 82, 83, 84, 85, 86, 87, 88, 89, 75, -1,
1020 -1, -1, -1, -1, -1, -1, -1, 84, 85, -1,
1021 102, -1, -1, 90, 91, 92, -1, 94, 95, -1,
1022 97, -1, 99, 4, 5, -1, 7, 8, -1, -1,
1023 11, -1, -1, -1, 15, -1, 17, -1, 19, -1,
1024 21, -1, 23, 24, -1, -1, 27, -1, -1, -1,
1025 31, -1, -1, -1, 35, 36, 37, 38, 39, -1,
1026 41, 42, 43, 44, 45, 46, 47, 67, 49, 69,
1027 -1, 71, 72, 73, 74, 75, 76, 77, 78, 79,
1028 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
1029 -1, -1, -1, -1, 75, -1, -1, -1, -1, -1,
1030 -1, -1, 102, 84, 85, -1, -1, -1, -1, 90,
1031 91, 92, -1, 94, 95, -1, 97, 4, 5, -1,
1032 7, 8, -1, -1, 11, -1, -1, -1, 15, -1,
1033 -1, -1, 19, -1, 21, -1, 23, 24, -1, -1,
1034 27, -1, -1, -1, 31, -1, -1, -1, 35, 36,
1035 37, 38, 39, -1, 41, 42, 43, 44, 45, 46,
1036 47, 67, 49, 69, -1, 71, 72, 73, 74, 75,
1037 76, 77, 78, 79, 80, 81, 82, 83, 84, 85,
1038 86, 87, 88, 89, -1, -1, -1, -1, 75, -1,
1039 -1, -1, -1, -1, -1, -1, 102, 84, 85, -1,
1040 -1, -1, -1, 90, 91, 92, -1, 94, 95, -1,
1041 97, 4, 5, -1, 7, 8, -1, -1, 11, -1,
1042 -1, -1, 15, -1, -1, -1, 19, -1, 21, -1,
1043 23, 24, -1, -1, 27, -1, -1, -1, 31, -1,
1044 -1, -1, 35, 36, 37, 38, 39, -1, 41, 42,
1045 43, 44, 45, 46, 47, 67, 49, 69, -1, 71,
1046 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
1047 82, 83, 84, 85, 86, 87, 88, 89, -1, -1,
1048 -1, -1, 75, -1, -1, -1, -1, -1, -1, -1,
1049 102, 84, 85, -1, -1, -1, -1, 90, 91, 92,
1050 -1, 94, 95, 67, 97, 69, -1, 71, 72, 73,
1051 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
1052 84, 85, 86, 87, 88, 89, -1, -1, -1, -1,
1053 -1, -1, -1, -1, -1, -1, -1, 67, 102, 69,
1054 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
1055 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
1056 67, -1, 69, -1, 71, 72, 73, 74, 75, 76,
1057 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
1058 87, 88, 89, 67, -1, 69, -1, 71, 72, 73,
1059 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
1060 84, 85, 86, 87, 88, 89, 69, -1, 71, 72,
1061 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
1062 83, 84, 85, 86, 87, 88, 89, 72, 73, 74,
1063 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
1064 85, 86, 87, 88, 89, 73, 74, 75, 76, 77,
1065 78, 79, 80, 81, 82, 83, 84, 85, 86, 87,
1066 88, 89, 74, 75, 76, 77, 78, 79, 80, 81,
1067 82, 83, 84, 85, 86, 87, 88, 89, 75, 76,
1068 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,
1069 87, 88, 89, 76, 77, 78, 79, 80, 81, 82,
1070 83, 84, 85, 86, 87, 88, 89, 76, 77, 78,
1071 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
1072 89
1073};
1074
1075/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
1076 state STATE-NUM. */
1077static const yytype_uint8 yystos[] =
1078{
1079 0, 107, 111, 0, 4, 5, 7, 8, 11, 12,
1080 15, 16, 17, 19, 21, 22, 23, 24, 26, 27,
1081 28, 31, 35, 36, 37, 38, 39, 40, 41, 42,
1082 43, 44, 45, 46, 47, 48, 49, 50, 51, 75,
1083 84, 85, 90, 91, 92, 94, 95, 97, 99, 108,
1084 112, 125, 126, 129, 130, 131, 132, 133, 103, 125,
1085 125, 113, 103, 135, 97, 97, 97, 97, 97, 105,
1086 142, 143, 97, 97, 97, 97, 125, 97, 97, 97,
1087 97, 97, 97, 133, 126, 126, 126, 126, 11, 19,
1088 133, 133, 17, 126, 111, 29, 109, 101, 67, 69,
1089 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
1090 81, 82, 83, 84, 85, 86, 87, 88, 89, 97,
1091 97, 97, 68, 94, 95, 144, 126, 136, 137, 101,
1092 101, 19, 23, 27, 31, 119, 120, 122, 126, 142,
1093 126, 125, 133, 136, 136, 133, 27, 31, 126, 136,
1094 136, 102, 101, 102, 126, 136, 136, 126, 19, 126,
1095 102, 102, 100, 70, 126, 127, 126, 126, 126, 126,
1096 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
1097 126, 11, 19, 126, 126, 126, 126, 136, 136, 126,
1098 104, 67, 67, 101, 121, 104, 102, 101, 102, 102,
1099 102, 102, 105, 143, 102, 102, 102, 102, 102, 102,
1100 114, 67, 102, 102, 126, 110, 126, 67, 102, 102,
1101 126, 120, 103, 134, 125, 112, 112, 27, 112, 102,
1102 126, 112, 111, 70, 19, 17, 104, 97, 144, 145,
1103 101, 20, 124, 99, 102, 128, 67, 102, 104, 146,
1104 125, 112, 115, 126, 126, 17, 138, 139, 140, 102,
1105 14, 18, 100, 116, 117, 118, 102, 141, 147, 67,
1106 112, 130, 70, 111, 118, 19, 31, 123, 102, 17,
1107 140, 70, 99, 111, 100
1108};
1109
1110/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */
1111static const yytype_uint8 yyr1[] =
1112{
1113 0, 106, 107, 108, 108, 110, 109, 111, 111, 112,
1114 112, 113, 112, 112, 112, 112, 112, 112, 112, 112,
1115 114, 112, 112, 112, 112, 115, 115, 116, 117, 117,
1116 118, 118, 119, 119, 121, 120, 122, 122, 122, 122,
1117 123, 123, 124, 124, 125, 125, 126, 126, 126, 126,
1118 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
1119 126, 126, 126, 126, 126, 126, 126, 127, 128, 126,
1120 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
1121 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
1122 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
1123 129, 129, 130, 130, 130, 130, 130, 131, 131, 131,
1124 132, 132, 133, 133, 133, 134, 134, 134, 135, 135,
1125 136, 136, 137, 137, 138, 138, 138, 139, 139, 141,
1126 140, 142, 142, 142, 143, 143, 144, 144, 145, 146,
1127 147, 145
1128};
1129
1130/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */
1131static const yytype_int8 yyr2[] =
1132{
1133 0, 2, 2, 0, 2, 0, 4, 0, 2, 3,
1134 2, 0, 4, 6, 5, 9, 5, 4, 6, 5,
1135 0, 8, 3, 3, 3, 0, 2, 2, 1, 2,
1136 3, 2, 1, 3, 0, 4, 1, 1, 1, 1,
1137 1, 1, 0, 2, 0, 1, 3, 4, 3, 3,
1138 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
1139 3, 3, 3, 3, 3, 3, 3, 0, 0, 7,
1140 2, 2, 2, 2, 2, 2, 2, 4, 4, 4,
1141 4, 4, 6, 8, 4, 3, 3, 4, 4, 4,
1142 4, 4, 2, 2, 2, 3, 3, 2, 2, 1,
1143 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1144 1, 1, 2, 3, 1, 0, 2, 3, 0, 3,
1145 0, 1, 1, 3, 0, 1, 1, 1, 3, 0,
1146 3, 0, 1, 3, 2, 2, 0, 2, 1, 0,
1147 0, 8
1148};
1149
1150
1151enum { YYENOMEM = -2 };
1152
1153#define yyerrok (yyerrstatus = 0)
1154#define yyclearin (yychar = EX_EMPTY)
1155
1156#define YYACCEPT goto yyacceptlab
1157#define YYABORT goto yyabortlab
1158#define YYERROR goto yyerrorlab
1159#define YYNOMEM goto yyexhaustedlab
1160
1161
1162#define YYRECOVERING() (!!yyerrstatus)
1163
1164#define YYBACKUP(Token, Value) \
1165 do \
1166 if (yychar == EX_EMPTY) \
1167 { \
1168 yychar = (Token); \
1169 yylval = (Value); \
1170 YYPOPSTACK (yylen); \
1171 yystate = *yyssp; \
1172 goto yybackup; \
1173 } \
1174 else \
1175 { \
1176 yyerror (YY_("syntax error: cannot back up")); \
1177 YYERROR; \
1178 } \
1179 while (0)
1180
1181/* Backward compatibility with an undocumented macro.
1182 Use EX_error or EX_UNDEF. */
1183#define YYERRCODE EX_UNDEF
1184
1185
1186/* Enable debugging if requested. */
1187#if EX_DEBUG
1188
1189# ifndef YYFPRINTF
1190# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1191# define YYFPRINTF fprintf
1192# endif
1193
1194# define YYDPRINTF(Args) \
1195do { \
1196 if (yydebug) \
1197 YYFPRINTF Args; \
1198} while (0)
1199
1200
1201
1202
1203# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \
1204do { \
1205 if (yydebug) \
1206 { \
1207 YYFPRINTF (stderr, "%s ", Title); \
1208 yy_symbol_print (stderr, \
1209 Kind, Value); \
1210 YYFPRINTF (stderr, "\n"); \
1211 } \
1212} while (0)
1213
1214
1215/*-----------------------------------.
1216| Print this symbol's value on YYO. |
1217`-----------------------------------*/
1218
1219static void
1220yy_symbol_value_print (FILE *yyo,
1221 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
1222{
1223 FILE *yyoutput = yyo;
1224 YY_USE (yyoutput);
1225 if (!yyvaluep)
1226 return;
1228 YY_USE (yykind);
1230}
1231
1232
1233/*---------------------------.
1234| Print this symbol on YYO. |
1235`---------------------------*/
1236
1237static void
1238yy_symbol_print (FILE *yyo,
1239 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
1240{
1241 YYFPRINTF (yyo, "%s %s (",
1242 yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
1243
1244 yy_symbol_value_print (yyo, yykind, yyvaluep);
1245 YYFPRINTF (yyo, ")");
1246}
1247
1248/*------------------------------------------------------------------.
1249| yy_stack_print -- Print the state stack from its BOTTOM up to its |
1250| TOP (included). |
1251`------------------------------------------------------------------*/
1252
1253static void
1254yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
1255{
1256 YYFPRINTF (stderr, "Stack now");
1257 for (; yybottom <= yytop; yybottom++)
1258 {
1259 int yybot = *yybottom;
1260 YYFPRINTF (stderr, " %d", yybot);
1261 }
1262 YYFPRINTF (stderr, "\n");
1263}
1264
1265# define YY_STACK_PRINT(Bottom, Top) \
1266do { \
1267 if (yydebug) \
1268 yy_stack_print ((Bottom), (Top)); \
1269} while (0)
1270
1271
1272/*------------------------------------------------.
1273| Report that the YYRULE is going to be reduced. |
1274`------------------------------------------------*/
1275
1276static void
1277yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp,
1278 int yyrule)
1279{
1280 int yylno = yyrline[yyrule];
1281 int yynrhs = yyr2[yyrule];
1282 int yyi;
1283 YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
1284 yyrule - 1, yylno);
1285 /* The symbols being reduced. */
1286 for (yyi = 0; yyi < yynrhs; yyi++)
1287 {
1288 YYFPRINTF (stderr, " $%d = ", yyi + 1);
1289 yy_symbol_print (stderr,
1290 YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
1291 &yyvsp[(yyi + 1) - (yynrhs)]);
1292 YYFPRINTF (stderr, "\n");
1293 }
1294}
1295
1296# define YY_REDUCE_PRINT(Rule) \
1297do { \
1298 if (yydebug) \
1299 yy_reduce_print (yyssp, yyvsp, Rule); \
1300} while (0)
1301
1302/* Nonzero means print parse trace. It is left uninitialized so that
1303 multiple parsers can coexist. */
1304int yydebug;
1305#else /* !EX_DEBUG */
1306# define YYDPRINTF(Args) ((void) 0)
1307# define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
1308# define YY_STACK_PRINT(Bottom, Top)
1309# define YY_REDUCE_PRINT(Rule)
1310#endif /* !EX_DEBUG */
1311
1312
1313/* YYINITDEPTH -- initial size of the parser's stacks. */
1314#ifndef YYINITDEPTH
1315# define YYINITDEPTH 200
1316#endif
1317
1318/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1319 if the built-in stack extension method is used).
1320
1321 Do not make this value too large; the results are undefined if
1322 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1323 evaluated with infinite-precision integer arithmetic. */
1324
1325#ifndef YYMAXDEPTH
1326# define YYMAXDEPTH 10000
1327#endif
1328
1329
1330
1331
1332
1333
1334/*-----------------------------------------------.
1335| Release the memory associated to this symbol. |
1336`-----------------------------------------------*/
1337
1338static void
1339yydestruct (const char *yymsg,
1340 yysymbol_kind_t yykind, YYSTYPE *yyvaluep)
1341{
1342 YY_USE (yyvaluep);
1343 if (!yymsg)
1344 yymsg = "Deleting";
1345 YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
1346
1348 YY_USE (yykind);
1350}
1351
1352
1353/* Lookahead token kind. */
1355
1356/* The semantic value of the lookahead symbol. */
1358/* Number of syntax errors so far. */
1360
1361
1362
1363
1364/*----------.
1365| yyparse. |
1366`----------*/
1367
1368int
1370{
1371 yy_state_fast_t yystate = 0;
1372 /* Number of tokens to shift before error messages enabled. */
1373 int yyerrstatus = 0;
1374
1375 /* Refer to the stacks through separate pointers, to allow yyoverflow
1376 to reallocate them elsewhere. */
1377
1378 /* Their size. */
1379 YYPTRDIFF_T yystacksize = YYINITDEPTH;
1380
1381 /* The state stack: array, bottom, top. */
1382 yy_state_t yyssa[YYINITDEPTH];
1383 yy_state_t *yyss = yyssa;
1384 yy_state_t *yyssp = yyss;
1385
1386 /* The semantic value stack: array, bottom, top. */
1387 YYSTYPE yyvsa[YYINITDEPTH];
1388 YYSTYPE *yyvs = yyvsa;
1389 YYSTYPE *yyvsp = yyvs;
1390
1391 int yyn;
1392 /* The return value of yyparse. */
1393 int yyresult;
1394 /* Lookahead symbol kind. */
1396 /* The variables used to return semantic value and location from the
1397 action routines. */
1398 YYSTYPE yyval;
1399
1400
1401
1402#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1403
1404 /* The number of symbols on the RHS of the reduced rule.
1405 Keep to zero when no symbol should be popped. */
1406 int yylen = 0;
1407
1408 YYDPRINTF ((stderr, "Starting parse\n"));
1409
1410 yychar = EX_EMPTY; /* Cause a token to be read. */
1411
1412 goto yysetstate;
1413
1414
1415/*------------------------------------------------------------.
1416| yynewstate -- push a new state, which is found in yystate. |
1417`------------------------------------------------------------*/
1418yynewstate:
1419 /* In all cases, when you get here, the value and location stacks
1420 have just been pushed. So pushing a state here evens the stacks. */
1421 yyssp++;
1422
1423
1424/*--------------------------------------------------------------------.
1425| yysetstate -- set current state (the top of the stack) to yystate. |
1426`--------------------------------------------------------------------*/
1427yysetstate:
1428 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1429 YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
1431 *yyssp = YY_CAST (yy_state_t, yystate);
1433 YY_STACK_PRINT (yyss, yyssp);
1434
1435 if (yyss + yystacksize - 1 <= yyssp)
1436#if !defined yyoverflow && !defined YYSTACK_RELOCATE
1437 YYNOMEM;
1438#else
1439 {
1440 /* Get the current used size of the three stacks, in elements. */
1441 YYPTRDIFF_T yysize = yyssp - yyss + 1;
1442
1443# if defined yyoverflow
1444 {
1445 /* Give user a chance to reallocate the stack. Use copies of
1446 these so that the &'s don't force the real ones into
1447 memory. */
1448 yy_state_t *yyss1 = yyss;
1449 YYSTYPE *yyvs1 = yyvs;
1450
1451 /* Each stack pointer address is followed by the size of the
1452 data in use in that stack, in bytes. This used to be a
1453 conditional around just the two extra args, but that might
1454 be undefined if yyoverflow is a macro. */
1455 yyoverflow (YY_("memory exhausted"),
1456 &yyss1, yysize * YYSIZEOF (*yyssp),
1457 &yyvs1, yysize * YYSIZEOF (*yyvsp),
1458 &yystacksize);
1459 yyss = yyss1;
1460 yyvs = yyvs1;
1461 }
1462# else /* defined YYSTACK_RELOCATE */
1463 /* Extend the stack our own way. */
1464 if (YYMAXDEPTH <= yystacksize)
1465 YYNOMEM;
1466 yystacksize *= 2;
1467 if (YYMAXDEPTH < yystacksize)
1468 yystacksize = YYMAXDEPTH;
1469
1470 {
1471 yy_state_t *yyss1 = yyss;
1472 union yyalloc *yyptr =
1473 YY_CAST (union yyalloc *,
1474 YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
1475 if (! yyptr)
1476 YYNOMEM;
1477 YYSTACK_RELOCATE (yyss_alloc, yyss);
1478 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1479# undef YYSTACK_RELOCATE
1480 if (yyss1 != yyssa)
1481 YYSTACK_FREE (yyss1);
1482 }
1483# endif
1484
1485 yyssp = yyss + yysize - 1;
1486 yyvsp = yyvs + yysize - 1;
1487
1489 YYDPRINTF ((stderr, "Stack size increased to %ld\n",
1490 YY_CAST (long, yystacksize)));
1492
1493 if (yyss + yystacksize - 1 <= yyssp)
1494 YYABORT;
1495 }
1496#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
1497
1498
1499 if (yystate == YYFINAL)
1500 YYACCEPT;
1501
1502 goto yybackup;
1503
1504
1505/*-----------.
1506| yybackup. |
1507`-----------*/
1508yybackup:
1509 /* Do appropriate processing given the current state. Read a
1510 lookahead token if we need one and don't already have one. */
1511
1512 /* First try to decide what to do without reference to lookahead token. */
1513 yyn = yypact[yystate];
1514 if (yypact_value_is_default (yyn))
1515 goto yydefault;
1516
1517 /* Not known => get a lookahead token if don't already have one. */
1518
1519 /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */
1520 if (yychar == EX_EMPTY)
1521 {
1522 YYDPRINTF ((stderr, "Reading a token\n"));
1523 yychar = yylex ();
1524 }
1525
1526 if (yychar <= EX_EOF)
1527 {
1528 yychar = EX_EOF;
1529 yytoken = YYSYMBOL_YYEOF;
1530 YYDPRINTF ((stderr, "Now at end of input.\n"));
1531 }
1532 else if (yychar == EX_error)
1533 {
1534 /* The scanner already issued an error message, process directly
1535 to error recovery. But do not keep the error token as
1536 lookahead, it is too special and may lead us to an endless
1537 loop in error recovery. */
1538 yychar = EX_UNDEF;
1539 yytoken = YYSYMBOL_YYerror;
1540 goto yyerrlab1;
1541 }
1542 else
1543 {
1544 yytoken = YYTRANSLATE (yychar);
1545 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1546 }
1547
1548 /* If the proper action on seeing token YYTOKEN is to reduce or to
1549 detect an error, take that action. */
1550 yyn += yytoken;
1551 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1552 goto yydefault;
1553 yyn = yytable[yyn];
1554 if (yyn <= 0)
1555 {
1556 if (yytable_value_is_error (yyn))
1557 goto yyerrlab;
1558 yyn = -yyn;
1559 goto yyreduce;
1560 }
1561
1562 /* Count tokens shifted since error; after three, turn off error
1563 status. */
1564 if (yyerrstatus)
1565 yyerrstatus--;
1566
1567 /* Shift the lookahead token. */
1568 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1569 yystate = yyn;
1571 *++yyvsp = yylval;
1573
1574 /* Discard the shifted token. */
1575 yychar = EX_EMPTY;
1576 goto yynewstate;
1577
1578
1579/*-----------------------------------------------------------.
1580| yydefault -- do the default action for the current state. |
1581`-----------------------------------------------------------*/
1582yydefault:
1583 yyn = yydefact[yystate];
1584 if (yyn == 0)
1585 goto yyerrlab;
1586 goto yyreduce;
1587
1588
1589/*-----------------------------.
1590| yyreduce -- do a reduction. |
1591`-----------------------------*/
1592yyreduce:
1593 /* yyn is the number of a rule to reduce with. */
1594 yylen = yyr2[yyn];
1595
1596 /* If YYLEN is nonzero, implement the default value of the action:
1597 '$$ = $1'.
1598
1599 Otherwise, the following line sets YYVAL to garbage.
1600 This behavior is undocumented and Bison
1601 users should not rely upon it. Assigning to YYVAL
1602 unconditionally makes the parser a bit smaller, and it avoids a
1603 GCC warning that YYVAL may be used uninitialized. */
1604 yyval = yyvsp[1-yylen];
1605
1606
1607 YY_REDUCE_PRINT (yyn);
1608 switch (yyn)
1609 {
1610 case 2: /* program: statement_list action_list */
1611#line 180 "../../lib/expr/exparse.y"
1612 {
1613 if ((yyvsp[-1].expr)) {
1614 if (expr.program->main.value)
1615 exfreenode(expr.program, expr.program->main.value);
1616 if ((yyvsp[-1].expr)->op == S2B)
1617 {
1618 Exnode_t *x = (yyvsp[-1].expr);
1619 (yyvsp[-1].expr) = x->data.operand.left;
1620 x->data.operand.left = 0;
1622 }
1623 expr.program->main.lex = PROCEDURE;
1624 expr.program->main.value = exnewnode(expr.program, PROCEDURE, true, (yyvsp[-1].expr)->type, NULL, (yyvsp[-1].expr));
1625 }
1626 }
1627#line 1628 "exparse.c"
1628 break;
1629
1630 case 5: /* $@1: %empty */
1631#line 201 "../../lib/expr/exparse.y"
1632 {
1633 if (expr.procedure)
1634 exerror("no nested function definitions");
1635 (yyvsp[-1].id)->lex = PROCEDURE;
1636 expr.procedure = (yyvsp[-1].id)->value = exnewnode(expr.program, PROCEDURE, true, (yyvsp[-1].id)->type, NULL, NULL);
1638 static Dtdisc_t disc = {.key = offsetof(Exid_t, name)};
1639 if (expr.assigned && !streq((yyvsp[-1].id)->name, "begin"))
1640 {
1641 if (!(expr.procedure->data.procedure.frame = dtopen(&disc, Dtset)) ||
1642 !dtview(expr.procedure->data.procedure.frame, expr.program->symbols))
1643 exnospace();
1644 expr.program->symbols = expr.program->frame = expr.procedure->data.procedure.frame;
1645 }
1646 }
1647#line 1648 "exparse.c"
1648 break;
1649
1650 case 6: /* action: LABEL ':' $@1 statement_list */
1651#line 216 "../../lib/expr/exparse.y"
1652 {
1654 if (expr.program->frame)
1655 {
1656 expr.program->symbols = expr.program->frame->view;
1657 dtview(expr.program->frame, NULL);
1658 expr.program->frame = NULL;
1659 }
1660 if ((yyvsp[0].expr) && (yyvsp[0].expr)->op == S2B)
1661 {
1662 Exnode_t *x = (yyvsp[0].expr);
1663 (yyvsp[0].expr) = x->data.operand.left;
1664 x->data.operand.left = 0;
1666 }
1667 (yyvsp[-3].id)->value->data.procedure.body = excast(expr.program, (yyvsp[0].expr), (yyvsp[-3].id)->type, NULL, 0);
1668 }
1669#line 1670 "exparse.c"
1670 break;
1671
1672 case 7: /* statement_list: %empty */
1673#line 236 "../../lib/expr/exparse.y"
1674 {
1675 (yyval.expr) = 0;
1676 }
1677#line 1678 "exparse.c"
1678 break;
1679
1680 case 8: /* statement_list: statement_list statement */
1681#line 240 "../../lib/expr/exparse.y"
1682 {
1683 if (!(yyvsp[-1].expr))
1684 (yyval.expr) = (yyvsp[0].expr);
1685 else if (!(yyvsp[0].expr))
1686 (yyval.expr) = (yyvsp[-1].expr);
1687 else if ((yyvsp[-1].expr)->op == CONSTANT)
1688 {
1689 exfreenode(expr.program, (yyvsp[-1].expr));
1690 (yyval.expr) = (yyvsp[0].expr);
1691 }
1692 else (yyval.expr) = exnewnode(expr.program, ';', true, (yyvsp[0].expr)->type, (yyvsp[-1].expr), (yyvsp[0].expr));
1693 }
1694#line 1695 "exparse.c"
1695 break;
1696
1697 case 9: /* statement: '{' statement_list '}' */
1698#line 255 "../../lib/expr/exparse.y"
1699 {
1700 (yyval.expr) = (yyvsp[-1].expr);
1701 }
1702#line 1703 "exparse.c"
1703 break;
1704
1705 case 10: /* statement: expr_opt ';' */
1706#line 259 "../../lib/expr/exparse.y"
1707 {
1708 (yyval.expr) = ((yyvsp[-1].expr) && (yyvsp[-1].expr)->type == STRING) ? exnewnode(expr.program, S2B, true, INTEGER, (yyvsp[-1].expr), NULL) : (yyvsp[-1].expr);
1709 }
1710#line 1711 "exparse.c"
1711 break;
1712
1713 case 11: /* $@2: %empty */
1714#line 262 "../../lib/expr/exparse.y"
1715 {expr.declare = (yyvsp[0].id)->type;}
1716#line 1717 "exparse.c"
1717 break;
1718
1719 case 12: /* statement: DECLARE $@2 dcl_list ';' */
1720#line 263 "../../lib/expr/exparse.y"
1721 {
1722 (yyval.expr) = (yyvsp[-1].expr);
1723 expr.declare = 0;
1724 }
1725#line 1726 "exparse.c"
1726 break;
1727
1728 case 13: /* statement: IF '(' expr ')' statement else_opt */
1729#line 268 "../../lib/expr/exparse.y"
1730 {
1731 if (exisAssign ((yyvsp[-3].expr)))
1732 exwarn ("assignment used as boolean in if statement");
1733 if ((yyvsp[-3].expr)->type == STRING)
1734 (yyvsp[-3].expr) = exnewnode(expr.program, S2B, true, INTEGER, (yyvsp[-3].expr), NULL);
1735 else if (!INTEGRAL((yyvsp[-3].expr)->type))
1736 (yyvsp[-3].expr) = excast(expr.program, (yyvsp[-3].expr), INTEGER, NULL, 0);
1737 (yyval.expr) = exnewnode(expr.program, (yyvsp[-5].id)->index, true, INTEGER, (yyvsp[-3].expr), exnewnode(expr.program, ':', true, (yyvsp[-1].expr) ? (yyvsp[-1].expr)->type : 0, (yyvsp[-1].expr), (yyvsp[0].expr)));
1738 }
1739#line 1740 "exparse.c"
1740 break;
1741
1742 case 14: /* statement: FOR '(' variable ')' statement */
1743#line 278 "../../lib/expr/exparse.y"
1744 {
1745 (yyval.expr) = exnewnode(expr.program, ITERATE, false, INTEGER, NULL, NULL);
1746 (yyval.expr)->data.generate.array = (yyvsp[-2].expr);
1747 if (!(yyvsp[-2].expr)->data.variable.index || (yyvsp[-2].expr)->data.variable.index->op != DYNAMIC)
1748 exerror("simple index variable expected");
1749 (yyval.expr)->data.generate.index = (yyvsp[-2].expr)->data.variable.index->data.variable.symbol;
1750 if ((yyvsp[-2].expr)->op == ID && (yyval.expr)->data.generate.index->type != INTEGER)
1751 exerror("integer index variable expected");
1752 exfreenode(expr.program, (yyvsp[-2].expr)->data.variable.index);
1753 (yyvsp[-2].expr)->data.variable.index = 0;
1754 (yyval.expr)->data.generate.statement = (yyvsp[0].expr);
1755 }
1756#line 1757 "exparse.c"
1757 break;
1758
1759 case 15: /* statement: FOR '(' expr_opt ';' expr_opt ';' expr_opt ')' statement */
1760#line 291 "../../lib/expr/exparse.y"
1761 {
1762 if (!(yyvsp[-4].expr))
1763 {
1764 (yyvsp[-4].expr) = exnewnode(expr.program, CONSTANT, false, INTEGER, NULL, NULL);
1765 (yyvsp[-4].expr)->data.constant.value.integer = 1;
1766 }
1767 else if ((yyvsp[-4].expr)->type == STRING)
1768 (yyvsp[-4].expr) = exnewnode(expr.program, S2B, true, INTEGER, (yyvsp[-4].expr), NULL);
1769 else if (!INTEGRAL((yyvsp[-4].expr)->type))
1770 (yyvsp[-4].expr) = excast(expr.program, (yyvsp[-4].expr), INTEGER, NULL, 0);
1771 (yyval.expr) = exnewnode(expr.program, (yyvsp[-8].id)->index, true, INTEGER, (yyvsp[-4].expr), exnewnode(expr.program, ';', 1, 0, (yyvsp[-2].expr), (yyvsp[0].expr)));
1772 if ((yyvsp[-6].expr))
1773 (yyval.expr) = exnewnode(expr.program, ';', true, INTEGER, (yyvsp[-6].expr), (yyval.expr));
1774 }
1775#line 1776 "exparse.c"
1776 break;
1777
1778 case 16: /* statement: ITERATOR '(' variable ')' statement */
1779#line 306 "../../lib/expr/exparse.y"
1780 {
1781 (yyval.expr) = exnewnode(expr.program, ITERATOR, false, INTEGER, NULL, NULL);
1782 (yyval.expr)->data.generate.array = (yyvsp[-2].expr);
1783 if (!(yyvsp[-2].expr)->data.variable.index || (yyvsp[-2].expr)->data.variable.index->op != DYNAMIC)
1784 exerror("simple index variable expected");
1785 (yyval.expr)->data.generate.index = (yyvsp[-2].expr)->data.variable.index->data.variable.symbol;
1786 if ((yyvsp[-2].expr)->op == ID && (yyval.expr)->data.generate.index->type != INTEGER)
1787 exerror("integer index variable expected");
1788 exfreenode(expr.program, (yyvsp[-2].expr)->data.variable.index);
1789 (yyvsp[-2].expr)->data.variable.index = 0;
1790 (yyval.expr)->data.generate.statement = (yyvsp[0].expr);
1791 }
1792#line 1793 "exparse.c"
1793 break;
1794
1795 case 17: /* statement: UNSET '(' DYNAMIC ')' */
1796#line 319 "../../lib/expr/exparse.y"
1797 {
1798 if ((yyvsp[-1].id)->local == NULL)
1799 exerror("cannot apply unset to non-array %s", (yyvsp[-1].id)->name);
1800 (yyval.expr) = exnewnode(expr.program, UNSET, false, INTEGER, NULL, NULL);
1801 (yyval.expr)->data.variable.symbol = (yyvsp[-1].id);
1802 (yyval.expr)->data.variable.index = NULL;
1803 }
1804#line 1805 "exparse.c"
1805 break;
1806
1807 case 18: /* statement: UNSET '(' DYNAMIC ',' expr ')' */
1808#line 327 "../../lib/expr/exparse.y"
1809 {
1810 if ((yyvsp[-3].id)->local == NULL)
1811 exerror("cannot apply unset to non-array %s", (yyvsp[-3].id)->name);
1812 if (((yyvsp[-3].id)->index_type > 0) && ((yyvsp[-1].expr)->type != (yyvsp[-3].id)->index_type))
1813 exerror("%s indices must have type %s, not %s",
1814 (yyvsp[-3].id)->name, extypename(expr.program, (yyvsp[-3].id)->index_type),extypename(expr.program, (yyvsp[-1].expr)->type));
1815 (yyval.expr) = exnewnode(expr.program, UNSET, false, INTEGER, NULL, NULL);
1816 (yyval.expr)->data.variable.symbol = (yyvsp[-3].id);
1817 (yyval.expr)->data.variable.index = (yyvsp[-1].expr);
1818 }
1819#line 1820 "exparse.c"
1820 break;
1821
1822 case 19: /* statement: WHILE '(' expr ')' statement */
1823#line 338 "../../lib/expr/exparse.y"
1824 {
1825 if (exisAssign ((yyvsp[-2].expr)))
1826 exwarn ("assignment used as boolean in while statement");
1827 if ((yyvsp[-2].expr)->type == STRING)
1828 (yyvsp[-2].expr) = exnewnode(expr.program, S2B, true, INTEGER, (yyvsp[-2].expr), NULL);
1829 else if (!INTEGRAL((yyvsp[-2].expr)->type))
1830 (yyvsp[-2].expr) = excast(expr.program, (yyvsp[-2].expr), INTEGER, NULL, 0);
1831 (yyval.expr) = exnewnode(expr.program, (yyvsp[-4].id)->index, true, INTEGER, (yyvsp[-2].expr), exnewnode(expr.program, ';', true, 0, NULL, (yyvsp[0].expr)));
1832 }
1833#line 1834 "exparse.c"
1834 break;
1835
1836 case 20: /* $@3: %empty */
1837#line 347 "../../lib/expr/exparse.y"
1838 {expr.declare=(yyvsp[0].expr)->type;}
1839#line 1840 "exparse.c"
1840 break;
1841
1842 case 21: /* statement: SWITCH '(' expr $@3 ')' '{' switch_list '}' */
1843#line 348 "../../lib/expr/exparse.y"
1844 {
1845 Switch_t* sw = expr.swstate;
1846
1847 (yyval.expr) = exnewnode(expr.program, (yyvsp[-7].id)->index, true, INTEGER, (yyvsp[-5].expr), exnewnode(expr.program, DEFAULT, true, 0, sw->defcase, sw->firstcase));
1849 free(sw->base);
1850 free(sw);
1851 expr.declare = 0;
1852 }
1853#line 1854 "exparse.c"
1854 break;
1855
1856 case 22: /* statement: BREAK expr_opt ';' */
1857#line 358 "../../lib/expr/exparse.y"
1858 {
1859 loopop:
1860 if (!(yyvsp[-1].expr))
1861 {
1862 (yyvsp[-1].expr) = exnewnode(expr.program, CONSTANT, false, INTEGER, NULL, NULL);
1863 (yyvsp[-1].expr)->data.constant.value.integer = 1;
1864 }
1865 else if (!INTEGRAL((yyvsp[-1].expr)->type))
1866 (yyvsp[-1].expr) = excast(expr.program, (yyvsp[-1].expr), INTEGER, NULL, 0);
1867 (yyval.expr) = exnewnode(expr.program, (yyvsp[-2].id)->index, true, INTEGER, (yyvsp[-1].expr), NULL);
1868 }
1869#line 1870 "exparse.c"
1870 break;
1871
1872 case 23: /* statement: CONTINUE expr_opt ';' */
1873#line 370 "../../lib/expr/exparse.y"
1874 {
1875 goto loopop;
1876 }
1877#line 1878 "exparse.c"
1878 break;
1879
1880 case 24: /* statement: RETURN expr_opt ';' */
1881#line 374 "../../lib/expr/exparse.y"
1882 {
1883 if ((yyvsp[-1].expr))
1884 {
1885 if (expr.procedure && !expr.procedure->type)
1886 exerror("return in void function");
1887 (yyvsp[-1].expr) = excast(expr.program, (yyvsp[-1].expr), expr.procedure ? expr.procedure->type : INTEGER, NULL, 0);
1888 }
1889 (yyval.expr) = exnewnode(expr.program, RETURN, true, (yyvsp[-1].expr) ? (yyvsp[-1].expr)->type : 0, (yyvsp[-1].expr), NULL);
1890 }
1891#line 1892 "exparse.c"
1892 break;
1893
1894 case 25: /* switch_list: %empty */
1895#line 386 "../../lib/expr/exparse.y"
1896 {
1897 Switch_t* sw;
1898
1899 if (!(sw = calloc(1, sizeof(Switch_t)))) {
1900 exnospace();
1901 } else {
1902 expr.swstate = sw;
1903 sw->type = expr.declare;
1904 size_t n = 8;
1905 if (!(sw->base = calloc(n, sizeof(Extype_t*)))) {
1906 exnospace();
1907 n = 0;
1908 }
1909 sw->cap = n;
1910 }
1911 }
1912#line 1913 "exparse.c"
1913 break;
1914
1915 case 27: /* switch_item: case_list statement_list */
1916#line 406 "../../lib/expr/exparse.y"
1917 {
1918 Switch_t* sw = expr.swstate;
1919
1920 (yyval.expr) = exnewnode(expr.program, CASE, true, 0, (yyvsp[0].expr), NULL);
1921 if (sw->cur > 0)
1922 {
1923 if (sw->lastcase)
1924 sw->lastcase->data.select.next = (yyval.expr);
1925 else
1926 sw->firstcase = (yyval.expr);
1927 sw->lastcase = (yyval.expr);
1928 const size_t n = sw->cap;
1929 sw->cur = 0;
1930 (yyval.expr)->data.select.constant = exalloc(expr.program, (n + 1) * sizeof(Extype_t*));
1931 memcpy((yyval.expr)->data.select.constant, sw->base, n * sizeof(Extype_t*));
1932 (yyval.expr)->data.select.constant[n] = 0;
1933 }
1934 else
1935 (yyval.expr)->data.select.constant = 0;
1936 if (sw->def)
1937 {
1938 sw->def = 0;
1939 if (sw->defcase)
1940 exerror("duplicate default in switch");
1941 else
1942 sw->defcase = (yyvsp[0].expr);
1943 }
1944 }
1945#line 1946 "exparse.c"
1946 break;
1947
1948 case 30: /* case_item: CASE constant ':' */
1949#line 441 "../../lib/expr/exparse.y"
1950 {
1951 if (expr.swstate->cur >= expr.swstate->cap)
1952 {
1953 size_t n = expr.swstate->cap;
1954 if (!(expr.swstate->base = realloc(expr.swstate->base, sizeof(Extype_t*) * 2 * n)))
1955 {
1956 exerror("too many case labels for switch");
1957 n = 0;
1958 }
1959 expr.swstate->cap = 2 * n;
1960 }
1961 if (expr.swstate->base != NULL)
1962 {
1963 (yyvsp[-1].expr) = excast(expr.program, (yyvsp[-1].expr), expr.swstate->type, NULL, 0);
1964 expr.swstate->base[expr.swstate->cur++] = &(yyvsp[-1].expr)->data.constant.value;
1965 }
1966 }
1967#line 1968 "exparse.c"
1968 break;
1969
1970 case 31: /* case_item: DEFAULT ':' */
1971#line 459 "../../lib/expr/exparse.y"
1972 {
1973 expr.swstate->def = 1;
1974 }
1975#line 1976 "exparse.c"
1976 break;
1977
1978 case 33: /* dcl_list: dcl_list ',' dcl_item */
1979#line 466 "../../lib/expr/exparse.y"
1980 {
1981 if ((yyvsp[0].expr))
1982 (yyval.expr) = (yyvsp[-2].expr) ? exnewnode(expr.program, ',', true, (yyvsp[0].expr)->type, (yyvsp[-2].expr), (yyvsp[0].expr)) : (yyvsp[0].expr);
1983 }
1984#line 1985 "exparse.c"
1985 break;
1986
1987 case 34: /* $@4: %empty */
1988#line 472 "../../lib/expr/exparse.y"
1989 {checkName ((yyvsp[0].id)); expr.id=(yyvsp[0].id);}
1990#line 1991 "exparse.c"
1991 break;
1992
1993 case 35: /* dcl_item: dcl_name $@4 array initialize */
1994#line 473 "../../lib/expr/exparse.y"
1995 {
1996 (yyval.expr) = 0;
1997 if (!(yyvsp[-3].id)->type || expr.declare)
1998 (yyvsp[-3].id)->type = expr.declare;
1999 if ((yyvsp[0].expr) && (yyvsp[0].expr)->op == PROCEDURE)
2000 {
2001 (yyvsp[-3].id)->lex = PROCEDURE;
2002 (yyvsp[-3].id)->type = (yyvsp[0].expr)->type;
2003 (yyvsp[-3].id)->value = (yyvsp[0].expr);
2004 }
2005 else
2006 {
2007 if ((yyvsp[-3].id)->type == 0) {
2008 exerror("%s: a variable cannot be void typed", (yyvsp[-3].id)->name);
2009 }
2010 (yyvsp[-3].id)->lex = DYNAMIC;
2011 (yyvsp[-3].id)->value = exnewnode(expr.program, 0, false, 0, NULL, NULL);
2012 if ((yyvsp[-1].integer) && (yyvsp[-3].id)->local == NULL)
2013 {
2014 static Dtdisc_t disc_key = {
2015 .key = offsetof(Exassoc_t, key),
2016 .size = sizeof(Extype_t),
2017 .freef = free,
2018 .comparf = cmpKey,
2019 };
2020 static Dtdisc_t disc_name = {
2021 .key = offsetof(Exassoc_t, name),
2022 .freef = free,
2023 };
2024 Dtdisc_t *const disc = (yyvsp[-1].integer) == INTEGER ? &disc_key : &disc_name;
2025 if (!((yyvsp[-3].id)->local = dtopen(disc, Dtoset)))
2026 exerror("%s: cannot initialize associative array", (yyvsp[-3].id)->name);
2027 (yyvsp[-3].id)->index_type = (yyvsp[-1].integer); /* -1 indicates no typechecking */
2028 }
2029 if ((yyvsp[0].expr))
2030 {
2031 if ((yyvsp[0].expr)->type != (yyvsp[-3].id)->type)
2032 {
2033 (yyvsp[0].expr)->type = (yyvsp[-3].id)->type;
2034 (yyvsp[0].expr)->data.operand.right = excast(expr.program, (yyvsp[0].expr)->data.operand.right, (yyvsp[-3].id)->type, NULL, 0);
2035 }
2036 (yyvsp[0].expr)->data.operand.left = exnewnode(expr.program, DYNAMIC, false, (yyvsp[-3].id)->type, NULL, NULL);
2037 (yyvsp[0].expr)->data.operand.left->data.variable.symbol = (yyvsp[-3].id);
2038 (yyval.expr) = (yyvsp[0].expr);
2039 }
2040 else if (!(yyvsp[-1].integer))
2041 (yyvsp[-3].id)->value->data.value = exzero((yyvsp[-3].id)->type);
2042 }
2043 }
2044#line 2045 "exparse.c"
2045 break;
2046
2047 case 42: /* else_opt: %empty */
2048#line 535 "../../lib/expr/exparse.y"
2049 {
2050 (yyval.expr) = 0;
2051 }
2052#line 2053 "exparse.c"
2053 break;
2054
2055 case 43: /* else_opt: ELSE statement */
2056#line 539 "../../lib/expr/exparse.y"
2057 {
2058 (yyval.expr) = (yyvsp[0].expr);
2059 }
2060#line 2061 "exparse.c"
2061 break;
2062
2063 case 44: /* expr_opt: %empty */
2064#line 545 "../../lib/expr/exparse.y"
2065 {
2066 (yyval.expr) = 0;
2067 }
2068#line 2069 "exparse.c"
2069 break;
2070
2071 case 46: /* expr: '(' expr ')' */
2072#line 552 "../../lib/expr/exparse.y"
2073 {
2074 (yyval.expr) = (yyvsp[-1].expr);
2075 }
2076#line 2077 "exparse.c"
2077 break;
2078
2079 case 47: /* expr: '(' DECLARE ')' expr */
2080#line 556 "../../lib/expr/exparse.y"
2081 {
2082 (yyval.expr) = ((yyvsp[0].expr)->type == (yyvsp[-2].id)->type) ? (yyvsp[0].expr) : excast(expr.program, (yyvsp[0].expr), (yyvsp[-2].id)->type, NULL, 0);
2083 }
2084#line 2085 "exparse.c"
2085 break;
2086
2087 case 48: /* expr: expr '<' expr */
2088#line 560 "../../lib/expr/exparse.y"
2089 {
2090 long rel;
2091
2092 relational:
2093 rel = INTEGER;
2094 goto coerce;
2095 binary:
2096 rel = 0;
2097 coerce:
2098 if (!(yyvsp[-2].expr)->type)
2099 {
2100 if (!(yyvsp[0].expr)->type)
2101 (yyvsp[-2].expr)->type = (yyvsp[0].expr)->type = rel ? STRING : INTEGER;
2102 else
2103 (yyvsp[-2].expr)->type = (yyvsp[0].expr)->type;
2104 }
2105 else if (!(yyvsp[0].expr)->type)
2106 (yyvsp[0].expr)->type = (yyvsp[-2].expr)->type;
2107 if ((yyvsp[-2].expr)->type != (yyvsp[0].expr)->type)
2108 {
2109 if ((yyvsp[-2].expr)->type == STRING)
2110 (yyvsp[-2].expr) = excast(expr.program, (yyvsp[-2].expr), (yyvsp[0].expr)->type, (yyvsp[0].expr), 0);
2111 else if ((yyvsp[0].expr)->type == STRING)
2112 (yyvsp[0].expr) = excast(expr.program, (yyvsp[0].expr), (yyvsp[-2].expr)->type, (yyvsp[-2].expr), 0);
2113 else if ((yyvsp[-2].expr)->type == FLOATING)
2114 (yyvsp[0].expr) = excast(expr.program, (yyvsp[0].expr), FLOATING, (yyvsp[-2].expr), 0);
2115 else if ((yyvsp[0].expr)->type == FLOATING)
2116 (yyvsp[-2].expr) = excast(expr.program, (yyvsp[-2].expr), FLOATING, (yyvsp[0].expr), 0);
2117 }
2118 if (!rel)
2119 rel = ((yyvsp[-2].expr)->type == STRING) ? STRING : (((yyvsp[-2].expr)->type == UNSIGNED) ? UNSIGNED : (yyvsp[0].expr)->type);
2120 (yyval.expr) = exnewnode(expr.program, (yyvsp[-1].op), true, rel, (yyvsp[-2].expr), (yyvsp[0].expr));
2121 if (!expr.program->errors && (yyvsp[-2].expr)->op == CONSTANT && (yyvsp[0].expr)->op == CONSTANT)
2122 {
2123 (yyval.expr)->data.constant.value = exeval(expr.program, (yyval.expr), NULL);
2124 /* If a constant string, re-allocate from program heap. This is because the
2125 * value was constructed from string operators, which create a value in the
2126 * temporary heap, which is cleared when exeval is called again.
2127 */
2128 if ((yyval.expr)->type == STRING) {
2129 (yyval.expr)->data.constant.value.string =
2130 vmstrdup(expr.program->vm, (yyval.expr)->data.constant.value.string);
2131 }
2132 (yyval.expr)->binary = false;
2133 (yyval.expr)->op = CONSTANT;
2134 exfreenode(expr.program, (yyvsp[-2].expr));
2135 exfreenode(expr.program, (yyvsp[0].expr));
2136 }
2137 else if (!BUILTIN((yyvsp[-2].expr)->type) || !BUILTIN((yyvsp[0].expr)->type)) {
2138 checkBinary(expr.program, (yyvsp[-2].expr), (yyval.expr), (yyvsp[0].expr));
2139 }
2140 }
2141#line 2142 "exparse.c"
2142 break;
2143
2144 case 49: /* expr: expr '-' expr */
2145#line 613 "../../lib/expr/exparse.y"
2146 {
2147 goto binary;
2148 }
2149#line 2150 "exparse.c"
2150 break;
2151
2152 case 50: /* expr: expr '*' expr */
2153#line 617 "../../lib/expr/exparse.y"
2154 {
2155 goto binary;
2156 }
2157#line 2158 "exparse.c"
2158 break;
2159
2160 case 51: /* expr: expr '/' expr */
2161#line 621 "../../lib/expr/exparse.y"
2162 {
2163 goto binary;
2164 }
2165#line 2166 "exparse.c"
2166 break;
2167
2168 case 52: /* expr: expr '%' expr */
2169#line 625 "../../lib/expr/exparse.y"
2170 {
2171 goto binary;
2172 }
2173#line 2174 "exparse.c"
2174 break;
2175
2176 case 53: /* expr: expr LSH expr */
2177#line 629 "../../lib/expr/exparse.y"
2178 {
2179 goto binary;
2180 }
2181#line 2182 "exparse.c"
2182 break;
2183
2184 case 54: /* expr: expr RSH expr */
2185#line 633 "../../lib/expr/exparse.y"
2186 {
2187 goto binary;
2188 }
2189#line 2190 "exparse.c"
2190 break;
2191
2192 case 55: /* expr: expr '>' expr */
2193#line 637 "../../lib/expr/exparse.y"
2194 {
2195 goto relational;
2196 }
2197#line 2198 "exparse.c"
2198 break;
2199
2200 case 56: /* expr: expr LE expr */
2201#line 641 "../../lib/expr/exparse.y"
2202 {
2203 goto relational;
2204 }
2205#line 2206 "exparse.c"
2206 break;
2207
2208 case 57: /* expr: expr GE expr */
2209#line 645 "../../lib/expr/exparse.y"
2210 {
2211 goto relational;
2212 }
2213#line 2214 "exparse.c"
2214 break;
2215
2216 case 58: /* expr: expr EQ expr */
2217#line 649 "../../lib/expr/exparse.y"
2218 {
2219 goto relational;
2220 }
2221#line 2222 "exparse.c"
2222 break;
2223
2224 case 59: /* expr: expr NE expr */
2225#line 653 "../../lib/expr/exparse.y"
2226 {
2227 goto relational;
2228 }
2229#line 2230 "exparse.c"
2230 break;
2231
2232 case 60: /* expr: expr '&' expr */
2233#line 657 "../../lib/expr/exparse.y"
2234 {
2235 goto binary;
2236 }
2237#line 2238 "exparse.c"
2238 break;
2239
2240 case 61: /* expr: expr '|' expr */
2241#line 661 "../../lib/expr/exparse.y"
2242 {
2243 goto binary;
2244 }
2245#line 2246 "exparse.c"
2246 break;
2247
2248 case 62: /* expr: expr '^' expr */
2249#line 665 "../../lib/expr/exparse.y"
2250 {
2251 goto binary;
2252 }
2253#line 2254 "exparse.c"
2254 break;
2255
2256 case 63: /* expr: expr '+' expr */
2257#line 669 "../../lib/expr/exparse.y"
2258 {
2259 goto binary;
2260 }
2261#line 2262 "exparse.c"
2262 break;
2263
2264 case 64: /* expr: expr AND expr */
2265#line 673 "../../lib/expr/exparse.y"
2266 {
2267 logical:
2268 if ((yyvsp[-2].expr)->type == STRING)
2269 (yyvsp[-2].expr) = exnewnode(expr.program, S2B, true, INTEGER, (yyvsp[-2].expr), NULL);
2270 else if (!BUILTIN((yyvsp[-2].expr)->type))
2271 (yyvsp[-2].expr) = excast(expr.program, (yyvsp[-2].expr), INTEGER, NULL, 0);
2272 if ((yyvsp[0].expr)->type == STRING)
2273 (yyvsp[0].expr) = exnewnode(expr.program, S2B, true, INTEGER, (yyvsp[0].expr), NULL);
2274 else if (!BUILTIN((yyvsp[0].expr)->type))
2275 (yyvsp[0].expr) = excast(expr.program, (yyvsp[0].expr), INTEGER, NULL, 0);
2276 goto binary;
2277 }
2278#line 2279 "exparse.c"
2279 break;
2280
2281 case 65: /* expr: expr OR expr */
2282#line 686 "../../lib/expr/exparse.y"
2283 {
2284 goto logical;
2285 }
2286#line 2287 "exparse.c"
2287 break;
2288
2289 case 66: /* expr: expr ',' expr */
2290#line 690 "../../lib/expr/exparse.y"
2291 {
2292 if ((yyvsp[-2].expr)->op == CONSTANT)
2293 {
2294 exfreenode(expr.program, (yyvsp[-2].expr));
2295 (yyval.expr) = (yyvsp[0].expr);
2296 }
2297 else
2298 (yyval.expr) = exnewnode(expr.program, ',', true, (yyvsp[0].expr)->type, (yyvsp[-2].expr), (yyvsp[0].expr));
2299 }
2300#line 2301 "exparse.c"
2301 break;
2302
2303 case 67: /* $@5: %empty */
2304#line 699 "../../lib/expr/exparse.y"
2305 {expr.nolabel=1;}
2306#line 2307 "exparse.c"
2307 break;
2308
2309 case 68: /* $@6: %empty */
2310#line 699 "../../lib/expr/exparse.y"
2311 {expr.nolabel=0;}
2312#line 2313 "exparse.c"
2313 break;
2314
2315 case 69: /* expr: expr '?' $@5 expr ':' $@6 expr */
2316#line 700 "../../lib/expr/exparse.y"
2317 {
2318 if (!(yyvsp[-3].expr)->type)
2319 {
2320 if (!(yyvsp[0].expr)->type)
2321 (yyvsp[-3].expr)->type = (yyvsp[0].expr)->type = INTEGER;
2322 else
2323 (yyvsp[-3].expr)->type = (yyvsp[0].expr)->type;
2324 }
2325 else if (!(yyvsp[0].expr)->type)
2326 (yyvsp[0].expr)->type = (yyvsp[-3].expr)->type;
2327 if ((yyvsp[-6].expr)->type == STRING)
2328 (yyvsp[-6].expr) = exnewnode(expr.program, S2B, true, INTEGER, (yyvsp[-6].expr), NULL);
2329 else if (!INTEGRAL((yyvsp[-6].expr)->type))
2330 (yyvsp[-6].expr) = excast(expr.program, (yyvsp[-6].expr), INTEGER, NULL, 0);
2331 if ((yyvsp[-3].expr)->type != (yyvsp[0].expr)->type)
2332 {
2333 if ((yyvsp[-3].expr)->type == STRING || (yyvsp[0].expr)->type == STRING)
2334 exerror("if statement string type mismatch");
2335 else if ((yyvsp[-3].expr)->type == FLOATING)
2336 (yyvsp[0].expr) = excast(expr.program, (yyvsp[0].expr), FLOATING, NULL, 0);
2337 else if ((yyvsp[0].expr)->type == FLOATING)
2338 (yyvsp[-3].expr) = excast(expr.program, (yyvsp[-3].expr), FLOATING, NULL, 0);
2339 }
2340 if ((yyvsp[-6].expr)->op == CONSTANT)
2341 {
2342 if ((yyvsp[-6].expr)->data.constant.value.integer)
2343 {
2344 (yyval.expr) = (yyvsp[-3].expr);
2345 exfreenode(expr.program, (yyvsp[0].expr));
2346 }
2347 else
2348 {
2349 (yyval.expr) = (yyvsp[0].expr);
2350 exfreenode(expr.program, (yyvsp[-3].expr));
2351 }
2352 exfreenode(expr.program, (yyvsp[-6].expr));
2353 }
2354 else
2355 (yyval.expr) = exnewnode(expr.program, '?', true, (yyvsp[-3].expr)->type, (yyvsp[-6].expr), exnewnode(expr.program, ':', true, (yyvsp[-3].expr)->type, (yyvsp[-3].expr), (yyvsp[0].expr)));
2356 }
2357#line 2358 "exparse.c"
2358 break;
2359
2360 case 70: /* expr: '!' expr */
2361#line 741 "../../lib/expr/exparse.y"
2362 {
2363 iunary:
2364 if ((yyvsp[0].expr)->type == STRING)
2365 (yyvsp[0].expr) = exnewnode(expr.program, S2B, true, INTEGER, (yyvsp[0].expr), NULL);
2366 else if (!INTEGRAL((yyvsp[0].expr)->type))
2367 (yyvsp[0].expr) = excast(expr.program, (yyvsp[0].expr), INTEGER, NULL, 0);
2368 unary:
2369 (yyval.expr) = exnewnode(expr.program, (yyvsp[-1].op), true, (yyvsp[0].expr)->type == UNSIGNED ? INTEGER : (yyvsp[0].expr)->type, (yyvsp[0].expr), NULL);
2370 if ((yyvsp[0].expr)->op == CONSTANT)
2371 {
2372 (yyval.expr)->data.constant.value = exeval(expr.program, (yyval.expr), NULL);
2373 (yyval.expr)->binary = false;
2374 (yyval.expr)->op = CONSTANT;
2375 exfreenode(expr.program, (yyvsp[0].expr));
2376 }
2377 else if (!BUILTIN((yyvsp[0].expr)->type)) {
2378 checkBinary(expr.program, (yyvsp[0].expr), (yyval.expr), 0);
2379 }
2380 }
2381#line 2382 "exparse.c"
2382 break;
2383
2384 case 71: /* expr: '#' DYNAMIC */
2385#line 761 "../../lib/expr/exparse.y"
2386 {
2387 if ((yyvsp[0].id)->local == NULL)
2388 exerror("cannot apply '#' operator to non-array %s", (yyvsp[0].id)->name);
2389 (yyval.expr) = exnewnode(expr.program, '#', false, INTEGER, NULL, NULL);
2390 (yyval.expr)->data.variable.symbol = (yyvsp[0].id);
2391 }
2392#line 2393 "exparse.c"
2393 break;
2394
2395 case 72: /* expr: '#' ARRAY */
2396#line 768 "../../lib/expr/exparse.y"
2397 {
2398 (yyval.expr) = exnewnode(expr.program, '#', false, INTEGER, NULL, NULL);
2399 (yyval.expr)->data.variable.symbol = (yyvsp[0].id);
2400 }
2401#line 2402 "exparse.c"
2402 break;
2403
2404 case 73: /* expr: '~' expr */
2405#line 773 "../../lib/expr/exparse.y"
2406 {
2407 goto iunary;
2408 }
2409#line 2410 "exparse.c"
2410 break;
2411
2412 case 74: /* expr: '-' expr */
2413#line 777 "../../lib/expr/exparse.y"
2414 {
2415 goto unary;
2416 }
2417#line 2418 "exparse.c"
2418 break;
2419
2420 case 75: /* expr: '+' expr */
2421#line 781 "../../lib/expr/exparse.y"
2422 {
2423 (yyval.expr) = (yyvsp[0].expr);
2424 }
2425#line 2426 "exparse.c"
2426 break;
2427
2428 case 76: /* expr: '&' variable */
2429#line 785 "../../lib/expr/exparse.y"
2430 {
2431 (yyval.expr) = exnewnode(expr.program, ADDRESS, false, T((yyvsp[0].expr)->type), (yyvsp[0].expr), NULL);
2432 }
2433#line 2434 "exparse.c"
2434 break;
2435
2436 case 77: /* expr: ARRAY '[' args ']' */
2437#line 789 "../../lib/expr/exparse.y"
2438 {
2439 (yyval.expr) = exnewnode(expr.program, ARRAY, true, T((yyvsp[-3].id)->type), call(0, (yyvsp[-3].id), (yyvsp[-1].expr)), (yyvsp[-1].expr));
2440 }
2441#line 2442 "exparse.c"
2442 break;
2443
2444 case 78: /* expr: FUNCTION '(' args ')' */
2445#line 793 "../../lib/expr/exparse.y"
2446 {
2447 (yyval.expr) = exnewnode(expr.program, FUNCTION, true, T((yyvsp[-3].id)->type), call(0, (yyvsp[-3].id), (yyvsp[-1].expr)), (yyvsp[-1].expr));
2448 }
2449#line 2450 "exparse.c"
2450 break;
2451
2452 case 79: /* expr: GSUB '(' args ')' */
2453#line 797 "../../lib/expr/exparse.y"
2454 {
2455 (yyval.expr) = exnewsub (expr.program, (yyvsp[-1].expr), GSUB);
2456 }
2457#line 2458 "exparse.c"
2458 break;
2459
2460 case 80: /* expr: SUB '(' args ')' */
2461#line 801 "../../lib/expr/exparse.y"
2462 {
2463 (yyval.expr) = exnewsub (expr.program, (yyvsp[-1].expr), SUB);
2464 }
2465#line 2466 "exparse.c"
2466 break;
2467
2468 case 81: /* expr: SUBSTR '(' args ')' */
2469#line 805 "../../lib/expr/exparse.y"
2470 {
2471 (yyval.expr) = exnewsubstr (expr.program, (yyvsp[-1].expr));
2472 }
2473#line 2474 "exparse.c"
2474 break;
2475
2476 case 82: /* expr: splitop '(' expr ',' DYNAMIC ')' */
2477#line 809 "../../lib/expr/exparse.y"
2478 {
2479 (yyval.expr) = exnewsplit (expr.program, (yyvsp[-5].id)->index, (yyvsp[-1].id), (yyvsp[-3].expr), NULL);
2480 }
2481#line 2482 "exparse.c"
2482 break;
2483
2484 case 83: /* expr: splitop '(' expr ',' DYNAMIC ',' expr ')' */
2485#line 813 "../../lib/expr/exparse.y"
2486 {
2487 (yyval.expr) = exnewsplit (expr.program, (yyvsp[-7].id)->index, (yyvsp[-3].id), (yyvsp[-5].expr), (yyvsp[-1].expr));
2488 }
2489#line 2490 "exparse.c"
2490 break;
2491
2492 case 84: /* expr: EXIT '(' expr ')' */
2493#line 817 "../../lib/expr/exparse.y"
2494 {
2495 if (!INTEGRAL((yyvsp[-1].expr)->type))
2496 (yyvsp[-1].expr) = excast(expr.program, (yyvsp[-1].expr), INTEGER, NULL, 0);
2497 (yyval.expr) = exnewnode(expr.program, EXIT, true, INTEGER, (yyvsp[-1].expr), NULL);
2498 }
2499#line 2500 "exparse.c"
2500 break;
2501
2502 case 85: /* expr: RAND '(' ')' */
2503#line 823 "../../lib/expr/exparse.y"
2504 {
2505 (yyval.expr) = exnewnode(expr.program, RAND, false, FLOATING, NULL, NULL);
2506 }
2507#line 2508 "exparse.c"
2508 break;
2509
2510 case 86: /* expr: SRAND '(' ')' */
2511#line 827 "../../lib/expr/exparse.y"
2512 {
2513 (yyval.expr) = exnewnode(expr.program, SRAND, false, INTEGER, NULL, NULL);
2514 }
2515#line 2516 "exparse.c"
2516 break;
2517
2518 case 87: /* expr: SRAND '(' expr ')' */
2519#line 831 "../../lib/expr/exparse.y"
2520 {
2521 if (!INTEGRAL((yyvsp[-1].expr)->type))
2522 (yyvsp[-1].expr) = excast(expr.program, (yyvsp[-1].expr), INTEGER, NULL, 0);
2523 (yyval.expr) = exnewnode(expr.program, SRAND, true, INTEGER, (yyvsp[-1].expr), NULL);
2524 }
2525#line 2526 "exparse.c"
2526 break;
2527
2528 case 88: /* expr: PROCEDURE '(' args ')' */
2529#line 837 "../../lib/expr/exparse.y"
2530 {
2531 (yyval.expr) = exnewnode(expr.program, CALL, true, (yyvsp[-3].id)->type, NULL, (yyvsp[-1].expr));
2532 (yyval.expr)->data.call.procedure = (yyvsp[-3].id);
2533 }
2534#line 2535 "exparse.c"
2535 break;
2536
2537 case 89: /* expr: PRINT '(' args ')' */
2538#line 842 "../../lib/expr/exparse.y"
2539 {
2540 (yyval.expr) = exprint(expr.program, (yyvsp[-3].id), (yyvsp[-1].expr));
2541 }
2542#line 2543 "exparse.c"
2543 break;
2544
2545 case 90: /* expr: print '(' args ')' */
2546#line 846 "../../lib/expr/exparse.y"
2547 {
2548 (yyval.expr) = exnewnode(expr.program, (yyvsp[-3].id)->index, false, (yyvsp[-3].id)->type, NULL, NULL);
2549 if ((yyvsp[-1].expr) && (yyvsp[-1].expr)->data.operand.left->type == INTEGER)
2550 {
2551 (yyval.expr)->data.print.descriptor = (yyvsp[-1].expr)->data.operand.left;
2552 (yyvsp[-1].expr) = (yyvsp[-1].expr)->data.operand.right;
2553 }
2554 else
2555 switch ((yyvsp[-3].id)->index)
2556 {
2557 case QUERY:
2558 (yyval.expr)->data.print.descriptor = exnewnode(expr.program, CONSTANT, false, INTEGER, NULL, NULL);
2559 (yyval.expr)->data.print.descriptor->data.constant.value.integer = 2;
2560 break;
2561 case PRINTF:
2562 (yyval.expr)->data.print.descriptor = exnewnode(expr.program, CONSTANT, false, INTEGER, NULL, NULL);
2563 (yyval.expr)->data.print.descriptor->data.constant.value.integer = 1;
2564 break;
2565 case SPRINTF:
2566 (yyval.expr)->data.print.descriptor = 0;
2567 break;
2568 }
2569 (yyval.expr)->data.print.args = preprint((yyvsp[-1].expr));
2570 }
2571#line 2572 "exparse.c"
2572 break;
2573
2574 case 91: /* expr: scan '(' args ')' */
2575#line 871 "../../lib/expr/exparse.y"
2576 {
2577 Exnode_t* x;
2578
2579 (yyval.expr) = exnewnode(expr.program, (yyvsp[-3].id)->index, false, (yyvsp[-3].id)->type, NULL, NULL);
2580 if ((yyvsp[-1].expr) && (yyvsp[-1].expr)->data.operand.left->type == INTEGER)
2581 {
2582 (yyval.expr)->data.scan.descriptor = (yyvsp[-1].expr)->data.operand.left;
2583 (yyvsp[-1].expr) = (yyvsp[-1].expr)->data.operand.right;
2584 }
2585 else
2586 switch ((yyvsp[-3].id)->index)
2587 {
2588 case SCANF:
2589 (yyval.expr)->data.scan.descriptor = 0;
2590 break;
2591 case SSCANF:
2592 if ((yyvsp[-1].expr) && (yyvsp[-1].expr)->data.operand.left->type == STRING)
2593 {
2594 (yyval.expr)->data.scan.descriptor = (yyvsp[-1].expr)->data.operand.left;
2595 (yyvsp[-1].expr) = (yyvsp[-1].expr)->data.operand.right;
2596 }
2597 else
2598 exerror("%s: string argument expected", (yyvsp[-3].id)->name);
2599 break;
2600 }
2601 if (!(yyvsp[-1].expr) || !(yyvsp[-1].expr)->data.operand.left || (yyvsp[-1].expr)->data.operand.left->type != STRING)
2602 exerror("%s: format argument expected", (yyvsp[-3].id)->name);
2603 (yyval.expr)->data.scan.format = (yyvsp[-1].expr)->data.operand.left;
2604 for (x = (yyval.expr)->data.scan.args = (yyvsp[-1].expr)->data.operand.right; x; x = x->data.operand.right)
2605 {
2606 if (x->data.operand.left->op != ADDRESS)
2607 exerror("%s: address argument expected", (yyvsp[-3].id)->name);
2609 }
2610 }
2611#line 2612 "exparse.c"
2612 break;
2613
2614 case 92: /* expr: variable assign */
2615#line 907 "../../lib/expr/exparse.y"
2616 {
2617 if ((yyvsp[0].expr))
2618 {
2619 if ((yyvsp[-1].expr)->op == ID && !expr.program->disc->setf)
2620 exerror("%s: variable assignment not supported", (yyvsp[-1].expr)->data.variable.symbol->name);
2621 else
2622 {
2623 if (!(yyvsp[-1].expr)->type)
2624 (yyvsp[-1].expr)->type = (yyvsp[0].expr)->type;
2625 else if ((yyvsp[0].expr)->type != (yyvsp[-1].expr)->type)
2626 {
2627 (yyvsp[0].expr)->type = (yyvsp[-1].expr)->type;
2628 (yyvsp[0].expr)->data.operand.right = excast(expr.program, (yyvsp[0].expr)->data.operand.right, (yyvsp[-1].expr)->type, NULL, 0);
2629 }
2630 (yyvsp[0].expr)->data.operand.left = (yyvsp[-1].expr);
2631 (yyval.expr) = (yyvsp[0].expr);
2632 }
2633 }
2634 }
2635#line 2636 "exparse.c"
2636 break;
2637
2638 case 93: /* expr: INC variable */
2639#line 927 "../../lib/expr/exparse.y"
2640 {
2641 pre:
2642 if ((yyvsp[0].expr)->type == STRING)
2643 exerror("++ and -- invalid for string variables");
2644 (yyval.expr) = exnewnode(expr.program, (yyvsp[-1].op), false, (yyvsp[0].expr)->type, (yyvsp[0].expr), NULL);
2645 (yyval.expr)->subop = PRE;
2646 }
2647#line 2648 "exparse.c"
2648 break;
2649
2650 case 94: /* expr: variable INC */
2651#line 935 "../../lib/expr/exparse.y"
2652 {
2653 pos:
2654 if ((yyvsp[-1].expr)->type == STRING)
2655 exerror("++ and -- invalid for string variables");
2656 (yyval.expr) = exnewnode(expr.program, (yyvsp[0].op), false, (yyvsp[-1].expr)->type, (yyvsp[-1].expr), NULL);
2657 (yyval.expr)->subop = POS;
2658 }
2659#line 2660 "exparse.c"
2660 break;
2661
2662 case 95: /* expr: expr IN_OP DYNAMIC */
2663#line 943 "../../lib/expr/exparse.y"
2664 {
2665 if ((yyvsp[0].id)->local == NULL)
2666 exerror("cannot apply IN to non-array %s", (yyvsp[0].id)->name);
2667 if ((yyvsp[0].id)->index_type > 0 && (yyvsp[-2].expr)->type != (yyvsp[0].id)->index_type)
2668 exerror("%s indices must have type %s, not %s",
2669 (yyvsp[0].id)->name, extypename(expr.program, (yyvsp[0].id)->index_type),extypename(expr.program, (yyvsp[-2].expr)->type));
2670 (yyval.expr) = exnewnode(expr.program, IN_OP, false, INTEGER, NULL, NULL);
2671 (yyval.expr)->data.variable.symbol = (yyvsp[0].id);
2672 (yyval.expr)->data.variable.index = (yyvsp[-2].expr);
2673 }
2674#line 2675 "exparse.c"
2675 break;
2676
2677 case 96: /* expr: expr IN_OP ARRAY */
2678#line 954 "../../lib/expr/exparse.y"
2679 {
2680 if ((yyvsp[0].id)->index_type > 0 && (yyvsp[-2].expr)->type != (yyvsp[0].id)->index_type)
2681 exerror("%s indices must have type %s, not %s",
2682 (yyvsp[0].id)->name, extypename(expr.program, (yyvsp[0].id)->index_type),extypename(expr.program, (yyvsp[-2].expr)->type));
2683 (yyval.expr) = exnewnode(expr.program, IN_OP, false, INTEGER, NULL, NULL);
2684 (yyval.expr)->data.variable.symbol = (yyvsp[0].id);
2685 (yyval.expr)->data.variable.index = (yyvsp[-2].expr);
2686 }
2687#line 2688 "exparse.c"
2688 break;
2689
2690 case 97: /* expr: DEC variable */
2691#line 963 "../../lib/expr/exparse.y"
2692 {
2693 goto pre;
2694 }
2695#line 2696 "exparse.c"
2696 break;
2697
2698 case 98: /* expr: variable DEC */
2699#line 967 "../../lib/expr/exparse.y"
2700 {
2701 goto pos;
2702 }
2703#line 2704 "exparse.c"
2704 break;
2705
2706 case 102: /* constant: CONSTANT */
2707#line 977 "../../lib/expr/exparse.y"
2708 {
2709 (yyval.expr) = exnewnode(expr.program, CONSTANT, false, (yyvsp[0].id)->type, NULL, NULL);
2710 if (!expr.program->disc->reff)
2711 exerror("%s: identifier references not supported", (yyvsp[0].id)->name);
2712 else
2713 (yyval.expr)->data.constant.value = expr.program->disc->reff(expr.program, (yyval.expr), (yyvsp[0].id), NULL);
2714 }
2715#line 2716 "exparse.c"
2716 break;
2717
2718 case 103: /* constant: FLOATING */
2719#line 985 "../../lib/expr/exparse.y"
2720 {
2721 (yyval.expr) = exnewnode(expr.program, CONSTANT, false, FLOATING, NULL, NULL);
2722 (yyval.expr)->data.constant.value.floating = (yyvsp[0].floating);
2723 }
2724#line 2725 "exparse.c"
2725 break;
2726
2727 case 104: /* constant: INTEGER */
2728#line 990 "../../lib/expr/exparse.y"
2729 {
2730 (yyval.expr) = exnewnode(expr.program, CONSTANT, false, INTEGER, NULL, NULL);
2731 (yyval.expr)->data.constant.value.integer = (yyvsp[0].integer);
2732 }
2733#line 2734 "exparse.c"
2734 break;
2735
2736 case 105: /* constant: STRING */
2737#line 995 "../../lib/expr/exparse.y"
2738 {
2739 (yyval.expr) = exnewnode(expr.program, CONSTANT, false, STRING, NULL, NULL);
2740 (yyval.expr)->data.constant.value.string = (yyvsp[0].string);
2741 }
2742#line 2743 "exparse.c"
2743 break;
2744
2745 case 106: /* constant: UNSIGNED */
2746#line 1000 "../../lib/expr/exparse.y"
2747 {
2748 (yyval.expr) = exnewnode(expr.program, CONSTANT, false, UNSIGNED, NULL, NULL);
2749 (yyval.expr)->data.constant.value.integer = (yyvsp[0].integer);
2750 }
2751#line 2752 "exparse.c"
2752 break;
2753
2754 case 112: /* variable: ID members */
2755#line 1016 "../../lib/expr/exparse.y"
2756 {
2757 (yyval.expr) = makeVar(expr.program, (yyvsp[-1].id), 0, 0, (yyvsp[0].reference));
2758 }
2759#line 2760 "exparse.c"
2760 break;
2761
2762 case 113: /* variable: DYNAMIC index members */
2763#line 1020 "../../lib/expr/exparse.y"
2764 {
2765 Exnode_t *n = exnewnode(expr.program, DYNAMIC, false, (yyvsp[-2].id)->type, NULL, NULL);
2766 n->data.variable.symbol = (yyvsp[-2].id);
2767 n->data.variable.reference = 0;
2768 if (((n->data.variable.index = (yyvsp[-1].expr)) == 0) != ((yyvsp[-2].id)->local == NULL))
2769 exerror("%s: is%s an array", (yyvsp[-2].id)->name, (yyvsp[-2].id)->local != NULL ? "" : " not");
2770 if ((yyvsp[-2].id)->local != NULL && (yyvsp[-2].id)->index_type > 0) {
2771 if ((yyvsp[-1].expr)->type != (yyvsp[-2].id)->index_type)
2772 exerror("%s: indices must have type %s, not %s",
2773 (yyvsp[-2].id)->name, extypename(expr.program, (yyvsp[-2].id)->index_type),extypename(expr.program, (yyvsp[-1].expr)->type));
2774 }
2775 if ((yyvsp[0].reference)) {
2776 n->data.variable.dyna = exnewnode(expr.program, 0, false, 0, NULL, NULL);
2777 (yyval.expr) = makeVar(expr.program, (yyvsp[-2].id), (yyvsp[-1].expr), n, (yyvsp[0].reference));
2778 }
2779 else (yyval.expr) = n;
2780 }
2781#line 2782 "exparse.c"
2782 break;
2783
2784 case 114: /* variable: NAME */
2785#line 1038 "../../lib/expr/exparse.y"
2786 {
2787 (yyval.expr) = exnewnode(expr.program, ID, false, STRING, NULL, NULL);
2788 (yyval.expr)->data.variable.symbol = (yyvsp[0].id);
2789 (yyval.expr)->data.variable.reference = 0;
2790 (yyval.expr)->data.variable.index = 0;
2791 (yyval.expr)->data.variable.dyna = 0;
2792 if (!(expr.program->disc->flags & EX_UNDECLARED))
2793 exerror("unknown identifier");
2794 }
2795#line 2796 "exparse.c"
2796 break;
2797
2798 case 115: /* array: %empty */
2799#line 1050 "../../lib/expr/exparse.y"
2800 {
2801 (yyval.integer) = 0;
2802 }
2803#line 2804 "exparse.c"
2804 break;
2805
2806 case 116: /* array: '[' ']' */
2807#line 1054 "../../lib/expr/exparse.y"
2808 {
2809 (yyval.integer) = -1;
2810 }
2811#line 2812 "exparse.c"
2812 break;
2813
2814 case 117: /* array: '[' DECLARE ']' */
2815#line 1058 "../../lib/expr/exparse.y"
2816 {
2817 /* If DECLARE is VOID, its type is 0, so this acts like
2818 * the empty case.
2819 */
2820 if (INTEGRAL((yyvsp[-1].id)->type))
2821 (yyval.integer) = INTEGER;
2822 else
2823 (yyval.integer) = (yyvsp[-1].id)->type;
2824
2825 }
2826#line 2827 "exparse.c"
2827 break;
2828
2829 case 118: /* index: %empty */
2830#line 1071 "../../lib/expr/exparse.y"
2831 {
2832 (yyval.expr) = 0;
2833 }
2834#line 2835 "exparse.c"
2835 break;
2836
2837 case 119: /* index: '[' expr ']' */
2838#line 1075 "../../lib/expr/exparse.y"
2839 {
2840 (yyval.expr) = (yyvsp[-1].expr);
2841 }
2842#line 2843 "exparse.c"
2843 break;
2844
2845 case 120: /* args: %empty */
2846#line 1081 "../../lib/expr/exparse.y"
2847 {
2848 (yyval.expr) = 0;
2849 }
2850#line 2851 "exparse.c"
2851 break;
2852
2853 case 121: /* args: arg_list */
2854#line 1085 "../../lib/expr/exparse.y"
2855 {
2856 (yyval.expr) = (yyvsp[0].expr)->data.operand.left;
2857 (yyvsp[0].expr)->data.operand.left = (yyvsp[0].expr)->data.operand.right = 0;
2858 exfreenode(expr.program, (yyvsp[0].expr));
2859 }
2860#line 2861 "exparse.c"
2861 break;
2862
2863 case 122: /* arg_list: expr */
2864#line 1093 "../../lib/expr/exparse.y"
2865 {
2866 (yyval.expr) = exnewnode(expr.program, ',', true, 0, exnewnode(expr.program, ',', true, (yyvsp[0].expr)->type, (yyvsp[0].expr), NULL), NULL);
2867 (yyval.expr)->data.operand.right = (yyval.expr)->data.operand.left;
2868 }
2869#line 2870 "exparse.c"
2870 break;
2871
2872 case 123: /* arg_list: arg_list ',' expr */
2873#line 1098 "../../lib/expr/exparse.y"
2874 {
2875 (yyvsp[-2].expr)->data.operand.right = (yyvsp[-2].expr)->data.operand.right->data.operand.right = exnewnode(expr.program, ',', true, (yyvsp[-2].expr)->type, (yyvsp[0].expr), NULL);
2876 }
2877#line 2878 "exparse.c"
2878 break;
2879
2880 case 124: /* formals: %empty */
2881#line 1104 "../../lib/expr/exparse.y"
2882 {
2883 (yyval.expr) = 0;
2884 }
2885#line 2886 "exparse.c"
2886 break;
2887
2888 case 125: /* formals: DECLARE */
2889#line 1108 "../../lib/expr/exparse.y"
2890 {
2891 (yyval.expr) = 0;
2892 if ((yyvsp[0].id)->type)
2893 exerror("(void) expected");
2894 }
2895#line 2896 "exparse.c"
2896 break;
2897
2898 case 127: /* formal_list: formal_item */
2899#line 1117 "../../lib/expr/exparse.y"
2900 {
2901 (yyval.expr) = exnewnode(expr.program, ',', true, (yyvsp[0].expr)->type, (yyvsp[0].expr), NULL);
2902 }
2903#line 2904 "exparse.c"
2904 break;
2905
2906 case 128: /* formal_list: formal_list ',' formal_item */
2907#line 1121 "../../lib/expr/exparse.y"
2908 {
2909 Exnode_t* x;
2910 Exnode_t* y;
2911
2912 (yyval.expr) = (yyvsp[-2].expr);
2913 for (x = (yyvsp[-2].expr); (y = x->data.operand.right); x = y);
2914 x->data.operand.right = exnewnode(expr.program, ',', true, (yyvsp[0].expr)->type, (yyvsp[0].expr), NULL);
2915 }
2916#line 2917 "exparse.c"
2917 break;
2918
2919 case 129: /* $@7: %empty */
2920#line 1131 "../../lib/expr/exparse.y"
2921 {expr.declare=(yyvsp[0].id)->type;}
2922#line 2923 "exparse.c"
2923 break;
2924
2925 case 130: /* formal_item: DECLARE $@7 name */
2926#line 1132 "../../lib/expr/exparse.y"
2927 {
2928 if ((yyvsp[-2].id)->type == 0) {
2929 exerror("%s: parameters to functions cannot be void typed", (yyvsp[0].id)->name);
2930 }
2931 (yyval.expr) = exnewnode(expr.program, ID, false, (yyvsp[-2].id)->type, NULL, NULL);
2932 (yyval.expr)->data.variable.symbol = (yyvsp[0].id);
2933 (yyvsp[0].id)->lex = DYNAMIC;
2934 (yyvsp[0].id)->type = (yyvsp[-2].id)->type;
2935 (yyvsp[0].id)->value = exnewnode(expr.program, 0, false, 0, NULL, NULL);
2936 expr.procedure->data.procedure.arity++;
2937 expr.declare = 0;
2938 }
2939#line 2940 "exparse.c"
2940 break;
2941
2942 case 131: /* members: %empty */
2943#line 1147 "../../lib/expr/exparse.y"
2944 {
2945 (yyval.reference) = expr.refs = 0;
2946 }
2947#line 2948 "exparse.c"
2948 break;
2949
2950 case 132: /* members: member */
2951#line 1151 "../../lib/expr/exparse.y"
2952 {
2953 Exref_t* r;
2954
2955 r = ALLOCATE(expr.program, Exref_t);
2956 *r = (Exref_t){0};
2957 r->symbol = (yyvsp[0].id);
2958 expr.refs = r;
2959 r->next = 0;
2960 r->index = 0;
2961 (yyval.reference) = expr.refs;
2962 }
2963#line 2964 "exparse.c"
2964 break;
2965
2966 case 133: /* members: '.' ID member */
2967#line 1163 "../../lib/expr/exparse.y"
2968 {
2969 Exref_t* r;
2970 Exref_t* l;
2971
2972 r = ALLOCATE(expr.program, Exref_t);
2973 *r = (Exref_t){0};
2974 r->symbol = (yyvsp[0].id);
2975 r->index = 0;
2976 r->next = 0;
2977 l = ALLOCATE(expr.program, Exref_t);
2978 *l = (Exref_t){0};
2979 l->symbol = (yyvsp[-1].id);
2980 l->index = 0;
2981 l->next = r;
2982 expr.refs = l;
2983 (yyval.reference) = expr.refs;
2984 }
2985#line 2986 "exparse.c"
2986 break;
2987
2988 case 134: /* member: '.' ID */
2989#line 1183 "../../lib/expr/exparse.y"
2990 {
2991 (yyval.id) = (yyvsp[0].id);
2992 }
2993#line 2994 "exparse.c"
2994 break;
2995
2996 case 135: /* member: '.' NAME */
2997#line 1187 "../../lib/expr/exparse.y"
2998 {
2999 (yyval.id) = (yyvsp[0].id);
3000 }
3001#line 3002 "exparse.c"
3002 break;
3003
3004 case 136: /* assign: %empty */
3005#line 1192 "../../lib/expr/exparse.y"
3006 {
3007 (yyval.expr) = 0;
3008 }
3009#line 3010 "exparse.c"
3010 break;
3011
3012 case 137: /* assign: '=' expr */
3013#line 1196 "../../lib/expr/exparse.y"
3014 {
3015 (yyval.expr) = exnewnode(expr.program, '=', true, (yyvsp[0].expr)->type, NULL, (yyvsp[0].expr));
3016 (yyval.expr)->subop = (yyvsp[-1].op);
3017 }
3018#line 3019 "exparse.c"
3019 break;
3020
3021 case 139: /* $@8: %empty */
3022#line 1203 "../../lib/expr/exparse.y"
3023 {
3024 if (expr.procedure)
3025 exerror("%s: nested function definitions not supported", expr.id->name);
3027 if (!streq(expr.id->name, "begin"))
3028 {
3029 static Dtdisc_t disc = {.key = offsetof(Exid_t, name)};
3030 if (!(expr.procedure->data.procedure.frame = dtopen(&disc, Dtset)) || !dtview(expr.procedure->data.procedure.frame, expr.program->symbols))
3031 exnospace();
3032 expr.program->symbols = expr.program->frame = expr.procedure->data.procedure.frame;
3033 }
3034 expr.declare = 0;
3035 }
3036#line 3037 "exparse.c"
3037 break;
3038
3039 case 140: /* $@9: %empty */
3040#line 1215 "../../lib/expr/exparse.y"
3041 {
3042 expr.id->lex = PROCEDURE;
3044 expr.declare = 0;
3045 }
3046#line 3047 "exparse.c"
3047 break;
3048
3049 case 141: /* initialize: '(' $@8 formals $@9 ')' '{' statement_list '}' */
3050#line 1220 "../../lib/expr/exparse.y"
3051 {
3052 (yyval.expr) = expr.procedure;
3054 if (expr.program->frame)
3055 {
3056 expr.program->symbols = expr.program->frame->view;
3057 dtview(expr.program->frame, NULL);
3058 expr.program->frame = NULL;
3059 }
3060 // dictionary of locals no longer required, now that we have parsed the body
3061 (void)dtclose((yyval.expr)->data.procedure.frame);
3062 (yyval.expr)->data.procedure.frame = NULL;
3063 (yyval.expr)->data.procedure.args = (yyvsp[-5].expr);
3064 (yyval.expr)->data.procedure.body = excast(expr.program, (yyvsp[-1].expr), (yyval.expr)->type, NULL, 0);
3065
3066 /*
3067 * NOTE: procedure definition was slipped into the
3068 * declaration initializer statement production,
3069 * therefore requiring the statement terminator
3070 */
3071
3072 exunlex(expr.program, ';');
3073 }
3074#line 3075 "exparse.c"
3075 break;
3076
3077
3078#line 3079 "exparse.c"
3079
3080 default: break;
3081 }
3082 /* User semantic actions sometimes alter yychar, and that requires
3083 that yytoken be updated with the new translation. We take the
3084 approach of translating immediately before every use of yytoken.
3085 One alternative is translating here after every semantic action,
3086 but that translation would be missed if the semantic action invokes
3087 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
3088 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
3089 incorrect destructor might then be invoked immediately. In the
3090 case of YYERROR or YYBACKUP, subsequent parser actions might lead
3091 to an incorrect destructor call or verbose syntax error message
3092 before the lookahead is translated. */
3093 YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
3094
3095 YYPOPSTACK (yylen);
3096 yylen = 0;
3097
3098 *++yyvsp = yyval;
3099
3100 /* Now 'shift' the result of the reduction. Determine what state
3101 that goes to, based on the state we popped back to and the rule
3102 number reduced by. */
3103 {
3104 const int yylhs = yyr1[yyn] - YYNTOKENS;
3105 const int yyi = yypgoto[yylhs] + *yyssp;
3106 yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
3107 ? yytable[yyi]
3108 : yydefgoto[yylhs]);
3109 }
3110
3111 goto yynewstate;
3112
3113
3114/*--------------------------------------.
3115| yyerrlab -- here on detecting error. |
3116`--------------------------------------*/
3117yyerrlab:
3118 /* Make sure we have latest lookahead translation. See comments at
3119 user semantic actions for why this is necessary. */
3121 /* If not already recovering from an error, report this error. */
3122 if (!yyerrstatus)
3123 {
3124 ++yynerrs;
3125 yyerror (YY_("syntax error"));
3126 }
3127
3128 if (yyerrstatus == 3)
3129 {
3130 /* If just tried and failed to reuse lookahead token after an
3131 error, discard it. */
3132
3133 if (yychar <= EX_EOF)
3134 {
3135 /* Return failure if at end of input. */
3136 if (yychar == EX_EOF)
3137 YYABORT;
3138 }
3139 else
3140 {
3141 yydestruct ("Error: discarding",
3142 yytoken, &yylval);
3143 yychar = EX_EMPTY;
3144 }
3145 }
3146
3147 /* Else will try to reuse lookahead token after shifting the error
3148 token. */
3149 goto yyerrlab1;
3150
3151
3152/*---------------------------------------------------.
3153| yyerrorlab -- error raised explicitly by YYERROR. |
3154`---------------------------------------------------*/
3155yyerrorlab:
3156 /* Pacify compilers when the user code never invokes YYERROR and the
3157 label yyerrorlab therefore never appears in user code. */
3158 if (0)
3159 YYERROR;
3160 ++yynerrs;
3161
3162 /* Do not reclaim the symbols of the rule whose action triggered
3163 this YYERROR. */
3164 YYPOPSTACK (yylen);
3165 yylen = 0;
3166 YY_STACK_PRINT (yyss, yyssp);
3167 yystate = *yyssp;
3168 goto yyerrlab1;
3169
3170
3171/*-------------------------------------------------------------.
3172| yyerrlab1 -- common code for both syntax error and YYERROR. |
3173`-------------------------------------------------------------*/
3174yyerrlab1:
3175 yyerrstatus = 3; /* Each real token shifted decrements this. */
3176
3177 /* Pop stack until we find a state that shifts the error token. */
3178 for (;;)
3179 {
3180 yyn = yypact[yystate];
3181 if (!yypact_value_is_default (yyn))
3182 {
3183 yyn += YYSYMBOL_YYerror;
3184 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
3185 {
3186 yyn = yytable[yyn];
3187 if (0 < yyn)
3188 break;
3189 }
3190 }
3191
3192 /* Pop the current state because it cannot handle the error token. */
3193 if (yyssp == yyss)
3194 YYABORT;
3195
3196
3197 yydestruct ("Error: popping",
3198 YY_ACCESSING_SYMBOL (yystate), yyvsp);
3199 YYPOPSTACK (1);
3200 yystate = *yyssp;
3201 YY_STACK_PRINT (yyss, yyssp);
3202 }
3203
3205 *++yyvsp = yylval;
3207
3208
3209 /* Shift the error token. */
3210 YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
3211
3212 yystate = yyn;
3213 goto yynewstate;
3214
3215
3216/*-------------------------------------.
3217| yyacceptlab -- YYACCEPT comes here. |
3218`-------------------------------------*/
3219yyacceptlab:
3220 yyresult = 0;
3221 goto yyreturnlab;
3222
3223
3224/*-----------------------------------.
3225| yyabortlab -- YYABORT comes here. |
3226`-----------------------------------*/
3227yyabortlab:
3228 yyresult = 1;
3229 goto yyreturnlab;
3230
3231
3232/*-----------------------------------------------------------.
3233| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. |
3234`-----------------------------------------------------------*/
3235yyexhaustedlab:
3236 yyerror (YY_("memory exhausted"));
3237 yyresult = 2;
3238 goto yyreturnlab;
3239
3240
3241/*----------------------------------------------------------.
3242| yyreturnlab -- parsing is finished, clean up and return. |
3243`----------------------------------------------------------*/
3244yyreturnlab:
3245 if (yychar != EX_EMPTY)
3246 {
3247 /* Make sure we have latest lookahead translation. See comments at
3248 user semantic actions for why this is necessary. */
3249 yytoken = YYTRANSLATE (yychar);
3250 yydestruct ("Cleanup: discarding lookahead",
3251 yytoken, &yylval);
3252 }
3253 /* Do not reclaim the symbols of the rule whose action triggered
3254 this YYABORT or YYACCEPT. */
3255 YYPOPSTACK (yylen);
3256 YY_STACK_PRINT (yyss, yyssp);
3257 while (yyssp != yyss)
3258 {
3259 yydestruct ("Cleanup: popping",
3260 YY_ACCESSING_SYMBOL (+*yyssp), yyvsp);
3261 YYPOPSTACK (1);
3262 }
3263#ifndef yyoverflow
3264 if (yyss != yyssa)
3265 YYSTACK_FREE (yyss);
3266#endif
3267
3268 return yyresult;
3269}
3270
3271#line 1245 "../../lib/expr/exparse.y"
3272
3273
3274const char *exop(size_t index) {
3275
3276 /* yytname is generated by the %token-table directive */
3277
3278 /* find the index of MINTOKEN */
3279 size_t minid;
3280 for (minid = 0; yytname[minid] != NULL; ++minid) {
3281 if (strcmp(yytname[minid], "MINTOKEN") == 0) {
3282 break;
3283 }
3284 }
3285
3286 assert(yytname[minid] != NULL
3287 && "failed to find MINTOKEN; incorrect token list in exparse.y?");
3288
3289 /* find the requested token */
3290 {
3291 size_t i, j;
3292 for (i = j = minid; yytname[i] != NULL; ++i) {
3293
3294 /* if this token is not a word, skip it */
3295 {
3296 size_t k;
3297 for (k = 0; yytname[i][k] != '\0'; ++k) {
3298 if (yytname[i][k] != '_' && !gv_isalnum(yytname[i][k])) {
3299 break;
3300 }
3301 }
3302 if (yytname[i][k] != '\0') {
3303 continue;
3304 }
3305 }
3306
3307 if (j == index + minid) {
3308 return yytname[i];
3309 }
3310 ++j;
3311 }
3312 }
3313
3314 /* failed to find the requested token */
3315 return NULL;
3316}
3317
3318void ex_error(const char *message) {
3319 exerror("%s", message);
3320}
3321
3322#include <expr/exgram.h>
CDT_API Dtmethod_t * Dtset
set with unique elements
Definition dthash.c:277
CDT_API Dt_t * dtview(Dt_t *, Dt_t *)
Definition dtview.c:91
CDT_API int dtclose(Dt_t *)
Definition dtclose.c:8
CDT_API Dtmethod_t * Dtoset
ordered set (self-adjusting tree)
Definition dttree.c:304
CDT_API Dt_t * dtopen(Dtdisc_t *, Dtmethod_t *)
Definition dtopen.c:9
static int binary(Exnode_t *l, Exnode_t *ex, Exnode_t *r, int arg)
Definition compile.c:1834
void exwarn(const char *format,...)
Definition exerror.c:79
void exerror(const char *format,...)
Definition exerror.c:62
Extype_t exeval(Expr_t *ex, Exnode_t *exnode, void *env)
Definition exeval.c:1991
Exstate_t expr
#define exunlex(p, c)
Definition exlib.h:125
char * exnospace(void)
Definition exnospace.c:25
static const char * yysymbol_name(yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED
Definition exparse.c:731
static const yytype_uint8 yyr1[]
Definition exparse.c:1111
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
Definition exparse.c:460
const char * exop(size_t index)
Definition exparse.c:3274
#define YYMAXDEPTH
Definition exparse.c:1326
#define YYSTACK_FREE
Definition exparse.c:522
static const yytype_int8 yytranslate[]
Definition exparse.c:636
yysymbol_kind_t
Definition exparse.c:125
@ YYSYMBOL_action_list
Definition exparse.c:235
@ YYSYMBOL_DYNAMIC
Definition exparse.c:146
@ YYSYMBOL_member
Definition exparse.c:270
@ YYSYMBOL_S2X
Definition exparse.c:188
@ YYSYMBOL_74_
Definition exparse.c:201
@ YYSYMBOL_statement_list
Definition exparse.c:238
@ YYSYMBOL_INC
Definition exparse.c:221
@ YYSYMBOL_68_
Definition exparse.c:195
@ YYSYMBOL_DECLARE
Definition exparse.c:144
@ YYSYMBOL_STRING
Definition exparse.c:135
@ YYSYMBOL_MINTOKEN
Definition exparse.c:130
@ YYSYMBOL_YYUNDEF
Definition exparse.c:129
@ YYSYMBOL_CONSTANT
Definition exparse.c:142
@ YYSYMBOL_PRINT
Definition exparse.c:162
@ YYSYMBOL_assign
Definition exparse.c:271
@ YYSYMBOL_SRAND
Definition exparse.c:171
@ YYSYMBOL_EQ
Definition exparse.c:203
@ YYSYMBOL_101_
Definition exparse.c:228
@ YYSYMBOL_F2S
Definition exparse.c:180
@ YYSYMBOL_FLOATING
Definition exparse.c:134
@ YYSYMBOL_110_1
Definition exparse.c:237
@ YYSYMBOL_102_
Definition exparse.c:229
@ YYSYMBOL_IF
Definition exparse.c:155
@ YYSYMBOL_array
Definition exparse.c:261
@ YYSYMBOL_SUBSTR
Definition exparse.c:174
@ YYSYMBOL_UNSIGNED
Definition exparse.c:132
@ YYSYMBOL_IN_OP
Definition exparse.c:213
@ YYSYMBOL_POS
Definition exparse.c:159
@ YYSYMBOL_I2S
Definition exparse.c:182
@ YYSYMBOL_UNARY
Definition exparse.c:220
@ YYSYMBOL_121_4
Definition exparse.c:248
@ YYSYMBOL_S2I
Definition exparse.c:185
@ YYSYMBOL_YYerror
Definition exparse.c:128
@ YYSYMBOL_127_5
Definition exparse.c:254
@ YYSYMBOL_BREAK
Definition exparse.c:139
@ YYSYMBOL_ADDRESS
Definition exparse.c:137
@ YYSYMBOL_141_7
Definition exparse.c:268
@ YYSYMBOL_ID
Definition exparse.c:154
@ YYSYMBOL_97_
Definition exparse.c:224
@ YYSYMBOL_constant
Definition exparse.c:257
@ YYSYMBOL_initialize
Definition exparse.c:272
@ YYSYMBOL_NE
Definition exparse.c:204
@ YYSYMBOL_PRE
Definition exparse.c:161
@ YYSYMBOL_dcl_name
Definition exparse.c:249
@ YYSYMBOL_RAND
Definition exparse.c:166
@ YYSYMBOL_I2F
Definition exparse.c:181
@ YYSYMBOL_89_
Definition exparse.c:216
@ YYSYMBOL_S2F
Definition exparse.c:184
@ YYSYMBOL_MAXTOKEN
Definition exparse.c:225
@ YYSYMBOL_switch_item
Definition exparse.c:243
@ YYSYMBOL_expr
Definition exparse.c:253
@ YYSYMBOL_GE
Definition exparse.c:208
@ YYSYMBOL_DEFAULT
Definition exparse.c:145
@ YYSYMBOL_75_
Definition exparse.c:202
@ YYSYMBOL_99_
Definition exparse.c:226
@ YYSYMBOL_CALL
Definition exparse.c:140
@ YYSYMBOL_TOKENS
Definition exparse.c:176
@ YYSYMBOL_AND
Definition exparse.c:199
@ YYSYMBOL_78_
Definition exparse.c:205
@ YYSYMBOL_105_
Definition exparse.c:232
@ YYSYMBOL_LABEL
Definition exparse.c:156
@ YYSYMBOL_EXIT
Definition exparse.c:148
@ YYSYMBOL_ITERATOR
Definition exparse.c:153
@ YYSYMBOL_114_3
Definition exparse.c:241
@ YYSYMBOL_113_2
Definition exparse.c:240
@ YYSYMBOL_91_
Definition exparse.c:218
@ YYSYMBOL_84_
Definition exparse.c:211
@ YYSYMBOL_LSH
Definition exparse.c:209
@ YYSYMBOL_args
Definition exparse.c:263
@ YYSYMBOL_formal_list
Definition exparse.c:266
@ YYSYMBOL_67_
Definition exparse.c:194
@ YYSYMBOL_I2X
Definition exparse.c:187
@ YYSYMBOL_ELSE
Definition exparse.c:147
@ YYSYMBOL_CONTINUE
Definition exparse.c:143
@ YYSYMBOL_MEMBER
Definition exparse.c:157
@ YYSYMBOL_GSUB
Definition exparse.c:151
@ YYSYMBOL_UNSET
Definition exparse.c:177
@ YYSYMBOL_WHILE
Definition exparse.c:178
@ YYSYMBOL_index
Definition exparse.c:262
@ YYSYMBOL_85_
Definition exparse.c:212
@ YYSYMBOL_70_
Definition exparse.c:197
@ YYSYMBOL_else_opt
Definition exparse.c:251
@ YYSYMBOL_QUERY
Definition exparse.c:165
@ YYSYMBOL_F2X
Definition exparse.c:186
@ YYSYMBOL_action
Definition exparse.c:236
@ YYSYMBOL_RSH
Definition exparse.c:210
@ YYSYMBOL_79_
Definition exparse.c:206
@ YYSYMBOL_name
Definition exparse.c:250
@ YYSYMBOL_print
Definition exparse.c:258
@ YYSYMBOL_arg_list
Definition exparse.c:264
@ YYSYMBOL_X2X
Definition exparse.c:192
@ YYSYMBOL_members
Definition exparse.c:269
@ YYSYMBOL_DEC
Definition exparse.c:222
@ YYSYMBOL_ARRAY
Definition exparse.c:138
@ YYSYMBOL_splitop
Definition exparse.c:256
@ YYSYMBOL_SWITCH
Definition exparse.c:175
@ YYSYMBOL_switch_list
Definition exparse.c:242
@ YYSYMBOL_S2B
Definition exparse.c:183
@ YYSYMBOL_100_
Definition exparse.c:227
@ YYSYMBOL_X2F
Definition exparse.c:189
@ YYSYMBOL_case_item
Definition exparse.c:245
@ YYSYMBOL_YYACCEPT
Definition exparse.c:233
@ YYSYMBOL_SCANF
Definition exparse.c:168
@ YYSYMBOL_statement
Definition exparse.c:239
@ YYSYMBOL_OR
Definition exparse.c:198
@ YYSYMBOL_LE
Definition exparse.c:207
@ YYSYMBOL_146_8
Definition exparse.c:273
@ YYSYMBOL_104_
Definition exparse.c:231
@ YYSYMBOL_SUB
Definition exparse.c:173
@ YYSYMBOL_SPLIT
Definition exparse.c:169
@ YYSYMBOL_YYEOF
Definition exparse.c:127
@ YYSYMBOL_formals
Definition exparse.c:265
@ YYSYMBOL_FUNCTION
Definition exparse.c:150
@ YYSYMBOL_147_9
Definition exparse.c:274
@ YYSYMBOL_XPRINT
Definition exparse.c:193
@ YYSYMBOL_scan
Definition exparse.c:259
@ YYSYMBOL_X2S
Definition exparse.c:191
@ YYSYMBOL_dcl_item
Definition exparse.c:247
@ YYSYMBOL_program
Definition exparse.c:234
@ YYSYMBOL_expr_opt
Definition exparse.c:252
@ YYSYMBOL_dcl_list
Definition exparse.c:246
@ YYSYMBOL_case_list
Definition exparse.c:244
@ YYSYMBOL_variable
Definition exparse.c:260
@ YYSYMBOL_CASE
Definition exparse.c:141
@ YYSYMBOL_INTEGER
Definition exparse.c:131
@ YYSYMBOL_73_
Definition exparse.c:200
@ YYSYMBOL_PRAGMA
Definition exparse.c:160
@ YYSYMBOL_YYEMPTY
Definition exparse.c:126
@ YYSYMBOL_SPRINTF
Definition exparse.c:170
@ YYSYMBOL_PROCEDURE
Definition exparse.c:164
@ YYSYMBOL_90_
Definition exparse.c:217
@ YYSYMBOL_128_6
Definition exparse.c:255
@ YYSYMBOL_PRINTF
Definition exparse.c:163
@ YYSYMBOL_X2I
Definition exparse.c:190
@ YYSYMBOL_69_
Definition exparse.c:196
@ YYSYMBOL_RETURN
Definition exparse.c:167
@ YYSYMBOL_NAME
Definition exparse.c:158
@ YYSYMBOL_87_
Definition exparse.c:214
@ YYSYMBOL_ITERATE
Definition exparse.c:152
@ YYSYMBOL_formal_item
Definition exparse.c:267
@ YYSYMBOL_88_
Definition exparse.c:215
@ YYSYMBOL_CAST
Definition exparse.c:223
@ YYSYMBOL_FOR
Definition exparse.c:149
@ YYSYMBOL_SSCANF
Definition exparse.c:172
@ YYSYMBOL_F2I
Definition exparse.c:179
@ YYSYMBOL_103_
Definition exparse.c:230
@ YYSYMBOL_CHARACTER
Definition exparse.c:133
@ YYSYMBOL_VOIDTYPE
Definition exparse.c:136
@ YYSYMBOL_92_
Definition exparse.c:219
#define YY_ASSERT(E)
Definition exparse.c:480
#define YY_(Msgid)
Definition exparse.c:414
#define YYNOMEM
Definition exparse.c:1159
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
Definition exparse.c:461
#define YYNSTATES
Definition exparse.c:621
#define YYSTYPE
Definition exparse.c:67
#define YY_IGNORE_USELESS_CAST_END
Definition exparse.c:476
short yytype_int16
Definition exparse.c:325
#define yychar
Definition exparse.c:75
#define YYABORT
Definition exparse.c:1157
#define YYSTACK_BYTES(N)
Definition exparse.c:565
yytype_int16 yy_state_t
Definition exparse.c:401
static const yytype_int16 yydefgoto[]
Definition exparse.c:829
#define YY_REDUCE_PRINT(Rule)
Definition exparse.c:1309
#define YY_CAST(Type, Val)
Definition exparse.c:106
static void yydestruct(const char *yymsg, yysymbol_kind_t yykind, YYSTYPE *yyvaluep)
Definition exparse.c:1339
static const yytype_int16 yypact[]
Definition exparse.c:749
#define yylex
Definition exparse.c:70
#define YY_NULLPTR
Definition exparse.c:118
@ YYENOMEM
Definition exparse.c:1151
#define YYFINAL
Definition exparse.c:610
#define YY_ACCESSING_SYMBOL(State)
Definition exparse.c:697
#define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
Definition exparse.c:1307
static const yytype_int16 yypgoto[]
Definition exparse.c:819
#define yyparse
Definition exparse.c:1369
#define yylval
Definition exparse.c:74
#define YYNTOKENS
Definition exparse.c:615
unsigned char yytype_uint8
Definition exparse.c:346
#define YY_STACK_PRINT(Bottom, Top)
Definition exparse.c:1308
#define YYSIZE_T
Definition exparse.c:387
#define yydebug
Definition exparse.c:72
#define YY_IGNORE_USELESS_CAST_BEGIN
Definition exparse.c:475
static const yytype_int8 yyr2[]
Definition exparse.c:1131
void * malloc(YYSIZE_T)
#define YYPTRDIFF_T
Definition exparse.c:373
#define yynerrs
Definition exparse.c:73
static const yytype_int16 yytable[]
Definition exparse.c:841
#define YYACCEPT
Definition exparse.c:1156
#define yytable_value_is_error(Yyn)
Definition exparse.c:744
#define YYTRANSLATE(YYX)
Definition exparse.c:629
#define YY_ATTRIBUTE_UNUSED
Definition exparse.c:431
static const char *const yytname[]
Definition exparse.c:706
static const yytype_uint8 yystos[]
Definition exparse.c:1077
#define YYPOPSTACK(N)
int yy_state_fast_t
Definition exparse.c:404
unsigned short yytype_uint16
Definition exparse.c:357
#define YYLAST
Definition exparse.c:612
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
Definition exparse.c:576
#define yypact_value_is_default(Yyn)
Definition exparse.c:739
#define YYINITDEPTH
Definition exparse.c:1315
void ex_error(const char *message)
Definition exparse.c:3318
signed char yytype_int8
Definition exparse.c:317
void free(void *)
#define YYERROR
Definition exparse.c:1158
#define YYSIZEOF(X)
Definition exparse.c:397
static const yytype_int16 yycheck[]
Definition exparse.c:958
#define YYSTACK_ALLOC
Definition exparse.c:521
#define YYDPRINTF(Args)
Definition exparse.c:1306
static const yytype_uint8 yydefact[]
Definition exparse.c:785
#define YY_USE(E)
Definition exparse.c:437
#define yyerror
Definition exparse.c:71
#define UNSIGNED
Definition exparse.h:153
#define DYNAMIC
Definition exparse.h:167
#define SCANF
Definition exparse.h:189
#define EX_UNDEF
Definition exparse.h:150
#define SSCANF
Definition exparse.h:193
#define ADDRESS
Definition exparse.h:158
#define PRE
Definition exparse.h:182
#define DEFAULT
Definition exparse.h:166
#define ITERATE
Definition exparse.h:173
#define EX_EMPTY
Definition exparse.h:147
#define SRAND
Definition exparse.h:192
#define SUB
Definition exparse.h:194
#define POS
Definition exparse.h:180
#define FLOATING
Definition exparse.h:155
#define IN_OP
Definition exparse.h:223
#define EX_error
Definition exparse.h:149
#define ITERATOR
Definition exparse.h:174
#define RAND
Definition exparse.h:187
#define EX_EOF
Definition exparse.h:148
#define SPRINTF
Definition exparse.h:191
#define CONSTANT
Definition exparse.h:163
#define S2B
Definition exparse.h:204
#define CALL
Definition exparse.h:161
#define GSUB
Definition exparse.h:172
#define UNSET
Definition exparse.h:198
#define PROCEDURE
Definition exparse.h:185
#define EXIT
Definition exparse.h:169
#define PRINTF
Definition exparse.h:184
#define QUERY
Definition exparse.h:186
#define FUNCTION
Definition exparse.h:171
#define CASE
Definition exparse.h:162
#define ARRAY
Definition exparse.h:159
$1 lex
Definition exparse.y:204
static Dtdisc_t disc
Definition exparse.y:207
expr procedure type
Definition exparse.y:206
struct Exref_s Exref_t
Definition expr.h:87
int exisAssign(Exnode_t *)
#define exalloc(p, n)
Definition expr.h:79
EX_STYPE Extype_t
Definition expr.h:81
Exnode_t * excast(Expr_t *, Exnode_t *, long, Exnode_t *, int)
#define BUILTIN(t)
Definition expr.h:58
Exnode_t * exnewnode(Expr_t *, long, bool, long, Exnode_t *, Exnode_t *)
void exfreenode(Expr_t *, Exnode_t *)
char * extypename(Expr_t *p, long)
#define EX_UNDECLARED
Definition expr.h:45
#define INTEGRAL(t)
Definition expr.h:57
Extype_t exzero(long int)
Definition exzero.c:24
yysymbol_kind_t
Definition gmlparse.c:282
#define YYSTYPE
Definition gmlparse.c:67
short yytype_int16
Definition gmlparse.c:381
unsigned char yytype_uint8
Definition gmlparse.c:402
int yy_state_fast_t
Definition gmlparse.c:460
signed char yytype_int8
Definition gmlparse.c:373
yytype_int8 yy_state_t
Definition gmlparse.c:457
#define ID
Definition gmlparse.h:134
#define STRING
Definition gmlparse.h:133
#define INTEGER
Definition gmlparse.h:131
node NULL
Definition grammar.y:180
replacements for ctype.h functions
static bool gv_isalnum(int c)
Definition gv_ctype.h:43
static void freef(void *ident)
char * pre
Definition maze.c:32
static bool streq(const char *a, const char *b)
are a and b equal?
Definition streq.h:11
#define RETURN(v)
Definition strmatch.c:144
Definition expr.h:93
long type
Definition expr.h:97
long lex
Definition expr.h:95
char name[EX_NAMELEN]
Definition expr.h:101
long op
operator
Definition expr.h:150
long type
value type
Definition expr.h:149
Exdata_t data
Definition expr.h:158
Dt_t * symbols
Definition expr.h:222
Vmalloc_t * vm
Definition expr.h:224
Exid_t * symbol
Definition expr.h:107
Exref_t * next
Definition expr.h:106
Exnode_t * index
Definition expr.h:108
int assigned
Definition exlib.h:159
Expr_t * program
Definition exlib.h:156
Switch_t * swstate
Definition exlib.h:160
Exid_t * id
Definition exlib.h:152
Exref_t * refs
Definition exlib.h:158
long declare
current declaration type
Definition exlib.h:153
int nolabel
Definition exlib.h:154
Exnode_t * procedure
Definition exlib.h:157
size_t cap
Definition exlib.h:137
int def
Definition exlib.h:138
Exnode_t * defcase
Definition exlib.h:134
struct Switch_s * prev
Definition exlib.h:131
long type
switch test type
Definition exlib.h:139
Exnode_t * lastcase
Definition exlib.h:133
size_t cur
Definition exlib.h:136
Extype_t ** base
Definition exlib.h:135
Exnode_t * firstcase
Definition exlib.h:132
Definition legal.c:50
int key
Definition cdt.h:85
static mytime_t T
Definition timing.c:41
Exnode_t * left
Definition expr.h:122
Exnode_t * right
Definition expr.h:123
Exid_t * reference
Definition expr.h:117
Exnode_t * next
Definition expr.h:129
Exid_t * symbol
Definition expr.h:135
struct Exdata_u::@90 operand
struct Exdata_u::@92 variable
Exnode_t * dyna
Definition expr.h:138
struct Exdata_u::@91 select
Exnode_t * index
Definition expr.h:137
char * vmstrdup(Vmalloc_t *, const char *)
Definition vmstrdup.c:19