holded calls: basic functionality.
[asterisk-bristuff.git] / pbx / ael / ael.tab.c
blob78986ec09cc7f360defb6b7fc56139a5ef850fb0
1 /* A Bison parser, made by GNU Bison 2.1a. */
3 /* Skeleton parser for Yacc-like parsing with Bison,
4 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA. */
21 /* As a special exception, when this file is copied by Bison into a
22 Bison output file, you may use that output file without restriction.
23 This special exception was added by the Free Software Foundation
24 in version 1.24 of Bison. */
26 /* C LALR(1) parser skeleton written by Richard Stallman, by
27 simplifying the original so-called "semantic" parser. */
29 /* All symbols defined below should begin with yy or YY, to avoid
30 infringing on user name space. This should be done even for local
31 variables, as they might otherwise be expanded by user macros.
32 There are some unavoidable exceptions within include files to
33 define necessary library symbols; they are noted "INFRINGES ON
34 USER NAME SPACE" below. */
36 /* Identify Bison output. */
37 #define YYBISON 1
39 /* Bison version. */
40 #define YYBISON_VERSION "2.1a"
42 /* Skeleton name. */
43 #define YYSKELETON_NAME "yacc.c"
45 /* Pure parsers. */
46 #define YYPURE 1
48 /* Using locations. */
49 #define YYLSP_NEEDED 1
51 /* Substitute the variable and function names. */
52 #define yyparse ael_yyparse
53 #define yylex ael_yylex
54 #define yyerror ael_yyerror
55 #define yylval ael_yylval
56 #define yychar ael_yychar
57 #define yydebug ael_yydebug
58 #define yynerrs ael_yynerrs
59 #define yylloc ael_yylloc
61 /* Tokens. */
62 #ifndef YYTOKENTYPE
63 # define YYTOKENTYPE
64 /* Put the tokens into the symbol table, so that GDB and other debuggers
65 know about them. */
66 enum yytokentype {
67 KW_CONTEXT = 258,
68 LC = 259,
69 RC = 260,
70 LP = 261,
71 RP = 262,
72 SEMI = 263,
73 EQ = 264,
74 COMMA = 265,
75 COLON = 266,
76 AMPER = 267,
77 BAR = 268,
78 AT = 269,
79 KW_MACRO = 270,
80 KW_GLOBALS = 271,
81 KW_IGNOREPAT = 272,
82 KW_SWITCH = 273,
83 KW_IF = 274,
84 KW_IFTIME = 275,
85 KW_ELSE = 276,
86 KW_RANDOM = 277,
87 KW_ABSTRACT = 278,
88 KW_EXTEND = 279,
89 EXTENMARK = 280,
90 KW_GOTO = 281,
91 KW_JUMP = 282,
92 KW_RETURN = 283,
93 KW_BREAK = 284,
94 KW_CONTINUE = 285,
95 KW_REGEXTEN = 286,
96 KW_HINT = 287,
97 KW_FOR = 288,
98 KW_WHILE = 289,
99 KW_CASE = 290,
100 KW_PATTERN = 291,
101 KW_DEFAULT = 292,
102 KW_CATCH = 293,
103 KW_SWITCHES = 294,
104 KW_ESWITCHES = 295,
105 KW_INCLUDES = 296,
106 word = 297
108 #endif
109 /* Tokens. */
110 #define KW_CONTEXT 258
111 #define LC 259
112 #define RC 260
113 #define LP 261
114 #define RP 262
115 #define SEMI 263
116 #define EQ 264
117 #define COMMA 265
118 #define COLON 266
119 #define AMPER 267
120 #define BAR 268
121 #define AT 269
122 #define KW_MACRO 270
123 #define KW_GLOBALS 271
124 #define KW_IGNOREPAT 272
125 #define KW_SWITCH 273
126 #define KW_IF 274
127 #define KW_IFTIME 275
128 #define KW_ELSE 276
129 #define KW_RANDOM 277
130 #define KW_ABSTRACT 278
131 #define KW_EXTEND 279
132 #define EXTENMARK 280
133 #define KW_GOTO 281
134 #define KW_JUMP 282
135 #define KW_RETURN 283
136 #define KW_BREAK 284
137 #define KW_CONTINUE 285
138 #define KW_REGEXTEN 286
139 #define KW_HINT 287
140 #define KW_FOR 288
141 #define KW_WHILE 289
142 #define KW_CASE 290
143 #define KW_PATTERN 291
144 #define KW_DEFAULT 292
145 #define KW_CATCH 293
146 #define KW_SWITCHES 294
147 #define KW_ESWITCHES 295
148 #define KW_INCLUDES 296
149 #define word 297
154 /* Copy the first part of user declarations. */
155 #line 1 "ael.y"
158 * Asterisk -- An open source telephony toolkit.
160 * Copyright (C) 2006, Digium, Inc.
162 * Steve Murphy <murf@parsetree.com>
164 * See http://www.asterisk.org for more information about
165 * the Asterisk project. Please do not directly contact
166 * any of the maintainers of this project for assistance;
167 * the project provides a web site, mailing lists and IRC
168 * channels for your use.
170 * This program is free software, distributed under the terms of
171 * the GNU General Public License Version 2. See the LICENSE file
172 * at the top of the source tree.
174 /*! \file
176 * \brief Bison Grammar description of AEL2.
180 #include "asterisk.h"
182 ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
184 #include <stdio.h>
185 #include <stdlib.h>
186 #include <string.h>
188 #include "asterisk/logger.h"
189 #include "asterisk/ael_structs.h"
191 static pval * linku1(pval *head, pval *tail);
192 static void set_dads(pval *dad, pval *child_list);
193 void reset_parencount(yyscan_t yyscanner);
194 void reset_semicount(yyscan_t yyscanner);
195 void reset_argcount(yyscan_t yyscanner );
197 #define YYLEX_PARAM ((struct parse_io *)parseio)->scanner
198 #define YYERROR_VERBOSE 1
200 extern char *my_file;
201 #ifdef AAL_ARGCHECK
202 int ael_is_funcname(char *name);
203 #endif
204 static char *ael_token_subst(const char *mess);
208 /* Enabling traces. */
209 #ifndef YYDEBUG
210 # define YYDEBUG 0
211 #endif
213 /* Enabling verbose error messages. */
214 #ifdef YYERROR_VERBOSE
215 # undef YYERROR_VERBOSE
216 # define YYERROR_VERBOSE 1
217 #else
218 # define YYERROR_VERBOSE 1
219 #endif
221 /* Enabling the token table. */
222 #ifndef YYTOKEN_TABLE
223 # define YYTOKEN_TABLE 0
224 #endif
226 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
227 typedef union YYSTYPE
228 #line 54 "ael.y"
230 int intval; /* integer value, typically flags */
231 char *str; /* strings */
232 struct pval *pval; /* full objects */
234 /* Line 198 of yacc.c. */
235 #line 236 "ael.tab.c"
236 YYSTYPE;
237 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
238 # define YYSTYPE_IS_DECLARED 1
239 # define YYSTYPE_IS_TRIVIAL 1
240 #endif
242 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
243 typedef struct YYLTYPE
245 int first_line;
246 int first_column;
247 int last_line;
248 int last_column;
249 } YYLTYPE;
250 # define yyltype YYLTYPE /* obsolescent; will be withdrawn */
251 # define YYLTYPE_IS_DECLARED 1
252 # define YYLTYPE_IS_TRIVIAL 1
253 #endif
256 /* Copy the second part of user declarations. */
257 #line 60 "ael.y"
259 /* declaring these AFTER the union makes things a lot simpler! */
260 void yyerror(YYLTYPE *locp, struct parse_io *parseio, char const *s);
261 int ael_yylex (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , void * yyscanner);
263 /* create a new object with start-end marker */
264 static pval *npval(pvaltype type, int first_line, int last_line,
265 int first_column, int last_column);
267 /* create a new object with start-end marker, simplified interface.
268 * Must be declared here because YYLTYPE is not known before
270 static pval *npval2(pvaltype type, YYLTYPE *first, YYLTYPE *last);
272 /* another frontend for npval, this time for a string */
273 static pval *nword(char *string, YYLTYPE *pos);
275 /* update end position of an object, return the object */
276 static pval *update_last(pval *, YYLTYPE *);
279 /* Line 221 of yacc.c. */
280 #line 281 "ael.tab.c"
282 #ifdef short
283 # undef short
284 #endif
286 #ifdef YYTYPE_UINT8
287 typedef YYTYPE_UINT8 yytype_uint8;
288 #else
289 typedef unsigned char yytype_uint8;
290 #endif
292 #ifdef YYTYPE_INT8
293 typedef YYTYPE_INT8 yytype_int8;
294 #elif (defined __STDC__ || defined __C99__FUNC__ \
295 || defined __cplusplus || defined _MSC_VER)
296 typedef signed char yytype_int8;
297 #else
298 typedef short int yytype_int8;
299 #endif
301 #ifdef YYTYPE_UINT16
302 typedef YYTYPE_UINT16 yytype_uint16;
303 #else
304 typedef unsigned short int yytype_uint16;
305 #endif
307 #ifdef YYTYPE_INT16
308 typedef YYTYPE_INT16 yytype_int16;
309 #else
310 typedef short int yytype_int16;
311 #endif
313 #ifndef YYSIZE_T
314 # ifdef __SIZE_TYPE__
315 # define YYSIZE_T __SIZE_TYPE__
316 # elif defined size_t
317 # define YYSIZE_T size_t
318 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
319 || defined __cplusplus || defined _MSC_VER)
320 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
321 # define YYSIZE_T size_t
322 # else
323 # define YYSIZE_T unsigned int
324 # endif
325 #endif
327 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
329 #ifndef YY_
330 # if YYENABLE_NLS
331 # if ENABLE_NLS
332 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
333 # define YY_(msgid) dgettext ("bison-runtime", msgid)
334 # endif
335 # endif
336 # ifndef YY_
337 # define YY_(msgid) msgid
338 # endif
339 #endif
341 /* Suppress unused-variable warnings by "using" E. */
342 #if ! defined lint || defined __GNUC__
343 # define YYUSE(e) ((void) (e))
344 #else
345 # define YYUSE(e) /* empty */
346 #endif
348 /* Identity function, used to suppress warnings about constant conditions. */
349 #ifndef lint
350 # define YYID(n) (n)
351 #else
352 #if (defined __STDC__ || defined __C99__FUNC__ \
353 || defined __cplusplus || defined _MSC_VER)
354 static int
355 YYID (int i)
356 #else
357 static int
358 YYID (i)
359 int i;
360 #endif
362 return i;
364 #endif
366 #if ! defined yyoverflow || YYERROR_VERBOSE
368 /* The parser invokes alloca or malloc; define the necessary symbols. */
370 # ifdef YYSTACK_USE_ALLOCA
371 # if YYSTACK_USE_ALLOCA
372 # ifdef __GNUC__
373 # define YYSTACK_ALLOC __builtin_alloca
374 # elif defined __BUILTIN_VA_ARG_INCR
375 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
376 # elif defined _AIX
377 # define YYSTACK_ALLOC __alloca
378 # elif defined _MSC_VER
379 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
380 # define alloca _alloca
381 # else
382 # define YYSTACK_ALLOC alloca
383 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
384 || defined __cplusplus || defined _MSC_VER)
385 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
386 # ifndef _STDLIB_H
387 # define _STDLIB_H 1
388 # endif
389 # endif
390 # endif
391 # endif
392 # endif
394 # ifdef YYSTACK_ALLOC
395 /* Pacify GCC's `empty if-body' warning. */
396 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
397 # ifndef YYSTACK_ALLOC_MAXIMUM
398 /* The OS might guarantee only one guard page at the bottom of the stack,
399 and a page size can be as small as 4096 bytes. So we cannot safely
400 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
401 to allow for a few compiler-allocated temporary stack slots. */
402 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
403 # endif
404 # else
405 # define YYSTACK_ALLOC YYMALLOC
406 # define YYSTACK_FREE YYFREE
407 # ifndef YYSTACK_ALLOC_MAXIMUM
408 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
409 # endif
410 # ifdef __cplusplus
411 extern "C" {
412 # endif
413 # ifndef YYMALLOC
414 # define YYMALLOC malloc
415 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
416 || defined __cplusplus || defined _MSC_VER)
417 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
418 # endif
419 # endif
420 # ifndef YYFREE
421 # define YYFREE free
422 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
423 || defined __cplusplus || defined _MSC_VER)
424 void free (void *); /* INFRINGES ON USER NAME SPACE */
425 # endif
426 # endif
427 # ifdef __cplusplus
429 # endif
430 # endif
431 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
434 #if (! defined yyoverflow \
435 && (! defined __cplusplus \
436 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
437 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
439 /* A type that is properly aligned for any stack member. */
440 union yyalloc
442 yytype_int16 yyss;
443 YYSTYPE yyvs;
444 YYLTYPE yyls;
447 /* The size of the maximum gap between one aligned stack and the next. */
448 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
450 /* The size of an array large to enough to hold all stacks, each with
451 N elements. */
452 # define YYSTACK_BYTES(N) \
453 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
454 + 2 * YYSTACK_GAP_MAXIMUM)
456 /* Copy COUNT objects from FROM to TO. The source and destination do
457 not overlap. */
458 # ifndef YYCOPY
459 # if defined __GNUC__ && 1 < __GNUC__
460 # define YYCOPY(To, From, Count) \
461 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
462 # else
463 # define YYCOPY(To, From, Count) \
464 do \
466 YYSIZE_T yyi; \
467 for (yyi = 0; yyi < (Count); yyi++) \
468 (To)[yyi] = (From)[yyi]; \
470 while (YYID (0))
471 # endif
472 # endif
474 /* Relocate STACK from its old location to the new one. The
475 local variables YYSIZE and YYSTACKSIZE give the old and new number of
476 elements in the stack, and YYPTR gives the new location of the
477 stack. Advance YYPTR to a properly aligned location for the next
478 stack. */
479 # define YYSTACK_RELOCATE(Stack) \
480 do \
482 YYSIZE_T yynewbytes; \
483 YYCOPY (&yyptr->Stack, Stack, yysize); \
484 Stack = &yyptr->Stack; \
485 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
486 yyptr += yynewbytes / sizeof (*yyptr); \
488 while (YYID (0))
490 #endif
492 /* YYFINAL -- State number of the termination state. */
493 #define YYFINAL 17
494 /* YYLAST -- Last index in YYTABLE. */
495 #define YYLAST 311
497 /* YYNTOKENS -- Number of terminals. */
498 #define YYNTOKENS 43
499 /* YYNNTS -- Number of nonterminals. */
500 #define YYNNTS 54
501 /* YYNRULES -- Number of rules. */
502 #define YYNRULES 137
503 /* YYNRULES -- Number of states. */
504 #define YYNSTATES 276
506 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
507 #define YYUNDEFTOK 2
508 #define YYMAXUTOK 297
510 #define YYTRANSLATE(YYX) \
511 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
513 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
514 static const yytype_uint8 yytranslate[] =
516 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
517 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
518 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
519 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
520 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
521 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
522 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
523 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
524 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
525 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
526 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
527 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
528 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
529 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
530 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
531 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
532 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
533 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
534 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
535 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
536 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
537 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
538 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
539 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
540 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
541 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
542 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
543 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
544 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
545 35, 36, 37, 38, 39, 40, 41, 42
548 #if YYDEBUG
549 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
550 YYRHS. */
551 static const yytype_uint16 yyprhs[] =
553 0, 0, 3, 5, 7, 10, 13, 15, 17, 19,
554 21, 23, 25, 32, 34, 35, 37, 40, 43, 52,
555 57, 58, 61, 64, 65, 71, 72, 74, 78, 81,
556 82, 85, 88, 90, 92, 94, 96, 98, 100, 103,
557 105, 110, 114, 119, 127, 136, 137, 140, 143, 149,
558 151, 159, 160, 165, 168, 171, 176, 178, 181, 183,
559 186, 190, 194, 196, 199, 203, 205, 208, 212, 218,
560 222, 224, 228, 232, 235, 236, 237, 238, 251, 255,
561 257, 261, 264, 267, 268, 274, 277, 280, 283, 287,
562 289, 292, 293, 295, 299, 303, 309, 315, 321, 327,
563 328, 331, 334, 339, 340, 346, 350, 351, 355, 359,
564 362, 364, 365, 367, 368, 372, 373, 376, 381, 385,
565 390, 391, 394, 396, 398, 404, 409, 414, 415, 419,
566 425, 428, 430, 434, 437, 441, 444, 449
569 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
570 static const yytype_int8 yyrhs[] =
572 44, 0, -1, 45, -1, 46, -1, 45, 46, -1,
573 45, 1, -1, 48, -1, 50, -1, 51, -1, 8,
574 -1, 42, -1, 37, -1, 49, 3, 47, 4, 56,
575 5, -1, 23, -1, -1, 24, -1, 24, 23, -1,
576 23, 24, -1, 15, 42, 6, 55, 7, 4, 89,
577 5, -1, 16, 4, 52, 5, -1, -1, 53, 52,
578 -1, 1, 52, -1, -1, 42, 9, 54, 42, 8,
579 -1, -1, 42, -1, 55, 10, 42, -1, 55, 1,
580 -1, -1, 57, 56, -1, 1, 56, -1, 59, -1,
581 96, -1, 91, -1, 92, -1, 58, -1, 53, -1,
582 42, 1, -1, 8, -1, 17, 25, 42, 8, -1,
583 42, 25, 71, -1, 31, 42, 25, 71, -1, 32,
584 6, 67, 7, 42, 25, 71, -1, 31, 32, 6,
585 67, 7, 42, 25, 71, -1, -1, 71, 60, -1,
586 1, 60, -1, 68, 11, 68, 11, 68, -1, 42,
587 -1, 61, 13, 68, 13, 68, 13, 68, -1, -1,
588 6, 64, 66, 7, -1, 19, 63, -1, 22, 63,
589 -1, 20, 6, 62, 7, -1, 42, -1, 42, 42,
590 -1, 42, -1, 67, 42, -1, 67, 11, 42, -1,
591 67, 12, 42, -1, 42, -1, 42, 42, -1, 42,
592 42, 42, -1, 42, -1, 42, 42, -1, 69, 11,
593 42, -1, 18, 63, 4, 87, 5, -1, 4, 60,
594 5, -1, 53, -1, 26, 77, 8, -1, 27, 79,
595 8, -1, 42, 11, -1, -1, -1, -1, 33, 6,
596 72, 42, 8, 73, 42, 8, 74, 42, 7, 71,
597 -1, 34, 63, 71, -1, 70, -1, 12, 80, 8,
598 -1, 84, 8, -1, 42, 8, -1, -1, 84, 9,
599 75, 42, 8, -1, 29, 8, -1, 28, 8, -1,
600 30, 8, -1, 65, 71, 76, -1, 8, -1, 21,
601 71, -1, -1, 69, -1, 69, 13, 69, -1, 69,
602 10, 69, -1, 69, 13, 69, 13, 69, -1, 69,
603 10, 69, 10, 69, -1, 37, 13, 69, 13, 69,
604 -1, 37, 10, 69, 10, 69, -1, -1, 10, 42,
605 -1, 69, 78, -1, 69, 78, 14, 47, -1, -1,
606 42, 6, 81, 86, 7, -1, 42, 6, 7, -1,
607 -1, 42, 6, 83, -1, 82, 86, 7, -1, 82,
608 7, -1, 42, -1, -1, 66, -1, -1, 86, 10,
609 85, -1, -1, 88, 87, -1, 35, 42, 11, 60,
610 -1, 37, 11, 60, -1, 36, 42, 11, 60, -1,
611 -1, 90, 89, -1, 71, -1, 96, -1, 38, 42,
612 4, 60, 5, -1, 39, 4, 93, 5, -1, 40,
613 4, 93, 5, -1, -1, 42, 8, 93, -1, 42,
614 14, 42, 8, 93, -1, 1, 93, -1, 47, -1,
615 47, 13, 62, -1, 94, 8, -1, 95, 94, 8,
616 -1, 95, 1, -1, 41, 4, 95, 5, -1, 41,
617 4, 5, -1
620 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
621 static const yytype_uint16 yyrline[] =
623 0, 185, 185, 188, 189, 190, 193, 194, 195, 196,
624 199, 200, 203, 212, 213, 214, 215, 216, 219, 225,
625 231, 232, 233, 236, 236, 243, 244, 245, 246, 249,
626 250, 251, 254, 255, 256, 257, 258, 259, 260, 261,
627 264, 269, 273, 278, 283, 293, 294, 295, 301, 306,
628 310, 318, 318, 322, 325, 328, 339, 340, 347, 348,
629 352, 356, 362, 363, 368, 376, 377, 381, 387, 396,
630 399, 400, 403, 406, 409, 410, 411, 409, 417, 421,
631 422, 423, 424, 427, 427, 460, 461, 462, 463, 467,
632 470, 471, 474, 475, 478, 481, 485, 489, 493, 499,
633 500, 504, 507, 513, 513, 518, 526, 526, 537, 544,
634 547, 548, 551, 552, 555, 558, 559, 562, 566, 570,
635 576, 577, 580, 581, 582, 588, 593, 598, 599, 600,
636 602, 605, 606, 613, 614, 615, 618, 621
638 #endif
640 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
641 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
642 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
643 static const char *const yytname[] =
645 "$end", "error", "$undefined", "KW_CONTEXT", "LC", "RC", "LP", "RP",
646 "SEMI", "EQ", "COMMA", "COLON", "AMPER", "BAR", "AT", "KW_MACRO",
647 "KW_GLOBALS", "KW_IGNOREPAT", "KW_SWITCH", "KW_IF", "KW_IFTIME",
648 "KW_ELSE", "KW_RANDOM", "KW_ABSTRACT", "KW_EXTEND", "EXTENMARK",
649 "KW_GOTO", "KW_JUMP", "KW_RETURN", "KW_BREAK", "KW_CONTINUE",
650 "KW_REGEXTEN", "KW_HINT", "KW_FOR", "KW_WHILE", "KW_CASE", "KW_PATTERN",
651 "KW_DEFAULT", "KW_CATCH", "KW_SWITCHES", "KW_ESWITCHES", "KW_INCLUDES",
652 "word", "$accept", "file", "objects", "object", "context_name",
653 "context", "opt_abstract", "macro", "globals", "global_statements",
654 "assignment", "@1", "arglist", "elements", "element", "ignorepat",
655 "extension", "statements", "timerange", "timespec", "test_expr", "@2",
656 "if_like_head", "word_list", "hint_word", "word3_list", "goto_word",
657 "switch_statement", "statement", "@3", "@4", "@5", "@6", "opt_else",
658 "target", "opt_pri", "jumptarget", "macro_call", "@7",
659 "application_call_head", "@8", "application_call", "opt_word",
660 "eval_arglist", "case_statements", "case_statement", "macro_statements",
661 "macro_statement", "switches", "eswitches", "switchlist",
662 "included_entry", "includeslist", "includes", 0
664 #endif
666 # ifdef YYPRINT
667 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
668 token YYLEX-NUM. */
669 static const yytype_uint16 yytoknum[] =
671 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
672 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
673 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
674 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
675 295, 296, 297
677 # endif
679 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
680 static const yytype_uint8 yyr1[] =
682 0, 43, 44, 45, 45, 45, 46, 46, 46, 46,
683 47, 47, 48, 49, 49, 49, 49, 49, 50, 51,
684 52, 52, 52, 54, 53, 55, 55, 55, 55, 56,
685 56, 56, 57, 57, 57, 57, 57, 57, 57, 57,
686 58, 59, 59, 59, 59, 60, 60, 60, 61, 61,
687 62, 64, 63, 65, 65, 65, 66, 66, 67, 67,
688 67, 67, 68, 68, 68, 69, 69, 69, 70, 71,
689 71, 71, 71, 71, 72, 73, 74, 71, 71, 71,
690 71, 71, 71, 75, 71, 71, 71, 71, 71, 71,
691 76, 76, 77, 77, 77, 77, 77, 77, 77, 78,
692 78, 79, 79, 81, 80, 80, 83, 82, 84, 84,
693 85, 85, 86, 86, 86, 87, 87, 88, 88, 88,
694 89, 89, 90, 90, 90, 91, 92, 93, 93, 93,
695 93, 94, 94, 95, 95, 95, 96, 96
698 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
699 static const yytype_uint8 yyr2[] =
701 0, 2, 1, 1, 2, 2, 1, 1, 1, 1,
702 1, 1, 6, 1, 0, 1, 2, 2, 8, 4,
703 0, 2, 2, 0, 5, 0, 1, 3, 2, 0,
704 2, 2, 1, 1, 1, 1, 1, 1, 2, 1,
705 4, 3, 4, 7, 8, 0, 2, 2, 5, 1,
706 7, 0, 4, 2, 2, 4, 1, 2, 1, 2,
707 3, 3, 1, 2, 3, 1, 2, 3, 5, 3,
708 1, 3, 3, 2, 0, 0, 0, 12, 3, 1,
709 3, 2, 2, 0, 5, 2, 2, 2, 3, 1,
710 2, 0, 1, 3, 3, 5, 5, 5, 5, 0,
711 2, 2, 4, 0, 5, 3, 0, 3, 3, 2,
712 1, 0, 1, 0, 3, 0, 2, 4, 3, 4,
713 0, 2, 1, 1, 5, 4, 4, 0, 3, 5,
714 2, 1, 3, 2, 3, 2, 4, 3
717 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
718 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
719 means the default is an error. */
720 static const yytype_uint8 yydefact[] =
722 14, 9, 0, 0, 13, 15, 0, 0, 3, 6,
723 0, 7, 8, 0, 0, 17, 16, 1, 5, 4,
724 0, 25, 0, 0, 0, 0, 11, 10, 0, 26,
725 0, 22, 23, 19, 21, 0, 28, 0, 0, 0,
726 0, 39, 0, 0, 0, 0, 0, 0, 0, 37,
727 0, 0, 36, 32, 34, 35, 33, 120, 27, 0,
728 31, 0, 0, 0, 0, 0, 0, 0, 38, 0,
729 12, 30, 0, 89, 0, 0, 0, 0, 0, 0,
730 0, 0, 0, 0, 0, 0, 0, 0, 70, 0,
731 79, 122, 113, 0, 0, 120, 123, 24, 0, 0,
732 0, 58, 0, 0, 0, 0, 0, 137, 131, 0,
733 0, 41, 0, 0, 0, 0, 0, 51, 0, 53,
734 0, 54, 0, 65, 92, 0, 99, 0, 86, 85,
735 87, 74, 0, 0, 106, 82, 73, 91, 109, 56,
736 112, 0, 81, 83, 18, 121, 40, 0, 42, 0,
737 0, 0, 59, 130, 0, 0, 125, 126, 0, 133,
738 135, 136, 0, 47, 69, 46, 103, 80, 0, 115,
739 49, 0, 0, 0, 0, 0, 66, 0, 0, 0,
740 71, 0, 101, 72, 0, 78, 0, 107, 0, 88,
741 57, 108, 111, 0, 0, 0, 60, 61, 128, 0,
742 132, 134, 105, 113, 0, 0, 0, 0, 0, 115,
743 63, 0, 55, 0, 0, 0, 94, 67, 93, 100,
744 0, 0, 0, 90, 110, 114, 0, 0, 0, 0,
745 0, 52, 0, 0, 0, 68, 116, 64, 62, 0,
746 0, 0, 0, 0, 0, 102, 75, 124, 84, 0,
747 43, 129, 104, 0, 0, 118, 0, 0, 98, 97,
748 96, 95, 0, 44, 117, 119, 0, 48, 0, 0,
749 76, 50, 0, 0, 0, 77
752 /* YYDEFGOTO[NTERM-NUM]. */
753 static const yytype_int16 yydefgoto[] =
755 -1, 6, 7, 8, 108, 9, 10, 11, 12, 24,
756 88, 39, 30, 50, 51, 52, 53, 113, 171, 172,
757 118, 168, 89, 140, 102, 173, 124, 90, 114, 184,
758 262, 272, 193, 189, 125, 182, 127, 116, 203, 92,
759 187, 93, 225, 141, 208, 209, 94, 95, 54, 55,
760 105, 109, 110, 56
763 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
764 STATE-NUM. */
765 #define YYPACT_NINF -206
766 static const yytype_int16 yypact[] =
768 65, -206, 2, 64, -1, 70, 84, 231, -206, -206,
769 108, -206, -206, 120, 13, -206, -206, -206, -206, -206,
770 29, 88, 13, 130, 163, 13, -206, -206, 165, -206,
771 75, -206, -206, -206, -206, 8, -206, 171, 134, 136,
772 8, -206, 154, -22, 178, 182, 186, 189, 61, -206,
773 200, 8, -206, -206, -206, -206, -206, 169, -206, 198,
774 -206, 152, 203, 187, 177, 14, 14, 23, -206, 196,
775 -206, -206, 128, -206, 179, 207, 207, 214, 207, 58,
776 185, 220, 225, 227, 230, 207, 195, 174, -206, 196,
777 -206, -206, 17, 94, 235, 169, -206, -206, 233, 177,
778 196, -206, 19, 14, 55, 237, 238, -206, 232, 236,
779 16, -206, 86, 243, 86, 244, 241, -206, 247, -206,
780 210, -206, 97, 211, 24, 248, 107, 249, -206, -206,
781 -206, -206, 196, 254, -206, -206, -206, 239, -206, 217,
782 -206, 117, -206, -206, -206, -206, -206, 67, -206, 219,
783 221, 222, -206, -206, 14, 223, -206, -206, 210, -206,
784 -206, -206, 258, -206, -206, -206, 255, -206, 226, 106,
785 0, 256, 260, 259, 185, 185, -206, 185, 229, 185,
786 -206, 234, 261, -206, 240, -206, 128, -206, 196, -206,
787 -206, -206, 242, 245, 246, 252, -206, -206, -206, 264,
788 -206, -206, -206, 226, 266, 250, 251, 263, 273, 106,
789 253, 257, -206, 257, 142, 138, 149, -206, 161, -206,
790 29, 271, 275, -206, -206, -206, 277, 265, 196, 14,
791 127, -206, 270, 272, 86, -206, -206, -206, 262, 276,
792 280, 185, 185, 185, 185, -206, -206, -206, -206, 196,
793 -206, -206, -206, 86, 86, -206, 257, 257, 283, 283,
794 283, 283, 267, -206, -206, -206, 284, -206, 278, 257,
795 -206, -206, 268, 289, 196, -206
798 /* YYPGOTO[NTERM-NUM]. */
799 static const yytype_int16 yypgoto[] =
801 -206, -206, -206, 291, -19, -206, -206, -206, -206, 113,
802 32, -206, -206, -18, -206, -206, -206, -109, -206, 143,
803 -49, -206, -206, 132, 204, -205, -78, -206, -57, -206,
804 -206, -206, -206, -206, -206, -206, -206, -206, -206, -206,
805 -206, -206, -206, 99, 96, -206, 212, -206, -206, -206,
806 -62, 201, -206, -50
809 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
810 positive, shift that token. If negative, reduce the rule which
811 number is the opposite. If zero, do what YYDEFACT says.
812 If YYTABLE_NINF, syntax error. */
813 #define YYTABLE_NINF -128
814 static const yytype_int16 yytable[] =
816 91, 28, 126, 163, 106, 165, 239, 96, 240, 40,
817 62, -62, 111, -29, 22, 103, 41, 160, -20, -127,
818 63, 161, 60, 15, 138, 42, 149, 119, 107, 121,
819 150, 151, 137, 71, 177, 178, 132, 179, 91, 43,
820 44, 153, 210, 148, 13, 96, 25, 45, 46, 47,
821 48, 266, 267, 26, 25, 23, 104, 25, 27, 139,
822 26, 152, 68, 154, 271, 27, 26, 49, 14, 155,
823 32, 27, 49, 1, 194, 185, 36, 222, 150, 151,
824 2, 3, 37, 49, 17, 38, 69, 112, 4, 5,
825 72, -45, 198, 16, 73, 122, 214, 215, 74, 216,
826 123, 218, 142, 143, 75, 76, 77, 174, 78, 152,
827 175, 20, 79, 80, 81, 82, 83, 181, 178, 84,
828 85, -45, -45, -45, 191, 255, 21, 192, 87, 112,
829 29, 223, 72, -45, 252, 31, 73, 192, 34, 32,
830 74, 205, 206, 207, 264, 265, 75, 76, 77, 178,
831 78, 242, 241, 178, 79, 80, 81, 82, 83, 243,
832 178, 84, 85, 258, 259, 260, 261, 251, 33, 35,
833 87, 250, 178, 72, 244, 57, 58, 73, 59, 61,
834 134, 74, 135, 32, 64, 136, 65, 75, 76, 77,
835 66, 78, 263, 67, 98, 79, 80, 81, 82, 83,
836 72, 245, 84, 85, 73, 70, 97, 86, 74, 99,
837 47, 87, 100, 117, 75, 76, 77, 275, 78, 101,
838 120, 115, 79, 80, 81, 82, 83, 123, 128, 84,
839 85, -2, 18, 129, -14, 130, 131, 133, 87, 1,
840 144, 146, 156, 157, 159, 158, 2, 3, 164, 167,
841 166, 169, 170, 176, 4, 5, 180, 183, 186, 190,
842 188, 195, 202, 196, 197, 199, 201, 212, 139, 211,
843 213, 217, 229, 231, 234, 220, 219, 228, 235, 246,
844 247, 253, 221, 254, 224, 248, 270, 226, 227, 256,
845 249, 257, 232, 233, 178, 237, 274, 269, 19, 238,
846 204, 200, 230, 147, 210, 236, 0, 145, 0, 268,
847 273, 162
850 static const yytype_int16 yycheck[] =
852 57, 20, 80, 112, 66, 114, 211, 57, 213, 1,
853 32, 11, 69, 5, 1, 1, 8, 1, 5, 5,
854 42, 5, 40, 24, 7, 17, 7, 76, 5, 78,
855 11, 12, 89, 51, 10, 11, 85, 13, 95, 31,
856 32, 103, 42, 100, 42, 95, 14, 39, 40, 41,
857 42, 256, 257, 37, 22, 42, 42, 25, 42, 42,
858 37, 42, 1, 8, 269, 42, 37, 35, 4, 14,
859 9, 42, 40, 8, 7, 132, 1, 186, 11, 12,
860 15, 16, 7, 51, 0, 10, 25, 1, 23, 24,
861 4, 5, 154, 23, 8, 37, 174, 175, 12, 177,
862 42, 179, 8, 9, 18, 19, 20, 10, 22, 42,
863 13, 3, 26, 27, 28, 29, 30, 10, 11, 33,
864 34, 35, 36, 37, 7, 234, 6, 10, 42, 1,
865 42, 188, 4, 5, 7, 22, 8, 10, 25, 9,
866 12, 35, 36, 37, 253, 254, 18, 19, 20, 11,
867 22, 13, 10, 11, 26, 27, 28, 29, 30, 10,
868 11, 33, 34, 241, 242, 243, 244, 229, 5, 4,
869 42, 228, 11, 4, 13, 4, 42, 8, 42, 25,
870 6, 12, 8, 9, 6, 11, 4, 18, 19, 20,
871 4, 22, 249, 4, 42, 26, 27, 28, 29, 30,
872 4, 220, 33, 34, 8, 5, 8, 38, 12, 6,
873 41, 42, 25, 6, 18, 19, 20, 274, 22, 42,
874 6, 42, 26, 27, 28, 29, 30, 42, 8, 33,
875 34, 0, 1, 8, 3, 8, 6, 42, 42, 8,
876 5, 8, 5, 5, 8, 13, 15, 16, 5, 8,
877 6, 4, 42, 42, 23, 24, 8, 8, 4, 42,
878 21, 42, 7, 42, 42, 42, 8, 7, 42, 13,
879 11, 42, 8, 7, 11, 14, 42, 25, 5, 8,
880 5, 11, 42, 11, 42, 8, 8, 42, 42, 13,
881 25, 11, 42, 42, 11, 42, 7, 13, 7, 42,
882 168, 158, 203, 99, 42, 209, -1, 95, -1, 42,
883 42, 110
886 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
887 symbol of state STATE-NUM. */
888 static const yytype_uint8 yystos[] =
890 0, 8, 15, 16, 23, 24, 44, 45, 46, 48,
891 49, 50, 51, 42, 4, 24, 23, 0, 1, 46,
892 3, 6, 1, 42, 52, 53, 37, 42, 47, 42,
893 55, 52, 9, 5, 52, 4, 1, 7, 10, 54,
894 1, 8, 17, 31, 32, 39, 40, 41, 42, 53,
895 56, 57, 58, 59, 91, 92, 96, 4, 42, 42,
896 56, 25, 32, 42, 6, 4, 4, 4, 1, 25,
897 5, 56, 4, 8, 12, 18, 19, 20, 22, 26,
898 27, 28, 29, 30, 33, 34, 38, 42, 53, 65,
899 70, 71, 82, 84, 89, 90, 96, 8, 42, 6,
900 25, 42, 67, 1, 42, 93, 93, 5, 47, 94,
901 95, 71, 1, 60, 71, 42, 80, 6, 63, 63,
902 6, 63, 37, 42, 69, 77, 69, 79, 8, 8,
903 8, 6, 63, 42, 6, 8, 11, 71, 7, 42,
904 66, 86, 8, 9, 5, 89, 8, 67, 71, 7,
905 11, 12, 42, 93, 8, 14, 5, 5, 13, 8,
906 1, 5, 94, 60, 5, 60, 6, 8, 64, 4,
907 42, 61, 62, 68, 10, 13, 42, 10, 11, 13,
908 8, 10, 78, 8, 72, 71, 4, 83, 21, 76,
909 42, 7, 10, 75, 7, 42, 42, 42, 93, 42,
910 62, 8, 7, 81, 66, 35, 36, 37, 87, 88,
911 42, 13, 7, 11, 69, 69, 69, 42, 69, 42,
912 14, 42, 60, 71, 42, 85, 42, 42, 25, 8,
913 86, 7, 42, 42, 11, 5, 87, 42, 42, 68,
914 68, 10, 13, 10, 13, 47, 8, 5, 8, 25,
915 71, 93, 7, 11, 11, 60, 13, 11, 69, 69,
916 69, 69, 73, 71, 60, 60, 68, 68, 42, 13,
917 8, 68, 74, 42, 7, 71
920 #define yyerrok (yyerrstatus = 0)
921 #define yyclearin (yychar = YYEMPTY)
922 #define YYEMPTY (-2)
923 #define YYEOF 0
925 #define YYACCEPT goto yyacceptlab
926 #define YYABORT goto yyabortlab
927 #define YYERROR goto yyerrorlab
930 /* Like YYERROR except do call yyerror. This remains here temporarily
931 to ease the transition to the new meaning of YYERROR, for GCC.
932 Once GCC version 2 has supplanted version 1, this can go. */
934 #define YYFAIL goto yyerrlab
936 #define YYRECOVERING() (!!yyerrstatus)
938 #define YYBACKUP(Token, Value) \
939 do \
940 if (yychar == YYEMPTY && yylen == 1) \
942 yychar = (Token); \
943 yylval = (Value); \
944 yytoken = YYTRANSLATE (yychar); \
945 YYPOPSTACK (1); \
946 goto yybackup; \
948 else \
950 yyerror (&yylloc, parseio, YY_("syntax error: cannot back up")); \
951 YYERROR; \
953 while (YYID (0))
956 #define YYTERROR 1
957 #define YYERRCODE 256
960 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
961 If N is 0, then set CURRENT to the empty location which ends
962 the previous symbol: RHS[0] (always defined). */
964 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
965 #ifndef YYLLOC_DEFAULT
966 # define YYLLOC_DEFAULT(Current, Rhs, N) \
967 do \
968 if (YYID (N)) \
970 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
971 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
972 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
973 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
975 else \
977 (Current).first_line = (Current).last_line = \
978 YYRHSLOC (Rhs, 0).last_line; \
979 (Current).first_column = (Current).last_column = \
980 YYRHSLOC (Rhs, 0).last_column; \
982 while (YYID (0))
983 #endif
986 /* YY_LOCATION_PRINT -- Print the location on the stream.
987 This macro was not mandated originally: define only if we know
988 we won't break user code: when these are the locations we know. */
990 #ifndef YY_LOCATION_PRINT
991 # if YYLTYPE_IS_TRIVIAL
992 # define YY_LOCATION_PRINT(File, Loc) \
993 fprintf (File, "%d.%d-%d.%d", \
994 (Loc).first_line, (Loc).first_column, \
995 (Loc).last_line, (Loc).last_column)
996 # else
997 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
998 # endif
999 #endif
1002 /* YYLEX -- calling `yylex' with the right arguments. */
1004 #ifdef YYLEX_PARAM
1005 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
1006 #else
1007 # define YYLEX yylex (&yylval, &yylloc)
1008 #endif
1010 /* Enable debugging if requested. */
1011 #if YYDEBUG
1013 # ifndef YYFPRINTF
1014 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1015 # define YYFPRINTF fprintf
1016 # endif
1018 # define YYDPRINTF(Args) \
1019 do { \
1020 if (yydebug) \
1021 YYFPRINTF Args; \
1022 } while (YYID (0))
1024 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1025 do { \
1026 if (yydebug) \
1028 YYFPRINTF (stderr, "%s ", Title); \
1029 yy_symbol_print (stderr, \
1030 Type, Value, Location, parseio); \
1031 YYFPRINTF (stderr, "\n"); \
1033 } while (YYID (0))
1036 /*--------------------------------.
1037 | Print this symbol on YYOUTPUT. |
1038 `--------------------------------*/
1040 /*ARGSUSED*/
1041 #if (defined __STDC__ || defined __C99__FUNC__ \
1042 || defined __cplusplus || defined _MSC_VER)
1043 static void
1044 yy_symbol_value_print (FILE *yyoutput, int yytype, const YYSTYPE * const yyvaluep, const YYLTYPE * const yylocationp, struct parse_io *parseio)
1045 #else
1046 static void
1047 yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, parseio)
1048 FILE *yyoutput;
1049 int yytype;
1050 const YYSTYPE * const yyvaluep;
1051 const YYLTYPE * const yylocationp;
1052 struct parse_io *parseio;
1053 #endif
1055 if (!yyvaluep)
1056 return;
1057 YYUSE (yylocationp);
1058 YYUSE (parseio);
1059 # ifdef YYPRINT
1060 if (yytype < YYNTOKENS)
1061 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1062 # else
1063 YYUSE (yyoutput);
1064 # endif
1065 switch (yytype)
1067 default:
1068 break;
1073 /*--------------------------------.
1074 | Print this symbol on YYOUTPUT. |
1075 `--------------------------------*/
1077 #if (defined __STDC__ || defined __C99__FUNC__ \
1078 || defined __cplusplus || defined _MSC_VER)
1079 static void
1080 yy_symbol_print (FILE *yyoutput, int yytype, const YYSTYPE * const yyvaluep, const YYLTYPE * const yylocationp, struct parse_io *parseio)
1081 #else
1082 static void
1083 yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp, parseio)
1084 FILE *yyoutput;
1085 int yytype;
1086 const YYSTYPE * const yyvaluep;
1087 const YYLTYPE * const yylocationp;
1088 struct parse_io *parseio;
1089 #endif
1091 if (yytype < YYNTOKENS)
1092 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1093 else
1094 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1096 YY_LOCATION_PRINT (yyoutput, *yylocationp);
1097 YYFPRINTF (yyoutput, ": ");
1098 yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, parseio);
1099 YYFPRINTF (yyoutput, ")");
1102 /*------------------------------------------------------------------.
1103 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1104 | TOP (included). |
1105 `------------------------------------------------------------------*/
1107 #if (defined __STDC__ || defined __C99__FUNC__ \
1108 || defined __cplusplus || defined _MSC_VER)
1109 static void
1110 yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
1111 #else
1112 static void
1113 yy_stack_print (bottom, top)
1114 yytype_int16 *bottom;
1115 yytype_int16 *top;
1116 #endif
1118 YYFPRINTF (stderr, "Stack now");
1119 for (; bottom <= top; ++bottom)
1120 YYFPRINTF (stderr, " %d", *bottom);
1121 YYFPRINTF (stderr, "\n");
1124 # define YY_STACK_PRINT(Bottom, Top) \
1125 do { \
1126 if (yydebug) \
1127 yy_stack_print ((Bottom), (Top)); \
1128 } while (YYID (0))
1131 /*------------------------------------------------.
1132 | Report that the YYRULE is going to be reduced. |
1133 `------------------------------------------------*/
1135 #if (defined __STDC__ || defined __C99__FUNC__ \
1136 || defined __cplusplus || defined _MSC_VER)
1137 static void
1138 yy_reduce_print (YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, struct parse_io *parseio)
1139 #else
1140 static void
1141 yy_reduce_print (yyvsp, yylsp, yyrule, parseio)
1142 YYSTYPE *yyvsp;
1143 YYLTYPE *yylsp;
1144 int yyrule;
1145 struct parse_io *parseio;
1146 #endif
1148 int yynrhs = yyr2[yyrule];
1149 int yyi;
1150 unsigned long int yylno = yyrline[yyrule];
1151 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1152 yyrule - 1, yylno);
1153 /* The symbols being reduced. */
1154 for (yyi = 0; yyi < yynrhs; yyi++)
1156 fprintf (stderr, " $%d = ", yyi + 1);
1157 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1158 &(yyvsp[(yyi + 1) - (yynrhs)])
1159 , &(yylsp[(yyi + 1) - (yynrhs)]) , parseio);
1160 fprintf (stderr, "\n");
1164 # define YY_REDUCE_PRINT(Rule) \
1165 do { \
1166 if (yydebug) \
1167 yy_reduce_print (yyvsp, yylsp, Rule, parseio); \
1168 } while (YYID (0))
1170 /* Nonzero means print parse trace. It is left uninitialized so that
1171 multiple parsers can coexist. */
1172 int yydebug;
1173 #else /* !YYDEBUG */
1174 # define YYDPRINTF(Args)
1175 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1176 # define YY_STACK_PRINT(Bottom, Top)
1177 # define YY_REDUCE_PRINT(Rule)
1178 #endif /* !YYDEBUG */
1181 /* YYINITDEPTH -- initial size of the parser's stacks. */
1182 #ifndef YYINITDEPTH
1183 # define YYINITDEPTH 200
1184 #endif
1186 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1187 if the built-in stack extension method is used).
1189 Do not make this value too large; the results are undefined if
1190 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1191 evaluated with infinite-precision integer arithmetic. */
1193 #ifndef YYMAXDEPTH
1194 # define YYMAXDEPTH 10000
1195 #endif
1199 #if YYERROR_VERBOSE
1201 # ifndef yystrlen
1202 # if defined __GLIBC__ && defined _STRING_H
1203 # define yystrlen strlen
1204 # else
1205 /* Return the length of YYSTR. */
1206 #if (defined __STDC__ || defined __C99__FUNC__ \
1207 || defined __cplusplus || defined _MSC_VER)
1208 static YYSIZE_T
1209 yystrlen (const char *yystr)
1210 #else
1211 static YYSIZE_T
1212 yystrlen (yystr)
1213 const char *yystr;
1214 #endif
1216 YYSIZE_T yylen;
1217 for (yylen = 0; yystr[yylen]; yylen++)
1218 continue;
1219 return yylen;
1221 # endif
1222 # endif
1224 # ifndef yystpcpy
1225 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1226 # define yystpcpy stpcpy
1227 # else
1228 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1229 YYDEST. */
1230 #if (defined __STDC__ || defined __C99__FUNC__ \
1231 || defined __cplusplus || defined _MSC_VER)
1232 static char *
1233 yystpcpy (char *yydest, const char *yysrc)
1234 #else
1235 static char *
1236 yystpcpy (yydest, yysrc)
1237 char *yydest;
1238 const char *yysrc;
1239 #endif
1241 char *yyd = yydest;
1242 const char *yys = yysrc;
1244 while ((*yyd++ = *yys++) != '\0')
1245 continue;
1247 return yyd - 1;
1249 # endif
1250 # endif
1252 # ifndef yytnamerr
1253 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1254 quotes and backslashes, so that it's suitable for yyerror. The
1255 heuristic is that double-quoting is unnecessary unless the string
1256 contains an apostrophe, a comma, or backslash (other than
1257 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1258 null, do not copy; instead, return the length of what the result
1259 would have been. */
1260 static YYSIZE_T
1261 yytnamerr (char *yyres, const char *yystr)
1263 if (*yystr == '"')
1265 size_t yyn = 0;
1266 char const *yyp = yystr;
1268 for (;;)
1269 switch (*++yyp)
1271 case '\'':
1272 case ',':
1273 goto do_not_strip_quotes;
1275 case '\\':
1276 if (*++yyp != '\\')
1277 goto do_not_strip_quotes;
1278 /* Fall through. */
1279 default:
1280 if (yyres)
1281 yyres[yyn] = *yyp;
1282 yyn++;
1283 break;
1285 case '"':
1286 if (yyres)
1287 yyres[yyn] = '\0';
1288 return yyn;
1290 do_not_strip_quotes: ;
1293 if (! yyres)
1294 return yystrlen (yystr);
1296 return yystpcpy (yyres, yystr) - yyres;
1298 # endif
1300 /* Copy into YYRESULT an error message about the unexpected token
1301 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1302 including the terminating null byte. If YYRESULT is null, do not
1303 copy anything; just return the number of bytes that would be
1304 copied. As a special case, return 0 if an ordinary "syntax error"
1305 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1306 size calculation. */
1307 static YYSIZE_T
1308 yysyntax_error (char *yyresult, int yystate, int yychar)
1310 int yyn = yypact[yystate];
1312 if (! (YYPACT_NINF < yyn && yyn < YYLAST))
1313 return 0;
1314 else
1316 int yytype = YYTRANSLATE (yychar);
1317 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1318 YYSIZE_T yysize = yysize0;
1319 YYSIZE_T yysize1;
1320 int yysize_overflow = 0;
1321 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1322 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1323 int yyx;
1325 # if 0
1326 /* This is so xgettext sees the translatable formats that are
1327 constructed on the fly. */
1328 YY_("syntax error, unexpected %s");
1329 YY_("syntax error, unexpected %s, expecting %s");
1330 YY_("syntax error, unexpected %s, expecting %s or %s");
1331 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1332 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1333 # endif
1334 char *yyfmt;
1335 char const *yyf;
1336 static char const yyunexpected[] = "syntax error, unexpected %s";
1337 static char const yyexpecting[] = ", expecting %s";
1338 static char const yyor[] = " or %s";
1339 char yyformat[sizeof yyunexpected
1340 + sizeof yyexpecting - 1
1341 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1342 * (sizeof yyor - 1))];
1343 char const *yyprefix = yyexpecting;
1345 /* Start YYX at -YYN if negative to avoid negative indexes in
1346 YYCHECK. */
1347 int yyxbegin = yyn < 0 ? -yyn : 0;
1349 /* Stay within bounds of both yycheck and yytname. */
1350 int yychecklim = YYLAST - yyn;
1351 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1352 int yycount = 1;
1354 yyarg[0] = yytname[yytype];
1355 yyfmt = yystpcpy (yyformat, yyunexpected);
1357 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1358 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1360 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1362 yycount = 1;
1363 yysize = yysize0;
1364 yyformat[sizeof yyunexpected - 1] = '\0';
1365 break;
1367 yyarg[yycount++] = yytname[yyx];
1368 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1369 yysize_overflow |= (yysize1 < yysize);
1370 yysize = yysize1;
1371 yyfmt = yystpcpy (yyfmt, yyprefix);
1372 yyprefix = yyor;
1375 yyf = YY_(yyformat);
1376 yysize1 = yysize + yystrlen (yyf);
1377 yysize_overflow |= (yysize1 < yysize);
1378 yysize = yysize1;
1380 if (yysize_overflow)
1381 return YYSIZE_MAXIMUM;
1383 if (yyresult)
1385 /* Avoid sprintf, as that infringes on the user's name space.
1386 Don't have undefined behavior even if the translation
1387 produced a string with the wrong number of "%s"s. */
1388 char *yyp = yyresult;
1389 int yyi = 0;
1390 while ((*yyp = *yyf) != '\0')
1392 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1394 yyp += yytnamerr (yyp, yyarg[yyi++]);
1395 yyf += 2;
1397 else
1399 yyp++;
1400 yyf++;
1404 return yysize;
1407 #endif /* YYERROR_VERBOSE */
1410 /*-----------------------------------------------.
1411 | Release the memory associated to this symbol. |
1412 `-----------------------------------------------*/
1414 /*ARGSUSED*/
1415 #if (defined __STDC__ || defined __C99__FUNC__ \
1416 || defined __cplusplus || defined _MSC_VER)
1417 static void
1418 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, struct parse_io *parseio)
1419 #else
1420 static void
1421 yydestruct (yymsg, yytype, yyvaluep, yylocationp, parseio)
1422 const char *yymsg;
1423 int yytype;
1424 YYSTYPE *yyvaluep;
1425 YYLTYPE *yylocationp;
1426 struct parse_io *parseio;
1427 #endif
1429 YYUSE (yyvaluep);
1430 YYUSE (yylocationp);
1431 YYUSE (parseio);
1433 if (!yymsg)
1434 yymsg = "Deleting";
1435 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1437 switch (yytype)
1439 case 42: /* "word" */
1440 #line 177 "ael.y"
1441 { free((yyvaluep->str));};
1442 #line 1443 "ael.tab.c"
1443 break;
1444 case 45: /* "objects" */
1445 #line 164 "ael.y"
1447 destroy_pval((yyvaluep->pval));
1448 prev_word=0;
1450 #line 1451 "ael.tab.c"
1451 break;
1452 case 46: /* "object" */
1453 #line 164 "ael.y"
1455 destroy_pval((yyvaluep->pval));
1456 prev_word=0;
1458 #line 1459 "ael.tab.c"
1459 break;
1460 case 47: /* "context_name" */
1461 #line 177 "ael.y"
1462 { free((yyvaluep->str));};
1463 #line 1464 "ael.tab.c"
1464 break;
1465 case 48: /* "context" */
1466 #line 164 "ael.y"
1468 destroy_pval((yyvaluep->pval));
1469 prev_word=0;
1471 #line 1472 "ael.tab.c"
1472 break;
1473 case 50: /* "macro" */
1474 #line 164 "ael.y"
1476 destroy_pval((yyvaluep->pval));
1477 prev_word=0;
1479 #line 1480 "ael.tab.c"
1480 break;
1481 case 51: /* "globals" */
1482 #line 164 "ael.y"
1484 destroy_pval((yyvaluep->pval));
1485 prev_word=0;
1487 #line 1488 "ael.tab.c"
1488 break;
1489 case 52: /* "global_statements" */
1490 #line 164 "ael.y"
1492 destroy_pval((yyvaluep->pval));
1493 prev_word=0;
1495 #line 1496 "ael.tab.c"
1496 break;
1497 case 53: /* "assignment" */
1498 #line 164 "ael.y"
1500 destroy_pval((yyvaluep->pval));
1501 prev_word=0;
1503 #line 1504 "ael.tab.c"
1504 break;
1505 case 55: /* "arglist" */
1506 #line 164 "ael.y"
1508 destroy_pval((yyvaluep->pval));
1509 prev_word=0;
1511 #line 1512 "ael.tab.c"
1512 break;
1513 case 56: /* "elements" */
1514 #line 164 "ael.y"
1516 destroy_pval((yyvaluep->pval));
1517 prev_word=0;
1519 #line 1520 "ael.tab.c"
1520 break;
1521 case 57: /* "element" */
1522 #line 164 "ael.y"
1524 destroy_pval((yyvaluep->pval));
1525 prev_word=0;
1527 #line 1528 "ael.tab.c"
1528 break;
1529 case 58: /* "ignorepat" */
1530 #line 164 "ael.y"
1532 destroy_pval((yyvaluep->pval));
1533 prev_word=0;
1535 #line 1536 "ael.tab.c"
1536 break;
1537 case 59: /* "extension" */
1538 #line 164 "ael.y"
1540 destroy_pval((yyvaluep->pval));
1541 prev_word=0;
1543 #line 1544 "ael.tab.c"
1544 break;
1545 case 60: /* "statements" */
1546 #line 164 "ael.y"
1548 destroy_pval((yyvaluep->pval));
1549 prev_word=0;
1551 #line 1552 "ael.tab.c"
1552 break;
1553 case 61: /* "timerange" */
1554 #line 177 "ael.y"
1555 { free((yyvaluep->str));};
1556 #line 1557 "ael.tab.c"
1557 break;
1558 case 62: /* "timespec" */
1559 #line 164 "ael.y"
1561 destroy_pval((yyvaluep->pval));
1562 prev_word=0;
1564 #line 1565 "ael.tab.c"
1565 break;
1566 case 63: /* "test_expr" */
1567 #line 177 "ael.y"
1568 { free((yyvaluep->str));};
1569 #line 1570 "ael.tab.c"
1570 break;
1571 case 65: /* "if_like_head" */
1572 #line 164 "ael.y"
1574 destroy_pval((yyvaluep->pval));
1575 prev_word=0;
1577 #line 1578 "ael.tab.c"
1578 break;
1579 case 66: /* "word_list" */
1580 #line 177 "ael.y"
1581 { free((yyvaluep->str));};
1582 #line 1583 "ael.tab.c"
1583 break;
1584 case 68: /* "word3_list" */
1585 #line 177 "ael.y"
1586 { free((yyvaluep->str));};
1587 #line 1588 "ael.tab.c"
1588 break;
1589 case 69: /* "goto_word" */
1590 #line 177 "ael.y"
1591 { free((yyvaluep->str));};
1592 #line 1593 "ael.tab.c"
1593 break;
1594 case 70: /* "switch_statement" */
1595 #line 164 "ael.y"
1597 destroy_pval((yyvaluep->pval));
1598 prev_word=0;
1600 #line 1601 "ael.tab.c"
1601 break;
1602 case 71: /* "statement" */
1603 #line 164 "ael.y"
1605 destroy_pval((yyvaluep->pval));
1606 prev_word=0;
1608 #line 1609 "ael.tab.c"
1609 break;
1610 case 76: /* "opt_else" */
1611 #line 164 "ael.y"
1613 destroy_pval((yyvaluep->pval));
1614 prev_word=0;
1616 #line 1617 "ael.tab.c"
1617 break;
1618 case 77: /* "target" */
1619 #line 164 "ael.y"
1621 destroy_pval((yyvaluep->pval));
1622 prev_word=0;
1624 #line 1625 "ael.tab.c"
1625 break;
1626 case 78: /* "opt_pri" */
1627 #line 177 "ael.y"
1628 { free((yyvaluep->str));};
1629 #line 1630 "ael.tab.c"
1630 break;
1631 case 79: /* "jumptarget" */
1632 #line 164 "ael.y"
1634 destroy_pval((yyvaluep->pval));
1635 prev_word=0;
1637 #line 1638 "ael.tab.c"
1638 break;
1639 case 80: /* "macro_call" */
1640 #line 164 "ael.y"
1642 destroy_pval((yyvaluep->pval));
1643 prev_word=0;
1645 #line 1646 "ael.tab.c"
1646 break;
1647 case 82: /* "application_call_head" */
1648 #line 164 "ael.y"
1650 destroy_pval((yyvaluep->pval));
1651 prev_word=0;
1653 #line 1654 "ael.tab.c"
1654 break;
1655 case 84: /* "application_call" */
1656 #line 164 "ael.y"
1658 destroy_pval((yyvaluep->pval));
1659 prev_word=0;
1661 #line 1662 "ael.tab.c"
1662 break;
1663 case 85: /* "opt_word" */
1664 #line 177 "ael.y"
1665 { free((yyvaluep->str));};
1666 #line 1667 "ael.tab.c"
1667 break;
1668 case 86: /* "eval_arglist" */
1669 #line 164 "ael.y"
1671 destroy_pval((yyvaluep->pval));
1672 prev_word=0;
1674 #line 1675 "ael.tab.c"
1675 break;
1676 case 87: /* "case_statements" */
1677 #line 164 "ael.y"
1679 destroy_pval((yyvaluep->pval));
1680 prev_word=0;
1682 #line 1683 "ael.tab.c"
1683 break;
1684 case 88: /* "case_statement" */
1685 #line 164 "ael.y"
1687 destroy_pval((yyvaluep->pval));
1688 prev_word=0;
1690 #line 1691 "ael.tab.c"
1691 break;
1692 case 89: /* "macro_statements" */
1693 #line 164 "ael.y"
1695 destroy_pval((yyvaluep->pval));
1696 prev_word=0;
1698 #line 1699 "ael.tab.c"
1699 break;
1700 case 90: /* "macro_statement" */
1701 #line 164 "ael.y"
1703 destroy_pval((yyvaluep->pval));
1704 prev_word=0;
1706 #line 1707 "ael.tab.c"
1707 break;
1708 case 91: /* "switches" */
1709 #line 164 "ael.y"
1711 destroy_pval((yyvaluep->pval));
1712 prev_word=0;
1714 #line 1715 "ael.tab.c"
1715 break;
1716 case 92: /* "eswitches" */
1717 #line 164 "ael.y"
1719 destroy_pval((yyvaluep->pval));
1720 prev_word=0;
1722 #line 1723 "ael.tab.c"
1723 break;
1724 case 93: /* "switchlist" */
1725 #line 164 "ael.y"
1727 destroy_pval((yyvaluep->pval));
1728 prev_word=0;
1730 #line 1731 "ael.tab.c"
1731 break;
1732 case 94: /* "included_entry" */
1733 #line 164 "ael.y"
1735 destroy_pval((yyvaluep->pval));
1736 prev_word=0;
1738 #line 1739 "ael.tab.c"
1739 break;
1740 case 95: /* "includeslist" */
1741 #line 164 "ael.y"
1743 destroy_pval((yyvaluep->pval));
1744 prev_word=0;
1746 #line 1747 "ael.tab.c"
1747 break;
1748 case 96: /* "includes" */
1749 #line 164 "ael.y"
1751 destroy_pval((yyvaluep->pval));
1752 prev_word=0;
1754 #line 1755 "ael.tab.c"
1755 break;
1757 default:
1758 break;
1763 /* Prevent warnings from -Wmissing-prototypes. */
1765 #ifdef YYPARSE_PARAM
1766 #if defined __STDC__ || defined __cplusplus
1767 int yyparse (void *YYPARSE_PARAM);
1768 #else
1769 int yyparse ();
1770 #endif
1771 #else /* ! YYPARSE_PARAM */
1772 #if defined __STDC__ || defined __cplusplus
1773 int yyparse (struct parse_io *parseio);
1774 #else
1775 int yyparse ();
1776 #endif
1777 #endif /* ! YYPARSE_PARAM */
1784 /*----------.
1785 | yyparse. |
1786 `----------*/
1788 #ifdef YYPARSE_PARAM
1789 #if (defined __STDC__ || defined __C99__FUNC__ \
1790 || defined __cplusplus || defined _MSC_VER)
1792 yyparse (void *YYPARSE_PARAM)
1793 #else
1795 yyparse (YYPARSE_PARAM)
1796 void *YYPARSE_PARAM;
1797 #endif
1798 #else /* ! YYPARSE_PARAM */
1799 #if (defined __STDC__ || defined __C99__FUNC__ \
1800 || defined __cplusplus || defined _MSC_VER)
1802 yyparse (struct parse_io *parseio)
1803 #else
1805 yyparse (parseio)
1806 struct parse_io *parseio;
1807 #endif
1808 #endif
1810 /* The look-ahead symbol. */
1811 int yychar;
1813 /* The semantic value of the look-ahead symbol. */
1814 YYSTYPE yylval;
1816 /* Number of syntax errors so far. */
1817 int yynerrs;
1818 /* Location data for the look-ahead symbol. */
1819 YYLTYPE yylloc;
1821 int yystate;
1822 int yyn;
1823 int yyresult;
1824 /* Number of tokens to shift before error messages enabled. */
1825 int yyerrstatus;
1826 /* Look-ahead token as an internal (translated) token number. */
1827 int yytoken = 0;
1828 #if YYERROR_VERBOSE
1829 /* Buffer for error messages, and its allocated size. */
1830 char yymsgbuf[128];
1831 char *yymsg = yymsgbuf;
1832 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1833 #endif
1835 /* Three stacks and their tools:
1836 `yyss': related to states,
1837 `yyvs': related to semantic values,
1838 `yyls': related to locations.
1840 Refer to the stacks thru separate pointers, to allow yyoverflow
1841 to reallocate them elsewhere. */
1843 /* The state stack. */
1844 yytype_int16 yyssa[YYINITDEPTH];
1845 yytype_int16 *yyss = yyssa;
1846 yytype_int16 *yyssp;
1848 /* The semantic value stack. */
1849 YYSTYPE yyvsa[YYINITDEPTH];
1850 YYSTYPE *yyvs = yyvsa;
1851 YYSTYPE *yyvsp;
1853 /* The location stack. */
1854 YYLTYPE yylsa[YYINITDEPTH];
1855 YYLTYPE *yyls = yylsa;
1856 YYLTYPE *yylsp;
1857 /* The locations where the error started and ended. */
1858 YYLTYPE yyerror_range[2];
1860 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1862 YYSIZE_T yystacksize = YYINITDEPTH;
1864 /* The variables used to return semantic value and location from the
1865 action routines. */
1866 YYSTYPE yyval;
1867 YYLTYPE yyloc;
1869 /* The number of symbols on the RHS of the reduced rule.
1870 Keep to zero when no symbol should be popped. */
1871 int yylen = 0;
1873 YYDPRINTF ((stderr, "Starting parse\n"));
1875 yystate = 0;
1876 yyerrstatus = 0;
1877 yynerrs = 0;
1878 yychar = YYEMPTY; /* Cause a token to be read. */
1880 /* Initialize stack pointers.
1881 Waste one element of value and location stack
1882 so that they stay on the same level as the state stack.
1883 The wasted elements are never initialized. */
1885 yyssp = yyss;
1886 yyvsp = yyvs;
1887 yylsp = yyls;
1888 #if YYLTYPE_IS_TRIVIAL
1889 /* Initialize the default location before parsing starts. */
1890 yylloc.first_line = yylloc.last_line = 1;
1891 yylloc.first_column = yylloc.last_column = 0;
1892 #endif
1894 goto yysetstate;
1896 /*------------------------------------------------------------.
1897 | yynewstate -- Push a new state, which is found in yystate. |
1898 `------------------------------------------------------------*/
1899 yynewstate:
1900 /* In all cases, when you get here, the value and location stacks
1901 have just been pushed. So pushing a state here evens the stacks. */
1902 yyssp++;
1904 yysetstate:
1905 *yyssp = yystate;
1907 if (yyss + yystacksize - 1 <= yyssp)
1909 /* Get the current used size of the three stacks, in elements. */
1910 YYSIZE_T yysize = yyssp - yyss + 1;
1912 #ifdef yyoverflow
1914 /* Give user a chance to reallocate the stack. Use copies of
1915 these so that the &'s don't force the real ones into
1916 memory. */
1917 YYSTYPE *yyvs1 = yyvs;
1918 yytype_int16 *yyss1 = yyss;
1919 YYLTYPE *yyls1 = yyls;
1921 /* Each stack pointer address is followed by the size of the
1922 data in use in that stack, in bytes. This used to be a
1923 conditional around just the two extra args, but that might
1924 be undefined if yyoverflow is a macro. */
1925 yyoverflow (YY_("memory exhausted"),
1926 &yyss1, yysize * sizeof (*yyssp),
1927 &yyvs1, yysize * sizeof (*yyvsp),
1928 &yyls1, yysize * sizeof (*yylsp),
1929 &yystacksize);
1930 yyls = yyls1;
1931 yyss = yyss1;
1932 yyvs = yyvs1;
1934 #else /* no yyoverflow */
1935 # ifndef YYSTACK_RELOCATE
1936 goto yyexhaustedlab;
1937 # else
1938 /* Extend the stack our own way. */
1939 if (YYMAXDEPTH <= yystacksize)
1940 goto yyexhaustedlab;
1941 yystacksize *= 2;
1942 if (YYMAXDEPTH < yystacksize)
1943 yystacksize = YYMAXDEPTH;
1946 yytype_int16 *yyss1 = yyss;
1947 union yyalloc *yyptr =
1948 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1949 if (! yyptr)
1950 goto yyexhaustedlab;
1951 YYSTACK_RELOCATE (yyss);
1952 YYSTACK_RELOCATE (yyvs);
1953 YYSTACK_RELOCATE (yyls);
1954 # undef YYSTACK_RELOCATE
1955 if (yyss1 != yyssa)
1956 YYSTACK_FREE (yyss1);
1958 # endif
1959 #endif /* no yyoverflow */
1961 yyssp = yyss + yysize - 1;
1962 yyvsp = yyvs + yysize - 1;
1963 yylsp = yyls + yysize - 1;
1965 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1966 (unsigned long int) yystacksize));
1968 if (yyss + yystacksize - 1 <= yyssp)
1969 YYABORT;
1972 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1974 goto yybackup;
1976 /*-----------.
1977 | yybackup. |
1978 `-----------*/
1979 yybackup:
1981 /* Do appropriate processing given the current state. Read a
1982 look-ahead token if we need one and don't already have one. */
1984 /* First try to decide what to do without reference to look-ahead token. */
1985 yyn = yypact[yystate];
1986 if (yyn == YYPACT_NINF)
1987 goto yydefault;
1989 /* Not known => get a look-ahead token if don't already have one. */
1991 /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
1992 if (yychar == YYEMPTY)
1994 YYDPRINTF ((stderr, "Reading a token: "));
1995 yychar = YYLEX;
1998 if (yychar <= YYEOF)
2000 yychar = yytoken = YYEOF;
2001 YYDPRINTF ((stderr, "Now at end of input.\n"));
2003 else
2005 yytoken = YYTRANSLATE (yychar);
2006 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
2009 /* If the proper action on seeing token YYTOKEN is to reduce or to
2010 detect an error, take that action. */
2011 yyn += yytoken;
2012 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
2013 goto yydefault;
2014 yyn = yytable[yyn];
2015 if (yyn <= 0)
2017 if (yyn == 0 || yyn == YYTABLE_NINF)
2018 goto yyerrlab;
2019 yyn = -yyn;
2020 goto yyreduce;
2023 if (yyn == YYFINAL)
2024 YYACCEPT;
2026 /* Count tokens shifted since error; after three, turn off error
2027 status. */
2028 if (yyerrstatus)
2029 yyerrstatus--;
2031 /* Shift the look-ahead token. */
2032 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
2034 /* Discard the shifted token unless it is eof. */
2035 if (yychar != YYEOF)
2036 yychar = YYEMPTY;
2038 yystate = yyn;
2039 *++yyvsp = yylval;
2040 *++yylsp = yylloc;
2041 goto yynewstate;
2044 /*-----------------------------------------------------------.
2045 | yydefault -- do the default action for the current state. |
2046 `-----------------------------------------------------------*/
2047 yydefault:
2048 yyn = yydefact[yystate];
2049 if (yyn == 0)
2050 goto yyerrlab;
2051 goto yyreduce;
2054 /*-----------------------------.
2055 | yyreduce -- Do a reduction. |
2056 `-----------------------------*/
2057 yyreduce:
2058 /* yyn is the number of a rule to reduce with. */
2059 yylen = yyr2[yyn];
2061 /* If YYLEN is nonzero, implement the default value of the action:
2062 `$$ = $1'.
2064 Otherwise, the following line sets YYVAL to garbage.
2065 This behavior is undocumented and Bison
2066 users should not rely upon it. Assigning to YYVAL
2067 unconditionally makes the parser a bit smaller, and it avoids a
2068 GCC warning that YYVAL may be used uninitialized. */
2069 yyval = yyvsp[1-yylen];
2071 /* Default location. */
2072 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
2073 YY_REDUCE_PRINT (yyn);
2074 switch (yyn)
2076 case 2:
2077 #line 185 "ael.y"
2078 { (yyval.pval) = parseio->pval = (yyvsp[(1) - (1)].pval); ;}
2079 break;
2081 case 3:
2082 #line 188 "ael.y"
2083 {(yyval.pval)=(yyvsp[(1) - (1)].pval);;}
2084 break;
2086 case 4:
2087 #line 189 "ael.y"
2088 { (yyval.pval) = linku1((yyvsp[(1) - (2)].pval), (yyvsp[(2) - (2)].pval)); ;}
2089 break;
2091 case 5:
2092 #line 190 "ael.y"
2093 {(yyval.pval)=(yyvsp[(1) - (2)].pval);;}
2094 break;
2096 case 6:
2097 #line 193 "ael.y"
2098 {(yyval.pval)=(yyvsp[(1) - (1)].pval);;}
2099 break;
2101 case 7:
2102 #line 194 "ael.y"
2103 {(yyval.pval)=(yyvsp[(1) - (1)].pval);;}
2104 break;
2106 case 8:
2107 #line 195 "ael.y"
2108 {(yyval.pval)=(yyvsp[(1) - (1)].pval);;}
2109 break;
2111 case 9:
2112 #line 196 "ael.y"
2113 {(yyval.pval)=0;/* allow older docs to be read */;}
2114 break;
2116 case 10:
2117 #line 199 "ael.y"
2118 { (yyval.str) = (yyvsp[(1) - (1)].str); ;}
2119 break;
2121 case 11:
2122 #line 200 "ael.y"
2123 { (yyval.str) = strdup("default"); ;}
2124 break;
2126 case 12:
2127 #line 203 "ael.y"
2129 (yyval.pval) = npval2(PV_CONTEXT, &(yylsp[(1) - (6)]), &(yylsp[(6) - (6)]));
2130 (yyval.pval)->u1.str = (yyvsp[(3) - (6)].str);
2131 (yyval.pval)->u2.statements = (yyvsp[(5) - (6)].pval);
2132 set_dads((yyval.pval),(yyvsp[(5) - (6)].pval));
2133 (yyval.pval)->u3.abstract = (yyvsp[(1) - (6)].intval);;}
2134 break;
2136 case 13:
2137 #line 212 "ael.y"
2138 { (yyval.intval) = 1; ;}
2139 break;
2141 case 14:
2142 #line 213 "ael.y"
2143 { (yyval.intval) = 0; ;}
2144 break;
2146 case 15:
2147 #line 214 "ael.y"
2148 { (yyval.intval) = 2; ;}
2149 break;
2151 case 16:
2152 #line 215 "ael.y"
2153 { (yyval.intval)=3; ;}
2154 break;
2156 case 17:
2157 #line 216 "ael.y"
2158 { (yyval.intval)=3; ;}
2159 break;
2161 case 18:
2162 #line 219 "ael.y"
2164 (yyval.pval) = npval2(PV_MACRO, &(yylsp[(1) - (8)]), &(yylsp[(8) - (8)]));
2165 (yyval.pval)->u1.str = (yyvsp[(2) - (8)].str); (yyval.pval)->u2.arglist = (yyvsp[(4) - (8)].pval); (yyval.pval)->u3.macro_statements = (yyvsp[(7) - (8)].pval);
2166 set_dads((yyval.pval),(yyvsp[(7) - (8)].pval));;}
2167 break;
2169 case 19:
2170 #line 225 "ael.y"
2172 (yyval.pval) = npval2(PV_GLOBALS, &(yylsp[(1) - (4)]), &(yylsp[(4) - (4)]));
2173 (yyval.pval)->u1.statements = (yyvsp[(3) - (4)].pval);
2174 set_dads((yyval.pval),(yyvsp[(3) - (4)].pval));;}
2175 break;
2177 case 20:
2178 #line 231 "ael.y"
2179 { (yyval.pval) = NULL; ;}
2180 break;
2182 case 21:
2183 #line 232 "ael.y"
2184 {(yyval.pval) = linku1((yyvsp[(1) - (2)].pval), (yyvsp[(2) - (2)].pval)); ;}
2185 break;
2187 case 22:
2188 #line 233 "ael.y"
2189 {(yyval.pval)=(yyvsp[(2) - (2)].pval);;}
2190 break;
2192 case 23:
2193 #line 236 "ael.y"
2194 { reset_semicount(parseio->scanner); ;}
2195 break;
2197 case 24:
2198 #line 236 "ael.y"
2200 (yyval.pval) = npval2(PV_VARDEC, &(yylsp[(1) - (5)]), &(yylsp[(5) - (5)]));
2201 (yyval.pval)->u1.str = (yyvsp[(1) - (5)].str);
2202 (yyval.pval)->u2.val = (yyvsp[(4) - (5)].str); ;}
2203 break;
2205 case 25:
2206 #line 243 "ael.y"
2207 { (yyval.pval) = NULL; ;}
2208 break;
2210 case 26:
2211 #line 244 "ael.y"
2212 { (yyval.pval) = nword((yyvsp[(1) - (1)].str), &(yylsp[(1) - (1)])); ;}
2213 break;
2215 case 27:
2216 #line 245 "ael.y"
2217 { (yyval.pval) = linku1((yyvsp[(1) - (3)].pval), nword((yyvsp[(3) - (3)].str), &(yylsp[(3) - (3)]))); ;}
2218 break;
2220 case 28:
2221 #line 246 "ael.y"
2222 {(yyval.pval)=(yyvsp[(1) - (2)].pval);;}
2223 break;
2225 case 29:
2226 #line 249 "ael.y"
2227 {(yyval.pval)=0;;}
2228 break;
2230 case 30:
2231 #line 250 "ael.y"
2232 { (yyval.pval) = linku1((yyvsp[(1) - (2)].pval), (yyvsp[(2) - (2)].pval)); ;}
2233 break;
2235 case 31:
2236 #line 251 "ael.y"
2237 { (yyval.pval)=(yyvsp[(2) - (2)].pval);;}
2238 break;
2240 case 32:
2241 #line 254 "ael.y"
2242 {(yyval.pval)=(yyvsp[(1) - (1)].pval);;}
2243 break;
2245 case 33:
2246 #line 255 "ael.y"
2247 {(yyval.pval)=(yyvsp[(1) - (1)].pval);;}
2248 break;
2250 case 34:
2251 #line 256 "ael.y"
2252 {(yyval.pval)=(yyvsp[(1) - (1)].pval);;}
2253 break;
2255 case 35:
2256 #line 257 "ael.y"
2257 {(yyval.pval)=(yyvsp[(1) - (1)].pval);;}
2258 break;
2260 case 36:
2261 #line 258 "ael.y"
2262 {(yyval.pval)=(yyvsp[(1) - (1)].pval);;}
2263 break;
2265 case 37:
2266 #line 259 "ael.y"
2267 {(yyval.pval)=(yyvsp[(1) - (1)].pval);;}
2268 break;
2270 case 38:
2271 #line 260 "ael.y"
2272 {free((yyvsp[(1) - (2)].str)); (yyval.pval)=0;;}
2273 break;
2275 case 39:
2276 #line 261 "ael.y"
2277 {(yyval.pval)=0;/* allow older docs to be read */;}
2278 break;
2280 case 40:
2281 #line 264 "ael.y"
2283 (yyval.pval) = npval2(PV_IGNOREPAT, &(yylsp[(1) - (4)]), &(yylsp[(4) - (4)]));
2284 (yyval.pval)->u1.str = (yyvsp[(3) - (4)].str);;}
2285 break;
2287 case 41:
2288 #line 269 "ael.y"
2290 (yyval.pval) = npval2(PV_EXTENSION, &(yylsp[(1) - (3)]), &(yylsp[(3) - (3)]));
2291 (yyval.pval)->u1.str = (yyvsp[(1) - (3)].str);
2292 (yyval.pval)->u2.statements = (yyvsp[(3) - (3)].pval); set_dads((yyval.pval),(yyvsp[(3) - (3)].pval));;}
2293 break;
2295 case 42:
2296 #line 273 "ael.y"
2298 (yyval.pval) = npval2(PV_EXTENSION, &(yylsp[(1) - (4)]), &(yylsp[(4) - (4)]));
2299 (yyval.pval)->u1.str = (yyvsp[(2) - (4)].str);
2300 (yyval.pval)->u2.statements = (yyvsp[(4) - (4)].pval); set_dads((yyval.pval),(yyvsp[(4) - (4)].pval));
2301 (yyval.pval)->u4.regexten=1;;}
2302 break;
2304 case 43:
2305 #line 278 "ael.y"
2307 (yyval.pval) = npval2(PV_EXTENSION, &(yylsp[(1) - (7)]), &(yylsp[(7) - (7)]));
2308 (yyval.pval)->u1.str = (yyvsp[(5) - (7)].str);
2309 (yyval.pval)->u2.statements = (yyvsp[(7) - (7)].pval); set_dads((yyval.pval),(yyvsp[(7) - (7)].pval));
2310 (yyval.pval)->u3.hints = (yyvsp[(3) - (7)].str);;}
2311 break;
2313 case 44:
2314 #line 283 "ael.y"
2316 (yyval.pval) = npval2(PV_EXTENSION, &(yylsp[(1) - (8)]), &(yylsp[(8) - (8)]));
2317 (yyval.pval)->u1.str = (yyvsp[(6) - (8)].str);
2318 (yyval.pval)->u2.statements = (yyvsp[(8) - (8)].pval); set_dads((yyval.pval),(yyvsp[(8) - (8)].pval));
2319 (yyval.pval)->u4.regexten=1;
2320 (yyval.pval)->u3.hints = (yyvsp[(4) - (8)].str);;}
2321 break;
2323 case 45:
2324 #line 293 "ael.y"
2325 { (yyval.pval) = NULL; ;}
2326 break;
2328 case 46:
2329 #line 294 "ael.y"
2330 { (yyval.pval) = linku1((yyvsp[(1) - (2)].pval), (yyvsp[(2) - (2)].pval)); ;}
2331 break;
2333 case 47:
2334 #line 295 "ael.y"
2335 {(yyval.pval)=(yyvsp[(2) - (2)].pval);;}
2336 break;
2338 case 48:
2339 #line 301 "ael.y"
2341 asprintf(&(yyval.str), "%s:%s:%s", (yyvsp[(1) - (5)].str), (yyvsp[(3) - (5)].str), (yyvsp[(5) - (5)].str));
2342 free((yyvsp[(1) - (5)].str));
2343 free((yyvsp[(3) - (5)].str));
2344 free((yyvsp[(5) - (5)].str)); ;}
2345 break;
2347 case 49:
2348 #line 306 "ael.y"
2349 { (yyval.str) = (yyvsp[(1) - (1)].str); ;}
2350 break;
2352 case 50:
2353 #line 310 "ael.y"
2355 (yyval.pval) = nword((yyvsp[(1) - (7)].str), &(yylsp[(1) - (7)]));
2356 (yyval.pval)->next = nword((yyvsp[(3) - (7)].str), &(yylsp[(3) - (7)]));
2357 (yyval.pval)->next->next = nword((yyvsp[(5) - (7)].str), &(yylsp[(5) - (7)]));
2358 (yyval.pval)->next->next->next = nword((yyvsp[(7) - (7)].str), &(yylsp[(7) - (7)])); ;}
2359 break;
2361 case 51:
2362 #line 318 "ael.y"
2363 { reset_parencount(parseio->scanner); ;}
2364 break;
2366 case 52:
2367 #line 318 "ael.y"
2368 { (yyval.str) = (yyvsp[(3) - (4)].str); ;}
2369 break;
2371 case 53:
2372 #line 322 "ael.y"
2374 (yyval.pval)= npval2(PV_IF, &(yylsp[(1) - (2)]), &(yylsp[(2) - (2)]));
2375 (yyval.pval)->u1.str = (yyvsp[(2) - (2)].str); ;}
2376 break;
2378 case 54:
2379 #line 325 "ael.y"
2381 (yyval.pval) = npval2(PV_RANDOM, &(yylsp[(1) - (2)]), &(yylsp[(2) - (2)]));
2382 (yyval.pval)->u1.str=(yyvsp[(2) - (2)].str);;}
2383 break;
2385 case 55:
2386 #line 328 "ael.y"
2388 (yyval.pval) = npval2(PV_IFTIME, &(yylsp[(1) - (4)]), &(yylsp[(4) - (4)]));
2389 (yyval.pval)->u1.list = (yyvsp[(3) - (4)].pval);
2390 prev_word = 0; ;}
2391 break;
2393 case 56:
2394 #line 339 "ael.y"
2395 { (yyval.str) = (yyvsp[(1) - (1)].str);;}
2396 break;
2398 case 57:
2399 #line 340 "ael.y"
2401 asprintf(&((yyval.str)), "%s%s", (yyvsp[(1) - (2)].str), (yyvsp[(2) - (2)].str));
2402 free((yyvsp[(1) - (2)].str));
2403 free((yyvsp[(2) - (2)].str));
2404 prev_word = (yyval.str);;}
2405 break;
2407 case 58:
2408 #line 347 "ael.y"
2409 { (yyval.str) = (yyvsp[(1) - (1)].str); ;}
2410 break;
2412 case 59:
2413 #line 348 "ael.y"
2415 asprintf(&((yyval.str)), "%s %s", (yyvsp[(1) - (2)].str), (yyvsp[(2) - (2)].str));
2416 free((yyvsp[(1) - (2)].str));
2417 free((yyvsp[(2) - (2)].str)); ;}
2418 break;
2420 case 60:
2421 #line 352 "ael.y"
2423 asprintf(&((yyval.str)), "%s:%s", (yyvsp[(1) - (3)].str), (yyvsp[(3) - (3)].str));
2424 free((yyvsp[(1) - (3)].str));
2425 free((yyvsp[(3) - (3)].str)); ;}
2426 break;
2428 case 61:
2429 #line 356 "ael.y"
2430 { /* there are often '&' in hints */
2431 asprintf(&((yyval.str)), "%s&%s", (yyvsp[(1) - (3)].str), (yyvsp[(3) - (3)].str));
2432 free((yyvsp[(1) - (3)].str));
2433 free((yyvsp[(3) - (3)].str));;}
2434 break;
2436 case 62:
2437 #line 362 "ael.y"
2438 { (yyval.str) = (yyvsp[(1) - (1)].str);;}
2439 break;
2441 case 63:
2442 #line 363 "ael.y"
2444 asprintf(&((yyval.str)), "%s%s", (yyvsp[(1) - (2)].str), (yyvsp[(2) - (2)].str));
2445 free((yyvsp[(1) - (2)].str));
2446 free((yyvsp[(2) - (2)].str));
2447 prev_word = (yyval.str);;}
2448 break;
2450 case 64:
2451 #line 368 "ael.y"
2453 asprintf(&((yyval.str)), "%s%s%s", (yyvsp[(1) - (3)].str), (yyvsp[(2) - (3)].str), (yyvsp[(3) - (3)].str));
2454 free((yyvsp[(1) - (3)].str));
2455 free((yyvsp[(2) - (3)].str));
2456 free((yyvsp[(3) - (3)].str));
2457 prev_word=(yyval.str);;}
2458 break;
2460 case 65:
2461 #line 376 "ael.y"
2462 { (yyval.str) = (yyvsp[(1) - (1)].str);;}
2463 break;
2465 case 66:
2466 #line 377 "ael.y"
2468 asprintf(&((yyval.str)), "%s%s", (yyvsp[(1) - (2)].str), (yyvsp[(2) - (2)].str));
2469 free((yyvsp[(1) - (2)].str));
2470 free((yyvsp[(2) - (2)].str));;}
2471 break;
2473 case 67:
2474 #line 381 "ael.y"
2476 asprintf(&((yyval.str)), "%s:%s", (yyvsp[(1) - (3)].str), (yyvsp[(3) - (3)].str));
2477 free((yyvsp[(1) - (3)].str));
2478 free((yyvsp[(3) - (3)].str));;}
2479 break;
2481 case 68:
2482 #line 387 "ael.y"
2484 (yyval.pval) = npval2(PV_SWITCH, &(yylsp[(1) - (5)]), &(yylsp[(5) - (5)]));
2485 (yyval.pval)->u1.str = (yyvsp[(2) - (5)].str);
2486 (yyval.pval)->u2.statements = (yyvsp[(4) - (5)].pval); set_dads((yyval.pval),(yyvsp[(4) - (5)].pval));;}
2487 break;
2489 case 69:
2490 #line 396 "ael.y"
2492 (yyval.pval) = npval2(PV_STATEMENTBLOCK, &(yylsp[(1) - (3)]), &(yylsp[(3) - (3)]));
2493 (yyval.pval)->u1.list = (yyvsp[(2) - (3)].pval); set_dads((yyval.pval),(yyvsp[(2) - (3)].pval));;}
2494 break;
2496 case 70:
2497 #line 399 "ael.y"
2498 { (yyval.pval) = (yyvsp[(1) - (1)].pval); ;}
2499 break;
2501 case 71:
2502 #line 400 "ael.y"
2504 (yyval.pval) = npval2(PV_GOTO, &(yylsp[(1) - (3)]), &(yylsp[(3) - (3)]));
2505 (yyval.pval)->u1.list = (yyvsp[(2) - (3)].pval);;}
2506 break;
2508 case 72:
2509 #line 403 "ael.y"
2511 (yyval.pval) = npval2(PV_GOTO, &(yylsp[(1) - (3)]), &(yylsp[(3) - (3)]));
2512 (yyval.pval)->u1.list = (yyvsp[(2) - (3)].pval);;}
2513 break;
2515 case 73:
2516 #line 406 "ael.y"
2518 (yyval.pval) = npval2(PV_LABEL, &(yylsp[(1) - (2)]), &(yylsp[(2) - (2)]));
2519 (yyval.pval)->u1.str = (yyvsp[(1) - (2)].str); ;}
2520 break;
2522 case 74:
2523 #line 409 "ael.y"
2524 {reset_semicount(parseio->scanner);;}
2525 break;
2527 case 75:
2528 #line 410 "ael.y"
2529 {reset_semicount(parseio->scanner);;}
2530 break;
2532 case 76:
2533 #line 411 "ael.y"
2534 {reset_parencount(parseio->scanner);;}
2535 break;
2537 case 77:
2538 #line 411 "ael.y"
2539 { /* XXX word_list maybe ? */
2540 (yyval.pval) = npval2(PV_FOR, &(yylsp[(1) - (12)]), &(yylsp[(12) - (12)]));
2541 (yyval.pval)->u1.for_init = (yyvsp[(4) - (12)].str);
2542 (yyval.pval)->u2.for_test=(yyvsp[(7) - (12)].str);
2543 (yyval.pval)->u3.for_inc = (yyvsp[(10) - (12)].str);
2544 (yyval.pval)->u4.for_statements = (yyvsp[(12) - (12)].pval); set_dads((yyval.pval),(yyvsp[(12) - (12)].pval));;}
2545 break;
2547 case 78:
2548 #line 417 "ael.y"
2550 (yyval.pval) = npval2(PV_WHILE, &(yylsp[(1) - (3)]), &(yylsp[(3) - (3)]));
2551 (yyval.pval)->u1.str = (yyvsp[(2) - (3)].str);
2552 (yyval.pval)->u2.statements = (yyvsp[(3) - (3)].pval); set_dads((yyval.pval),(yyvsp[(3) - (3)].pval));;}
2553 break;
2555 case 79:
2556 #line 421 "ael.y"
2557 { (yyval.pval) = (yyvsp[(1) - (1)].pval); ;}
2558 break;
2560 case 80:
2561 #line 422 "ael.y"
2562 { (yyval.pval) = update_last((yyvsp[(2) - (3)].pval), &(yylsp[(2) - (3)])); ;}
2563 break;
2565 case 81:
2566 #line 423 "ael.y"
2567 { (yyval.pval) = update_last((yyvsp[(1) - (2)].pval), &(yylsp[(2) - (2)])); ;}
2568 break;
2570 case 82:
2571 #line 424 "ael.y"
2573 (yyval.pval)= npval2(PV_APPLICATION_CALL, &(yylsp[(1) - (2)]), &(yylsp[(2) - (2)]));
2574 (yyval.pval)->u1.str = (yyvsp[(1) - (2)].str);;}
2575 break;
2577 case 83:
2578 #line 427 "ael.y"
2579 {reset_semicount(parseio->scanner);;}
2580 break;
2582 case 84:
2583 #line 427 "ael.y"
2585 char *bufx;
2586 int tot=0;
2587 pval *pptr;
2588 (yyval.pval) = npval2(PV_VARDEC, &(yylsp[(1) - (5)]), &(yylsp[(5) - (5)]));
2589 (yyval.pval)->u2.val=(yyvsp[(4) - (5)].str);
2590 /* rebuild the original string-- this is not an app call, it's an unwrapped vardec, with a func call on the LHS */
2591 /* string to big to fit in the buffer? */
2592 tot+=strlen((yyvsp[(1) - (5)].pval)->u1.str);
2593 for(pptr=(yyvsp[(1) - (5)].pval)->u2.arglist;pptr;pptr=pptr->next) {
2594 tot+=strlen(pptr->u1.str);
2595 tot++; /* for a sep like a comma */
2597 tot+=4; /* for safety */
2598 bufx = calloc(1, tot);
2599 strcpy(bufx,(yyvsp[(1) - (5)].pval)->u1.str);
2600 strcat(bufx,"(");
2601 /* XXX need to advance the pointer or the loop is very inefficient */
2602 for (pptr=(yyvsp[(1) - (5)].pval)->u2.arglist;pptr;pptr=pptr->next) {
2603 if ( pptr != (yyvsp[(1) - (5)].pval)->u2.arglist )
2604 strcat(bufx,",");
2605 strcat(bufx,pptr->u1.str);
2607 strcat(bufx,")");
2608 #ifdef AAL_ARGCHECK
2609 if ( !ael_is_funcname((yyvsp[(1) - (5)].pval)->u1.str) )
2610 ast_log(LOG_WARNING, "==== File: %s, Line %d, Cols: %d-%d: Function call? The name %s is not in my internal list of function names\n",
2611 my_file, (yylsp[(1) - (5)]).first_line, (yylsp[(1) - (5)]).first_column, (yylsp[(1) - (5)]).last_column, (yyvsp[(1) - (5)].pval)->u1.str);
2612 #endif
2613 (yyval.pval)->u1.str = bufx;
2614 destroy_pval((yyvsp[(1) - (5)].pval)); /* the app call it is not, get rid of that chain */
2615 prev_word = 0;
2617 break;
2619 case 85:
2620 #line 460 "ael.y"
2621 { (yyval.pval) = npval2(PV_BREAK, &(yylsp[(1) - (2)]), &(yylsp[(2) - (2)])); ;}
2622 break;
2624 case 86:
2625 #line 461 "ael.y"
2626 { (yyval.pval) = npval2(PV_RETURN, &(yylsp[(1) - (2)]), &(yylsp[(2) - (2)])); ;}
2627 break;
2629 case 87:
2630 #line 462 "ael.y"
2631 { (yyval.pval) = npval2(PV_CONTINUE, &(yylsp[(1) - (2)]), &(yylsp[(2) - (2)])); ;}
2632 break;
2634 case 88:
2635 #line 463 "ael.y"
2637 (yyval.pval) = update_last((yyvsp[(1) - (3)].pval), &(yylsp[(2) - (3)]));
2638 (yyval.pval)->u2.statements = (yyvsp[(2) - (3)].pval); set_dads((yyval.pval),(yyvsp[(2) - (3)].pval));
2639 (yyval.pval)->u3.else_statements = (yyvsp[(3) - (3)].pval);set_dads((yyval.pval),(yyvsp[(3) - (3)].pval));;}
2640 break;
2642 case 89:
2643 #line 467 "ael.y"
2644 { (yyval.pval)=0; ;}
2645 break;
2647 case 90:
2648 #line 470 "ael.y"
2649 { (yyval.pval) = (yyvsp[(2) - (2)].pval); ;}
2650 break;
2652 case 91:
2653 #line 471 "ael.y"
2654 { (yyval.pval) = NULL ; ;}
2655 break;
2657 case 92:
2658 #line 474 "ael.y"
2659 { (yyval.pval) = nword((yyvsp[(1) - (1)].str), &(yylsp[(1) - (1)])); ;}
2660 break;
2662 case 93:
2663 #line 475 "ael.y"
2665 (yyval.pval) = nword((yyvsp[(1) - (3)].str), &(yylsp[(1) - (3)]));
2666 (yyval.pval)->next = nword((yyvsp[(3) - (3)].str), &(yylsp[(3) - (3)])); ;}
2667 break;
2669 case 94:
2670 #line 478 "ael.y"
2672 (yyval.pval) = nword((yyvsp[(1) - (3)].str), &(yylsp[(1) - (3)]));
2673 (yyval.pval)->next = nword((yyvsp[(3) - (3)].str), &(yylsp[(3) - (3)])); ;}
2674 break;
2676 case 95:
2677 #line 481 "ael.y"
2679 (yyval.pval) = nword((yyvsp[(1) - (5)].str), &(yylsp[(1) - (5)]));
2680 (yyval.pval)->next = nword((yyvsp[(3) - (5)].str), &(yylsp[(3) - (5)]));
2681 (yyval.pval)->next->next = nword((yyvsp[(5) - (5)].str), &(yylsp[(5) - (5)])); ;}
2682 break;
2684 case 96:
2685 #line 485 "ael.y"
2687 (yyval.pval) = nword((yyvsp[(1) - (5)].str), &(yylsp[(1) - (5)]));
2688 (yyval.pval)->next = nword((yyvsp[(3) - (5)].str), &(yylsp[(3) - (5)]));
2689 (yyval.pval)->next->next = nword((yyvsp[(5) - (5)].str), &(yylsp[(5) - (5)])); ;}
2690 break;
2692 case 97:
2693 #line 489 "ael.y"
2695 (yyval.pval) = nword(strdup("default"), &(yylsp[(1) - (5)]));
2696 (yyval.pval)->next = nword((yyvsp[(3) - (5)].str), &(yylsp[(3) - (5)]));
2697 (yyval.pval)->next->next = nword((yyvsp[(5) - (5)].str), &(yylsp[(5) - (5)])); ;}
2698 break;
2700 case 98:
2701 #line 493 "ael.y"
2703 (yyval.pval) = nword(strdup("default"), &(yylsp[(1) - (5)]));
2704 (yyval.pval)->next = nword((yyvsp[(3) - (5)].str), &(yylsp[(3) - (5)]));
2705 (yyval.pval)->next->next = nword((yyvsp[(5) - (5)].str), &(yylsp[(5) - (5)])); ;}
2706 break;
2708 case 99:
2709 #line 499 "ael.y"
2710 { (yyval.str) = strdup("1"); ;}
2711 break;
2713 case 100:
2714 #line 500 "ael.y"
2715 { (yyval.str) = (yyvsp[(2) - (2)].str); ;}
2716 break;
2718 case 101:
2719 #line 504 "ael.y"
2720 { /* ext[, pri] default 1 */
2721 (yyval.pval) = nword((yyvsp[(1) - (2)].str), &(yylsp[(1) - (2)]));
2722 (yyval.pval)->next = nword((yyvsp[(2) - (2)].str), &(yylsp[(2) - (2)])); ;}
2723 break;
2725 case 102:
2726 #line 507 "ael.y"
2727 { /* context, ext, pri */
2728 (yyval.pval) = nword((yyvsp[(4) - (4)].str), &(yylsp[(4) - (4)]));
2729 (yyval.pval)->next = nword((yyvsp[(1) - (4)].str), &(yylsp[(1) - (4)]));
2730 (yyval.pval)->next->next = nword((yyvsp[(2) - (4)].str), &(yylsp[(2) - (4)])); ;}
2731 break;
2733 case 103:
2734 #line 513 "ael.y"
2735 {reset_argcount(parseio->scanner);;}
2736 break;
2738 case 104:
2739 #line 513 "ael.y"
2741 /* XXX original code had @2 but i think we need @5 */
2742 (yyval.pval) = npval2(PV_MACRO_CALL, &(yylsp[(1) - (5)]), &(yylsp[(5) - (5)]));
2743 (yyval.pval)->u1.str = (yyvsp[(1) - (5)].str);
2744 (yyval.pval)->u2.arglist = (yyvsp[(4) - (5)].pval);;}
2745 break;
2747 case 105:
2748 #line 518 "ael.y"
2750 (yyval.pval)= npval2(PV_MACRO_CALL, &(yylsp[(1) - (3)]), &(yylsp[(3) - (3)]));
2751 (yyval.pval)->u1.str = (yyvsp[(1) - (3)].str); ;}
2752 break;
2754 case 106:
2755 #line 526 "ael.y"
2756 {reset_argcount(parseio->scanner);;}
2757 break;
2759 case 107:
2760 #line 526 "ael.y"
2762 if (strcasecmp((yyvsp[(1) - (3)].str),"goto") == 0) {
2763 (yyval.pval) = npval2(PV_GOTO, &(yylsp[(1) - (3)]), &(yylsp[(2) - (3)]));
2764 free((yyvsp[(1) - (3)].str)); /* won't be using this */
2765 ast_log(LOG_WARNING, "==== File: %s, Line %d, Cols: %d-%d: Suggestion: Use the goto statement instead of the Goto() application call in AEL.\n", my_file, (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column, (yylsp[(1) - (3)]).last_column );
2766 } else {
2767 (yyval.pval)= npval2(PV_APPLICATION_CALL, &(yylsp[(1) - (3)]), &(yylsp[(2) - (3)]));
2768 (yyval.pval)->u1.str = (yyvsp[(1) - (3)].str);
2769 } ;}
2770 break;
2772 case 108:
2773 #line 537 "ael.y"
2775 (yyval.pval) = update_last((yyvsp[(1) - (3)].pval), &(yylsp[(3) - (3)]));
2776 if( (yyval.pval)->type == PV_GOTO )
2777 (yyval.pval)->u1.list = (yyvsp[(2) - (3)].pval);
2778 else
2779 (yyval.pval)->u2.arglist = (yyvsp[(2) - (3)].pval);
2781 break;
2783 case 109:
2784 #line 544 "ael.y"
2785 { (yyval.pval) = update_last((yyvsp[(1) - (2)].pval), &(yylsp[(2) - (2)])); ;}
2786 break;
2788 case 110:
2789 #line 547 "ael.y"
2790 { (yyval.str) = (yyvsp[(1) - (1)].str) ;}
2791 break;
2793 case 111:
2794 #line 548 "ael.y"
2795 { (yyval.str) = strdup(""); ;}
2796 break;
2798 case 112:
2799 #line 551 "ael.y"
2800 { (yyval.pval) = nword((yyvsp[(1) - (1)].str), &(yylsp[(1) - (1)])); ;}
2801 break;
2803 case 113:
2804 #line 552 "ael.y"
2806 (yyval.pval)= npval(PV_WORD,0/*@1.first_line*/,0/*@1.last_line*/,0/* @1.first_column*/, 0/*@1.last_column*/);
2807 (yyval.pval)->u1.str = strdup(""); ;}
2808 break;
2810 case 114:
2811 #line 555 "ael.y"
2812 { (yyval.pval) = linku1((yyvsp[(1) - (3)].pval), nword((yyvsp[(3) - (3)].str), &(yylsp[(3) - (3)]))); ;}
2813 break;
2815 case 115:
2816 #line 558 "ael.y"
2817 { (yyval.pval) = NULL; ;}
2818 break;
2820 case 116:
2821 #line 559 "ael.y"
2822 { (yyval.pval) = linku1((yyvsp[(1) - (2)].pval), (yyvsp[(2) - (2)].pval)); ;}
2823 break;
2825 case 117:
2826 #line 562 "ael.y"
2828 (yyval.pval) = npval2(PV_CASE, &(yylsp[(1) - (4)]), &(yylsp[(3) - (4)])); /* XXX 3 or 4 ? */
2829 (yyval.pval)->u1.str = (yyvsp[(2) - (4)].str);
2830 (yyval.pval)->u2.statements = (yyvsp[(4) - (4)].pval); set_dads((yyval.pval),(yyvsp[(4) - (4)].pval));;}
2831 break;
2833 case 118:
2834 #line 566 "ael.y"
2836 (yyval.pval) = npval2(PV_DEFAULT, &(yylsp[(1) - (3)]), &(yylsp[(3) - (3)]));
2837 (yyval.pval)->u1.str = NULL;
2838 (yyval.pval)->u2.statements = (yyvsp[(3) - (3)].pval);set_dads((yyval.pval),(yyvsp[(3) - (3)].pval));;}
2839 break;
2841 case 119:
2842 #line 570 "ael.y"
2844 (yyval.pval) = npval2(PV_PATTERN, &(yylsp[(1) - (4)]), &(yylsp[(4) - (4)])); /* XXX@3 or @4 ? */
2845 (yyval.pval)->u1.str = (yyvsp[(2) - (4)].str);
2846 (yyval.pval)->u2.statements = (yyvsp[(4) - (4)].pval);set_dads((yyval.pval),(yyvsp[(4) - (4)].pval));;}
2847 break;
2849 case 120:
2850 #line 576 "ael.y"
2851 { (yyval.pval) = NULL; ;}
2852 break;
2854 case 121:
2855 #line 577 "ael.y"
2856 { (yyval.pval) = linku1((yyvsp[(1) - (2)].pval), (yyvsp[(2) - (2)].pval)); ;}
2857 break;
2859 case 122:
2860 #line 580 "ael.y"
2861 {(yyval.pval)=(yyvsp[(1) - (1)].pval);;}
2862 break;
2864 case 123:
2865 #line 581 "ael.y"
2866 { (yyval.pval)=(yyvsp[(1) - (1)].pval);;}
2867 break;
2869 case 124:
2870 #line 582 "ael.y"
2872 (yyval.pval) = npval2(PV_CATCH, &(yylsp[(1) - (5)]), &(yylsp[(5) - (5)]));
2873 (yyval.pval)->u1.str = (yyvsp[(2) - (5)].str);
2874 (yyval.pval)->u2.statements = (yyvsp[(4) - (5)].pval); set_dads((yyval.pval),(yyvsp[(4) - (5)].pval));;}
2875 break;
2877 case 125:
2878 #line 588 "ael.y"
2880 (yyval.pval) = npval2(PV_SWITCHES, &(yylsp[(1) - (4)]), &(yylsp[(2) - (4)]));
2881 (yyval.pval)->u1.list = (yyvsp[(3) - (4)].pval); set_dads((yyval.pval),(yyvsp[(3) - (4)].pval));;}
2882 break;
2884 case 126:
2885 #line 593 "ael.y"
2887 (yyval.pval) = npval2(PV_ESWITCHES, &(yylsp[(1) - (4)]), &(yylsp[(2) - (4)]));
2888 (yyval.pval)->u1.list = (yyvsp[(3) - (4)].pval); set_dads((yyval.pval),(yyvsp[(3) - (4)].pval));;}
2889 break;
2891 case 127:
2892 #line 598 "ael.y"
2893 { (yyval.pval) = NULL; ;}
2894 break;
2896 case 128:
2897 #line 599 "ael.y"
2898 { (yyval.pval) = linku1(nword((yyvsp[(1) - (3)].str), &(yylsp[(1) - (3)])), (yyvsp[(3) - (3)].pval)); ;}
2899 break;
2901 case 129:
2902 #line 600 "ael.y"
2903 { char *x; asprintf(&x,"%s@%s", (yyvsp[(1) - (5)].str),(yyvsp[(3) - (5)].str)); free((yyvsp[(1) - (5)].str)); free((yyvsp[(3) - (5)].str));
2904 (yyval.pval) = linku1(nword(x, &(yylsp[(1) - (5)])), (yyvsp[(5) - (5)].pval));;}
2905 break;
2907 case 130:
2908 #line 602 "ael.y"
2909 {(yyval.pval)=(yyvsp[(2) - (2)].pval);;}
2910 break;
2912 case 131:
2913 #line 605 "ael.y"
2914 { (yyval.pval) = nword((yyvsp[(1) - (1)].str), &(yylsp[(1) - (1)])); ;}
2915 break;
2917 case 132:
2918 #line 606 "ael.y"
2920 (yyval.pval) = nword((yyvsp[(1) - (3)].str), &(yylsp[(1) - (3)]));
2921 (yyval.pval)->u2.arglist = (yyvsp[(3) - (3)].pval);
2922 prev_word=0; /* XXX sure ? */ ;}
2923 break;
2925 case 133:
2926 #line 613 "ael.y"
2927 { (yyval.pval) = (yyvsp[(1) - (2)].pval); ;}
2928 break;
2930 case 134:
2931 #line 614 "ael.y"
2932 { (yyval.pval) = linku1((yyvsp[(1) - (3)].pval), (yyvsp[(2) - (3)].pval)); ;}
2933 break;
2935 case 135:
2936 #line 615 "ael.y"
2937 {(yyval.pval)=(yyvsp[(1) - (2)].pval);;}
2938 break;
2940 case 136:
2941 #line 618 "ael.y"
2943 (yyval.pval) = npval2(PV_INCLUDES, &(yylsp[(1) - (4)]), &(yylsp[(4) - (4)]));
2944 (yyval.pval)->u1.list = (yyvsp[(3) - (4)].pval);set_dads((yyval.pval),(yyvsp[(3) - (4)].pval));;}
2945 break;
2947 case 137:
2948 #line 621 "ael.y"
2950 (yyval.pval) = npval2(PV_INCLUDES, &(yylsp[(1) - (3)]), &(yylsp[(3) - (3)]));;}
2951 break;
2954 /* Line 1270 of yacc.c. */
2955 #line 2956 "ael.tab.c"
2956 default: break;
2958 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2960 YYPOPSTACK (yylen);
2961 yylen = 0;
2962 YY_STACK_PRINT (yyss, yyssp);
2964 *++yyvsp = yyval;
2965 *++yylsp = yyloc;
2967 /* Now `shift' the result of the reduction. Determine what state
2968 that goes to, based on the state we popped back to and the rule
2969 number reduced by. */
2971 yyn = yyr1[yyn];
2973 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2974 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2975 yystate = yytable[yystate];
2976 else
2977 yystate = yydefgoto[yyn - YYNTOKENS];
2979 goto yynewstate;
2982 /*------------------------------------.
2983 | yyerrlab -- here on detecting error |
2984 `------------------------------------*/
2985 yyerrlab:
2986 /* If not already recovering from an error, report this error. */
2987 if (!yyerrstatus)
2989 ++yynerrs;
2990 #if ! YYERROR_VERBOSE
2991 yyerror (&yylloc, parseio, YY_("syntax error"));
2992 #else
2994 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
2995 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
2997 YYSIZE_T yyalloc = 2 * yysize;
2998 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
2999 yyalloc = YYSTACK_ALLOC_MAXIMUM;
3000 if (yymsg != yymsgbuf)
3001 YYSTACK_FREE (yymsg);
3002 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
3003 if (yymsg)
3004 yymsg_alloc = yyalloc;
3005 else
3007 yymsg = yymsgbuf;
3008 yymsg_alloc = sizeof yymsgbuf;
3012 if (0 < yysize && yysize <= yymsg_alloc)
3014 (void) yysyntax_error (yymsg, yystate, yychar);
3015 yyerror (&yylloc, parseio, yymsg);
3017 else
3019 yyerror (&yylloc, parseio, YY_("syntax error"));
3020 if (yysize != 0)
3021 goto yyexhaustedlab;
3024 #endif
3027 yyerror_range[0] = yylloc;
3029 if (yyerrstatus == 3)
3031 /* If just tried and failed to reuse look-ahead token after an
3032 error, discard it. */
3034 if (yychar <= YYEOF)
3036 /* Return failure if at end of input. */
3037 if (yychar == YYEOF)
3038 YYABORT;
3040 else
3042 yydestruct ("Error: discarding",
3043 yytoken, &yylval, &yylloc, parseio);
3044 yychar = YYEMPTY;
3048 /* Else will try to reuse look-ahead token after shifting the error
3049 token. */
3050 goto yyerrlab1;
3053 /*---------------------------------------------------.
3054 | yyerrorlab -- error raised explicitly by YYERROR. |
3055 `---------------------------------------------------*/
3056 yyerrorlab:
3058 /* Pacify compilers like GCC when the user code never invokes
3059 YYERROR and the label yyerrorlab therefore never appears in user
3060 code. */
3061 if (/*CONSTCOND*/ 0)
3062 goto yyerrorlab;
3064 yyerror_range[0] = yylsp[1-yylen];
3065 /* Do not reclaim the symbols of the rule which action triggered
3066 this YYERROR. */
3067 YYPOPSTACK (yylen);
3068 yylen = 0;
3069 YY_STACK_PRINT (yyss, yyssp);
3070 yystate = *yyssp;
3071 goto yyerrlab1;
3074 /*-------------------------------------------------------------.
3075 | yyerrlab1 -- common code for both syntax error and YYERROR. |
3076 `-------------------------------------------------------------*/
3077 yyerrlab1:
3078 yyerrstatus = 3; /* Each real token shifted decrements this. */
3080 for (;;)
3082 yyn = yypact[yystate];
3083 if (yyn != YYPACT_NINF)
3085 yyn += YYTERROR;
3086 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
3088 yyn = yytable[yyn];
3089 if (0 < yyn)
3090 break;
3094 /* Pop the current state because it cannot handle the error token. */
3095 if (yyssp == yyss)
3096 YYABORT;
3098 yyerror_range[0] = *yylsp;
3099 yydestruct ("Error: popping",
3100 yystos[yystate], yyvsp, yylsp, parseio);
3101 YYPOPSTACK (1);
3102 yystate = *yyssp;
3103 YY_STACK_PRINT (yyss, yyssp);
3106 if (yyn == YYFINAL)
3107 YYACCEPT;
3109 *++yyvsp = yylval;
3111 yyerror_range[1] = yylloc;
3112 /* Using YYLLOC is tempting, but would change the location of
3113 the look-ahead. YYLOC is available though. */
3114 YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);
3115 *++yylsp = yyloc;
3117 /* Shift the error token. */
3118 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
3120 yystate = yyn;
3121 goto yynewstate;
3124 /*-------------------------------------.
3125 | yyacceptlab -- YYACCEPT comes here. |
3126 `-------------------------------------*/
3127 yyacceptlab:
3128 yyresult = 0;
3129 goto yyreturn;
3131 /*-----------------------------------.
3132 | yyabortlab -- YYABORT comes here. |
3133 `-----------------------------------*/
3134 yyabortlab:
3135 yyresult = 1;
3136 goto yyreturn;
3138 #ifndef yyoverflow
3139 /*-------------------------------------------------.
3140 | yyexhaustedlab -- memory exhaustion comes here. |
3141 `-------------------------------------------------*/
3142 yyexhaustedlab:
3143 yyerror (&yylloc, parseio, YY_("memory exhausted"));
3144 yyresult = 2;
3145 /* Fall through. */
3146 #endif
3148 yyreturn:
3149 if (yychar != YYEOF && yychar != YYEMPTY)
3150 yydestruct ("Cleanup: discarding lookahead",
3151 yytoken, &yylval, &yylloc, parseio);
3152 /* Do not reclaim the symbols of the rule which action triggered
3153 this YYABORT or YYACCEPT. */
3154 YYPOPSTACK (yylen);
3155 YY_STACK_PRINT (yyss, yyssp);
3156 while (yyssp != yyss)
3158 yydestruct ("Cleanup: popping",
3159 yystos[*yyssp], yyvsp, yylsp, parseio);
3160 YYPOPSTACK (1);
3162 #ifndef yyoverflow
3163 if (yyss != yyssa)
3164 YYSTACK_FREE (yyss);
3165 #endif
3166 #if YYERROR_VERBOSE
3167 if (yymsg != yymsgbuf)
3168 YYSTACK_FREE (yymsg);
3169 #endif
3170 return yyresult;
3174 #line 626 "ael.y"
3177 static char *token_equivs1[] =
3179 "AMPER",
3180 "AT",
3181 "BAR",
3182 "COLON",
3183 "COMMA",
3184 "EQ",
3185 "EXTENMARK",
3186 "KW_BREAK",
3187 "KW_CASE",
3188 "KW_CATCH",
3189 "KW_CONTEXT",
3190 "KW_CONTINUE",
3191 "KW_DEFAULT",
3192 "KW_ELSE",
3193 "KW_ESWITCHES",
3194 "KW_FOR",
3195 "KW_GLOBALS",
3196 "KW_GOTO",
3197 "KW_HINT",
3198 "KW_IFTIME",
3199 "KW_IF",
3200 "KW_IGNOREPAT",
3201 "KW_INCLUDES"
3202 "KW_JUMP",
3203 "KW_MACRO",
3204 "KW_PATTERN",
3205 "KW_REGEXTEN",
3206 "KW_RETURN",
3207 "KW_SWITCHES",
3208 "KW_SWITCH",
3209 "KW_WHILE",
3210 "LC",
3211 "LP",
3212 "RC",
3213 "RP",
3214 "SEMI",
3217 static char *token_equivs2[] =
3219 "&",
3220 "@",
3221 "|",
3222 ":",
3223 ",",
3224 "=",
3225 "=>",
3226 "break",
3227 "case",
3228 "catch",
3229 "context",
3230 "continue",
3231 "default",
3232 "else",
3233 "eswitches",
3234 "for",
3235 "globals",
3236 "goto",
3237 "hint",
3238 "ifTime",
3239 "if",
3240 "ignorepat",
3241 "includes"
3242 "jump",
3243 "macro",
3244 "pattern",
3245 "regexten",
3246 "return",
3247 "switches",
3248 "switch",
3249 "while",
3250 "{",
3251 "(",
3252 "}",
3253 ")",
3254 ";",
3258 static char *ael_token_subst(const char *mess)
3260 /* calc a length, malloc, fill, and return; yyerror had better free it! */
3261 int len=0,i;
3262 const char *p;
3263 char *res, *s,*t;
3264 int token_equivs_entries = sizeof(token_equivs1)/sizeof(char*);
3266 for (p=mess; *p; p++) {
3267 for (i=0; i<token_equivs_entries; i++) {
3268 if ( strncmp(p,token_equivs1[i],strlen(token_equivs1[i])) == 0 )
3270 len+=strlen(token_equivs2[i])+2;
3271 p += strlen(token_equivs1[i])-1;
3272 break;
3275 len++;
3277 res = calloc(1, len+1);
3278 res[0] = 0;
3279 s = res;
3280 for (p=mess; *p;) {
3281 int found = 0;
3282 for (i=0; i<token_equivs_entries; i++) {
3283 if ( strncmp(p,token_equivs1[i],strlen(token_equivs1[i])) == 0 ) {
3284 *s++ = '\'';
3285 for (t=token_equivs2[i]; *t;) {
3286 *s++ = *t++;
3288 *s++ = '\'';
3289 p += strlen(token_equivs1[i]);
3290 found = 1;
3291 break;
3294 if( !found )
3295 *s++ = *p++;
3297 *s++ = 0;
3298 return res;
3301 void yyerror(YYLTYPE *locp, struct parse_io *parseio, char const *s)
3303 char *s2 = ael_token_subst(s);
3304 if (locp->first_line == locp->last_line) {
3305 ast_log(LOG_ERROR, "==== File: %s, Line %d, Cols: %d-%d: Error: %s\n", my_file, locp->first_line, locp->first_column, locp->last_column, s2);
3306 } else {
3307 ast_log(LOG_ERROR, "==== File: %s, Line %d Col %d to Line %d Col %d: Error: %s\n", my_file, locp->first_line, locp->first_column, locp->last_line, locp->last_column, s2);
3309 free(s2);
3310 parseio->syntax_error_count++;
3313 static struct pval *npval(pvaltype type, int first_line, int last_line,
3314 int first_column, int last_column)
3316 pval *z = calloc(1, sizeof(struct pval));
3317 z->type = type;
3318 z->startline = first_line;
3319 z->endline = last_line;
3320 z->startcol = first_column;
3321 z->endcol = last_column;
3322 z->filename = strdup(my_file);
3323 return z;
3326 static struct pval *npval2(pvaltype type, YYLTYPE *first, YYLTYPE *last)
3328 return npval(type, first->first_line, last->last_line,
3329 first->first_column, last->last_column);
3332 static struct pval *update_last(pval *obj, YYLTYPE *last)
3334 obj->endline = last->last_line;
3335 obj->endcol = last->last_column;
3336 return obj;
3339 /* frontend for npval to create a PV_WORD string from the given token */
3340 static pval *nword(char *string, YYLTYPE *pos)
3342 pval *p = npval2(PV_WORD, pos, pos);
3343 if (p)
3344 p->u1.str = string;
3345 return p;
3348 /* append second element to the list in the first one */
3349 static pval * linku1(pval *head, pval *tail)
3351 if (!head)
3352 return tail;
3353 if (tail) {
3354 if (!head->next) {
3355 head->next = tail;
3356 } else {
3357 head->u1_last->next = tail;
3359 head->u1_last = tail;
3360 tail->prev = head; /* the dad link only points to containers */
3362 return head;
3365 /* this routine adds a dad ptr to each element in the list */
3366 static void set_dads(struct pval *dad, struct pval *child_list)
3368 struct pval *t;
3370 for(t=child_list;t;t=t->next) /* simple stuff */
3371 t->dad = dad;