1 /* A Bison parser, made by GNU Bison 3.0.4. */
3 /* Bison implementation for Yacc-like parsers in C
5 Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
7 This program is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
20 /* As a special exception, you may create a larger work that contains
21 part or all of the Bison parser skeleton and distribute that work
22 under terms of your choice, so long as that work isn't itself a
23 parser generator using the skeleton or a modified version thereof
24 as a parser skeleton. Alternatively, if you modify or redistribute
25 the parser skeleton itself, you may (at your option) remove this
26 special exception, which will cause the skeleton and the resulting
27 Bison output files to be licensed under the GNU General Public
28 License without this special exception.
30 This special exception was added by the Free Software Foundation in
31 version 2.2 of Bison. */
33 /* C LALR(1) parser skeleton written by Richard Stallman, by
34 simplifying the original so-called "semantic" parser. */
36 /* All symbols defined below should begin with yy or YY, to avoid
37 infringing on user name space. This should be done even for local
38 variables, as they might otherwise be expanded by user macros.
39 There are some unavoidable exceptions within include files to
40 define necessary library symbols; they are noted "INFRINGES ON
41 USER NAME SPACE" below. */
43 /* Identify Bison output. */
47 #define YYBISON_VERSION "3.0.4"
50 #define YYSKELETON_NAME "yacc.c"
64 /* Copy the first part of user declarations. */
65 #line 24 "web2c-parser.y" /* yacc.c:339 */
71 #define symbol(x) sym_table[x].id
74 static char fn_return_type
[50], for_stack
[300], control_var
[50],
76 static char arg_type
[MAX_ARGS
][30];
77 static int last_type
= -1, ids_typed
;
78 static int proc_is_noreturn
= 0;
79 char my_routine
[100]; /* Name of routine being parsed, if any */
80 static char array_bounds
[80], array_offset
[80];
81 static int uses_mem
, uses_eqtb
, lower_sym
, upper_sym
;
82 static FILE *orig_out
;
83 boolean doing_statements
= false;
84 static boolean var_formals
= false;
85 static int param_id_list
[MAX_ARGS
], ids_paramed
=0;
87 extern char conditional
[], temp
[], *std_header
;
88 extern int tex
, mf
, strict_for
;
90 extern char coerce_name
[];
91 extern string program_name
;
94 static long my_labs (long);
95 static void compute_array_bounds (void);
96 static void fixup_var_list (void);
97 static void do_proc_args (void);
98 static void gen_function_head (void);
99 static boolean
doreturn (string
);
101 #line 102 "web2c-parser.c" /* yacc.c:339 */
104 # if defined __cplusplus && 201103L <= __cplusplus
105 # define YY_NULLPTR nullptr
107 # define YY_NULLPTR 0
111 /* Enabling verbose error messages. */
112 #ifdef YYERROR_VERBOSE
113 # undef YYERROR_VERBOSE
114 # define YYERROR_VERBOSE 1
116 # define YYERROR_VERBOSE 0
119 /* In a future release of Bison, this section will be replaced
120 by #include "y.tab.h". */
121 #ifndef YY_YY__TEX_LIVE_TEXK_WEB_C_WEB_C_WEB_C_PARSER_H_INCLUDED
122 # define YY_YY__TEX_LIVE_TEXK_WEB_C_WEB_C_WEB_C_PARSER_H_INCLUDED
165 string_literal_tok
= 287,
166 single_char_tok
= 288,
172 proc_param_tok
= 294,
187 unary_plus_tok
= 309,
188 unary_minus_tok
= 310,
196 #define array_tok 258
197 #define begin_tok 259
199 #define const_tok 261
201 #define downto_tok 263
206 #define function_tok 268
209 #define label_tok 271
211 #define procedure_tok 273
212 #define program_tok 274
213 #define record_tok 275
214 #define repeat_tok 276
218 #define until_tok 280
220 #define while_tok 282
221 #define noreturn_tok 283
222 #define others_tok 284
223 #define r_num_tok 285
224 #define i_num_tok 286
225 #define string_literal_tok 287
226 #define single_char_tok 288
227 #define assign_tok 289
228 #define two_dots_tok 290
229 #define undef_id_tok 291
230 #define var_id_tok 292
231 #define proc_id_tok 293
232 #define proc_param_tok 294
233 #define fun_id_tok 295
234 #define fun_param_tok 296
235 #define const_id_tok 297
236 #define type_id_tok 298
239 #define field_id_tok 301
240 #define define_tok 302
241 #define field_tok 303
242 #define break_tok 304
243 #define not_eq_tok 305
244 #define less_eq_tok 306
245 #define great_eq_tok 307
247 #define unary_plus_tok 309
248 #define unary_minus_tok 310
255 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
257 # define YYSTYPE_IS_TRIVIAL 1
258 # define YYSTYPE_IS_DECLARED 1
262 extern YYSTYPE yylval
;
266 #endif /* !YY_YY__TEX_LIVE_TEXK_WEB_C_WEB_C_WEB_C_PARSER_H_INCLUDED */
268 /* Copy the second part of user declarations. */
270 #line 271 "web2c-parser.c" /* yacc.c:358 */
277 typedef YYTYPE_UINT8 yytype_uint8
;
279 typedef unsigned char yytype_uint8
;
283 typedef YYTYPE_INT8 yytype_int8
;
285 typedef signed char yytype_int8
;
289 typedef YYTYPE_UINT16 yytype_uint16
;
291 typedef unsigned short int yytype_uint16
;
295 typedef YYTYPE_INT16 yytype_int16
;
297 typedef short int yytype_int16
;
301 # ifdef __SIZE_TYPE__
302 # define YYSIZE_T __SIZE_TYPE__
303 # elif defined size_t
304 # define YYSIZE_T size_t
305 # elif ! defined YYSIZE_T
306 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
307 # define YYSIZE_T size_t
309 # define YYSIZE_T unsigned int
313 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
316 # if defined YYENABLE_NLS && YYENABLE_NLS
318 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
319 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
323 # define YY_(Msgid) Msgid
328 # if (defined __GNUC__ \
329 && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
330 || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
331 # define YY_ATTRIBUTE(Spec) __attribute__(Spec)
333 # define YY_ATTRIBUTE(Spec) /* empty */
337 #ifndef YY_ATTRIBUTE_PURE
338 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
341 #ifndef YY_ATTRIBUTE_UNUSED
342 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
345 #if !defined _Noreturn \
346 && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
347 # if defined _MSC_VER && 1200 <= _MSC_VER
348 # define _Noreturn __declspec (noreturn)
350 # define _Noreturn YY_ATTRIBUTE ((__noreturn__))
354 /* Suppress unused-variable warnings by "using" E. */
355 #if ! defined lint || defined __GNUC__
356 # define YYUSE(E) ((void) (E))
358 # define YYUSE(E) /* empty */
361 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
362 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
363 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
364 _Pragma ("GCC diagnostic push") \
365 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
366 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
367 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
368 _Pragma ("GCC diagnostic pop")
370 # define YY_INITIAL_VALUE(Value) Value
372 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
373 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
374 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
376 #ifndef YY_INITIAL_VALUE
377 # define YY_INITIAL_VALUE(Value) /* Nothing. */
381 #if ! defined yyoverflow || YYERROR_VERBOSE
383 /* The parser invokes alloca or malloc; define the necessary symbols. */
385 # ifdef YYSTACK_USE_ALLOCA
386 # if YYSTACK_USE_ALLOCA
388 # define YYSTACK_ALLOC __builtin_alloca
389 # elif defined __BUILTIN_VA_ARG_INCR
390 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
392 # define YYSTACK_ALLOC __alloca
393 # elif defined _MSC_VER
394 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
395 # define alloca _alloca
397 # define YYSTACK_ALLOC alloca
398 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
399 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
400 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
401 # ifndef EXIT_SUCCESS
402 # define EXIT_SUCCESS 0
409 # ifdef YYSTACK_ALLOC
410 /* Pacify GCC's 'empty if-body' warning. */
411 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
412 # ifndef YYSTACK_ALLOC_MAXIMUM
413 /* The OS might guarantee only one guard page at the bottom of the stack,
414 and a page size can be as small as 4096 bytes. So we cannot safely
415 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
416 to allow for a few compiler-allocated temporary stack slots. */
417 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
420 # define YYSTACK_ALLOC YYMALLOC
421 # define YYSTACK_FREE YYFREE
422 # ifndef YYSTACK_ALLOC_MAXIMUM
423 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
425 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
426 && ! ((defined YYMALLOC || defined malloc) \
427 && (defined YYFREE || defined free)))
428 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
429 # ifndef EXIT_SUCCESS
430 # define EXIT_SUCCESS 0
434 # define YYMALLOC malloc
435 # if ! defined malloc && ! defined EXIT_SUCCESS
436 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
441 # if ! defined free && ! defined EXIT_SUCCESS
442 void free (void *); /* INFRINGES ON USER NAME SPACE */
446 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
449 #if (! defined yyoverflow \
450 && (! defined __cplusplus \
451 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
453 /* A type that is properly aligned for any stack member. */
456 yytype_int16 yyss_alloc
;
460 /* The size of the maximum gap between one aligned stack and the next. */
461 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
463 /* The size of an array large to enough to hold all stacks, each with
465 # define YYSTACK_BYTES(N) \
466 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
467 + YYSTACK_GAP_MAXIMUM)
469 # define YYCOPY_NEEDED 1
471 /* Relocate STACK from its old location to the new one. The
472 local variables YYSIZE and YYSTACKSIZE give the old and new number of
473 elements in the stack, and YYPTR gives the new location of the
474 stack. Advance YYPTR to a properly aligned location for the next
476 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
479 YYSIZE_T yynewbytes; \
480 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
481 Stack = &yyptr->Stack_alloc; \
482 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
483 yyptr += yynewbytes / sizeof (*yyptr); \
489 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
490 /* Copy COUNT objects from SRC to DST. The source and destination do
493 # if defined __GNUC__ && 1 < __GNUC__
494 # define YYCOPY(Dst, Src, Count) \
495 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
497 # define YYCOPY(Dst, Src, Count) \
501 for (yyi = 0; yyi < (Count); yyi++) \
502 (Dst)[yyi] = (Src)[yyi]; \
507 #endif /* !YYCOPY_NEEDED */
509 /* YYFINAL -- State number of the termination state. */
511 /* YYLAST -- Last index in YYTABLE. */
514 /* YYNTOKENS -- Number of terminals. */
516 /* YYNNTS -- Number of nonterminals. */
518 /* YYNRULES -- Number of rules. */
520 /* YYNSTATES -- Number of states. */
521 #define YYNSTATES 492
523 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
524 by yylex, with out-of-bounds checking. */
526 #define YYMAXUTOK 314
528 #define YYTRANSLATE(YYX) \
529 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
531 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
532 as returned by yylex, without out-of-bounds checking. */
533 static const yytype_uint8 yytranslate
[] =
535 0, 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 68, 69, 61, 56, 70, 57, 75, 62, 2, 2,
540 2, 2, 2, 2, 2, 2, 2, 2, 74, 67,
541 52, 50, 53, 2, 2, 2, 2, 2, 2, 2,
542 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
543 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
544 2, 72, 2, 73, 71, 2, 2, 2, 2, 2,
545 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
546 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
547 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
548 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
549 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
550 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
551 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
552 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
553 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
554 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
555 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
556 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
557 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
558 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
559 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
560 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
561 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
562 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
563 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
564 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
565 45, 46, 47, 48, 49, 51, 54, 55, 58, 59,
570 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
571 static const yytype_uint16 yyrline
[] =
573 0, 66, 66, 73, 64, 80, 82, 85, 90, 95,
574 100, 105, 110, 115, 120, 129, 138, 142, 143, 147,
575 148, 152, 153, 157, 162, 176, 157, 206, 208, 207,
576 213, 214, 218, 221, 223, 228, 229, 233, 241, 245,
577 246, 233, 251, 259, 260, 261, 265, 267, 267, 269,
578 269, 271, 271, 273, 273, 275, 275, 277, 277, 279,
579 279, 281, 281, 283, 283, 285, 285, 287, 287, 289,
580 289, 291, 291, 293, 293, 295, 300, 299, 303, 307,
581 313, 322, 325, 326, 329, 330, 334, 336, 343, 334,
582 360, 361, 365, 398, 402, 405, 407, 411, 418, 425,
583 434, 446, 460, 464, 465, 469, 476, 491, 492, 496,
584 498, 508, 512, 511, 517, 518, 522, 524, 522, 542,
585 545, 546, 549, 561, 575, 574, 580, 582, 586, 587,
586 591, 599, 591, 607, 608, 611, 625, 639, 655, 658,
587 657, 670, 671, 674, 676, 681, 684, 686, 685, 692,
588 691, 708, 707, 724, 730, 729, 741, 742, 746, 746,
589 762, 762, 763, 763, 767, 768, 771, 775, 786, 792,
590 774, 799, 809, 814, 798, 821, 822, 825, 828, 832,
591 831, 837, 838, 841, 842, 846, 854, 856, 860, 861,
592 862, 863, 864, 869, 868, 872, 871, 877, 876, 887,
593 893, 895, 899, 900, 904, 903, 907, 925, 927, 931,
594 933, 932, 937, 939, 939, 941, 941, 943, 943, 945,
595 945, 947, 947, 949, 949, 951, 951, 953, 953, 955,
596 955, 957, 957, 959, 959, 961, 961, 963, 963, 966,
597 965, 969, 974, 975, 977, 983, 982, 986, 987, 988,
598 991, 990, 996, 996, 1001, 1002, 1002, 1007, 1008, 1013,
599 1014, 1017, 1019, 1026, 1025, 1030, 1044, 1047, 1048, 1049,
600 1052, 1053, 1057, 1056, 1062, 1061, 1067, 1066, 1070, 1073,
601 1069, 1077, 1079, 1078, 1084, 1086, 1083, 1093, 1094, 1097,
602 1101, 1102, 1105, 1110, 1114, 1115, 1118, 1119, 1120, 1124,
603 1128, 1123, 1133, 1135, 1132, 1143, 1152, 1158, 1142, 1192,
604 1197, 1199, 1196, 1209, 1211, 1208
608 #if YYDEBUG || YYERROR_VERBOSE || 0
609 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
610 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
611 static const char *const yytname
[] =
613 "$end", "error", "$undefined", "array_tok", "begin_tok", "case_tok",
614 "const_tok", "do_tok", "downto_tok", "else_tok", "end_tok", "file_tok",
615 "for_tok", "function_tok", "goto_tok", "if_tok", "label_tok", "of_tok",
616 "procedure_tok", "program_tok", "record_tok", "repeat_tok", "then_tok",
617 "to_tok", "type_tok", "until_tok", "var_tok", "while_tok",
618 "noreturn_tok", "others_tok", "r_num_tok", "i_num_tok",
619 "string_literal_tok", "single_char_tok", "assign_tok", "two_dots_tok",
620 "undef_id_tok", "var_id_tok", "proc_id_tok", "proc_param_tok",
621 "fun_id_tok", "fun_param_tok", "const_id_tok", "type_id_tok", "hhb0_tok",
622 "hhb1_tok", "field_id_tok", "define_tok", "field_tok", "break_tok",
623 "'='", "not_eq_tok", "'<'", "'>'", "less_eq_tok", "great_eq_tok", "'+'",
624 "'-'", "or_tok", "unary_plus_tok", "unary_minus_tok", "'*'", "'/'",
625 "div_tok", "mod_tok", "and_tok", "not_tok", "';'", "'('", "')'", "','",
626 "'^'", "'['", "']'", "':'", "'.'", "$accept", "PROGRAM", "$@1", "$@2",
627 "DEFS", "DEF", "PROGRAM_HEAD", "PROGRAM_FILE_PART", "PROGRAM_FILE_LIST",
628 "PROGRAM_FILE", "BLOCK", "$@3", "$@4", "$@5", "LABEL_DEC_PART", "$@6",
629 "LABEL_LIST", "LABEL", "CONST_DEC_PART", "CONST_DEC_LIST", "CONST_DEC",
630 "$@7", "$@8", "$@9", "$@10", "CONSTANT", "CONSTANT_EXPRESS", "$@11",
631 "$@12", "$@13", "$@14", "$@15", "$@16", "$@17", "$@18", "$@19", "$@20",
632 "$@21", "$@22", "$@23", "$@24", "CONST_FACTOR", "$@25", "STRING",
633 "CONSTANT_ID", "TYPE_DEC_PART", "TYPE_DEF_LIST", "TYPE_DEF", "$@26",
634 "$@27", "$@28", "TYPE", "SIMPLE_TYPE", "SUBRANGE_TYPE", "POSSIBLE_PLUS",
635 "SUBRANGE_CONSTANT", "TYPE_ID", "STRUCTURED_TYPE", "POINTER_TYPE",
636 "ARRAY_TYPE", "INDEX_TYPE", "COMPONENT_TYPE", "RECORD_TYPE", "$@29",
637 "FIELD_LIST", "RECORD_SECTION", "$@30", "$@31", "FIELD_ID_LIST",
638 "FIELD_ID", "FILE_TYPE", "$@32", "VAR_DEC_PART", "VAR_DEC_LIST",
639 "VAR_DEC", "$@33", "$@34", "VAR_ID_DEC_LIST", "VAR_ID", "BODY", "$@35",
640 "P_F_DEC_PART", "P_F_DEC", "PROCEDURE_DEC", "PROCEDURE_TOK", "$@36",
641 "PROCEDURE_HEAD", "$@37", "$@38", "PARAM", "$@39", "FORM_PAR_SEC_L",
642 "FORM_PAR_SEC1", "$@40", "FORM_PAR_SEC", "$@41", "$@42", "DECLARED_PROC",
643 "FUNCTION_DEC", "FUNCTION_HEAD", "$@43", "$@44", "$@45", "$@46", "$@47",
644 "$@48", "DECLARED_FUN", "RESULT_TYPE", "STAT_PART", "COMPOUND_STAT",
645 "$@49", "STAT_LIST", "STATEMENT", "S_LABEL", "UNLAB_STAT", "SIMPLE_STAT",
646 "ASSIGN_STAT", "$@50", "$@51", "VARIABLE", "@52", "FUNC_ID_AS",
647 "VAR_DESIG_LIST", "VAR_DESIG", "$@53", "VAR_DESIG1", "$@54", "EXPRESS",
648 "$@55", "$@56", "$@57", "$@58", "$@59", "$@60", "$@61", "$@62", "$@63",
649 "$@64", "$@65", "$@66", "$@67", "$@68", "UNARY_OP", "FACTOR", "$@69",
650 "$@70", "PARAM_LIST", "$@71", "ACTUAL_PARAM_L", "$@72", "ACTUAL_PARAM",
651 "WIDTH_FIELD", "PROC_STAT", "$@73", "GO_TO_STAT", "EMPTY_STAT",
652 "STRUCT_STAT", "CONDIT_STAT", "IF_STATEMENT", "$@74",
653 "IF_THEN_ELSE_STAT", "$@75", "THEN_ELSE_STAT", "$@76", "$@77", "$@78",
654 "ELSE_STAT", "$@79", "CASE_STATEMENT", "$@80", "$@81", "CASE_EL_LIST",
655 "CASE_ELEMENT", "CASE_LAB_LIST", "CASE_LAB", "END_CASE", "REPETIT_STAT",
656 "WHILE_STATEMENT", "$@82", "$@83", "REP_STATEMENT", "$@84", "$@85",
657 "FOR_STATEMENT", "$@86", "$@87", "$@88", "CONTROL_VAR", "FOR_LIST",
658 "$@89", "$@90", "$@91", "$@92", YY_NULLPTR
663 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
664 (internal) symbol number NUM (which must be that of a token). */
665 static const yytype_uint16 yytoknum
[] =
667 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
668 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
669 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
670 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
671 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
672 61, 305, 60, 62, 306, 307, 43, 45, 308, 309,
673 310, 42, 47, 311, 312, 313, 314, 59, 40, 41,
674 44, 94, 91, 93, 58, 46
678 #define YYPACT_NINF -256
680 #define yypact_value_is_default(Yystate) \
681 (!!((Yystate) == (-256)))
683 #define YYTABLE_NINF -314
685 #define yytable_value_is_error(Yytable_value) \
686 (!!((Yytable_value) == (-314)))
688 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
690 static const yytype_int16 yypact
[] =
692 -256, 23, 8, -256, -7, 12, -256, -256, 32, 89,
693 109, 125, 163, 205, 209, 112, -16, 167, 173, -18,
694 16, -28, 182, 183, -256, 245, -256, -256, 48, -256,
695 -256, -256, -256, 195, -256, 201, 17, -256, -256, -256,
696 221, -256, 239, -256, -16, 206, 207, -256, -256, -256,
697 -256, 208, 240, 250, -256, 39, -256, 257, -256, 258,
698 -256, 269, -256, -256, -256, -256, -256, 17, -256, 221,
699 -256, -256, 260, -256, 263, -256, -256, -256, -256, 251,
700 -256, -256, -3, -256, 21, 92, -256, 253, -256, -256,
701 -256, -256, -8, -256, 86, 194, -256, 24, -256, 233,
702 268, -256, 242, -256, 317, -256, 21, -256, -256, -256,
703 -256, -256, -256, -256, -256, 288, -256, -256, -256, -256,
704 -256, -256, 112, -256, -256, -256, -256, -256, -256, -256,
705 -256, -256, -256, -256, -256, 449, -256, -256, -256, 317,
706 4, -256, 4, 247, 247, 247, -256, 293, 247, 245,
707 317, -256, -256, -256, -256, -256, -256, -256, -256, -256,
708 -256, -256, -256, -256, -256, 243, -256, 241, 299, -256,
709 -256, 274, 252, -256, -256, -256, -256, -256, -256, -256,
710 -256, 254, -256, 244, 248, 256, -256, -256, -256, 294,
711 -256, -256, -256, -256, -256, 36, -256, -256, -256, -256,
712 -256, -256, -2, -256, 264, -256, -256, -256, 292, 303,
713 -256, -256, -256, -256, -256, -256, -256, -256, -256, -256,
714 -256, 273, 239, 409, 317, 317, 317, 317, 317, 317,
715 317, 317, 317, 317, 317, 317, 317, 317, -256, 35,
716 -256, 1, -256, -256, -256, 301, -256, -256, -256, 293,
717 176, 304, -256, 176, 293, 176, 44, 276, 278, 293,
718 331, -256, -256, -256, -256, -256, 465, 465, 465, 465,
719 465, 465, 131, 131, 131, -256, -256, -256, -256, -256,
720 -256, -256, 127, 4, 2, -256, 15, -256, 22, -256,
721 -256, 4, 4, 3, -256, -256, -256, -256, -256, 226,
722 176, -256, -256, 320, 481, -256, -19, 481, -256, 180,
723 44, -256, -256, -256, -256, -256, -256, 176, 176, 269,
724 35, 334, -256, -256, 1, -256, -256, 128, -256, -256,
725 301, -256, -256, 21, -256, -256, -256, -256, 276, 176,
726 -256, -256, -256, -256, -256, -256, -256, -256, -256, -256,
727 -256, -256, -256, -256, -256, -256, -256, 333, -256, 349,
728 176, -256, -256, -256, -256, 55, 481, 481, -256, 284,
729 4, -256, 15, -256, -256, -256, 140, 295, 296, -256,
730 429, 198, 176, 176, 176, 176, 176, 176, 176, 176,
731 176, 176, 176, 176, 176, 176, 176, 345, -256, 176,
732 293, 361, -256, 336, 169, -256, 357, 347, -256, -256,
733 -256, 4, 322, -256, -256, -256, -256, -256, 6, -256,
734 141, -256, 497, 497, 497, 497, 497, 497, 158, 158,
735 158, -256, -256, -256, -256, -256, 204, 359, -256, 293,
736 481, -256, -256, -256, -256, 342, -256, -256, -256, 293,
737 -256, 4, -256, -256, -256, 70, -256, 198, 331, 351,
738 367, -256, 176, 369, 176, -256, 55, 7, -256, -256,
739 -256, -256, -256, -256, -256, 293, -256, -256, -256, 385,
740 -256, -256, 176, 176, -256, 369, 293, -256, 481, 481,
744 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
745 Performed when YYTABLE does not specify something else to do. Zero
746 means the default is an error. */
747 static const yytype_uint16 yydefact
[] =
749 5, 0, 0, 1, 0, 0, 6, 2, 18, 0,
750 0, 0, 0, 0, 0, 27, 0, 0, 0, 0,
751 0, 0, 0, 0, 28, 33, 22, 21, 0, 19,
752 16, 9, 8, 0, 11, 0, 95, 13, 15, 7,
753 0, 37, 82, 17, 0, 0, 0, 100, 99, 98,
754 96, 0, 0, 0, 32, 0, 30, 34, 35, 0,
755 86, 126, 20, 10, 12, 14, 97, 95, 29, 0,
756 36, 38, 83, 84, 0, 130, 3, 94, 31, 0,
757 85, 87, 127, 128, 0, 0, 39, 0, 129, 135,
758 136, 137, 0, 133, 0, 146, 147, 138, 141, 0,
759 0, 23, 0, 23, 0, 88, 0, 131, 167, 175,
760 176, 171, 164, 165, 151, 0, 139, 4, 142, 143,
761 149, 145, 27, 144, 166, 43, 42, 79, 80, 81,
762 242, 243, 244, 76, 78, 40, 75, 44, 45, 0,
763 95, 134, 95, 153, 153, 153, 148, 266, 153, 33,
764 0, 55, 57, 61, 63, 65, 67, 47, 49, 71,
765 51, 73, 53, 59, 69, 0, 46, 0, 0, 112,
766 101, 0, 0, 90, 92, 93, 91, 105, 102, 103,
767 104, 0, 154, 0, 0, 0, 179, 284, 305, 0,
768 272, 302, 299, 185, 262, 199, 261, 263, 200, 201,
769 192, 267, 0, 181, 0, 183, 186, 188, 0, 0,
770 189, 190, 191, 187, 268, 270, 271, 269, 296, 297,
771 298, 0, 82, 0, 0, 0, 0, 0, 0, 0,
772 0, 0, 0, 0, 0, 0, 0, 0, 41, 95,
773 124, 116, 106, 89, 132, 160, 168, 172, 152, 266,
774 0, 0, 265, 0, 266, 0, 0, 0, 0, 266,
775 266, 193, 195, 150, 24, 77, 56, 58, 62, 64,
776 66, 68, 48, 50, 72, 52, 74, 54, 60, 70,
777 110, 109, 0, 95, 0, 114, 0, 162, 0, 156,
778 158, 95, 95, 0, 249, 250, 245, 248, 247, 0,
779 0, 241, 309, 0, 274, 273, 0, 300, 204, 0,
780 198, 202, 252, 264, 140, 182, 184, 0, 0, 126,
781 95, 0, 125, 113, 116, 122, 123, 0, 120, 158,
782 160, 155, 161, 0, 177, 169, 173, 180, 0, 0,
783 285, 221, 223, 227, 229, 231, 233, 213, 215, 237,
784 217, 239, 219, 225, 235, 212, 306, 0, 303, 0,
785 0, 207, 208, 206, 203, 0, 194, 196, 25, 0,
786 95, 115, 0, 117, 163, 157, 0, 0, 0, 251,
787 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
788 0, 0, 0, 0, 0, 0, 0, 276, 275, 0,
789 266, 0, 258, 260, 0, 254, 0, 0, 111, 107,
790 121, 95, 0, 170, 174, 246, 293, 292, 0, 287,
791 0, 290, 222, 224, 228, 230, 232, 234, 214, 216,
792 238, 218, 240, 220, 226, 236, 310, 0, 278, 266,
793 304, 301, 210, 209, 205, 0, 257, 253, 255, 266,
794 26, 95, 118, 159, 294, 0, 286, 0, 266, 0,
795 0, 307, 0, 281, 0, 259, 0, 0, 108, 295,
796 288, 291, 289, 311, 314, 266, 279, 282, 277, 0,
797 256, 178, 0, 0, 308, 281, 266, 211, 312, 315,
801 /* YYPGOTO[NTERM-NUM]. */
802 static const yytype_int16 yypgoto
[] =
804 -256, -256, -256, -256, -256, -256, -256, -256, -256, 335,
805 279, -256, -256, -256, 259, -256, -256, 315, 246, -256,
806 339, -256, -256, -256, -256, -94, -46, -256, -256, -256,
807 -256, -256, -256, -256, -256, -256, -256, -256, -256, -256,
808 -256, -256, -256, -256, -256, 181, -256, 330, -256, -256,
809 -256, -139, -256, -34, -256, 337, -256, -256, -256, -256,
810 85, -45, -256, -256, -256, 83, -256, -256, -256, 37,
811 -256, -256, 101, -256, 326, -256, -256, 88, 321, -256,
812 -256, -256, 332, -256, -256, -256, -256, -256, -256, -113,
813 -256, -256, 99, -256, 100, -256, -256, -256, -256, -256,
814 -256, -256, -256, -256, -256, -256, -256, 152, -256, -256,
815 -256, -245, -238, -256, -255, -256, -256, -256, -256, -147,
816 -256, -256, -256, 122, -256, -256, -256, -236, -256, -256,
817 -256, -256, -256, -256, -256, -256, -256, -256, -256, -256,
818 -256, -256, -60, -256, -256, -256, 95, -256, -256, -256,
819 -21, -256, -256, -256, -256, -256, -256, -256, -256, -256,
820 -11, -256, -256, -256, -256, -256, -33, -256, -256, -256,
821 -256, -256, -1, -256, -4, -256, -256, -256, -256, -256,
822 -256, -256, -256, -256, -256, -256, -256, -256, -256, -256,
826 /* YYDEFGOTO[NTERM-NUM]. */
827 static const yytype_int16 yydefgoto
[] =
829 -1, 1, 15, 85, 2, 6, 7, 17, 28, 29,
830 121, 122, 319, 406, 25, 40, 55, 56, 42, 57,
831 58, 59, 79, 104, 165, 297, 135, 230, 231, 233,
832 235, 224, 225, 236, 226, 227, 228, 229, 237, 232,
833 234, 136, 150, 137, 138, 61, 72, 73, 74, 87,
834 140, 334, 173, 174, 52, 53, 175, 176, 177, 178,
835 282, 409, 179, 241, 284, 285, 286, 411, 327, 328,
836 180, 283, 76, 82, 83, 84, 142, 92, 93, 117,
837 147, 97, 98, 99, 100, 115, 101, 148, 145, 183,
838 245, 288, 332, 333, 289, 290, 329, 114, 102, 103,
839 143, 291, 377, 144, 292, 378, 111, 335, 450, 201,
840 249, 202, 203, 204, 205, 206, 207, 317, 318, 298,
841 256, 209, 310, 311, 360, 444, 464, 304, 388, 389,
842 391, 393, 382, 383, 394, 384, 385, 386, 387, 395,
843 390, 392, 300, 301, 339, 338, 313, 365, 404, 466,
844 405, 446, 210, 257, 211, 212, 213, 214, 215, 253,
845 305, 357, 398, 439, 462, 485, 478, 486, 216, 250,
846 381, 418, 419, 420, 421, 456, 217, 218, 255, 359,
847 219, 254, 399, 220, 251, 396, 475, 303, 437, 459,
851 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
852 positive, shift that token. If negative, reduce the rule whose
853 number is the opposite. If YYTABLE_NINF, syntax error. */
854 static const yytype_int16 yytable
[] =
856 208, 172, 51, 181, 293, 316, 358, 167, 258, 306,
857 134, -119, 323, 337, 299, 168, 454, 481, 9, 307,
858 26, 315, 36, 3, 169, 10, 27, 4, 116, 8,
859 11, 184, 185, -130, -130, 221, 12, 94, 13, 37,
860 47, 48, 95, -130, 139, 134, 49, 170, 259, 32,
861 33, 325, 96, 47, 48, 5, 134, 89, 90, 49,
862 14, 326, 106, 50, 355, 259, 107, 91, -119, 324,
863 259, 47, 48, 455, 259, 171, 50, 49, 280, 139,
864 469, 366, 367, 34, 35, 125, 126, 127, 128, 330,
865 139, 331, 195, 166, 50, 294, 295, 129, 402, 416,
866 16, 417, 208, 380, 223, 94, 68, 208, -197, 69,
867 95, -197, 208, 208, 130, 131, 308, 43, 44, 309,
868 96, 132, 108, 296, 401, 18, 109, 110, 24, 403,
869 134, 134, 134, 134, 134, 134, 134, 134, 134, 134,
870 134, 134, 134, 134, 322, 19, 422, 423, 424, 425,
871 426, 427, 428, 429, 430, 431, 432, 433, 434, 435,
872 436, 20, 441, 440, 139, 139, 139, 139, 139, 139,
873 139, 139, 139, 139, 139, 139, 139, 139, 266, 267,
874 268, 269, 270, 271, 272, 273, 274, 275, 276, 277,
875 278, 279, 160, 161, 162, 163, 164, 320, 372, 21,
876 321, 463, 373, 472, 467, 281, 125, 126, 127, 128,
877 106, 457, -313, 195, 412, 458, 294, 295, 129, 350,
878 351, 352, 353, 354, 361, 362, 363, 416, 479, 417,
879 403, 408, 112, 113, 30, 130, 131, 484, 447, 448,
880 31, 22, 132, 340, 296, 23, 488, 489, 491, 38,
881 39, 41, 54, 208, 341, 342, 343, 344, 345, 346,
882 347, 348, 349, 60, 45, 350, 351, 352, 353, 354,
883 46, 66, 452, 63, 64, 65, 341, 342, 343, 344,
884 345, 346, 347, 348, 349, 67, 281, 350, 351, 352,
885 353, 354, 208, -37, 71, 75, -86, 186, 187, 81,
886 119, 86, 208, 105, 120, 188, 146, 189, 190, 123,
887 238, 208, 408, 239, 191, 182, 240, 242, 246, 243,
888 192, 244, 247, 248, 193, 252, 261, 287, 208, 194,
889 195, 196, 197, 198, 199, 186, 187, 262, 260, 208,
890 263, 302, 200, 188, 312, 189, 190, 125, 126, 127,
891 128, 370, 191, 314, 356, 397, 400, 407, 192, 129,
892 438, 449, 413, 414, 451, 453, 461, 194, 195, 196,
893 197, 198, 199, 465, 473, 474, 130, 131, 477, 62,
894 200, 149, 124, 132, 78, 133, 341, 342, 343, 344,
895 345, 346, 347, 348, 349, 222, 70, 350, 351, 352,
896 353, 354, 80, 264, 77, 369, 468, 371, 88, 410,
897 445, 341, 342, 343, 344, 345, 346, 347, 348, 349,
898 368, 376, 350, 351, 352, 353, 354, 141, 374, 118,
899 375, 442, 364, 379, 443, 341, 342, 343, 344, 345,
900 346, 347, 348, 349, 336, 480, 350, 351, 352, 353,
901 354, 476, 490, 471, 470, 0, 0, 0, 487, 151,
902 152, 153, 154, 155, 156, 157, 158, 159, 0, 0,
903 160, 161, 162, 163, 164, 0, 0, 0, 265, 341,
904 342, 343, 344, 345, 346, 347, 348, 349, 0, 0,
905 350, 351, 352, 353, 354, 0, 0, 0, 415, 151,
906 152, 153, 154, 155, 156, 157, 158, 159, 0, 0,
907 160, 161, 162, 163, 164, -314, -314, -314, -314, -314,
908 -314, 157, 158, 159, 0, 0, 160, 161, 162, 163,
909 164, 341, 342, 343, 344, 345, 346, 347, 348, 349,
910 0, 0, 350, 351, 352, 353, 354, -314, -314, -314,
911 -314, -314, -314, 347, 348, 349, 0, 0, 350, 351,
915 static const yytype_int16 yycheck
[] =
917 147, 140, 36, 142, 249, 260, 25, 3, 10, 254,
918 104, 10, 10, 10, 250, 11, 10, 10, 6, 255,
919 36, 259, 50, 0, 20, 13, 42, 19, 4, 36,
920 18, 144, 145, 36, 37, 148, 24, 13, 26, 67,
921 36, 37, 18, 46, 104, 139, 42, 43, 67, 67,
922 68, 36, 28, 36, 37, 47, 150, 36, 37, 42,
923 48, 46, 70, 59, 300, 67, 74, 46, 67, 67,
924 67, 36, 37, 67, 67, 71, 59, 42, 43, 139,
925 10, 317, 318, 67, 68, 30, 31, 32, 33, 67,
926 150, 69, 37, 139, 59, 40, 41, 42, 43, 29,
927 68, 31, 249, 339, 150, 13, 67, 254, 72, 70,
928 18, 75, 259, 260, 59, 60, 72, 69, 70, 75,
929 28, 66, 36, 68, 360, 36, 40, 41, 16, 365,
930 224, 225, 226, 227, 228, 229, 230, 231, 232, 233,
931 234, 235, 236, 237, 283, 36, 382, 383, 384, 385,
932 386, 387, 388, 389, 390, 391, 392, 393, 394, 395,
933 396, 36, 400, 399, 224, 225, 226, 227, 228, 229,
934 230, 231, 232, 233, 234, 235, 236, 237, 224, 225,
935 226, 227, 228, 229, 230, 231, 232, 233, 234, 235,
936 236, 237, 61, 62, 63, 64, 65, 70, 70, 36,
937 73, 439, 74, 458, 449, 239, 30, 31, 32, 33,
938 70, 70, 8, 37, 74, 74, 40, 41, 42, 61,
939 62, 63, 64, 65, 44, 45, 46, 29, 464, 31,
940 466, 370, 38, 39, 67, 59, 60, 475, 69, 70,
941 67, 36, 66, 17, 68, 36, 482, 483, 486, 67,
942 67, 6, 31, 400, 50, 51, 52, 53, 54, 55,
943 56, 57, 58, 24, 69, 61, 62, 63, 64, 65,
944 69, 31, 411, 67, 67, 67, 50, 51, 52, 53,
945 54, 55, 56, 57, 58, 35, 320, 61, 62, 63,
946 64, 65, 439, 36, 36, 26, 36, 4, 5, 36,
947 67, 50, 449, 50, 36, 12, 18, 14, 15, 67,
948 67, 458, 451, 72, 21, 68, 17, 43, 74, 67,
949 27, 67, 74, 67, 31, 31, 34, 26, 475, 36,
950 37, 38, 39, 40, 41, 4, 5, 34, 74, 486,
951 67, 37, 49, 12, 68, 14, 15, 30, 31, 32,
952 33, 17, 21, 75, 34, 22, 7, 73, 27, 42,
953 15, 4, 67, 67, 17, 43, 7, 36, 37, 38,
954 39, 40, 41, 31, 23, 8, 59, 60, 9, 44,
955 49, 122, 103, 66, 69, 68, 50, 51, 52, 53,
956 54, 55, 56, 57, 58, 149, 57, 61, 62, 63,
957 64, 65, 72, 222, 67, 320, 451, 324, 82, 372,
958 74, 50, 51, 52, 53, 54, 55, 56, 57, 58,
959 319, 333, 61, 62, 63, 64, 65, 106, 329, 97,
960 330, 70, 310, 338, 73, 50, 51, 52, 53, 54,
961 55, 56, 57, 58, 292, 466, 61, 62, 63, 64,
962 65, 462, 485, 457, 455, -1, -1, -1, 73, 50,
963 51, 52, 53, 54, 55, 56, 57, 58, -1, -1,
964 61, 62, 63, 64, 65, -1, -1, -1, 69, 50,
965 51, 52, 53, 54, 55, 56, 57, 58, -1, -1,
966 61, 62, 63, 64, 65, -1, -1, -1, 69, 50,
967 51, 52, 53, 54, 55, 56, 57, 58, -1, -1,
968 61, 62, 63, 64, 65, 50, 51, 52, 53, 54,
969 55, 56, 57, 58, -1, -1, 61, 62, 63, 64,
970 65, 50, 51, 52, 53, 54, 55, 56, 57, 58,
971 -1, -1, 61, 62, 63, 64, 65, 50, 51, 52,
972 53, 54, 55, 56, 57, 58, -1, -1, 61, 62,
976 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
977 symbol of state STATE-NUM. */
978 static const yytype_uint16 yystos
[] =
980 0, 77, 80, 0, 19, 47, 81, 82, 36, 6,
981 13, 18, 24, 26, 48, 78, 68, 83, 36, 36,
982 36, 36, 36, 36, 16, 90, 36, 42, 84, 85,
983 67, 67, 67, 68, 67, 68, 50, 67, 67, 67,
984 91, 6, 94, 69, 70, 69, 69, 36, 37, 42,
985 59, 129, 130, 131, 31, 92, 93, 95, 96, 97,
986 24, 121, 85, 67, 67, 67, 31, 35, 67, 70,
987 96, 36, 122, 123, 124, 26, 148, 131, 93, 98,
988 123, 36, 149, 150, 151, 79, 50, 125, 150, 36,
989 37, 46, 153, 154, 13, 18, 28, 157, 158, 159,
990 160, 162, 174, 175, 99, 50, 70, 74, 36, 40,
991 41, 182, 38, 39, 173, 161, 4, 155, 158, 67,
992 36, 86, 87, 67, 86, 30, 31, 32, 33, 42,
993 59, 60, 66, 68, 101, 102, 117, 119, 120, 218,
994 126, 154, 152, 176, 179, 164, 18, 156, 163, 90,
995 118, 50, 51, 52, 53, 54, 55, 56, 57, 58,
996 61, 62, 63, 64, 65, 100, 102, 3, 11, 20,
997 43, 71, 127, 128, 129, 132, 133, 134, 135, 138,
998 146, 127, 68, 165, 165, 165, 4, 5, 12, 14,
999 15, 21, 27, 31, 36, 37, 38, 39, 40, 41,
1000 49, 185, 187, 188, 189, 190, 191, 192, 195, 197,
1001 228, 230, 231, 232, 233, 234, 244, 252, 253, 256,
1002 259, 165, 94, 102, 107, 108, 110, 111, 112, 113,
1003 103, 104, 115, 105, 116, 106, 109, 114, 67, 72,
1004 17, 139, 43, 67, 67, 166, 74, 74, 67, 186,
1005 245, 260, 31, 235, 257, 254, 196, 229, 10, 67,
1006 74, 34, 34, 67, 121, 69, 102, 102, 102, 102,
1007 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
1008 43, 129, 136, 147, 140, 141, 142, 26, 167, 170,
1009 171, 177, 180, 187, 40, 41, 68, 101, 195, 203,
1010 218, 219, 37, 263, 203, 236, 187, 203, 72, 75,
1011 198, 199, 68, 222, 75, 188, 190, 193, 194, 88,
1012 70, 73, 127, 10, 67, 36, 46, 144, 145, 172,
1013 67, 69, 168, 169, 127, 183, 183, 10, 221, 220,
1014 17, 50, 51, 52, 53, 54, 55, 56, 57, 58,
1015 61, 62, 63, 64, 65, 203, 34, 237, 25, 255,
1016 200, 44, 45, 46, 199, 223, 203, 203, 148, 136,
1017 17, 141, 70, 74, 168, 170, 153, 178, 181, 222,
1018 203, 246, 208, 209, 211, 212, 213, 214, 204, 205,
1019 216, 206, 217, 207, 210, 215, 261, 22, 238, 258,
1020 7, 203, 43, 203, 224, 226, 89, 73, 127, 137,
1021 145, 143, 74, 67, 67, 69, 29, 31, 247, 248,
1022 249, 250, 203, 203, 203, 203, 203, 203, 203, 203,
1023 203, 203, 203, 203, 203, 203, 203, 264, 15, 239,
1024 203, 188, 70, 73, 201, 74, 227, 69, 70, 4,
1025 184, 17, 127, 43, 10, 67, 251, 70, 74, 265,
1026 267, 7, 240, 188, 202, 31, 225, 187, 137, 10,
1027 248, 250, 190, 23, 8, 262, 236, 9, 242, 203,
1028 226, 10, 266, 268, 188, 241, 243, 73, 203, 203,
1032 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
1033 static const yytype_uint16 yyr1
[] =
1035 0, 76, 78, 79, 77, 80, 80, 81, 81, 81,
1036 81, 81, 81, 81, 81, 81, 82, 83, 83, 84,
1037 84, 85, 85, 87, 88, 89, 86, 90, 91, 90,
1038 92, 92, 93, 94, 94, 95, 95, 97, 98, 99,
1039 100, 96, 101, 101, 101, 101, 102, 103, 102, 104,
1040 102, 105, 102, 106, 102, 107, 102, 108, 102, 109,
1041 102, 110, 102, 111, 102, 112, 102, 113, 102, 114,
1042 102, 115, 102, 116, 102, 102, 118, 117, 117, 119,
1043 119, 120, 121, 121, 122, 122, 124, 125, 126, 123,
1044 127, 127, 128, 128, 129, 130, 130, 131, 131, 131,
1045 131, 132, 133, 133, 133, 133, 134, 135, 135, 136,
1046 136, 137, 139, 138, 140, 140, 142, 143, 141, 141,
1047 144, 144, 145, 145, 147, 146, 148, 148, 149, 149,
1048 151, 152, 150, 153, 153, 154, 154, 154, 155, 156,
1049 155, 157, 157, 158, 158, 159, 160, 161, 160, 163,
1050 162, 164, 162, 165, 166, 165, 167, 167, 169, 168,
1051 171, 170, 172, 170, 173, 173, 174, 176, 177, 178,
1052 175, 179, 180, 181, 175, 182, 182, 183, 184, 186,
1053 185, 187, 187, 188, 188, 189, 190, 190, 191, 191,
1054 191, 191, 191, 193, 192, 194, 192, 196, 195, 195,
1055 197, 197, 198, 198, 200, 199, 199, 199, 199, 201,
1056 202, 201, 203, 204, 203, 205, 203, 206, 203, 207,
1057 203, 208, 203, 209, 203, 210, 203, 211, 203, 212,
1058 203, 213, 203, 214, 203, 215, 203, 216, 203, 217,
1059 203, 203, 218, 218, 218, 220, 219, 219, 219, 219,
1060 221, 219, 223, 222, 224, 225, 224, 226, 226, 227,
1061 227, 228, 228, 229, 228, 230, 231, 232, 232, 232,
1062 233, 233, 235, 234, 237, 236, 239, 238, 240, 241,
1063 238, 242, 243, 242, 245, 246, 244, 247, 247, 248,
1064 249, 249, 250, 250, 251, 251, 252, 252, 252, 254,
1065 255, 253, 257, 258, 256, 260, 261, 262, 259, 263,
1066 265, 266, 264, 267, 268, 264
1069 /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
1070 static const yytype_uint8 yyr2
[] =
1072 0, 2, 0, 0, 10, 0, 2, 4, 4, 4,
1073 6, 4, 6, 4, 6, 4, 4, 3, 0, 1,
1074 3, 1, 1, 0, 0, 0, 8, 0, 0, 4,
1075 1, 3, 1, 0, 2, 1, 2, 0, 0, 0,
1076 0, 8, 1, 1, 1, 1, 2, 0, 4, 0,
1077 4, 0, 4, 0, 4, 0, 4, 0, 4, 0,
1078 4, 0, 4, 0, 4, 0, 4, 0, 4, 0,
1079 4, 0, 4, 0, 4, 1, 0, 4, 1, 1,
1080 1, 1, 0, 2, 1, 2, 0, 0, 0, 7,
1081 1, 1, 1, 1, 3, 0, 1, 2, 1, 1,
1082 1, 1, 1, 1, 1, 1, 2, 6, 8, 1,
1083 1, 1, 0, 4, 1, 3, 0, 0, 5, 0,
1084 1, 3, 1, 1, 0, 4, 0, 2, 1, 2,
1085 0, 0, 6, 1, 3, 1, 1, 1, 0, 0,
1086 5, 1, 2, 2, 2, 2, 1, 0, 3, 0,
1087 5, 0, 5, 0, 0, 4, 1, 3, 0, 4,
1088 0, 2, 0, 3, 1, 1, 2, 0, 0, 0,
1089 9, 0, 0, 0, 9, 1, 1, 1, 3, 0,
1090 4, 1, 3, 1, 3, 1, 1, 1, 1, 1,
1091 1, 1, 1, 0, 4, 0, 4, 0, 3, 1,
1092 1, 1, 1, 2, 0, 4, 2, 2, 2, 1,
1093 0, 4, 2, 0, 4, 0, 4, 0, 4, 0,
1094 4, 0, 4, 0, 4, 0, 4, 0, 4, 0,
1095 4, 0, 4, 0, 4, 0, 4, 0, 4, 0,
1096 4, 1, 1, 1, 1, 0, 4, 1, 1, 1,
1097 0, 3, 0, 4, 1, 0, 4, 2, 1, 2,
1098 0, 1, 1, 0, 3, 2, 0, 1, 1, 1,
1099 1, 1, 0, 3, 0, 3, 0, 4, 0, 0,
1100 6, 0, 0, 3, 0, 0, 7, 1, 3, 3,
1101 1, 3, 1, 1, 1, 2, 1, 1, 1, 0,
1102 0, 6, 0, 0, 6, 0, 0, 0, 9, 1,
1107 #define yyerrok (yyerrstatus = 0)
1108 #define yyclearin (yychar = YYEMPTY)
1109 #define YYEMPTY (-2)
1112 #define YYACCEPT goto yyacceptlab
1113 #define YYABORT goto yyabortlab
1114 #define YYERROR goto yyerrorlab
1117 #define YYRECOVERING() (!!yyerrstatus)
1119 #define YYBACKUP(Token, Value) \
1121 if (yychar == YYEMPTY) \
1125 YYPOPSTACK (yylen); \
1131 yyerror (YY_("syntax error: cannot back up")); \
1136 /* Error token number */
1138 #define YYERRCODE 256
1142 /* Enable debugging if requested. */
1146 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1147 # define YYFPRINTF fprintf
1150 # define YYDPRINTF(Args) \
1156 /* This macro is provided for backward compatibility. */
1157 #ifndef YY_LOCATION_PRINT
1158 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1162 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1166 YYFPRINTF (stderr, "%s ", Title); \
1167 yy_symbol_print (stderr, \
1169 YYFPRINTF (stderr, "\n"); \
1174 /*----------------------------------------.
1175 | Print this symbol's value on YYOUTPUT. |
1176 `----------------------------------------*/
1179 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
)
1181 FILE *yyo
= yyoutput
;
1186 if (yytype
< YYNTOKENS
)
1187 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
1193 /*--------------------------------.
1194 | Print this symbol on YYOUTPUT. |
1195 `--------------------------------*/
1198 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
)
1200 YYFPRINTF (yyoutput
, "%s %s (",
1201 yytype
< YYNTOKENS
? "token" : "nterm", yytname
[yytype
]);
1203 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
);
1204 YYFPRINTF (yyoutput
, ")");
1207 /*------------------------------------------------------------------.
1208 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1210 `------------------------------------------------------------------*/
1213 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
1215 YYFPRINTF (stderr
, "Stack now");
1216 for (; yybottom
<= yytop
; yybottom
++)
1218 int yybot
= *yybottom
;
1219 YYFPRINTF (stderr
, " %d", yybot
);
1221 YYFPRINTF (stderr
, "\n");
1224 # define YY_STACK_PRINT(Bottom, Top) \
1227 yy_stack_print ((Bottom), (Top)); \
1231 /*------------------------------------------------.
1232 | Report that the YYRULE is going to be reduced. |
1233 `------------------------------------------------*/
1236 yy_reduce_print (yytype_int16
*yyssp
, YYSTYPE
*yyvsp
, int yyrule
)
1238 unsigned long int yylno
= yyrline
[yyrule
];
1239 int yynrhs
= yyr2
[yyrule
];
1241 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
1243 /* The symbols being reduced. */
1244 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
1246 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
1247 yy_symbol_print (stderr
,
1248 yystos
[yyssp
[yyi
+ 1 - yynrhs
]],
1249 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
1251 YYFPRINTF (stderr
, "\n");
1255 # define YY_REDUCE_PRINT(Rule) \
1258 yy_reduce_print (yyssp, yyvsp, Rule); \
1261 /* Nonzero means print parse trace. It is left uninitialized so that
1262 multiple parsers can coexist. */
1264 #else /* !YYDEBUG */
1265 # define YYDPRINTF(Args)
1266 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1267 # define YY_STACK_PRINT(Bottom, Top)
1268 # define YY_REDUCE_PRINT(Rule)
1269 #endif /* !YYDEBUG */
1272 /* YYINITDEPTH -- initial size of the parser's stacks. */
1274 # define YYINITDEPTH 200
1277 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1278 if the built-in stack extension method is used).
1280 Do not make this value too large; the results are undefined if
1281 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1282 evaluated with infinite-precision integer arithmetic. */
1285 # define YYMAXDEPTH 10000
1292 # if defined __GLIBC__ && defined _STRING_H
1293 # define yystrlen strlen
1295 /* Return the length of YYSTR. */
1297 yystrlen (const char *yystr
)
1300 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1308 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1309 # define yystpcpy stpcpy
1311 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1314 yystpcpy (char *yydest
, const char *yysrc
)
1317 const char *yys
= yysrc
;
1319 while ((*yyd
++ = *yys
++) != '\0')
1328 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1329 quotes and backslashes, so that it's suitable for yyerror. The
1330 heuristic is that double-quoting is unnecessary unless the string
1331 contains an apostrophe, a comma, or backslash (other than
1332 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1333 null, do not copy; instead, return the length of what the result
1336 yytnamerr (char *yyres
, const char *yystr
)
1341 char const *yyp
= yystr
;
1348 goto do_not_strip_quotes
;
1352 goto do_not_strip_quotes
;
1365 do_not_strip_quotes
: ;
1369 return yystrlen (yystr
);
1371 return yystpcpy (yyres
, yystr
) - yyres
;
1375 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1376 about the unexpected token YYTOKEN for the state stack whose top is
1379 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1380 not large enough to hold the message. In that case, also set
1381 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1382 required number of bytes is too large to store. */
1384 yysyntax_error (YYSIZE_T
*yymsg_alloc
, char **yymsg
,
1385 yytype_int16
*yyssp
, int yytoken
)
1387 YYSIZE_T yysize0
= yytnamerr (YY_NULLPTR
, yytname
[yytoken
]);
1388 YYSIZE_T yysize
= yysize0
;
1389 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1390 /* Internationalized format string. */
1391 const char *yyformat
= YY_NULLPTR
;
1392 /* Arguments of yyformat. */
1393 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1394 /* Number of reported tokens (one for the "unexpected", one per
1398 /* There are many possibilities here to consider:
1399 - If this state is a consistent state with a default action, then
1400 the only way this function was invoked is if the default action
1401 is an error action. In that case, don't check for expected
1402 tokens because there are none.
1403 - The only way there can be no lookahead present (in yychar) is if
1404 this state is a consistent state with a default action. Thus,
1405 detecting the absence of a lookahead is sufficient to determine
1406 that there is no unexpected or expected token to report. In that
1407 case, just report a simple "syntax error".
1408 - Don't assume there isn't a lookahead just because this state is a
1409 consistent state with a default action. There might have been a
1410 previous inconsistent state, consistent state with a non-default
1411 action, or user semantic action that manipulated yychar.
1412 - Of course, the expected token list depends on states to have
1413 correct lookahead information, and it depends on the parser not
1414 to perform extra reductions after fetching a lookahead from the
1415 scanner and before detecting a syntax error. Thus, state merging
1416 (from LALR or IELR) and default reductions corrupt the expected
1417 token list. However, the list is correct for canonical LR with
1418 one exception: it will still contain any token that will not be
1419 accepted due to an error action in a later state.
1421 if (yytoken
!= YYEMPTY
)
1423 int yyn
= yypact
[*yyssp
];
1424 yyarg
[yycount
++] = yytname
[yytoken
];
1425 if (!yypact_value_is_default (yyn
))
1427 /* Start YYX at -YYN if negative to avoid negative indexes in
1428 YYCHECK. In other words, skip the first -YYN actions for
1429 this state because they are default actions. */
1430 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1431 /* Stay within bounds of both yycheck and yytname. */
1432 int yychecklim
= YYLAST
- yyn
+ 1;
1433 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1436 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1437 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
1438 && !yytable_value_is_error (yytable
[yyx
+ yyn
]))
1440 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1446 yyarg
[yycount
++] = yytname
[yyx
];
1448 YYSIZE_T yysize1
= yysize
+ yytnamerr (YY_NULLPTR
, yytname
[yyx
]);
1449 if (! (yysize
<= yysize1
1450 && yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1460 # define YYCASE_(N, S) \
1464 YYCASE_(0, YY_("syntax error"));
1465 YYCASE_(1, YY_("syntax error, unexpected %s"));
1466 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1467 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1468 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1469 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1474 YYSIZE_T yysize1
= yysize
+ yystrlen (yyformat
);
1475 if (! (yysize
<= yysize1
&& yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1480 if (*yymsg_alloc
< yysize
)
1482 *yymsg_alloc
= 2 * yysize
;
1483 if (! (yysize
<= *yymsg_alloc
1484 && *yymsg_alloc
<= YYSTACK_ALLOC_MAXIMUM
))
1485 *yymsg_alloc
= YYSTACK_ALLOC_MAXIMUM
;
1489 /* Avoid sprintf, as that infringes on the user's name space.
1490 Don't have undefined behavior even if the translation
1491 produced a string with the wrong number of "%s"s. */
1495 while ((*yyp
= *yyformat
) != '\0')
1496 if (*yyp
== '%' && yyformat
[1] == 's' && yyi
< yycount
)
1498 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1509 #endif /* YYERROR_VERBOSE */
1511 /*-----------------------------------------------.
1512 | Release the memory associated to this symbol. |
1513 `-----------------------------------------------*/
1516 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
)
1521 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1523 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1525 YY_IGNORE_MAYBE_UNINITIALIZED_END
1531 /* The lookahead symbol. */
1534 /* The semantic value of the lookahead symbol. */
1536 /* Number of syntax errors so far. */
1548 /* Number of tokens to shift before error messages enabled. */
1551 /* The stacks and their tools:
1552 'yyss': related to states.
1553 'yyvs': related to semantic values.
1555 Refer to the stacks through separate pointers, to allow yyoverflow
1556 to reallocate them elsewhere. */
1558 /* The state stack. */
1559 yytype_int16 yyssa
[YYINITDEPTH
];
1561 yytype_int16
*yyssp
;
1563 /* The semantic value stack. */
1564 YYSTYPE yyvsa
[YYINITDEPTH
];
1568 YYSIZE_T yystacksize
;
1572 /* Lookahead token as an internal (translated) token number. */
1574 /* The variables used to return semantic value and location from the
1579 /* Buffer for error messages, and its allocated size. */
1581 char *yymsg
= yymsgbuf
;
1582 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1585 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1587 /* The number of symbols on the RHS of the reduced rule.
1588 Keep to zero when no symbol should be popped. */
1591 yyssp
= yyss
= yyssa
;
1592 yyvsp
= yyvs
= yyvsa
;
1593 yystacksize
= YYINITDEPTH
;
1595 YYDPRINTF ((stderr
, "Starting parse\n"));
1600 yychar
= YYEMPTY
; /* Cause a token to be read. */
1603 /*------------------------------------------------------------.
1604 | yynewstate -- Push a new state, which is found in yystate. |
1605 `------------------------------------------------------------*/
1607 /* In all cases, when you get here, the value and location stacks
1608 have just been pushed. So pushing a state here evens the stacks. */
1614 if (yyss
+ yystacksize
- 1 <= yyssp
)
1616 /* Get the current used size of the three stacks, in elements. */
1617 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1621 /* Give user a chance to reallocate the stack. Use copies of
1622 these so that the &'s don't force the real ones into
1624 YYSTYPE
*yyvs1
= yyvs
;
1625 yytype_int16
*yyss1
= yyss
;
1627 /* Each stack pointer address is followed by the size of the
1628 data in use in that stack, in bytes. This used to be a
1629 conditional around just the two extra args, but that might
1630 be undefined if yyoverflow is a macro. */
1631 yyoverflow (YY_("memory exhausted"),
1632 &yyss1
, yysize
* sizeof (*yyssp
),
1633 &yyvs1
, yysize
* sizeof (*yyvsp
),
1639 #else /* no yyoverflow */
1640 # ifndef YYSTACK_RELOCATE
1641 goto yyexhaustedlab
;
1643 /* Extend the stack our own way. */
1644 if (YYMAXDEPTH
<= yystacksize
)
1645 goto yyexhaustedlab
;
1647 if (YYMAXDEPTH
< yystacksize
)
1648 yystacksize
= YYMAXDEPTH
;
1651 yytype_int16
*yyss1
= yyss
;
1652 union yyalloc
*yyptr
=
1653 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1655 goto yyexhaustedlab
;
1656 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
1657 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
1658 # undef YYSTACK_RELOCATE
1660 YYSTACK_FREE (yyss1
);
1663 #endif /* no yyoverflow */
1665 yyssp
= yyss
+ yysize
- 1;
1666 yyvsp
= yyvs
+ yysize
- 1;
1668 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1669 (unsigned long int) yystacksize
));
1671 if (yyss
+ yystacksize
- 1 <= yyssp
)
1675 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1677 if (yystate
== YYFINAL
)
1687 /* Do appropriate processing given the current state. Read a
1688 lookahead token if we need one and don't already have one. */
1690 /* First try to decide what to do without reference to lookahead token. */
1691 yyn
= yypact
[yystate
];
1692 if (yypact_value_is_default (yyn
))
1695 /* Not known => get a lookahead token if don't already have one. */
1697 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1698 if (yychar
== YYEMPTY
)
1700 YYDPRINTF ((stderr
, "Reading a token: "));
1704 if (yychar
<= YYEOF
)
1706 yychar
= yytoken
= YYEOF
;
1707 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1711 yytoken
= YYTRANSLATE (yychar
);
1712 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1715 /* If the proper action on seeing token YYTOKEN is to reduce or to
1716 detect an error, take that action. */
1718 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1723 if (yytable_value_is_error (yyn
))
1729 /* Count tokens shifted since error; after three, turn off error
1734 /* Shift the lookahead token. */
1735 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1737 /* Discard the shifted token. */
1741 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1743 YY_IGNORE_MAYBE_UNINITIALIZED_END
1748 /*-----------------------------------------------------------.
1749 | yydefault -- do the default action for the current state. |
1750 `-----------------------------------------------------------*/
1752 yyn
= yydefact
[yystate
];
1758 /*-----------------------------.
1759 | yyreduce -- Do a reduction. |
1760 `-----------------------------*/
1762 /* yyn is the number of a rule to reduce with. */
1765 /* If YYLEN is nonzero, implement the default value of the action:
1768 Otherwise, the following line sets YYVAL to garbage.
1769 This behavior is undocumented and Bison
1770 users should not rely upon it. Assigning to YYVAL
1771 unconditionally makes the parser a bit smaller, and it avoids a
1772 GCC warning that YYVAL may be used uninitialized. */
1773 yyval
= yyvsp
[1-yylen
];
1776 YY_REDUCE_PRINT (yyn
);
1780 #line 66 "web2c-parser.y" /* yacc.c:1646 */
1782 printf ("#define %s\n", uppercasify (program_name
));
1784 printf ("#include \"%s\"\n", std_header
);
1786 #line 1787 "web2c-parser.c" /* yacc.c:1646 */
1790 #line 73 "web2c-parser.y" /* yacc.c:1646 */
1791 { printf ("\n#include \"%s\"\n", coerce_name
); }
1792 #line 1793 "web2c-parser.c" /* yacc.c:1646 */
1796 #line 76 "web2c-parser.y" /* yacc.c:1646 */
1798 #line 1799 "web2c-parser.c" /* yacc.c:1646 */
1802 #line 86 "web2c-parser.y" /* yacc.c:1646 */
1804 ii
= add_to_table (last_id
);
1805 sym_table
[ii
].typ
= field_id_tok
;
1807 #line 1808 "web2c-parser.c" /* yacc.c:1646 */
1811 #line 91 "web2c-parser.y" /* yacc.c:1646 */
1813 ii
= add_to_table (last_id
);
1814 sym_table
[ii
].typ
= fun_id_tok
;
1816 #line 1817 "web2c-parser.c" /* yacc.c:1646 */
1820 #line 96 "web2c-parser.y" /* yacc.c:1646 */
1822 ii
= add_to_table (last_id
);
1823 sym_table
[ii
].typ
= const_id_tok
;
1825 #line 1826 "web2c-parser.c" /* yacc.c:1646 */
1829 #line 101 "web2c-parser.y" /* yacc.c:1646 */
1831 ii
= add_to_table (last_id
);
1832 sym_table
[ii
].typ
= fun_param_tok
;
1834 #line 1835 "web2c-parser.c" /* yacc.c:1646 */
1838 #line 106 "web2c-parser.y" /* yacc.c:1646 */
1840 ii
= add_to_table (last_id
);
1841 sym_table
[ii
].typ
= proc_id_tok
;
1843 #line 1844 "web2c-parser.c" /* yacc.c:1646 */
1847 #line 111 "web2c-parser.y" /* yacc.c:1646 */
1849 ii
= add_to_table (last_id
);
1850 sym_table
[ii
].typ
= proc_param_tok
;
1852 #line 1853 "web2c-parser.c" /* yacc.c:1646 */
1856 #line 116 "web2c-parser.y" /* yacc.c:1646 */
1858 ii
= add_to_table (last_id
);
1859 sym_table
[ii
].typ
= type_id_tok
;
1861 #line 1862 "web2c-parser.c" /* yacc.c:1646 */
1865 #line 121 "web2c-parser.y" /* yacc.c:1646 */
1867 ii
= add_to_table (last_id
);
1868 sym_table
[ii
].typ
= type_id_tok
;
1869 sym_table
[ii
].val
= lower_bound
;
1870 sym_table
[ii
].val_sym
= lower_sym
;
1871 sym_table
[ii
].upper
= upper_bound
;
1872 sym_table
[ii
].upper_sym
= upper_sym
;
1874 #line 1875 "web2c-parser.c" /* yacc.c:1646 */
1878 #line 130 "web2c-parser.y" /* yacc.c:1646 */
1880 ii
= add_to_table (last_id
);
1881 sym_table
[ii
].typ
= var_id_tok
;
1883 #line 1884 "web2c-parser.c" /* yacc.c:1646 */
1887 #line 157 "web2c-parser.y" /* yacc.c:1646 */
1888 { if (block_level
> 0) my_output("{\n ");
1889 indent
++; block_level
++;
1891 #line 1892 "web2c-parser.c" /* yacc.c:1646 */
1895 #line 162 "web2c-parser.y" /* yacc.c:1646 */
1896 { if (block_level
== 2) {
1897 if (strcmp(fn_return_type
, "void")) {
1898 my_output("register");
1899 my_output(fn_return_type
);
1900 my_output("Result;");
1903 sprintf(safe_string
, "%s_regmem", my_routine
);
1904 my_output(safe_string
);
1909 #line 1910 "web2c-parser.c" /* yacc.c:1646 */
1913 #line 176 "web2c-parser.y" /* yacc.c:1646 */
1914 { doing_statements
= true; }
1915 #line 1916 "web2c-parser.c" /* yacc.c:1646 */
1919 #line 178 "web2c-parser.y" /* yacc.c:1646 */
1921 if (block_level
== 2) {
1922 if (strcmp(fn_return_type
,"void")) {
1923 my_output("return Result");
1927 if (uses_mem
&& uses_eqtb
)
1929 "#define %s_regmem register memoryword *mem=zmem, *eqtb=zeqtb;\n",
1932 fprintf(coerce
, "#define %s_regmem register memoryword *mem=zmem;\n",
1935 fprintf(coerce
, "#define %s_regmem register memoryword *eqtb=zeqtb;\n",
1938 fprintf(coerce
, "#define %s_regmem\n", my_routine
);
1940 my_routine
[0] = '\0';
1942 indent
--; block_level
--;
1943 my_output("}"); new_line();
1944 doing_statements
= false;
1946 #line 1947 "web2c-parser.c" /* yacc.c:1646 */
1950 #line 208 "web2c-parser.y" /* yacc.c:1646 */
1951 { my_output("/*"); }
1952 #line 1953 "web2c-parser.c" /* yacc.c:1646 */
1956 #line 210 "web2c-parser.y" /* yacc.c:1646 */
1957 { my_output("*/"); }
1958 #line 1959 "web2c-parser.c" /* yacc.c:1646 */
1962 #line 218 "web2c-parser.y" /* yacc.c:1646 */
1963 { my_output(temp
); }
1964 #line 1965 "web2c-parser.c" /* yacc.c:1646 */
1968 #line 224 "web2c-parser.y" /* yacc.c:1646 */
1970 #line 1971 "web2c-parser.c" /* yacc.c:1646 */
1974 #line 233 "web2c-parser.y" /* yacc.c:1646 */
1975 { /* `#define' must be in column 1 for pcc. */
1976 unsigned save
= indent
;
1979 my_output ("#define");
1982 #line 1983 "web2c-parser.c" /* yacc.c:1646 */
1986 #line 241 "web2c-parser.y" /* yacc.c:1646 */
1987 { ii
= add_to_table (last_id
);
1988 sym_table
[ii
].typ
= const_id_tok
;
1989 my_output (last_id
);
1991 #line 1992 "web2c-parser.c" /* yacc.c:1646 */
1995 #line 245 "web2c-parser.y" /* yacc.c:1646 */
1996 { my_output ("("); }
1997 #line 1998 "web2c-parser.c" /* yacc.c:1646 */
2001 #line 246 "web2c-parser.y" /* yacc.c:1646 */
2002 { my_output (")"); }
2003 #line 2004 "web2c-parser.c" /* yacc.c:1646 */
2007 #line 247 "web2c-parser.y" /* yacc.c:1646 */
2008 { sym_table
[ii
].val
= last_i_num
; new_line(); }
2009 #line 2010 "web2c-parser.c" /* yacc.c:1646 */
2013 #line 252 "web2c-parser.y" /* yacc.c:1646 */
2015 sscanf (temp
, "%ld", &last_i_num
);
2016 if (my_labs ((long) last_i_num
) > 32767)
2021 #line 2022 "web2c-parser.c" /* yacc.c:1646 */
2025 #line 259 "web2c-parser.y" /* yacc.c:1646 */
2026 { my_output(temp
); (yyval
) = ex_real
; }
2027 #line 2028 "web2c-parser.c" /* yacc.c:1646 */
2031 #line 260 "web2c-parser.y" /* yacc.c:1646 */
2033 #line 2034 "web2c-parser.c" /* yacc.c:1646 */
2037 #line 261 "web2c-parser.y" /* yacc.c:1646 */
2038 { (yyval
) = ex_32
; }
2039 #line 2040 "web2c-parser.c" /* yacc.c:1646 */
2043 #line 266 "web2c-parser.y" /* yacc.c:1646 */
2044 { (yyval
) = (yyvsp
[0]); }
2045 #line 2046 "web2c-parser.c" /* yacc.c:1646 */
2049 #line 267 "web2c-parser.y" /* yacc.c:1646 */
2050 { my_output ("+"); }
2051 #line 2052 "web2c-parser.c" /* yacc.c:1646 */
2055 #line 268 "web2c-parser.y" /* yacc.c:1646 */
2056 { (yyval
) = max ((yyvsp
[-3]), (yyvsp
[0])); }
2057 #line 2058 "web2c-parser.c" /* yacc.c:1646 */
2061 #line 269 "web2c-parser.y" /* yacc.c:1646 */
2062 { my_output ("-"); }
2063 #line 2064 "web2c-parser.c" /* yacc.c:1646 */
2067 #line 270 "web2c-parser.y" /* yacc.c:1646 */
2068 { (yyval
) = max ((yyvsp
[-3]), (yyvsp
[0])); }
2069 #line 2070 "web2c-parser.c" /* yacc.c:1646 */
2073 #line 271 "web2c-parser.y" /* yacc.c:1646 */
2074 { my_output ("*"); }
2075 #line 2076 "web2c-parser.c" /* yacc.c:1646 */
2079 #line 272 "web2c-parser.y" /* yacc.c:1646 */
2080 { (yyval
) = max ((yyvsp
[-3]), (yyvsp
[0])); }
2081 #line 2082 "web2c-parser.c" /* yacc.c:1646 */
2085 #line 273 "web2c-parser.y" /* yacc.c:1646 */
2086 { my_output ("/"); }
2087 #line 2088 "web2c-parser.c" /* yacc.c:1646 */
2091 #line 274 "web2c-parser.y" /* yacc.c:1646 */
2092 { (yyval
) = max ((yyvsp
[-3]), (yyvsp
[0])); }
2093 #line 2094 "web2c-parser.c" /* yacc.c:1646 */
2097 #line 275 "web2c-parser.y" /* yacc.c:1646 */
2098 { my_output ("=="); }
2099 #line 2100 "web2c-parser.c" /* yacc.c:1646 */
2103 #line 276 "web2c-parser.y" /* yacc.c:1646 */
2104 { (yyval
) = max ((yyvsp
[-3]), (yyvsp
[0])); }
2105 #line 2106 "web2c-parser.c" /* yacc.c:1646 */
2109 #line 277 "web2c-parser.y" /* yacc.c:1646 */
2110 { my_output ("!="); }
2111 #line 2112 "web2c-parser.c" /* yacc.c:1646 */
2115 #line 278 "web2c-parser.y" /* yacc.c:1646 */
2116 { (yyval
) = max ((yyvsp
[-3]), (yyvsp
[0])); }
2117 #line 2118 "web2c-parser.c" /* yacc.c:1646 */
2121 #line 279 "web2c-parser.y" /* yacc.c:1646 */
2122 { my_output ("%"); }
2123 #line 2124 "web2c-parser.c" /* yacc.c:1646 */
2127 #line 280 "web2c-parser.y" /* yacc.c:1646 */
2128 { (yyval
) = max ((yyvsp
[-3]), (yyvsp
[0])); }
2129 #line 2130 "web2c-parser.c" /* yacc.c:1646 */
2133 #line 281 "web2c-parser.y" /* yacc.c:1646 */
2134 { my_output ("<"); }
2135 #line 2136 "web2c-parser.c" /* yacc.c:1646 */
2139 #line 282 "web2c-parser.y" /* yacc.c:1646 */
2140 { (yyval
) = max ((yyvsp
[-3]), (yyvsp
[0])); }
2141 #line 2142 "web2c-parser.c" /* yacc.c:1646 */
2145 #line 283 "web2c-parser.y" /* yacc.c:1646 */
2146 { my_output (">"); }
2147 #line 2148 "web2c-parser.c" /* yacc.c:1646 */
2151 #line 284 "web2c-parser.y" /* yacc.c:1646 */
2152 { (yyval
) = max ((yyvsp
[-3]), (yyvsp
[0])); }
2153 #line 2154 "web2c-parser.c" /* yacc.c:1646 */
2157 #line 285 "web2c-parser.y" /* yacc.c:1646 */
2158 { my_output ("<="); }
2159 #line 2160 "web2c-parser.c" /* yacc.c:1646 */
2163 #line 286 "web2c-parser.y" /* yacc.c:1646 */
2164 { (yyval
) = max ((yyvsp
[-3]), (yyvsp
[0])); }
2165 #line 2166 "web2c-parser.c" /* yacc.c:1646 */
2169 #line 287 "web2c-parser.y" /* yacc.c:1646 */
2170 { my_output (">="); }
2171 #line 2172 "web2c-parser.c" /* yacc.c:1646 */
2175 #line 288 "web2c-parser.y" /* yacc.c:1646 */
2176 { (yyval
) = max ((yyvsp
[-3]), (yyvsp
[0])); }
2177 #line 2178 "web2c-parser.c" /* yacc.c:1646 */
2181 #line 289 "web2c-parser.y" /* yacc.c:1646 */
2182 { my_output ("&&"); }
2183 #line 2184 "web2c-parser.c" /* yacc.c:1646 */
2187 #line 290 "web2c-parser.y" /* yacc.c:1646 */
2188 { (yyval
) = max ((yyvsp
[-3]), (yyvsp
[0])); }
2189 #line 2190 "web2c-parser.c" /* yacc.c:1646 */
2193 #line 291 "web2c-parser.y" /* yacc.c:1646 */
2194 { my_output ("||"); }
2195 #line 2196 "web2c-parser.c" /* yacc.c:1646 */
2199 #line 292 "web2c-parser.y" /* yacc.c:1646 */
2200 { (yyval
) = max ((yyvsp
[-3]), (yyvsp
[0])); }
2201 #line 2202 "web2c-parser.c" /* yacc.c:1646 */
2205 #line 293 "web2c-parser.y" /* yacc.c:1646 */
2206 { my_output ("/ ((double)"); }
2207 #line 2208 "web2c-parser.c" /* yacc.c:1646 */
2211 #line 294 "web2c-parser.y" /* yacc.c:1646 */
2212 { (yyval
) = max ((yyvsp
[-3]), (yyvsp
[0])); my_output (")"); }
2213 #line 2214 "web2c-parser.c" /* yacc.c:1646 */
2217 #line 295 "web2c-parser.y" /* yacc.c:1646 */
2218 { (yyval
) = (yyvsp
[0]); }
2219 #line 2220 "web2c-parser.c" /* yacc.c:1646 */
2223 #line 300 "web2c-parser.y" /* yacc.c:1646 */
2224 { my_output ("("); }
2225 #line 2226 "web2c-parser.c" /* yacc.c:1646 */
2229 #line 302 "web2c-parser.y" /* yacc.c:1646 */
2230 { my_output (")"); (yyval
) = (yyvsp
[-3]); }
2231 #line 2232 "web2c-parser.c" /* yacc.c:1646 */
2235 #line 308 "web2c-parser.y" /* yacc.c:1646 */
2238 get_string_literal(s
);
2241 #line 2242 "web2c-parser.c" /* yacc.c:1646 */
2245 #line 314 "web2c-parser.y" /* yacc.c:1646 */
2251 #line 2252 "web2c-parser.c" /* yacc.c:1646 */
2255 #line 322 "web2c-parser.y" /* yacc.c:1646 */
2256 { my_output (last_id
); }
2257 #line 2258 "web2c-parser.c" /* yacc.c:1646 */
2261 #line 334 "web2c-parser.y" /* yacc.c:1646 */
2262 { my_output ("typedef"); }
2263 #line 2264 "web2c-parser.c" /* yacc.c:1646 */
2267 #line 336 "web2c-parser.y" /* yacc.c:1646 */
2269 ii
= add_to_table(last_id
);
2270 sym_table
[ii
].typ
= type_id_tok
;
2271 strcpy(safe_string
, last_id
);
2274 #line 2275 "web2c-parser.c" /* yacc.c:1646 */
2278 #line 343 "web2c-parser.y" /* yacc.c:1646 */
2280 array_bounds
[0] = 0;
2281 array_offset
[0] = 0;
2283 #line 2284 "web2c-parser.c" /* yacc.c:1646 */
2287 #line 348 "web2c-parser.y" /* yacc.c:1646 */
2289 if (*array_offset
) {
2290 yyerror ("Cannot typedef arrays with offsets");
2292 my_output (safe_string
);
2293 my_output (array_bounds
);
2297 #line 2298 "web2c-parser.c" /* yacc.c:1646 */
2301 #line 366 "web2c-parser.y" /* yacc.c:1646 */
2305 sym_table
[ii
].val
= lower_bound
;
2306 sym_table
[ii
].val_sym
= lower_sym
;
2307 sym_table
[ii
].upper
= upper_bound
;
2308 sym_table
[ii
].upper_sym
= upper_sym
;
2312 /* If the bounds on an integral type are known at
2313 translation time, select the smallest ANSI C type which
2314 can represent it. We avoid using char as such variables
2315 are frequently used as array indices. We avoid using
2316 schar and unsigned short where possible, since they are
2317 treated differently by different compilers
2318 (see also config.h). */
2319 if (lower_sym
== -1 && upper_sym
== -1) {
2320 if (0 <= lower_bound
&& upper_bound
<= UCHAR_MAX
)
2321 my_output ("unsigned char");
2322 else if (SCHAR_MIN
<= lower_bound
&& upper_bound
<= SCHAR_MAX
)
2323 my_output ("schar");
2324 else if (SHRT_MIN
<= lower_bound
&& upper_bound
<= SHRT_MAX
)
2325 my_output ("short");
2326 else if (0 <= lower_bound
&& upper_bound
<= USHRT_MAX
)
2327 my_output ("unsigned short");
2329 my_output ("integer");
2331 my_output ("integer");
2334 #line 2335 "web2c-parser.c" /* yacc.c:1646 */
2338 #line 412 "web2c-parser.y" /* yacc.c:1646 */
2340 lower_bound
= upper_bound
;
2341 lower_sym
= upper_sym
;
2342 sscanf (temp
, "%ld", &upper_bound
);
2343 upper_sym
= -1; /* no sym table entry */
2345 #line 2346 "web2c-parser.c" /* yacc.c:1646 */
2349 #line 419 "web2c-parser.y" /* yacc.c:1646 */
2351 lower_bound
= upper_bound
;
2352 lower_sym
= upper_sym
;
2353 upper_bound
= sym_table
[l_s
].val
;
2356 #line 2357 "web2c-parser.c" /* yacc.c:1646 */
2360 #line 426 "web2c-parser.y" /* yacc.c:1646 */
2361 { /* We've changed some constants into dynamic variables.
2362 To avoid changing all the subrange decls, just use integer.
2363 This does not work for arrays, for which we check later. */
2364 lower_bound
= upper_bound
;
2365 lower_sym
= upper_sym
;
2367 upper_sym
= 0; /* Translate to integer. */
2369 #line 2370 "web2c-parser.c" /* yacc.c:1646 */
2373 #line 435 "web2c-parser.y" /* yacc.c:1646 */
2374 { /* Same as var_id_tok, to avoid changing type definitions.
2375 Should keep track of the variables we use in this way
2376 and make sure they're all eventually defined. */
2377 lower_bound
= upper_bound
;
2378 lower_sym
= upper_sym
;
2382 #line 2383 "web2c-parser.c" /* yacc.c:1646 */
2386 #line 447 "web2c-parser.y" /* yacc.c:1646 */
2388 if (last_type
>= 0) {
2389 sym_table
[last_type
].var_not_needed
= sym_table
[l_s
].var_not_needed
;
2390 sym_table
[last_type
].upper
= sym_table
[l_s
].upper
;
2391 sym_table
[last_type
].upper_sym
= sym_table
[l_s
].upper_sym
;
2392 sym_table
[last_type
].val
= sym_table
[l_s
].val
;
2393 sym_table
[last_type
].val_sym
= sym_table
[l_s
].val_sym
;
2395 my_output (last_id
);
2397 #line 2398 "web2c-parser.c" /* yacc.c:1646 */
2401 #line 461 "web2c-parser.y" /* yacc.c:1646 */
2402 { if (last_type
>= 0)
2403 sym_table
[last_type
].var_not_needed
= true;
2405 #line 2406 "web2c-parser.c" /* yacc.c:1646 */
2409 #line 466 "web2c-parser.y" /* yacc.c:1646 */
2410 { if (last_type
>= 0)
2411 sym_table
[last_type
].var_not_needed
= true;
2413 #line 2414 "web2c-parser.c" /* yacc.c:1646 */
2417 #line 470 "web2c-parser.y" /* yacc.c:1646 */
2418 { if (last_type
>= 0)
2419 sym_table
[last_type
].var_not_needed
= true;
2421 #line 2422 "web2c-parser.c" /* yacc.c:1646 */
2425 #line 477 "web2c-parser.y" /* yacc.c:1646 */
2427 if (last_type
>= 0) {
2428 sym_table
[last_type
].var_not_needed
= sym_table
[l_s
].var_not_needed
;
2429 sym_table
[last_type
].upper
= sym_table
[l_s
].upper
;
2430 sym_table
[last_type
].upper_sym
= sym_table
[l_s
].upper_sym
;
2431 sym_table
[last_type
].val
= sym_table
[l_s
].val
;
2432 sym_table
[last_type
].val_sym
= sym_table
[l_s
].val_sym
;
2434 my_output (last_id
);
2437 #line 2438 "web2c-parser.c" /* yacc.c:1646 */
2441 #line 497 "web2c-parser.y" /* yacc.c:1646 */
2442 { compute_array_bounds(); }
2443 #line 2444 "web2c-parser.c" /* yacc.c:1646 */
2447 #line 499 "web2c-parser.y" /* yacc.c:1646 */
2449 lower_bound
= sym_table
[l_s
].val
;
2450 lower_sym
= sym_table
[l_s
].val_sym
;
2451 upper_bound
= sym_table
[l_s
].upper
;
2452 upper_sym
= sym_table
[l_s
].upper_sym
;
2453 compute_array_bounds();
2455 #line 2456 "web2c-parser.c" /* yacc.c:1646 */
2459 #line 512 "web2c-parser.y" /* yacc.c:1646 */
2460 { my_output ("struct"); my_output ("{"); indent
++; }
2461 #line 2462 "web2c-parser.c" /* yacc.c:1646 */
2465 #line 514 "web2c-parser.y" /* yacc.c:1646 */
2466 { indent
--; my_output ("}"); semicolon(); }
2467 #line 2468 "web2c-parser.c" /* yacc.c:1646 */
2471 #line 522 "web2c-parser.y" /* yacc.c:1646 */
2472 { field_list
[0] = 0; }
2473 #line 2474 "web2c-parser.c" /* yacc.c:1646 */
2477 #line 524 "web2c-parser.y" /* yacc.c:1646 */
2479 /*array_bounds[0] = 0;
2480 array_offset[0] = 0;*/
2482 #line 2483 "web2c-parser.c" /* yacc.c:1646 */
2486 #line 529 "web2c-parser.y" /* yacc.c:1646 */
2487 { int i
=0, j
; char ltemp
[80];
2488 while(field_list
[i
++] == '!') {
2490 while (field_list
[i
])
2491 ltemp
[j
++] = field_list
[i
++];
2493 if (field_list
[i
] == '!')
2500 #line 2501 "web2c-parser.c" /* yacc.c:1646 */
2504 #line 550 "web2c-parser.y" /* yacc.c:1646 */
2506 while (field_list
[i
] == '!')
2507 while(field_list
[i
++]);
2508 ii
= add_to_table(last_id
);
2509 sym_table
[ii
].typ
= field_id_tok
;
2510 field_list
[i
++] = '!';
2512 field_list
[i
++] = last_id
[j
++];
2513 field_list
[i
++] = 0;
2514 field_list
[i
++] = 0;
2516 #line 2517 "web2c-parser.c" /* yacc.c:1646 */
2520 #line 562 "web2c-parser.y" /* yacc.c:1646 */
2522 while (field_list
[i
] == '!')
2523 while(field_list
[i
++]);
2524 field_list
[i
++] = '!';
2526 field_list
[i
++] = last_id
[j
++];
2527 field_list
[i
++] = 0;
2528 field_list
[i
++] = 0;
2530 #line 2531 "web2c-parser.c" /* yacc.c:1646 */
2534 #line 575 "web2c-parser.y" /* yacc.c:1646 */
2535 { my_output ("text /* of "); }
2536 #line 2537 "web2c-parser.c" /* yacc.c:1646 */
2540 #line 577 "web2c-parser.y" /* yacc.c:1646 */
2541 { my_output ("*/"); }
2542 #line 2543 "web2c-parser.c" /* yacc.c:1646 */
2546 #line 591 "web2c-parser.y" /* yacc.c:1646 */
2549 array_bounds
[0] = 0;
2550 array_offset
[0] = 0;
2551 var_formals
= false;
2554 #line 2555 "web2c-parser.c" /* yacc.c:1646 */
2558 #line 599 "web2c-parser.y" /* yacc.c:1646 */
2560 array_bounds
[0] = 0;
2561 array_offset
[0] = 0;
2563 #line 2564 "web2c-parser.c" /* yacc.c:1646 */
2567 #line 604 "web2c-parser.y" /* yacc.c:1646 */
2568 { fixup_var_list(); }
2569 #line 2570 "web2c-parser.c" /* yacc.c:1646 */
2573 #line 612 "web2c-parser.y" /* yacc.c:1646 */
2575 ii
= add_to_table(last_id
);
2576 sym_table
[ii
].typ
= var_id_tok
;
2577 sym_table
[ii
].var_formal
= var_formals
;
2578 param_id_list
[ids_paramed
++] = ii
;
2579 while (var_list
[i
] == '!')
2580 while(var_list
[i
++]);
2581 var_list
[i
++] = '!';
2583 var_list
[i
++] = last_id
[j
++];
2587 #line 2588 "web2c-parser.c" /* yacc.c:1646 */
2591 #line 626 "web2c-parser.y" /* yacc.c:1646 */
2593 ii
= add_to_table(last_id
);
2594 sym_table
[ii
].typ
= var_id_tok
;
2595 sym_table
[ii
].var_formal
= var_formals
;
2596 param_id_list
[ids_paramed
++] = ii
;
2597 while (var_list
[i
] == '!')
2598 while (var_list
[i
++]);
2599 var_list
[i
++] = '!';
2601 var_list
[i
++] = last_id
[j
++];
2605 #line 2606 "web2c-parser.c" /* yacc.c:1646 */
2609 #line 640 "web2c-parser.y" /* yacc.c:1646 */
2611 ii
= add_to_table(last_id
);
2612 sym_table
[ii
].typ
= var_id_tok
;
2613 sym_table
[ii
].var_formal
= var_formals
;
2614 param_id_list
[ids_paramed
++] = ii
;
2615 while (var_list
[i
] == '!')
2616 while(var_list
[i
++]);
2617 var_list
[i
++] = '!';
2619 var_list
[i
++] = last_id
[j
++];
2623 #line 2624 "web2c-parser.c" /* yacc.c:1646 */
2627 #line 658 "web2c-parser.y" /* yacc.c:1646 */
2628 { my_output ("void mainbody( void ) {");
2632 #line 2633 "web2c-parser.c" /* yacc.c:1646 */
2636 #line 663 "web2c-parser.y" /* yacc.c:1646 */
2641 #line 2642 "web2c-parser.c" /* yacc.c:1646 */
2645 #line 675 "web2c-parser.y" /* yacc.c:1646 */
2646 { new_line(); remove_locals(); }
2647 #line 2648 "web2c-parser.c" /* yacc.c:1646 */
2651 #line 677 "web2c-parser.y" /* yacc.c:1646 */
2652 { new_line(); remove_locals(); }
2653 #line 2654 "web2c-parser.c" /* yacc.c:1646 */
2657 #line 686 "web2c-parser.y" /* yacc.c:1646 */
2658 { proc_is_noreturn
= 1; }
2659 #line 2660 "web2c-parser.c" /* yacc.c:1646 */
2663 #line 692 "web2c-parser.y" /* yacc.c:1646 */
2664 { ii
= add_to_table(last_id
);
2666 fprintf(stderr
, "%3d Procedure %s\n", pf_count
++, last_id
);
2667 sym_table
[ii
].typ
= proc_id_tok
;
2668 strcpy(my_routine
, last_id
);
2669 uses_eqtb
= uses_mem
= false;
2675 #line 2676 "web2c-parser.c" /* yacc.c:1646 */
2679 #line 704 "web2c-parser.y" /* yacc.c:1646 */
2680 { strcpy(fn_return_type
, "void");
2682 gen_function_head(); }
2683 #line 2684 "web2c-parser.c" /* yacc.c:1646 */
2687 #line 708 "web2c-parser.y" /* yacc.c:1646 */
2690 fprintf(stderr
, "%3d Procedure %s\n", pf_count
++, last_id
);
2691 strcpy(my_routine
, last_id
);
2695 #line 2696 "web2c-parser.c" /* yacc.c:1646 */
2699 #line 716 "web2c-parser.y" /* yacc.c:1646 */
2700 { strcpy(fn_return_type
, "void");
2702 gen_function_head();
2704 #line 2705 "web2c-parser.c" /* yacc.c:1646 */
2708 #line 724 "web2c-parser.y" /* yacc.c:1646 */
2710 strcpy (z_id
, last_id
);
2714 #line 2715 "web2c-parser.c" /* yacc.c:1646 */
2718 #line 730 "web2c-parser.y" /* yacc.c:1646 */
2719 { sprintf (z_id
, "z%s", last_id
);
2721 if (sym_table
[ii
].typ
== proc_id_tok
)
2722 sym_table
[ii
].typ
= proc_param_tok
;
2723 else if (sym_table
[ii
].typ
== fun_id_tok
)
2724 sym_table
[ii
].typ
= fun_param_tok
;
2727 #line 2728 "web2c-parser.c" /* yacc.c:1646 */
2731 #line 746 "web2c-parser.y" /* yacc.c:1646 */
2732 { ids_typed
= ids_paramed
; }
2733 #line 2734 "web2c-parser.c" /* yacc.c:1646 */
2737 #line 748 "web2c-parser.y" /* yacc.c:1646 */
2739 i
= search_table(last_id
);
2740 need_var
= !sym_table
[i
].var_not_needed
;
2741 for (i
=ids_typed
; i
<ids_paramed
; i
++)
2743 strcpy(arg_type
[i
], last_id
);
2744 if (need_var
&& sym_table
[param_id_list
[i
]].var_formal
)
2745 strcat(arg_type
[i
], " *");
2747 sym_table
[param_id_list
[i
]].var_formal
= false;
2750 #line 2751 "web2c-parser.c" /* yacc.c:1646 */
2754 #line 762 "web2c-parser.y" /* yacc.c:1646 */
2756 #line 2757 "web2c-parser.c" /* yacc.c:1646 */
2760 #line 763 "web2c-parser.y" /* yacc.c:1646 */
2762 #line 2763 "web2c-parser.c" /* yacc.c:1646 */
2766 #line 775 "web2c-parser.y" /* yacc.c:1646 */
2770 ii
= add_to_table(last_id
);
2772 fprintf(stderr
, "%3d Function %s\n", pf_count
++, last_id
);
2773 sym_table
[ii
].typ
= fun_id_tok
;
2774 strcpy (my_routine
, last_id
);
2775 uses_eqtb
= uses_mem
= false;
2777 #line 2778 "web2c-parser.c" /* yacc.c:1646 */
2781 #line 786 "web2c-parser.y" /* yacc.c:1646 */
2784 array_bounds
[0] = 0;
2785 array_offset
[0] = 0;
2787 #line 2788 "web2c-parser.c" /* yacc.c:1646 */
2791 #line 792 "web2c-parser.y" /* yacc.c:1646 */
2793 get_result_type(fn_return_type
);
2795 gen_function_head();
2797 #line 2798 "web2c-parser.c" /* yacc.c:1646 */
2801 #line 799 "web2c-parser.y" /* yacc.c:1646 */
2807 fprintf(stderr
, "%3d Function %s\n", pf_count
++, last_id
);
2808 strcpy(my_routine
, last_id
);
2809 uses_eqtb
= uses_mem
= false;
2811 #line 2812 "web2c-parser.c" /* yacc.c:1646 */
2815 #line 809 "web2c-parser.y" /* yacc.c:1646 */
2817 array_bounds
[0] = 0;
2818 array_offset
[0] = 0;
2820 #line 2821 "web2c-parser.c" /* yacc.c:1646 */
2824 #line 814 "web2c-parser.y" /* yacc.c:1646 */
2825 { get_result_type(fn_return_type
);
2827 gen_function_head();
2829 #line 2830 "web2c-parser.c" /* yacc.c:1646 */
2833 #line 832 "web2c-parser.y" /* yacc.c:1646 */
2834 { my_output ("{"); indent
++; new_line(); }
2835 #line 2836 "web2c-parser.c" /* yacc.c:1646 */
2839 #line 834 "web2c-parser.y" /* yacc.c:1646 */
2840 { indent
--; my_output ("}"); new_line(); }
2841 #line 2842 "web2c-parser.c" /* yacc.c:1646 */
2845 #line 847 "web2c-parser.y" /* yacc.c:1646 */
2846 {if (!doreturn(temp
)) {
2847 sprintf(safe_string
, "lab%s:", temp
);
2848 my_output (safe_string
);
2851 #line 2852 "web2c-parser.c" /* yacc.c:1646 */
2855 #line 855 "web2c-parser.y" /* yacc.c:1646 */
2857 #line 2858 "web2c-parser.c" /* yacc.c:1646 */
2861 #line 857 "web2c-parser.y" /* yacc.c:1646 */
2863 #line 2864 "web2c-parser.c" /* yacc.c:1646 */
2867 #line 865 "web2c-parser.y" /* yacc.c:1646 */
2868 { my_output ("break"); }
2869 #line 2870 "web2c-parser.c" /* yacc.c:1646 */
2873 #line 869 "web2c-parser.y" /* yacc.c:1646 */
2874 { my_output ("="); }
2875 #line 2876 "web2c-parser.c" /* yacc.c:1646 */
2879 #line 872 "web2c-parser.y" /* yacc.c:1646 */
2880 { my_output ("Result ="); }
2881 #line 2882 "web2c-parser.c" /* yacc.c:1646 */
2885 #line 877 "web2c-parser.y" /* yacc.c:1646 */
2886 { if (strcmp(last_id
, "mem") == 0)
2888 else if (strcmp(last_id
, "eqtb") == 0)
2890 if (sym_table
[l_s
].var_formal
)
2892 my_output (last_id
);
2895 #line 2896 "web2c-parser.c" /* yacc.c:1646 */
2899 #line 888 "web2c-parser.y" /* yacc.c:1646 */
2900 { if (sym_table
[l_s
].var_formal
)
2902 my_output (last_id
); (yyval
) = ex_32
; }
2903 #line 2904 "web2c-parser.c" /* yacc.c:1646 */
2907 #line 894 "web2c-parser.y" /* yacc.c:1646 */
2908 { (yyval
) = ex_32
; }
2909 #line 2910 "web2c-parser.c" /* yacc.c:1646 */
2913 #line 896 "web2c-parser.y" /* yacc.c:1646 */
2914 { (yyval
) = ex_32
; }
2915 #line 2916 "web2c-parser.c" /* yacc.c:1646 */
2919 #line 904 "web2c-parser.y" /* yacc.c:1646 */
2920 { my_output ("["); }
2921 #line 2922 "web2c-parser.c" /* yacc.c:1646 */
2925 #line 906 "web2c-parser.y" /* yacc.c:1646 */
2926 { my_output ("]"); }
2927 #line 2928 "web2c-parser.c" /* yacc.c:1646 */
2931 #line 908 "web2c-parser.y" /* yacc.c:1646 */
2933 if (strcmp(last_id
, "int")==0)
2934 my_output (".cint");
2935 else if (strcmp(last_id
, "lh")==0)
2936 my_output (".v.LH");
2937 else if (strcmp(last_id
, "rh")==0)
2938 my_output (".v.RH");
2940 sprintf(safe_string
, ".%s", last_id
);
2941 my_output (safe_string
);
2945 sprintf(safe_string
, ".%s", last_id
);
2946 my_output (safe_string
);
2949 #line 2950 "web2c-parser.c" /* yacc.c:1646 */
2953 #line 926 "web2c-parser.y" /* yacc.c:1646 */
2954 { my_output (".hh.b0"); }
2955 #line 2956 "web2c-parser.c" /* yacc.c:1646 */
2959 #line 928 "web2c-parser.y" /* yacc.c:1646 */
2960 { my_output (".hh.b1"); }
2961 #line 2962 "web2c-parser.c" /* yacc.c:1646 */
2965 #line 933 "web2c-parser.y" /* yacc.c:1646 */
2966 { my_output ("]["); }
2967 #line 2968 "web2c-parser.c" /* yacc.c:1646 */
2971 #line 938 "web2c-parser.y" /* yacc.c:1646 */
2972 { (yyval
) = (yyvsp
[0]); }
2973 #line 2974 "web2c-parser.c" /* yacc.c:1646 */
2977 #line 939 "web2c-parser.y" /* yacc.c:1646 */
2978 { my_output ("+"); }
2979 #line 2980 "web2c-parser.c" /* yacc.c:1646 */
2983 #line 940 "web2c-parser.y" /* yacc.c:1646 */
2984 { (yyval
) = max ((yyvsp
[-3]), (yyvsp
[0])); }
2985 #line 2986 "web2c-parser.c" /* yacc.c:1646 */
2989 #line 941 "web2c-parser.y" /* yacc.c:1646 */
2990 { my_output ("-"); }
2991 #line 2992 "web2c-parser.c" /* yacc.c:1646 */
2995 #line 942 "web2c-parser.y" /* yacc.c:1646 */
2996 { (yyval
) = max ((yyvsp
[-3]), (yyvsp
[0])); }
2997 #line 2998 "web2c-parser.c" /* yacc.c:1646 */
3001 #line 943 "web2c-parser.y" /* yacc.c:1646 */
3002 { my_output ("*"); }
3003 #line 3004 "web2c-parser.c" /* yacc.c:1646 */
3007 #line 944 "web2c-parser.y" /* yacc.c:1646 */
3008 { (yyval
) = max ((yyvsp
[-3]), (yyvsp
[0])); }
3009 #line 3010 "web2c-parser.c" /* yacc.c:1646 */
3013 #line 945 "web2c-parser.y" /* yacc.c:1646 */
3014 { my_output ("/"); }
3015 #line 3016 "web2c-parser.c" /* yacc.c:1646 */
3019 #line 946 "web2c-parser.y" /* yacc.c:1646 */
3020 { (yyval
) = max ((yyvsp
[-3]), (yyvsp
[0])); }
3021 #line 3022 "web2c-parser.c" /* yacc.c:1646 */
3025 #line 947 "web2c-parser.y" /* yacc.c:1646 */
3026 { my_output ("=="); }
3027 #line 3028 "web2c-parser.c" /* yacc.c:1646 */
3031 #line 948 "web2c-parser.y" /* yacc.c:1646 */
3032 { (yyval
) = max ((yyvsp
[-3]), (yyvsp
[0])); }
3033 #line 3034 "web2c-parser.c" /* yacc.c:1646 */
3037 #line 949 "web2c-parser.y" /* yacc.c:1646 */
3038 { my_output ("!="); }
3039 #line 3040 "web2c-parser.c" /* yacc.c:1646 */
3043 #line 950 "web2c-parser.y" /* yacc.c:1646 */
3044 { (yyval
) = max ((yyvsp
[-3]), (yyvsp
[0])); }
3045 #line 3046 "web2c-parser.c" /* yacc.c:1646 */
3049 #line 951 "web2c-parser.y" /* yacc.c:1646 */
3050 { my_output ("%"); }
3051 #line 3052 "web2c-parser.c" /* yacc.c:1646 */
3055 #line 952 "web2c-parser.y" /* yacc.c:1646 */
3056 { (yyval
) = max ((yyvsp
[-3]), (yyvsp
[0])); }
3057 #line 3058 "web2c-parser.c" /* yacc.c:1646 */
3061 #line 953 "web2c-parser.y" /* yacc.c:1646 */
3062 { my_output ("<"); }
3063 #line 3064 "web2c-parser.c" /* yacc.c:1646 */
3067 #line 954 "web2c-parser.y" /* yacc.c:1646 */
3068 { (yyval
) = max ((yyvsp
[-3]), (yyvsp
[0])); }
3069 #line 3070 "web2c-parser.c" /* yacc.c:1646 */
3073 #line 955 "web2c-parser.y" /* yacc.c:1646 */
3074 { my_output (">"); }
3075 #line 3076 "web2c-parser.c" /* yacc.c:1646 */
3079 #line 956 "web2c-parser.y" /* yacc.c:1646 */
3080 { (yyval
) = max ((yyvsp
[-3]), (yyvsp
[0])); }
3081 #line 3082 "web2c-parser.c" /* yacc.c:1646 */
3085 #line 957 "web2c-parser.y" /* yacc.c:1646 */
3086 { my_output ("<="); }
3087 #line 3088 "web2c-parser.c" /* yacc.c:1646 */
3091 #line 958 "web2c-parser.y" /* yacc.c:1646 */
3092 { (yyval
) = max ((yyvsp
[-3]), (yyvsp
[0])); }
3093 #line 3094 "web2c-parser.c" /* yacc.c:1646 */
3097 #line 959 "web2c-parser.y" /* yacc.c:1646 */
3098 { my_output (">="); }
3099 #line 3100 "web2c-parser.c" /* yacc.c:1646 */
3103 #line 960 "web2c-parser.y" /* yacc.c:1646 */
3104 { (yyval
) = max ((yyvsp
[-3]), (yyvsp
[0])); }
3105 #line 3106 "web2c-parser.c" /* yacc.c:1646 */
3109 #line 961 "web2c-parser.y" /* yacc.c:1646 */
3110 { my_output ("&&"); }
3111 #line 3112 "web2c-parser.c" /* yacc.c:1646 */
3115 #line 962 "web2c-parser.y" /* yacc.c:1646 */
3116 { (yyval
) = max ((yyvsp
[-3]), (yyvsp
[0])); }
3117 #line 3118 "web2c-parser.c" /* yacc.c:1646 */
3121 #line 963 "web2c-parser.y" /* yacc.c:1646 */
3122 { my_output ("||"); }
3123 #line 3124 "web2c-parser.c" /* yacc.c:1646 */
3127 #line 964 "web2c-parser.y" /* yacc.c:1646 */
3128 { (yyval
) = max ((yyvsp
[-3]), (yyvsp
[0])); }
3129 #line 3130 "web2c-parser.c" /* yacc.c:1646 */
3133 #line 966 "web2c-parser.y" /* yacc.c:1646 */
3134 { my_output ("/ ((double)"); }
3135 #line 3136 "web2c-parser.c" /* yacc.c:1646 */
3139 #line 968 "web2c-parser.y" /* yacc.c:1646 */
3140 { (yyval
) = max ((yyvsp
[-3]), (yyvsp
[0])); my_output (")"); }
3141 #line 3142 "web2c-parser.c" /* yacc.c:1646 */
3145 #line 970 "web2c-parser.y" /* yacc.c:1646 */
3146 { (yyval
) = (yyvsp
[0]); }
3147 #line 3148 "web2c-parser.c" /* yacc.c:1646 */
3151 #line 976 "web2c-parser.y" /* yacc.c:1646 */
3152 { my_output ("- (integer)"); }
3153 #line 3154 "web2c-parser.c" /* yacc.c:1646 */
3157 #line 978 "web2c-parser.y" /* yacc.c:1646 */
3158 { my_output ("!"); }
3159 #line 3160 "web2c-parser.c" /* yacc.c:1646 */
3163 #line 983 "web2c-parser.y" /* yacc.c:1646 */
3164 { my_output ("("); }
3165 #line 3166 "web2c-parser.c" /* yacc.c:1646 */
3169 #line 985 "web2c-parser.y" /* yacc.c:1646 */
3170 { my_output (")"); (yyval
) = (yyvsp
[-3]); }
3171 #line 3172 "web2c-parser.c" /* yacc.c:1646 */
3175 #line 989 "web2c-parser.y" /* yacc.c:1646 */
3176 { my_output (last_id
); my_output ("()"); }
3177 #line 3178 "web2c-parser.c" /* yacc.c:1646 */
3181 #line 991 "web2c-parser.y" /* yacc.c:1646 */
3182 { my_output (last_id
); }
3183 #line 3184 "web2c-parser.c" /* yacc.c:1646 */
3187 #line 996 "web2c-parser.y" /* yacc.c:1646 */
3188 { my_output ("("); }
3189 #line 3190 "web2c-parser.c" /* yacc.c:1646 */
3193 #line 997 "web2c-parser.y" /* yacc.c:1646 */
3194 { my_output (")"); }
3195 #line 3196 "web2c-parser.c" /* yacc.c:1646 */
3199 #line 1002 "web2c-parser.y" /* yacc.c:1646 */
3200 { my_output (","); }
3201 #line 3202 "web2c-parser.c" /* yacc.c:1646 */
3205 #line 1009 "web2c-parser.y" /* yacc.c:1646 */
3206 { my_output (last_id
); }
3207 #line 3208 "web2c-parser.c" /* yacc.c:1646 */
3211 #line 1018 "web2c-parser.y" /* yacc.c:1646 */
3212 { my_output (last_id
); my_output ("()"); }
3213 #line 3214 "web2c-parser.c" /* yacc.c:1646 */
3217 #line 1020 "web2c-parser.y" /* yacc.c:1646 */
3218 { my_output (last_id
);
3219 ii
= add_to_table(last_id
);
3220 sym_table
[ii
].typ
= proc_id_tok
;
3223 #line 3224 "web2c-parser.c" /* yacc.c:1646 */
3227 #line 1026 "web2c-parser.y" /* yacc.c:1646 */
3228 { my_output (last_id
); }
3229 #line 3230 "web2c-parser.c" /* yacc.c:1646 */
3233 #line 1031 "web2c-parser.y" /* yacc.c:1646 */
3234 {if (doreturn(temp
)) {
3235 if (strcmp(fn_return_type
,"void"))
3236 my_output ("return Result");
3238 my_output ("return");
3240 sprintf(safe_string
, "goto lab%s",
3242 my_output (safe_string
);
3245 #line 3246 "web2c-parser.c" /* yacc.c:1646 */
3249 #line 1057 "web2c-parser.y" /* yacc.c:1646 */
3250 { my_output ("if"); my_output ("("); }
3251 #line 3252 "web2c-parser.c" /* yacc.c:1646 */
3255 #line 1062 "web2c-parser.y" /* yacc.c:1646 */
3256 { my_output (")"); }
3257 #line 3258 "web2c-parser.c" /* yacc.c:1646 */
3261 #line 1067 "web2c-parser.y" /* yacc.c:1646 */
3263 #line 3264 "web2c-parser.c" /* yacc.c:1646 */
3267 #line 1070 "web2c-parser.y" /* yacc.c:1646 */
3268 { my_output ("{"); indent
++; new_line();
3269 my_output ("if"); my_output ("("); }
3270 #line 3271 "web2c-parser.c" /* yacc.c:1646 */
3274 #line 1073 "web2c-parser.y" /* yacc.c:1646 */
3275 { indent
--; my_output ("}"); new_line(); }
3276 #line 3277 "web2c-parser.c" /* yacc.c:1646 */
3280 #line 1079 "web2c-parser.y" /* yacc.c:1646 */
3281 { my_output ("else"); }
3282 #line 3283 "web2c-parser.c" /* yacc.c:1646 */
3286 #line 1084 "web2c-parser.y" /* yacc.c:1646 */
3287 { my_output ("switch"); my_output ("("); }
3288 #line 3289 "web2c-parser.c" /* yacc.c:1646 */
3292 #line 1086 "web2c-parser.y" /* yacc.c:1646 */
3293 { my_output (")"); new_line();
3294 my_output ("{"); indent
++;
3296 #line 3297 "web2c-parser.c" /* yacc.c:1646 */
3300 #line 1090 "web2c-parser.y" /* yacc.c:1646 */
3301 { indent
--; my_output ("}"); new_line(); }
3302 #line 3303 "web2c-parser.c" /* yacc.c:1646 */
3306 #line 1098 "web2c-parser.y" /* yacc.c:1646 */
3307 { my_output ("break"); semicolon(); }
3308 #line 3309 "web2c-parser.c" /* yacc.c:1646 */
3312 #line 1106 "web2c-parser.y" /* yacc.c:1646 */
3313 { my_output ("case");
3315 my_output (":"); new_line();
3317 #line 3318 "web2c-parser.c" /* yacc.c:1646 */
3321 #line 1111 "web2c-parser.y" /* yacc.c:1646 */
3322 { my_output ("default:"); new_line(); }
3323 #line 3324 "web2c-parser.c" /* yacc.c:1646 */
3327 #line 1124 "web2c-parser.y" /* yacc.c:1646 */
3328 { my_output ("while");
3331 #line 3332 "web2c-parser.c" /* yacc.c:1646 */
3335 #line 1128 "web2c-parser.y" /* yacc.c:1646 */
3336 { my_output (")"); }
3337 #line 3338 "web2c-parser.c" /* yacc.c:1646 */
3341 #line 1133 "web2c-parser.y" /* yacc.c:1646 */
3342 { my_output ("do"); my_output ("{"); indent
++; }
3343 #line 3344 "web2c-parser.c" /* yacc.c:1646 */
3347 #line 1135 "web2c-parser.y" /* yacc.c:1646 */
3348 { indent
--; my_output ("}");
3349 my_output ("while"); my_output ("( ! (");
3351 #line 3352 "web2c-parser.c" /* yacc.c:1646 */
3355 #line 1139 "web2c-parser.y" /* yacc.c:1646 */
3356 { my_output (") )"); }
3357 #line 3358 "web2c-parser.c" /* yacc.c:1646 */
3361 #line 1143 "web2c-parser.y" /* yacc.c:1646 */
3364 my_output ("register");
3365 my_output ("integer");
3367 my_output ("for_begin,");
3368 my_output ("for_end;");
3370 #line 3371 "web2c-parser.c" /* yacc.c:1646 */
3374 #line 1152 "web2c-parser.y" /* yacc.c:1646 */
3376 my_output ("for_begin");
3378 my_output (control_var
);
3380 #line 3381 "web2c-parser.c" /* yacc.c:1646 */
3384 #line 1158 "web2c-parser.y" /* yacc.c:1646 */
3385 { my_output ("; if (");
3386 if (strict_for
) my_output ("for_begin");
3387 else my_output (control_var
);
3388 my_output (relation
);
3389 my_output ("for_end)");
3392 my_output (control_var
);
3394 my_output ("for_begin");
3401 #line 3402 "web2c-parser.c" /* yacc.c:1646 */
3405 #line 1175 "web2c-parser.y" /* yacc.c:1646 */
3407 char *top
= strrchr (for_stack
, '#');
3410 my_output ("while");
3421 #line 3422 "web2c-parser.c" /* yacc.c:1646 */
3425 #line 1193 "web2c-parser.y" /* yacc.c:1646 */
3426 { strcpy(control_var
, last_id
); }
3427 #line 3428 "web2c-parser.c" /* yacc.c:1646 */
3431 #line 1197 "web2c-parser.y" /* yacc.c:1646 */
3432 { my_output (";"); }
3433 #line 3434 "web2c-parser.c" /* yacc.c:1646 */
3437 #line 1199 "web2c-parser.y" /* yacc.c:1646 */
3439 strcpy(relation
, "<=");
3440 my_output ("for_end");
3442 #line 3443 "web2c-parser.c" /* yacc.c:1646 */
3446 #line 1204 "web2c-parser.y" /* yacc.c:1646 */
3448 sprintf(for_stack
+ strlen(for_stack
),
3449 "#%s++ < for_end", control_var
);
3451 #line 3452 "web2c-parser.c" /* yacc.c:1646 */
3455 #line 1209 "web2c-parser.y" /* yacc.c:1646 */
3456 { my_output (";"); }
3457 #line 3458 "web2c-parser.c" /* yacc.c:1646 */
3461 #line 1211 "web2c-parser.y" /* yacc.c:1646 */
3463 strcpy(relation
, ">=");
3464 my_output ("for_end");
3466 #line 3467 "web2c-parser.c" /* yacc.c:1646 */
3470 #line 1216 "web2c-parser.y" /* yacc.c:1646 */
3472 sprintf(for_stack
+ strlen(for_stack
),
3473 "#%s-- > for_end", control_var
);
3475 #line 3476 "web2c-parser.c" /* yacc.c:1646 */
3479 #line 3480 "web2c-parser.c" /* yacc.c:1646 */
3482 /* User semantic actions sometimes alter yychar, and that requires
3483 that yytoken be updated with the new translation. We take the
3484 approach of translating immediately before every use of yytoken.
3485 One alternative is translating here after every semantic action,
3486 but that translation would be missed if the semantic action invokes
3487 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
3488 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
3489 incorrect destructor might then be invoked immediately. In the
3490 case of YYERROR or YYBACKUP, subsequent parser actions might lead
3491 to an incorrect destructor call or verbose syntax error message
3492 before the lookahead is translated. */
3493 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
3497 YY_STACK_PRINT (yyss
, yyssp
);
3501 /* Now 'shift' the result of the reduction. Determine what state
3502 that goes to, based on the state we popped back to and the rule
3503 number reduced by. */
3507 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
3508 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
3509 yystate
= yytable
[yystate
];
3511 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
3516 /*--------------------------------------.
3517 | yyerrlab -- here on detecting error. |
3518 `--------------------------------------*/
3520 /* Make sure we have latest lookahead translation. See comments at
3521 user semantic actions for why this is necessary. */
3522 yytoken
= yychar
== YYEMPTY
? YYEMPTY
: YYTRANSLATE (yychar
);
3524 /* If not already recovering from an error, report this error. */
3528 #if ! YYERROR_VERBOSE
3529 yyerror (YY_("syntax error"));
3531 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
3534 char const *yymsgp
= YY_("syntax error");
3535 int yysyntax_error_status
;
3536 yysyntax_error_status
= YYSYNTAX_ERROR
;
3537 if (yysyntax_error_status
== 0)
3539 else if (yysyntax_error_status
== 1)
3541 if (yymsg
!= yymsgbuf
)
3542 YYSTACK_FREE (yymsg
);
3543 yymsg
= (char *) YYSTACK_ALLOC (yymsg_alloc
);
3547 yymsg_alloc
= sizeof yymsgbuf
;
3548 yysyntax_error_status
= 2;
3552 yysyntax_error_status
= YYSYNTAX_ERROR
;
3557 if (yysyntax_error_status
== 2)
3558 goto yyexhaustedlab
;
3560 # undef YYSYNTAX_ERROR
3566 if (yyerrstatus
== 3)
3568 /* If just tried and failed to reuse lookahead token after an
3569 error, discard it. */
3571 if (yychar
<= YYEOF
)
3573 /* Return failure if at end of input. */
3574 if (yychar
== YYEOF
)
3579 yydestruct ("Error: discarding",
3585 /* Else will try to reuse lookahead token after shifting the error
3590 /*---------------------------------------------------.
3591 | yyerrorlab -- error raised explicitly by YYERROR. |
3592 `---------------------------------------------------*/
3595 /* Pacify compilers like GCC when the user code never invokes
3596 YYERROR and the label yyerrorlab therefore never appears in user
3598 if (/*CONSTCOND*/ 0)
3601 /* Do not reclaim the symbols of the rule whose action triggered
3605 YY_STACK_PRINT (yyss
, yyssp
);
3610 /*-------------------------------------------------------------.
3611 | yyerrlab1 -- common code for both syntax error and YYERROR. |
3612 `-------------------------------------------------------------*/
3614 yyerrstatus
= 3; /* Each real token shifted decrements this. */
3618 yyn
= yypact
[yystate
];
3619 if (!yypact_value_is_default (yyn
))
3622 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
3630 /* Pop the current state because it cannot handle the error token. */
3635 yydestruct ("Error: popping",
3636 yystos
[yystate
], yyvsp
);
3639 YY_STACK_PRINT (yyss
, yyssp
);
3642 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
3644 YY_IGNORE_MAYBE_UNINITIALIZED_END
3647 /* Shift the error token. */
3648 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
3654 /*-------------------------------------.
3655 | yyacceptlab -- YYACCEPT comes here. |
3656 `-------------------------------------*/
3661 /*-----------------------------------.
3662 | yyabortlab -- YYABORT comes here. |
3663 `-----------------------------------*/
3668 #if !defined yyoverflow || YYERROR_VERBOSE
3669 /*-------------------------------------------------.
3670 | yyexhaustedlab -- memory exhaustion comes here. |
3671 `-------------------------------------------------*/
3673 yyerror (YY_("memory exhausted"));
3679 if (yychar
!= YYEMPTY
)
3681 /* Make sure we have latest lookahead translation. See comments at
3682 user semantic actions for why this is necessary. */
3683 yytoken
= YYTRANSLATE (yychar
);
3684 yydestruct ("Cleanup: discarding lookahead",
3687 /* Do not reclaim the symbols of the rule whose action triggered
3688 this YYABORT or YYACCEPT. */
3690 YY_STACK_PRINT (yyss
, yyssp
);
3691 while (yyssp
!= yyss
)
3693 yydestruct ("Cleanup: popping",
3694 yystos
[*yyssp
], yyvsp
);
3699 YYSTACK_FREE (yyss
);
3702 if (yymsg
!= yymsgbuf
)
3703 YYSTACK_FREE (yymsg
);
3707 #line 1221 "web2c-parser.y" /* yacc.c:1906 */
3711 compute_array_bounds (void)
3716 if (lower_sym
== 0 || upper_sym
== 0) {
3717 yyerror ("Cannot handle variable subrange in array decl");
3719 else if (lower_sym
== -1) { /* lower is a constant */
3720 lb
= lower_bound
- 1;
3721 if (lb
==0) lb
= -1; /* Treat lower_bound==1 as if lower_bound==0 */
3722 if (upper_sym
== -1) /* both constants */
3723 sprintf(tmp
, "[%ld]", upper_bound
- lb
);
3724 else { /* upper a symbol, lower constant */
3726 sprintf(tmp
, "[%s + %ld]",
3727 symbol(upper_sym
), (-lb
));
3729 sprintf(tmp
, "[%s - %ld]",
3730 symbol(upper_sym
), lb
);
3732 if (lower_bound
< 0 || lower_bound
> 1) {
3733 if (*array_bounds
) {
3734 yyerror ("Cannot handle offset in second dimension");
3736 if (lower_bound
< 0) {
3737 sprintf(array_offset
, "+%ld", -lower_bound
);
3739 sprintf(array_offset
, "-%ld", lower_bound
);
3742 strcat(array_bounds
, tmp
);
3743 } else { /* lower is a symbol */
3744 if (upper_sym
!= -1) /* both are symbols */
3745 sprintf(tmp
, "[%s - %s + 1]", symbol(upper_sym
),
3747 else { /* upper constant, lower symbol */
3748 sprintf(tmp
, "[%ld - %s]", upper_bound
+ 1,
3751 if (*array_bounds
) {
3752 yyerror ("Cannot handle symbolic offset in second dimension");
3754 sprintf(array_offset
, "- (int)(%s)", symbol(lower_sym
));
3755 strcat(array_bounds
, tmp
);
3760 /* Kludge around negative lower array bounds. */
3763 fixup_var_list (void)
3766 char output_string
[100], real_symbol
[100];
3768 for (i
= 0; var_list
[i
++] == '!'; )
3770 for (j
= 0; (real_symbol
[j
++] = var_list
[i
++]); )
3774 fprintf (out
, "\n#define %s (%s %s)\n ",
3775 real_symbol
, next_temp
, array_offset
);
3776 strcpy (real_symbol
, next_temp
);
3777 /* Add the temp to the symbol table, so that change files can
3778 use it later on if necessary. */
3779 j
= add_to_table (next_temp
);
3780 sym_table
[j
].typ
= var_id_tok
;
3783 sprintf (output_string
, "%s%s%c", real_symbol
, array_bounds
,
3784 var_list
[i
] == '!' ? ',' : ' ');
3785 my_output (output_string
);
3791 /* If we're not processing TeX, we return false. Otherwise,
3792 return true if the label is "10" and we're not in one of four TeX
3793 routines where the line labeled "10" isn't the end of the routine.
3794 Otherwise, return 0. */
3797 doreturn (string label
)
3801 && STREQ (label
, "10")
3802 && !STREQ (my_routine
, "macrocall")
3803 && !STREQ (my_routine
, "hpack")
3804 && !STREQ (my_routine
, "vpackage")
3805 && !STREQ (my_routine
, "trybreak");
3809 /* Return the absolute value of a long. */
3813 if (x
< 0L) return(-x
);
3818 /* Output current function declaration to coerce file. */
3823 /* If we want ANSI code and one of the parameters is a var
3824 parameter, then use the #define to add the &. We do this by
3825 adding a 'z' at the front of the name. gen_function_head will do
3829 for (i
= 0; i
< ids_paramed
; ++i
)
3830 var
+= sym_table
[param_id_list
[i
]].var_formal
;
3832 for (i
= strlen (z_id
); i
>= 0; --i
)
3833 z_id
[i
+1] = z_id
[i
];
3837 if (proc_is_noreturn
) {
3838 fprintf (coerce
, "WEB2C_NORETURN ");
3839 proc_is_noreturn
= 0;
3841 /* We can't use our P?H macros here, since there might be an arbitrary
3842 number of function arguments. */
3843 fprintf (coerce
, "%s %s (", fn_return_type
, z_id
);
3844 if (ids_paramed
== 0) fprintf (coerce
, "void");
3845 for (i
= 0; i
< ids_paramed
; i
++) {
3848 fprintf (coerce
, "%s %s", arg_type
[i
], symbol (param_id_list
[i
]));
3850 fprintf (coerce
, ");\n");
3854 gen_function_head (void)
3858 if (strcmp(my_routine
, z_id
)) {
3859 fprintf(coerce
, "#define %s(", my_routine
);
3860 for (i
=0; i
<ids_paramed
; i
++) {
3862 fprintf(coerce
, ", %s", symbol(param_id_list
[i
]));
3864 fprintf(coerce
, "%s", symbol(param_id_list
[i
]));
3866 fprintf(coerce
, ") %s(", z_id
);
3867 for (i
=0; i
<ids_paramed
; i
++) {
3869 fputs(", ", coerce
);
3870 fprintf(coerce
, "(%s) ", arg_type
[i
]);
3871 fprintf(coerce
, "%s(%s)",
3872 sym_table
[param_id_list
[i
]].var_formal
?"&":"",
3873 symbol(param_id_list
[i
]));
3875 fprintf(coerce
, ")\n");
3879 /* We now always use ANSI C prototypes. */
3882 if (ids_paramed
== 0) my_output ("void");
3883 for (i
=0; i
<ids_paramed
; i
++) {
3884 if (i
> 0) my_output (",");
3885 my_output (arg_type
[i
]);
3886 my_output (symbol (param_id_list
[i
]));