/* A Bison parser, made by GNU Bison 3.0.4. */ /* Bison implementation for Yacc-like parsers in C Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* C LALR(1) parser skeleton written by Richard Stallman, by simplifying the original so-called "semantic" parser. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. There are some unavoidable exceptions within include files to define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ /* Identify Bison output. */ #define YYBISON 1 /* Bison version. */ #define YYBISON_VERSION "3.0.4" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" /* Pure parsers. */ #define YYPURE 0 /* Push parsers. */ #define YYPUSH 0 /* Pull parsers. */ #define YYPULL 1 /* Copy the first part of user declarations. */ #line 27 "pass1/parser/grammar.y" /* yacc.c:339 */ # define YYDEBUG 1 # include # include "parm.h" # include "pass1/applinfer/precedence.h" # include "stree/ststructs.mh" # include "pass1/parser/rcs.h" /* bit vectors defining RUSSELL character set */ # include "pass1/parser/stt/sttdefs.h" # include "pass4/sigs.h" # include /* The following should really be handled with %union, */ /* but that would be lots of work to fix. */ typedef NODE * NodeStar; # define YYSTYPE NodeStar # define maxskip 8 /* maximum number of tokens to be skipped in error */ /* recovery, other than in denotation sequences */ # ifdef BAD extern boolean BADflag; # endif # ifdef DEBUG int yydebug; # endif # define LIST_END 0x7fff int paramstop [] /* stop symbols for parameter error recovery */ = { ';', ']', '{', VAR, VAL, FUNC, TYPE, SIGNATURE, EOF, LIST_END }; int denseqstop [] /* stop symbols for statement list error recovery */ = { ';', '#', ELSIF, ELSE, FI, OD, ')', NI, '}', IF, DO, LET, FUNC, '(', WITH, IN, EOF, LIST_END }; int condstop [] /* stop symbols for error recovery in various */ /* conditional constructs */ = { OD, FI, RIGHT_ARROW, '#', ';', LET, DO, IF, THEN, ELSE, '(', EOF, LIST_END }; int declstop [] /* stop symbols for error recovery in declarations */ = { EQUALS_EQUALS, EQUALS_EQUALS_EQUALS, ';', '}', IN, NI, IF, DO, LET, '(', EOF, LIST_END }; NODE * sig_in(); /* Read signature info from object file */ extern boolean initflag; /* This is a compiler initialization run */ extern boolean OOflag; /* Save info for intermediate code optimizer */ NODE * insrtptr = NIL; /* pointer to dummy BLOCKDENOTATION vertex into */ /* which the syntax tree is to be inserted. */ /* Set up by a previous initialization run of */ /* compiler. */ extern NODE * id_Boolean; /* LETTERID node in which the parameter node */ /* for Boolean must be inserted. */ extern NODE * id_Void; /* Analogous node for Void */ extern NODE * id_Integer; /* Analogous node for Integer */ extern NODE * id_Null; /* Analogous for Null */ extern NODE * appl_Null; /* Node corresponding to application of Null */ extern sttrelptr indx_Boolean; /* string table index of 'Boolean' */ extern sttrelptr indx_Integer; extern sttrelptr indx_Void; extern sttrelptr indx_simple; extern sttrelptr indx_standard; extern sttrelptr indx_inline; extern sttrelptr indx_put; extern sttrelptr indx_Callcc; extern sttrelptr indx_Array; extern sttrelptr indx_Null; NODE * stxtree = NIL; /* pointer to root of syntax tree */ unsigned i; /* temporary */ extern sttrelptr /* indices in string table of type components with */ /* predefined signatures. */ indx_assign, indx_passign, indx_massign, indx_equals, indx_less, indx_greater, indx_le, indx_ge, indx_ne, indx_New, indx_ptr_New, indx_init_New, indx_ValueOf, indx_sconc, indx_pconc; NODE * sig_assign, /* pointers to trees representing predefined */ * sig_equals, /* signatures. */ * sig_less, * sig_greater, * sig_New, * sig_const, * sig_ValueOf, * sig_sconc, * sig_pconc, * sig_Signature; extern char * (getname()); extern NODE * mkappl(); extern char * (* inline_cnvt)(); boolean has_externs; /* Mentions separately compiled Russell programs */ /* Defines to establish and test the presence of an optional element */ # define PRESENT ((NodeStar)1) # define NOTPRESENT 0 # define is_present(x) ((x) == PRESENT) #line 226 "grammar.tab.c" /* yacc.c:339 */ # ifndef YY_NULLPTR # if defined __cplusplus && 201103L <= __cplusplus # define YY_NULLPTR nullptr # else # define YY_NULLPTR 0 # endif # endif /* Enabling verbose error messages. */ #ifdef YYERROR_VERBOSE # undef YYERROR_VERBOSE # define YYERROR_VERBOSE 1 #else # define YYERROR_VERBOSE 0 #endif /* In a future release of Bison, this section will be replaced by #include "grammar.tab.h". */ #ifndef YY_YY_GRAMMAR_TAB_H_INCLUDED # define YY_YY_GRAMMAR_TAB_H_INCLUDED /* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif #if YYDEBUG extern int yydebug; #endif /* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE enum yytokentype { CAND = 258, CHARACTERS = 259, CONSTANTS = 260, COR = 261, DO = 262, ELSE = 263, ELSIF = 264, END = 265, ENUM = 266, EXPORT = 267, FI = 268, FIELD = 269, FUNC = 270, HIDE = 271, IF = 272, IN = 273, EXTEND = 274, LET = 275, NI = 276, OD = 277, READONLY = 278, RECORD = 279, THEN = 280, TYPE = 281, UNION = 282, USE = 283, VAL = 284, VAR = 285, WITH = 286, RIGHT_ARROW = 287, EQUALS_EQUALS = 288, EQUALS_EQUALS_EQUALS = 289, COLON = 290, WORDID = 291, OPID = 292, PROD = 293, QSTRING = 294, UQSTRING = 295, LEFT_ANGLE_BRACKET = 296, RIGHT_ANGLE_BRACKET = 297, EXTERN = 298, SIGNATURE = 299 }; #endif /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef int YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 #endif extern YYSTYPE yylval; int yyparse (void); #endif /* !YY_YY_GRAMMAR_TAB_H_INCLUDED */ /* Copy the second part of user declarations. */ #line 322 "grammar.tab.c" /* yacc.c:358 */ #ifdef short # undef short #endif #ifdef YYTYPE_UINT8 typedef YYTYPE_UINT8 yytype_uint8; #else typedef unsigned char yytype_uint8; #endif #ifdef YYTYPE_INT8 typedef YYTYPE_INT8 yytype_int8; #else typedef signed char yytype_int8; #endif #ifdef YYTYPE_UINT16 typedef YYTYPE_UINT16 yytype_uint16; #else typedef unsigned short int yytype_uint16; #endif #ifdef YYTYPE_INT16 typedef YYTYPE_INT16 yytype_int16; #else typedef short int yytype_int16; #endif #ifndef YYSIZE_T # ifdef __SIZE_TYPE__ # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t # elif ! defined YYSIZE_T # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else # define YYSIZE_T unsigned int # endif #endif #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) #ifndef YY_ # if defined YYENABLE_NLS && YYENABLE_NLS # if ENABLE_NLS # include /* INFRINGES ON USER NAME SPACE */ # define YY_(Msgid) dgettext ("bison-runtime", Msgid) # endif # endif # ifndef YY_ # define YY_(Msgid) Msgid # endif #endif #ifndef YY_ATTRIBUTE # if (defined __GNUC__ \ && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C # define YY_ATTRIBUTE(Spec) __attribute__(Spec) # else # define YY_ATTRIBUTE(Spec) /* empty */ # endif #endif #ifndef YY_ATTRIBUTE_PURE # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) #endif #ifndef YY_ATTRIBUTE_UNUSED # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) #endif #if !defined _Noreturn \ && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) # if defined _MSC_VER && 1200 <= _MSC_VER # define _Noreturn __declspec (noreturn) # else # define _Noreturn YY_ATTRIBUTE ((__noreturn__)) # endif #endif /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ # define YYUSE(E) ((void) (E)) #else # define YYUSE(E) /* empty */ #endif #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ /* Suppress an incorrect diagnostic about yylval being uninitialized. */ # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ _Pragma ("GCC diagnostic pop") #else # define YY_INITIAL_VALUE(Value) Value #endif #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN # define YY_IGNORE_MAYBE_UNINITIALIZED_END #endif #ifndef YY_INITIAL_VALUE # define YY_INITIAL_VALUE(Value) /* Nothing. */ #endif #if ! defined yyoverflow || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ # ifdef YYSTACK_USE_ALLOCA # if YYSTACK_USE_ALLOCA # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca # elif defined __BUILTIN_VA_ARG_INCR # include /* INFRINGES ON USER NAME SPACE */ # elif defined _AIX # define YYSTACK_ALLOC __alloca # elif defined _MSC_VER # include /* INFRINGES ON USER NAME SPACE */ # define alloca _alloca # else # define YYSTACK_ALLOC alloca # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS # include /* INFRINGES ON USER NAME SPACE */ /* Use EXIT_SUCCESS as a witness for stdlib.h. */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 # endif # endif # endif # endif # endif # ifdef YYSTACK_ALLOC /* Pacify GCC's 'empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely invoke alloca (N) if N exceeds 4096. Use a slightly smaller number to allow for a few compiler-allocated temporary stack slots. */ # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ # endif # else # define YYSTACK_ALLOC YYMALLOC # define YYSTACK_FREE YYFREE # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif # if (defined __cplusplus && ! defined EXIT_SUCCESS \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc # if ! defined malloc && ! defined EXIT_SUCCESS void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free # if ! defined free && ! defined EXIT_SUCCESS void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif # endif #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ #if (! defined yyoverflow \ && (! defined __cplusplus \ || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { yytype_int16 yyss_alloc; YYSTYPE yyvs_alloc; }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) # define YYCOPY_NEEDED 1 /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ do \ { \ YYSIZE_T yynewbytes; \ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ Stack = &yyptr->Stack_alloc; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (0) #endif #if defined YYCOPY_NEEDED && YYCOPY_NEEDED /* Copy COUNT objects from SRC to DST. The source and destination do not overlap. */ # ifndef YYCOPY # if defined __GNUC__ && 1 < __GNUC__ # define YYCOPY(Dst, Src, Count) \ __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) # else # define YYCOPY(Dst, Src, Count) \ do \ { \ YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (Dst)[yyi] = (Src)[yyi]; \ } \ while (0) # endif # endif #endif /* !YYCOPY_NEEDED */ /* YYFINAL -- State number of the termination state. */ #define YYFINAL 5 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 849 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 57 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 58 /* YYNRULES -- Number of rules. */ #define YYNRULES 148 /* YYNSTATES -- Number of states. */ #define YYNSTATES 390 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned by yylex, with out-of-bounds checking. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 299 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM as returned by yylex, without out-of-bounds checking. */ static const yytype_uint8 yytranslate[] = { 0, 2, 54, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 56, 55, 2, 2, 2, 48, 49, 2, 2, 47, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 46, 2, 45, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 52, 2, 53, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 50, 2, 51, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44 }; #if YYDEBUG /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { 0, 189, 189, 189, 201, 204, 203, 208, 254, 256, 288, 291, 294, 296, 300, 302, 306, 308, 312, 314, 318, 322, 326, 330, 332, 342, 352, 362, 372, 382, 390, 400, 404, 417, 421, 461, 466, 476, 478, 482, 484, 488, 490, 494, 506, 539, 580, 587, 594, 596, 600, 602, 605, 625, 637, 639, 641, 643, 647, 649, 651, 653, 655, 657, 659, 681, 683, 685, 691, 697, 705, 707, 709, 757, 759, 763, 782, 791, 793, 798, 802, 808, 813, 818, 824, 826, 828, 830, 832, 836, 838, 840, 844, 848, 850, 852, 856, 858, 862, 868, 878, 880, 925, 927, 931, 935, 939, 948, 952, 954, 958, 967, 971, 973, 977, 979, 983, 994, 996, 1000, 1002, 1006, 1008, 1010, 1014, 1016, 1020, 1022, 1024, 1028, 1030, 1032, 1036, 1038, 1042, 1044, 1048, 1051, 1057, 1067, 1086, 1088, 1090, 1107, 1147, 1159, 1161, 1165, 1167 }; #endif #if YYDEBUG || YYERROR_VERBOSE || 0 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { "$end", "error", "$undefined", "CAND", "CHARACTERS", "CONSTANTS", "COR", "DO", "ELSE", "ELSIF", "END", "ENUM", "EXPORT", "FI", "FIELD", "FUNC", "HIDE", "IF", "IN", "EXTEND", "LET", "NI", "OD", "READONLY", "RECORD", "THEN", "TYPE", "UNION", "USE", "VAL", "VAR", "WITH", "RIGHT_ARROW", "EQUALS_EQUALS", "EQUALS_EQUALS_EQUALS", "COLON", "WORDID", "OPID", "PROD", "QSTRING", "UQSTRING", "LEFT_ANGLE_BRACKET", "RIGHT_ANGLE_BRACKET", "EXTERN", "SIGNATURE", "'='", "';'", "','", "'('", "')'", "'{'", "'}'", "'['", "']'", "'\\002'", "'$'", "'#'", "$accept", "Program", "@1", "$@2", "Parameters", "Opt.Colon", "Opt.Parameters", "Opt.Parameter.list", "Id.list", "Signature", "ManifestSignature", "Opt.Simple", "Opt.InLine", "Special", "FuncSignature", "Opt.TypeSignatureComponents", "Opt.TypeSignatureComponent.list", "Opt.Id", "TypeSignatureComponents", "Opt.Readonly", "Denotation", "BasicDenotation", "Primary.list", "Primary", "Denotation.seq", "Opt.Denotation", "FuncConstruction", "IncompleteFuncSignature", "Selection", "TypeConstruction", "Guard", "ArgList", "Opt.Denotation.list", "Opt.Declaration.list", "Opt.Declarations", "Opt.ColonSignature", "Enumeration", "Extension", "Product", "Record", "Union", "Opt.RecordElement.list", "Opt.RecordElements", "RecordElements", "TypeModifier", "WithList", "ExportList", "Start.ExportList", "ExportElement.list", "ExportElement", "Opt.ExportList", "Opt.SigClause", "Opt.ElseList", "ElseList", "GuardedDenotation.list", "GuardedDenotation", "ID", "STRING", YY_NULLPTR }; #endif # ifdef YYPRINT /* YYTOKNUM[NUM] -- (External) token number corresponding to the (internal) symbol number NUM (which must be that of a token). */ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 61, 59, 44, 40, 41, 123, 125, 91, 93, 2, 36, 35 }; # endif #define YYPACT_NINF -295 #define yypact_value_is_default(Yystate) \ (!!((Yystate) == (-295))) #define YYTABLE_NINF -92 #define yytable_value_is_error(Yytable_value) \ 0 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ static const yytype_int16 yypact[] = { 471, 32, 39, 691, 515, -295, -295, -295, 377, 56, 234, 377, 92, 40, 13, 98, 118, 603, 735, 735, 84, 114, 132, 125, 150, 153, -295, 515, 603, 181, -295, 191, 215, -295, 773, 176, -295, 224, -295, -295, -295, 253, 254, 255, 259, 261, -5, 263, -295, 264, 163, 249, 265, 8, 279, -2, 267, 222, -295, 222, 262, 235, 17, 691, -295, -295, 3, 11, 272, 273, -295, 116, -295, 182, 274, 277, -295, 275, -295, 137, 305, 281, 282, 283, -295, -295, -295, 280, -295, -295, 290, 242, 284, -295, 288, -295, -295, 31, -295, 21, 24, 144, -295, 236, -295, 294, 296, 197, 559, -295, -295, -295, -295, -295, 805, -295, 303, -295, -295, 647, -295, 515, -295, 515, 308, 427, -295, 164, 43, 149, 222, 302, 311, 307, -295, -295, 222, 805, 256, 515, 40, -295, -295, -295, 2, 49, 312, 316, -295, 23, 322, 60, -295, 149, -295, 603, 515, -295, -295, -295, 149, 320, -295, 327, -295, -295, -295, -295, -295, 323, -5, 329, -295, -295, 325, -8, 62, 234, 291, -295, 331, -295, -295, -295, 332, 334, 103, 223, -295, -295, 336, 341, 342, 340, 351, -295, -295, 348, 350, 95, 2, 353, 273, 360, 149, -295, 355, 363, 364, 691, 691, 5, 365, 691, 116, 366, -295, -295, 373, 197, -295, -295, 374, -295, 2, 378, 79, 379, 381, 178, 382, 6, 186, 387, -295, 40, 391, -295, 73, 367, 392, 370, 235, 394, -295, -295, -295, 515, 691, -295, -295, -295, -295, -295, -295, 396, -295, -295, 149, 306, 805, -295, 119, -295, -295, -295, 395, 398, 403, -295, 404, 405, -295, 54, 402, -295, 241, -295, 60, 413, -295, -295, 414, -295, 415, 416, -295, 189, -295, -295, 417, -295, 390, 247, -5, 423, -295, 149, 421, -295, 163, 444, -295, 431, -295, 435, 438, 793, -295, -295, -295, -295, -295, 445, 197, 60, 440, -295, 442, 475, 447, -295, -295, -295, -295, 448, -295, 449, -295, 73, 155, -295, 130, 149, 515, -295, -295, -295, -295, 451, 159, 452, 192, -295, -295, 735, -295, -295, -295, 458, -295, 459, 460, 805, 152, 103, -295, 82, 197, 60, 461, 467, -295, -295, -295, 805, -295, 464, 197, 470, 193, -295, -295, 197, 474, 60, 472, 477, 60, 202, -295, 60, 203, 483, 206, 484, -295, 486, -295, -295 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. Performed when YYTABLE does not specify something else to do. Zero means the default is an error. */ static const yytype_uint8 yydefact[] = { 0, 5, 0, 0, 0, 1, 60, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 50, 0, 0, 51, 0, 0, 58, 0, 59, 62, 55, 0, 0, 0, 0, 0, 0, 0, 72, 0, 6, 143, 0, 0, 0, 0, 0, 0, 33, 0, 0, 0, 0, 0, 101, 100, 11, 0, 0, 0, 109, 0, 42, 0, 0, 0, 111, 0, 95, 0, 0, 0, 0, 0, 145, 146, 107, 0, 147, 148, 0, 0, 0, 53, 23, 3, 52, 56, 57, 0, 0, 0, 54, 0, 63, 0, 0, 0, 0, 84, 86, 87, 85, 88, 0, 135, 0, 83, 71, 0, 90, 0, 89, 0, 0, 0, 140, 0, 0, 0, 0, 0, 0, 0, 10, 103, 0, 0, 0, 0, 0, 96, 16, 115, 11, 0, 0, 0, 31, 0, 0, 0, 41, 0, 93, 0, 0, 77, 22, 21, 0, 0, 64, 0, 122, 124, 123, 125, 120, 0, 0, 0, 117, 118, 0, 0, 0, 0, 0, 19, 0, 18, 82, 74, 0, 0, 137, 0, 66, 91, 0, 0, 0, 0, 0, 9, 13, 0, 0, 0, 11, 0, 0, 0, 0, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 112, 114, 0, 0, 30, 47, 0, 38, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 92, 0, 0, 81, 0, 0, 0, 0, 0, 0, 23, 73, 70, 0, 0, 142, 136, 144, 141, 104, 32, 0, 12, 14, 0, 0, 0, 8, 0, 105, 17, 102, 0, 0, 0, 97, 0, 0, 108, 0, 0, 46, 0, 39, 0, 0, 37, 16, 0, 94, 0, 0, 69, 0, 80, 131, 0, 128, 0, 0, 0, 0, 75, 0, 0, 134, 138, 0, 34, 0, 79, 0, 0, 0, 98, 99, 67, 116, 113, 0, 0, 0, 0, 49, 0, 0, 0, 29, 110, 68, 106, 0, 130, 0, 126, 0, 0, 76, 0, 0, 0, 15, 36, 7, 78, 0, 0, 0, 0, 48, 43, 0, 40, 119, 121, 0, 133, 0, 0, 0, 0, 137, 35, 0, 0, 0, 0, 0, 127, 132, 129, 0, 139, 0, 0, 0, 0, 28, 44, 0, 0, 0, 0, 0, 0, 0, 27, 0, 0, 0, 0, 0, 26, 0, 25, 24 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { -295, -295, -295, -295, -295, -125, 278, -137, -12, -103, -46, -295, -55, 356, 37, 260, -294, -9, -295, -295, 7, -14, -295, 503, -19, -295, -295, -295, -295, -295, -295, 506, -11, 313, 406, -295, -295, -295, -295, -295, -295, -295, 333, -295, -295, -295, 219, -295, 221, -295, -295, -158, 201, -295, 546, 436, -13, 465 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { -1, 2, 3, 4, 197, 137, 198, 199, 200, 201, 30, 149, 60, 61, 31, 225, 226, 74, 227, 319, 49, 33, 34, 35, 50, 185, 36, 37, 38, 39, 54, 40, 80, 67, 68, 138, 41, 42, 43, 44, 45, 145, 146, 147, 104, 105, 106, 107, 292, 293, 352, 116, 249, 250, 55, 56, 46, 47 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule whose number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { 69, 66, 75, 75, 82, 83, 131, 77, 91, 75, 32, 178, 236, 87, 70, 53, 229, 92, 53, 213, 124, 342, 164, 232, 79, 166, 268, 284, 218, 139, 132, 239, -4, 121, 208, 79, 114, 134, 134, 5, 115, 64, 90, 99, 69, 127, 128, 100, 135, 136, 136, 119, 119, 122, 125, 81, 81, 140, 69, 144, 150, 221, 101, 71, 222, 370, 165, 262, 179, 167, 133, 81, 219, 125, 289, 260, 20, 21, 290, 20, 21, 379, 193, 179, 382, 65, 103, 384, 75, 176, 170, 179, 169, 313, 75, 214, 20, 21, 174, 276, 215, 181, 186, 314, 187, 223, 57, 179, 119, 20, 21, 247, 248, 240, 179, 194, 202, 203, 291, 76, 211, 367, 241, 207, 181, 278, 184, 69, 66, 84, 279, 368, 190, 86, 20, 21, 330, 231, 228, 224, 202, 258, 63, 72, 230, 168, 73, 202, 259, 119, 195, 180, 20, 21, 20, 21, 305, 306, 179, 85, 332, 143, 79, 72, 177, 258, 180, 99, 20, 21, 88, 100, 307, 318, 180, 15, 258, 72, 18, 19, 20, 21, 154, 353, 155, 20, 21, 298, 99, 72, 180, 202, 100, 26, 196, 89, 354, 180, 258, 357, 350, 69, 144, 90, 339, 365, 75, 101, 358, 119, 274, 136, 179, 179, 179, 192, 266, 267, 20, 21, 270, 102, 69, 66, 258, 294, 93, 148, 300, 282, 179, 103, 258, 20, 21, 140, 94, 285, 278, 278, 325, 180, 72, 360, 376, 202, 181, 181, 278, 278, 305, 179, 278, 383, 385, 301, 177, 387, 20, 21, 95, 179, 339, 181, 316, 228, 224, 15, 251, 119, 18, 19, 20, 21, 108, 23, 24, 20, 21, 58, 58, -91, 59, 130, 202, 26, 317, 179, 119, 209, 210, 162, 328, 329, 181, 180, 180, 180, 109, 110, 111, 75, 228, 224, 112, 341, 113, 179, 117, 118, 120, 123, 126, 180, 129, 355, 294, 141, 142, 179, 202, 177, 152, 156, 151, 153, 157, 158, 159, 161, 160, 361, 15, 243, 180, 18, 19, 163, -77, 172, 181, 173, 20, 21, 180, 75, 228, 224, 182, 369, 26, 304, 181, 188, 204, 75, 205, 216, 206, 374, 75, 217, 228, 224, 377, 228, 224, 220, 228, 224, 180, 233, 234, 235, 237, 238, 244, 245, 51, 246, 6, 122, 81, 7, 8, 52, 252, 253, 9, 254, 180, 255, 10, 256, 11, 257, 12, 13, 261, 193, 263, 14, 180, 15, 16, 17, 18, 19, 264, 265, 269, 272, 273, 20, 21, 22, 23, 24, 295, 275, 25, 26, 297, 277, 280, 27, 281, 283, 189, 28, 6, 29, 286, 7, 8, 52, 288, 296, 9, 299, 308, 327, 10, 309, 11, 302, 12, 13, 310, 311, 312, 14, 315, 15, 16, 17, 18, 19, 321, 322, 323, 324, 326, 20, 21, 22, 23, 24, 331, 334, 25, 26, 1, 333, -2, 27, 335, -2, -2, 28, 336, 29, -2, 337, 340, 343, -2, 344, -2, 345, -2, -2, 346, 347, 348, -2, 356, -2, -2, -2, -2, -2, 359, 362, 363, 364, 371, -2, -2, -2, -2, -2, 372, 373, -2, -2, 48, 380, 6, -2, 375, 7, 8, -2, 378, -2, 9, 381, 386, 388, 10, 389, 11, 242, 12, 13, 303, 97, 320, 14, 98, 15, 16, 17, 18, 19, 212, 271, 287, 351, 349, 20, 21, 22, 23, 24, 366, 62, 25, 26, 48, 191, 6, 27, 0, 7, 8, 28, 171, 29, 9, 0, 0, 0, 10, 0, 11, 0, 12, 13, 0, 0, 0, 14, 0, 15, 16, 17, 18, 19, 0, 0, 0, 0, 0, 20, 21, 22, 23, 24, 0, 0, 175, 26, 0, 0, 6, 27, 0, 7, 8, 28, 0, 29, 9, 0, 0, 0, 10, 0, 11, 0, 12, 13, 0, 0, 0, 14, 0, 15, 16, 17, 18, 19, 0, 0, 0, 0, 0, 20, 21, 22, 23, 24, 0, 0, 25, 26, 78, 0, 6, 27, 0, 7, 8, 28, 0, 29, 9, 0, 0, 0, 10, 0, 11, 0, 12, 13, 0, 0, 0, 14, 0, 15, 16, 17, 18, 19, 0, 0, 0, 0, 0, 20, 21, 22, 23, 24, 0, 0, 25, 26, 183, 0, 6, 27, 0, 7, 8, 28, 0, 29, 9, 0, 0, 0, 10, 0, 11, 0, 12, 13, 0, 0, 0, 14, 0, 15, 16, 17, 18, 19, 0, 0, 0, 0, 0, 20, 21, 22, 23, 24, 0, 0, 25, 26, 0, 0, 6, 27, 0, 7, 8, 28, 0, 29, 9, 0, 0, 0, 10, 0, 11, 0, 12, 13, 0, 0, 0, 14, 0, 0, 16, 17, 0, 0, 0, 0, 0, 0, 0, 20, 21, 22, 23, 24, 6, 0, 25, 7, 8, 0, 0, 27, 9, 0, 0, 28, 10, 29, 11, 0, 12, 13, 0, 0, 0, 14, 0, 0, 16, 17, 0, 0, 0, 0, 0, 0, 177, 20, 21, 22, 23, 24, 0, 0, 25, 0, 96, 15, 177, 27, 18, 19, 0, 28, 0, 0, 0, 20, 21, 15, 0, 0, 18, 19, 0, 26, 338, 0, 0, 20, 21, 0, 0, 0, 0, 0, 0, 26 }; static const yytype_int16 yycheck[] = { 13, 13, 15, 16, 18, 19, 61, 16, 27, 22, 3, 114, 170, 22, 1, 8, 153, 28, 11, 144, 22, 315, 1, 160, 17, 1, 21, 21, 5, 18, 13, 39, 0, 25, 137, 28, 41, 35, 35, 0, 45, 1, 50, 12, 57, 57, 59, 16, 45, 47, 47, 46, 46, 45, 56, 18, 19, 46, 71, 71, 73, 1, 31, 50, 4, 359, 45, 204, 114, 45, 63, 34, 49, 56, 1, 200, 36, 37, 5, 36, 37, 375, 39, 129, 378, 45, 55, 381, 101, 108, 103, 137, 101, 39, 107, 46, 36, 37, 107, 224, 51, 114, 121, 49, 123, 45, 50, 153, 46, 36, 37, 8, 9, 51, 160, 128, 129, 130, 45, 1, 139, 39, 177, 136, 137, 46, 119, 140, 140, 45, 51, 49, 125, 1, 36, 37, 294, 156, 151, 151, 153, 46, 50, 45, 155, 1, 48, 160, 53, 46, 1, 114, 36, 37, 36, 37, 259, 260, 204, 45, 297, 45, 155, 45, 15, 46, 129, 12, 36, 37, 45, 16, 53, 276, 137, 26, 46, 45, 29, 30, 36, 37, 45, 53, 47, 36, 37, 242, 12, 45, 153, 204, 16, 44, 45, 45, 333, 160, 46, 40, 45, 214, 214, 50, 307, 53, 219, 31, 49, 46, 219, 47, 258, 259, 260, 51, 209, 210, 36, 37, 213, 45, 235, 235, 46, 238, 45, 45, 247, 51, 276, 55, 46, 36, 37, 46, 45, 51, 46, 46, 51, 204, 45, 51, 51, 258, 259, 260, 46, 46, 353, 297, 46, 51, 51, 248, 15, 51, 36, 37, 45, 307, 365, 276, 23, 278, 278, 26, 45, 46, 29, 30, 36, 37, 50, 39, 40, 36, 37, 45, 45, 32, 48, 48, 297, 44, 45, 333, 46, 33, 34, 49, 45, 46, 307, 258, 259, 260, 45, 45, 45, 314, 315, 315, 45, 314, 45, 353, 45, 45, 45, 32, 45, 276, 52, 334, 329, 45, 45, 365, 333, 15, 45, 18, 50, 50, 45, 45, 45, 39, 50, 345, 26, 42, 297, 29, 30, 53, 50, 45, 353, 45, 36, 37, 307, 358, 359, 359, 45, 358, 44, 45, 365, 45, 52, 368, 45, 45, 51, 368, 373, 45, 375, 375, 373, 378, 378, 45, 381, 381, 333, 51, 45, 50, 45, 50, 45, 45, 1, 45, 3, 45, 345, 6, 7, 8, 45, 45, 11, 49, 353, 40, 15, 45, 17, 45, 19, 20, 45, 39, 45, 24, 365, 26, 27, 28, 29, 30, 45, 45, 45, 45, 39, 36, 37, 38, 39, 40, 51, 45, 43, 44, 52, 45, 45, 48, 45, 45, 1, 52, 3, 54, 45, 6, 7, 8, 45, 45, 11, 45, 45, 51, 15, 45, 17, 49, 19, 20, 45, 45, 45, 24, 50, 26, 27, 28, 29, 30, 45, 45, 45, 45, 45, 36, 37, 38, 39, 40, 45, 25, 43, 44, 1, 52, 3, 48, 45, 6, 7, 52, 45, 54, 11, 45, 39, 45, 15, 45, 17, 14, 19, 20, 45, 45, 45, 24, 45, 26, 27, 28, 29, 30, 50, 45, 45, 45, 45, 36, 37, 38, 39, 40, 45, 49, 43, 44, 1, 45, 3, 48, 50, 6, 7, 52, 50, 54, 11, 50, 45, 45, 15, 45, 17, 177, 19, 20, 258, 34, 278, 24, 34, 26, 27, 28, 29, 30, 140, 214, 235, 330, 329, 36, 37, 38, 39, 40, 355, 11, 43, 44, 1, 125, 3, 48, -1, 6, 7, 52, 103, 54, 11, -1, -1, -1, 15, -1, 17, -1, 19, 20, -1, -1, -1, 24, -1, 26, 27, 28, 29, 30, -1, -1, -1, -1, -1, 36, 37, 38, 39, 40, -1, -1, 43, 44, -1, -1, 3, 48, -1, 6, 7, 52, -1, 54, 11, -1, -1, -1, 15, -1, 17, -1, 19, 20, -1, -1, -1, 24, -1, 26, 27, 28, 29, 30, -1, -1, -1, -1, -1, 36, 37, 38, 39, 40, -1, -1, 43, 44, 45, -1, 3, 48, -1, 6, 7, 52, -1, 54, 11, -1, -1, -1, 15, -1, 17, -1, 19, 20, -1, -1, -1, 24, -1, 26, 27, 28, 29, 30, -1, -1, -1, -1, -1, 36, 37, 38, 39, 40, -1, -1, 43, 44, 45, -1, 3, 48, -1, 6, 7, 52, -1, 54, 11, -1, -1, -1, 15, -1, 17, -1, 19, 20, -1, -1, -1, 24, -1, 26, 27, 28, 29, 30, -1, -1, -1, -1, -1, 36, 37, 38, 39, 40, -1, -1, 43, 44, -1, -1, 3, 48, -1, 6, 7, 52, -1, 54, 11, -1, -1, -1, 15, -1, 17, -1, 19, 20, -1, -1, -1, 24, -1, -1, 27, 28, -1, -1, -1, -1, -1, -1, -1, 36, 37, 38, 39, 40, 3, -1, 43, 6, 7, -1, -1, 48, 11, -1, -1, 52, 15, 54, 17, -1, 19, 20, -1, -1, -1, 24, -1, -1, 27, 28, -1, -1, -1, -1, -1, -1, 15, 36, 37, 38, 39, 40, -1, -1, 43, -1, 45, 26, 15, 48, 29, 30, -1, 52, -1, -1, -1, 36, 37, 26, -1, -1, 29, 30, -1, 44, 45, -1, -1, 36, 37, -1, -1, -1, -1, -1, -1, 44 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { 0, 1, 58, 59, 60, 0, 3, 6, 7, 11, 15, 17, 19, 20, 24, 26, 27, 28, 29, 30, 36, 37, 38, 39, 40, 43, 44, 48, 52, 54, 67, 71, 77, 78, 79, 80, 83, 84, 85, 86, 88, 93, 94, 95, 96, 97, 113, 114, 1, 77, 81, 1, 8, 77, 87, 111, 112, 50, 45, 48, 69, 70, 111, 50, 1, 45, 65, 90, 91, 113, 1, 50, 45, 48, 74, 113, 1, 74, 45, 77, 89, 71, 78, 78, 45, 45, 1, 74, 45, 45, 50, 81, 89, 45, 45, 45, 45, 80, 88, 12, 16, 31, 45, 55, 101, 102, 103, 104, 50, 45, 45, 45, 45, 45, 41, 45, 108, 45, 45, 46, 45, 25, 45, 32, 22, 56, 45, 65, 113, 52, 48, 69, 13, 77, 35, 45, 47, 62, 92, 18, 46, 45, 45, 45, 65, 98, 99, 100, 45, 68, 113, 50, 45, 50, 45, 47, 18, 45, 45, 45, 50, 39, 49, 53, 1, 45, 1, 45, 1, 74, 113, 114, 45, 45, 74, 43, 81, 15, 66, 67, 71, 113, 45, 45, 77, 82, 81, 81, 45, 1, 77, 112, 51, 39, 113, 1, 45, 61, 63, 64, 65, 66, 113, 113, 52, 45, 51, 113, 66, 33, 34, 81, 91, 62, 46, 51, 45, 45, 5, 49, 45, 1, 4, 45, 65, 72, 73, 75, 113, 64, 89, 81, 64, 51, 45, 50, 108, 45, 50, 39, 51, 69, 70, 42, 45, 45, 45, 8, 9, 109, 110, 45, 45, 45, 49, 40, 45, 45, 46, 53, 62, 45, 64, 45, 45, 45, 77, 77, 21, 45, 77, 99, 45, 39, 74, 45, 62, 45, 46, 51, 45, 45, 51, 45, 21, 51, 45, 90, 45, 1, 5, 45, 105, 106, 113, 51, 45, 52, 69, 45, 81, 77, 49, 63, 45, 66, 66, 53, 45, 45, 45, 45, 45, 39, 49, 50, 23, 45, 66, 76, 72, 45, 45, 45, 45, 51, 45, 51, 45, 46, 108, 45, 64, 52, 25, 45, 45, 45, 45, 66, 39, 74, 73, 45, 45, 14, 45, 45, 45, 105, 45, 103, 107, 53, 64, 81, 45, 40, 49, 50, 51, 78, 45, 45, 45, 53, 109, 39, 49, 74, 73, 45, 45, 49, 74, 50, 51, 74, 50, 73, 45, 50, 73, 51, 73, 51, 45, 51, 45, 45 }; /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { 0, 57, 59, 58, 58, 60, 58, 61, 61, 61, 62, 62, 63, 63, 64, 64, 65, 65, 66, 66, 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 68, 68, 69, 69, 70, 71, 71, 72, 72, 73, 73, 74, 74, 75, 75, 75, 75, 75, 76, 76, 77, 77, 78, 78, 79, 79, 79, 79, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 81, 81, 81, 82, 82, 83, 83, 84, 84, 84, 85, 85, 85, 85, 86, 86, 86, 86, 86, 87, 87, 87, 88, 89, 89, 89, 90, 90, 91, 91, 91, 91, 92, 92, 93, 94, 95, 95, 96, 96, 97, 97, 98, 98, 99, 99, 100, 101, 101, 102, 102, 103, 103, 103, 104, 104, 105, 105, 105, 106, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111, 111, 111, 112, 113, 113, 114, 114 }; /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { 0, 2, 0, 3, 1, 0, 3, 4, 2, 1, 1, 0, 2, 1, 2, 4, 2, 4, 1, 1, 1, 3, 3, 2, 15, 14, 13, 11, 9, 6, 2, 1, 4, 1, 5, 8, 7, 2, 1, 2, 4, 2, 1, 4, 6, 2, 2, 1, 2, 1, 1, 1, 2, 2, 2, 1, 2, 2, 1, 1, 1, 1, 1, 2, 3, 4, 4, 6, 6, 5, 4, 2, 1, 2, 1, 5, 6, 2, 7, 6, 5, 4, 3, 2, 2, 2, 2, 2, 2, 2, 2, 1, 4, 2, 4, 1, 2, 4, 5, 5, 1, 1, 3, 1, 5, 5, 6, 2, 5, 2, 6, 2, 2, 4, 2, 1, 4, 2, 2, 6, 2, 6, 2, 2, 2, 2, 2, 4, 1, 4, 2, 1, 2, 1, 4, 1, 1, 0, 2, 5, 2, 4, 4, 1, 4, 2, 2, 2, 2 }; #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY (-2) #define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY) \ { \ yychar = (Token); \ yylval = (Value); \ YYPOPSTACK (yylen); \ yystate = *yyssp; \ goto yybackup; \ } \ else \ { \ yyerror (YY_("syntax error: cannot back up")); \ YYERROR; \ } \ while (0) /* Error token number */ #define YYTERROR 1 #define YYERRCODE 256 /* Enable debugging if requested. */ #if YYDEBUG # ifndef YYFPRINTF # include /* INFRINGES ON USER NAME SPACE */ # define YYFPRINTF fprintf # endif # define YYDPRINTF(Args) \ do { \ if (yydebug) \ YYFPRINTF Args; \ } while (0) /* This macro is provided for backward compatibility. */ #ifndef YY_LOCATION_PRINT # define YY_LOCATION_PRINT(File, Loc) ((void) 0) #endif # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ yy_symbol_print (stderr, \ Type, Value); \ YYFPRINTF (stderr, "\n"); \ } \ } while (0) /*----------------------------------------. | Print this symbol's value on YYOUTPUT. | `----------------------------------------*/ static void yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) { FILE *yyo = yyoutput; YYUSE (yyo); if (!yyvaluep) return; # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); # endif YYUSE (yytype); } /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ static void yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) { YYFPRINTF (yyoutput, "%s %s (", yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); yy_symbol_value_print (yyoutput, yytype, yyvaluep); YYFPRINTF (yyoutput, ")"); } /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (included). | `------------------------------------------------------------------*/ static void yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) { YYFPRINTF (stderr, "Stack now"); for (; yybottom <= yytop; yybottom++) { int yybot = *yybottom; YYFPRINTF (stderr, " %d", yybot); } YYFPRINTF (stderr, "\n"); } # define YY_STACK_PRINT(Bottom, Top) \ do { \ if (yydebug) \ yy_stack_print ((Bottom), (Top)); \ } while (0) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ static void yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule) { unsigned long int yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; int yyi; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { YYFPRINTF (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yystos[yyssp[yyi + 1 - yynrhs]], &(yyvsp[(yyi + 1) - (yynrhs)]) ); YYFPRINTF (stderr, "\n"); } } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ yy_reduce_print (yyssp, yyvsp, Rule); \ } while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) # define YY_SYMBOL_PRINT(Title, Type, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only if the built-in stack extension method is used). Do not make this value too large; the results are undefined if YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif #if YYERROR_VERBOSE # ifndef yystrlen # if defined __GLIBC__ && defined _STRING_H # define yystrlen strlen # else /* Return the length of YYSTR. */ static YYSIZE_T yystrlen (const char *yystr) { YYSIZE_T yylen; for (yylen = 0; yystr[yylen]; yylen++) continue; return yylen; } # endif # endif # ifndef yystpcpy # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ static char * yystpcpy (char *yydest, const char *yysrc) { char *yyd = yydest; const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; return yyd - 1; } # endif # endif # ifndef yytnamerr /* Copy to YYRES the contents of YYSTR after stripping away unnecessary quotes and backslashes, so that it's suitable for yyerror. The heuristic is that double-quoting is unnecessary unless the string contains an apostrophe, a comma, or backslash (other than backslash-backslash). YYSTR is taken from yytname. If YYRES is null, do not copy; instead, return the length of what the result would have been. */ static YYSIZE_T yytnamerr (char *yyres, const char *yystr) { if (*yystr == '"') { YYSIZE_T yyn = 0; char const *yyp = yystr; for (;;) switch (*++yyp) { case '\'': case ',': goto do_not_strip_quotes; case '\\': if (*++yyp != '\\') goto do_not_strip_quotes; /* Fall through. */ default: if (yyres) yyres[yyn] = *yyp; yyn++; break; case '"': if (yyres) yyres[yyn] = '\0'; return yyn; } do_not_strip_quotes: ; } if (! yyres) return yystrlen (yystr); return yystpcpy (yyres, yystr) - yyres; } # endif /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message about the unexpected token YYTOKEN for the state stack whose top is YYSSP. Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is not large enough to hold the message. In that case, also set *YYMSG_ALLOC to the required number of bytes. Return 2 if the required number of bytes is too large to store. */ static int yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, yytype_int16 *yyssp, int yytoken) { YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); YYSIZE_T yysize = yysize0; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; /* Internationalized format string. */ const char *yyformat = YY_NULLPTR; /* Arguments of yyformat. */ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; /* Number of reported tokens (one for the "unexpected", one per "expected"). */ int yycount = 0; /* There are many possibilities here to consider: - If this state is a consistent state with a default action, then the only way this function was invoked is if the default action is an error action. In that case, don't check for expected tokens because there are none. - The only way there can be no lookahead present (in yychar) is if this state is a consistent state with a default action. Thus, detecting the absence of a lookahead is sufficient to determine that there is no unexpected or expected token to report. In that case, just report a simple "syntax error". - Don't assume there isn't a lookahead just because this state is a consistent state with a default action. There might have been a previous inconsistent state, consistent state with a non-default action, or user semantic action that manipulated yychar. - Of course, the expected token list depends on states to have correct lookahead information, and it depends on the parser not to perform extra reductions after fetching a lookahead from the scanner and before detecting a syntax error. Thus, state merging (from LALR or IELR) and default reductions corrupt the expected token list. However, the list is correct for canonical LR with one exception: it will still contain any token that will not be accepted due to an error action in a later state. */ if (yytoken != YYEMPTY) { int yyn = yypact[*yyssp]; yyarg[yycount++] = yytname[yytoken]; if (!yypact_value_is_default (yyn)) { /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. In other words, skip the first -YYN actions for this state because they are default actions. */ int yyxbegin = yyn < 0 ? -yyn : 0; /* Stay within bounds of both yycheck and yytname. */ int yychecklim = YYLAST - yyn + 1; int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; int yyx; for (yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR && !yytable_value_is_error (yytable[yyx + yyn])) { if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) { yycount = 1; yysize = yysize0; break; } yyarg[yycount++] = yytname[yyx]; { YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) return 2; yysize = yysize1; } } } } switch (yycount) { # define YYCASE_(N, S) \ case N: \ yyformat = S; \ break YYCASE_(0, YY_("syntax error")); YYCASE_(1, YY_("syntax error, unexpected %s")); YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); # undef YYCASE_ } { YYSIZE_T yysize1 = yysize + yystrlen (yyformat); if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) return 2; yysize = yysize1; } if (*yymsg_alloc < yysize) { *yymsg_alloc = 2 * yysize; if (! (yysize <= *yymsg_alloc && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; return 1; } /* Avoid sprintf, as that infringes on the user's name space. Don't have undefined behavior even if the translation produced a string with the wrong number of "%s"s. */ { char *yyp = *yymsg; int yyi = 0; while ((*yyp = *yyformat) != '\0') if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) { yyp += yytnamerr (yyp, yyarg[yyi++]); yyformat += 2; } else { yyp++; yyformat++; } } return 0; } #endif /* YYERROR_VERBOSE */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) { YYUSE (yyvaluep); if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN YYUSE (yytype); YY_IGNORE_MAYBE_UNINITIALIZED_END } /* The lookahead symbol. */ int yychar; /* The semantic value of the lookahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ int yynerrs; /*----------. | yyparse. | `----------*/ int yyparse (void) { int yystate; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* The stacks and their tools: 'yyss': related to states. 'yyvs': related to semantic values. Refer to the stacks through separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ yytype_int16 yyssa[YYINITDEPTH]; yytype_int16 *yyss; yytype_int16 *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs; YYSTYPE *yyvsp; YYSIZE_T yystacksize; int yyn; int yyresult; /* Lookahead token as an internal (translated) token number. */ int yytoken = 0; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; #if YYERROR_VERBOSE /* Buffer for error messages, and its allocated size. */ char yymsgbuf[128]; char *yymsg = yymsgbuf; YYSIZE_T yymsg_alloc = sizeof yymsgbuf; #endif #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ int yylen = 0; yyssp = yyss = yyssa; yyvsp = yyvs = yyvsa; yystacksize = YYINITDEPTH; YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ goto yysetstate; /*------------------------------------------------------------. | yynewstate -- Push a new state, which is found in yystate. | `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. So pushing a state here evens the stacks. */ yyssp++; yysetstate: *yyssp = yystate; if (yyss + yystacksize - 1 <= yyssp) { /* Get the current used size of the three stacks, in elements. */ YYSIZE_T yysize = yyssp - yyss + 1; #ifdef yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; yytype_int16 *yyss1 = yyss; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow (YY_("memory exhausted"), &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yystacksize); yyss = yyss1; yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE goto yyexhaustedlab; # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { yytype_int16 *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyexhaustedlab; YYSTACK_RELOCATE (yyss_alloc, yyss); YYSTACK_RELOCATE (yyvs_alloc, yyvs); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); if (yystate == YYFINAL) YYACCEPT; goto yybackup; /*-----------. | yybackup. | `-----------*/ yybackup: /* Do appropriate processing given the current state. Read a lookahead token if we need one and don't already have one. */ /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yypact_value_is_default (yyn)) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); yychar = yylex (); } if (yychar <= YYEOF) { yychar = yytoken = YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } else { yytoken = YYTRANSLATE (yychar); YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to detect an error, take that action. */ yyn += yytoken; if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault; yyn = yytable[yyn]; if (yyn <= 0) { if (yytable_value_is_error (yyn)) goto yyerrlab; yyn = -yyn; goto yyreduce; } /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; /* Shift the lookahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); /* Discard the shifted token. */ yychar = YYEMPTY; yystate = yyn; YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; YY_IGNORE_MAYBE_UNINITIALIZED_END goto yynewstate; /*-----------------------------------------------------------. | yydefault -- do the default action for the current state. | `-----------------------------------------------------------*/ yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; goto yyreduce; /*-----------------------------. | yyreduce -- Do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: '$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ yyval = yyvsp[1-yylen]; YY_REDUCE_PRINT (yyn); switch (yyn) { case 2: #line 189 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = insrtptr; /* Remember original value */ } #line 1751 "grammar.tab.c" /* yacc.c:1646 */ break; case 3: #line 191 "pass1/parser/grammar.y" /* yacc.c:1646 */ { if (stxtree != NIL) { /* insert new syntax tree in standard prologue */ if ((yyvsp[-2]) != NIL) chgfld(&((yyvsp[-2]) -> bld_den_seq),mklist((yyvsp[-1]), -1)); else yyperror("No insertion marker in standard prologue"); } else { stxtree = lock((yyvsp[-1])); } } #line 1766 "grammar.tab.c" /* yacc.c:1646 */ break; case 4: #line 202 "pass1/parser/grammar.y" /* yacc.c:1646 */ { yyperror("Syntax error"); } #line 1772 "grammar.tab.c" /* yacc.c:1646 */ break; case 5: #line 204 "pass1/parser/grammar.y" /* yacc.c:1646 */ { yyperror("Syntax error"); } #line 1778 "grammar.tab.c" /* yacc.c:1646 */ break; case 7: #line 209 "pass1/parser/grammar.y" /* yacc.c:1646 */ { NODE *p; if (!(yyvsp[-2])) { yyperror("Missing colon in parameter specification"); } lock((yyvsp[-3])); lock((yyvsp[-1])); if (first((yyvsp[-3])) -> id_str_table_index == indx_Boolean && (id_Boolean -> id_last_definition == NIL)) { (yyval) = p = split(PARAMETER, (yyvsp[-3]), (yyvsp[-1])); chgfld ( &(id_Boolean -> id_last_definition), first(p) ); /* this is the actual definition */ id_Boolean -> id_def_found = TRUE; if (!initflag) { yywarn ("No builtin type Boolean"); } } else if (first((yyvsp[-3])) -> id_str_table_index == indx_Void && (id_Void -> id_last_definition == NIL)) { (yyval) = p = split(PARAMETER, (yyvsp[-3]), (yyvsp[-1])); chgfld ( &(id_Void -> id_last_definition), first(p) ); id_Void -> id_def_found = TRUE; if (!initflag) { yywarn ("No builtin type Void"); } } else if (first((yyvsp[-3])) -> id_str_table_index == indx_Integer && (id_Integer -> id_last_definition == NIL)) { (yyval) = p = split(PARAMETER, (yyvsp[-3]), (yyvsp[-1])); chgfld ( &(id_Integer -> id_last_definition), first(p) ); id_Integer -> id_def_found = TRUE; if (!initflag) { yywarn ("No builtin type Integer"); } } else if (first((yyvsp[-3])) -> id_str_table_index == indx_Null && (id_Null -> id_last_definition == NIL)) { (yyval) = p = split(PARAMETER, (yyvsp[-3]), (yyvsp[-1])); chgfld ( &(id_Null -> id_last_definition), first(p) ); id_Null -> id_def_found = TRUE; if (!initflag) { yywarn ("No builtin constant Null"); } } else { (yyval) = split(PARAMETER, (yyvsp[-3]), (yyvsp[-1])); } vfree(unlock((yyvsp[-3]))); vfree(unlock((yyvsp[-1]))); } #line 1828 "grammar.tab.c" /* yacc.c:1646 */ break; case 8: #line 255 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = mklist( mknode(PARAMETER,NIL,(yyvsp[-1])), -1 ); } #line 1834 "grammar.tab.c" /* yacc.c:1646 */ break; case 9: #line 257 "pass1/parser/grammar.y" /* yacc.c:1646 */ { int i = 0; int c; yyperror("Error in Parameter Specification"); for ( c = yychar; !in(c, paramstop); c = yylex() ) if ( ++i > maxskip ) break; yyclearin; switch (c) { case VAL: case VAR: case FUNC: yyunlex(c); yyunlex(';'); break; case '{': yyunlex(c); yyunlex(WORDID); yyunlex(VAL); yyunlex(']'); break; case ';': case ']': yyunlex(c); break; case EOF: exit(1); default: /* recover at outer level */ yyunlex(c); yyunlex(']'); } # ifdef DEBUG if ( yydebug ) rec_on(c); # endif (yyval) = emptylist(); } #line 1867 "grammar.tab.c" /* yacc.c:1646 */ break; case 10: #line 289 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = (NodeStar)TRUE; } #line 1873 "grammar.tab.c" /* yacc.c:1646 */ break; case 11: #line 291 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = (NodeStar)FALSE; } #line 1879 "grammar.tab.c" /* yacc.c:1646 */ break; case 12: #line 295 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } #line 1885 "grammar.tab.c" /* yacc.c:1646 */ break; case 13: #line 297 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = emptylist(); } #line 1891 "grammar.tab.c" /* yacc.c:1646 */ break; case 14: #line 301 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } #line 1897 "grammar.tab.c" /* yacc.c:1646 */ break; case 15: #line 303 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = conc((yyvsp[-3]),(yyvsp[-1])); } #line 1903 "grammar.tab.c" /* yacc.c:1646 */ break; case 16: #line 307 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = mklist((yyvsp[-1]), -1); } #line 1909 "grammar.tab.c" /* yacc.c:1646 */ break; case 17: #line 309 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = addright((yyvsp[-3]),(yyvsp[-1])); } #line 1915 "grammar.tab.c" /* yacc.c:1646 */ break; case 18: #line 313 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } #line 1921 "grammar.tab.c" /* yacc.c:1646 */ break; case 19: #line 315 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } #line 1927 "grammar.tab.c" /* yacc.c:1646 */ break; case 20: #line 319 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = sig_Signature; } #line 1935 "grammar.tab.c" /* yacc.c:1646 */ break; case 21: #line 323 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = mknode(VARSIGNATURE,(yyvsp[-1])); } #line 1943 "grammar.tab.c" /* yacc.c:1646 */ break; case 22: #line 327 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = mknode(VALSIGNATURE,(yyvsp[-1])); } #line 1951 "grammar.tab.c" /* yacc.c:1646 */ break; case 23: #line 331 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } #line 1957 "grammar.tab.c" /* yacc.c:1646 */ break; case 24: #line 334 "pass1/parser/grammar.y" /* yacc.c:1646 */ { if (!initflag) { yywarn("Compiler directive outside initialization"); } (yyval) = mknode(TYPESIGNATURE,(yyvsp[-4]),(yyvsp[-2]),(yyvsp[-10]),(yyvsp[-9]),(yyvsp[-8]),(yyvsp[-6])); (yyval) -> ts_string_max = atoi((yyvsp[-7])); (yyval) -> ts_simple_type = (int)(yyvsp[-12]); } #line 1970 "grammar.tab.c" /* yacc.c:1646 */ break; case 25: #line 344 "pass1/parser/grammar.y" /* yacc.c:1646 */ { if (!initflag) { yywarn("Compiler directive outside initialization"); } (yyval) = mknode(TYPESIGNATURE,(yyvsp[-4]),(yyvsp[-2]),(yyvsp[-9]),(yyvsp[-8]),(yyvsp[-7]),NIL); (yyval) -> ts_string_max = atoi((yyvsp[-6])); (yyval) -> ts_simple_type = (int)(yyvsp[-11]); } #line 1983 "grammar.tab.c" /* yacc.c:1646 */ break; case 26: #line 354 "pass1/parser/grammar.y" /* yacc.c:1646 */ { if (!initflag) { yywarn("Compiler directive outside initialization"); } (yyval) = mknode(TYPESIGNATURE,(yyvsp[-4]),(yyvsp[-2]),(yyvsp[-8]),(yyvsp[-7]),(yyvsp[-6]),NIL); (yyval) -> ts_string_max = -1; (yyval) -> ts_simple_type = (int)(yyvsp[-10]); } #line 1996 "grammar.tab.c" /* yacc.c:1646 */ break; case 27: #line 364 "pass1/parser/grammar.y" /* yacc.c:1646 */ { if (!initflag) { yywarn("Compiler directive outside initialization"); } (yyval) = mknode(TYPESIGNATURE,(yyvsp[-4]),(yyvsp[-2]),(yyvsp[-6]),NIL,NIL,NIL); (yyval) -> ts_string_max = -1; (yyval) -> ts_simple_type = (int)(yyvsp[-8]); } #line 2009 "grammar.tab.c" /* yacc.c:1646 */ break; case 28: #line 374 "pass1/parser/grammar.y" /* yacc.c:1646 */ { if (!initflag) { yywarn("Compiler directive outside initialization"); } (yyval) = mknode(TYPESIGNATURE,(yyvsp[-4]),(yyvsp[-2]),NIL,NIL,NIL,NIL); (yyval) -> ts_string_max = -1; (yyval) -> ts_simple_type = (int)(yyvsp[-6]); } #line 2022 "grammar.tab.c" /* yacc.c:1646 */ break; case 29: #line 383 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = mknode(TYPESIGNATURE,(yyvsp[-4]),(yyvsp[-2]),NIL,NIL,NIL,NIL); (yyval) -> ts_string_max = -1; (yyval) -> ts_simple_type = FALSE; } #line 2032 "grammar.tab.c" /* yacc.c:1646 */ break; case 30: #line 391 "pass1/parser/grammar.y" /* yacc.c:1646 */ { if ((yyvsp[-1]) -> id_str_table_index == indx_simple) { (yyval) = (NodeStar)TRUE; /* simple type, no pointers to activation records */ } else { yywarn("Compiler directive not understood"); (yyval) = (NodeStar)FALSE; } vfree((yyvsp[-1])); } #line 2046 "grammar.tab.c" /* yacc.c:1646 */ break; case 31: #line 401 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = FALSE; } #line 2052 "grammar.tab.c" /* yacc.c:1646 */ break; case 32: #line 405 "pass1/parser/grammar.y" /* yacc.c:1646 */ { if (!initflag) { yywarn("Compiler directive outside initialization"); } if ((yyvsp[-2]) -> id_str_table_index == indx_inline) { (yyval) = (NodeStar)((*inline_cnvt)((yyvsp[-1]))); } else { yywarn("Compiler directive not understood"); (yyval) = NIL; } vfree((yyvsp[-2])); } #line 2069 "grammar.tab.c" /* yacc.c:1646 */ break; case 33: #line 418 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = NIL; } #line 2075 "grammar.tab.c" /* yacc.c:1646 */ break; case 34: #line 422 "pass1/parser/grammar.y" /* yacc.c:1646 */ { if (!initflag) { yywarn("Compiler directive outside initialization"); } if ((yyvsp[-3]) -> id_str_table_index == indx_standard) { int num_arg = atoi((yyvsp[-1])); if ((yyvsp[-2]) -> id_str_table_index == indx_New) { (yyval) = (NodeStar)special(STD_NEW, num_arg); } else if ((yyvsp[-2]) -> id_str_table_index == indx_ptr_New) { (yyval) = (NodeStar)special(PTR_NEW, num_arg); } else if ((yyvsp[-2]) -> id_str_table_index == indx_init_New) { (yyval) = (NodeStar)special(INIT_NEW, num_arg); } else if ((yyvsp[-2]) -> id_str_table_index == indx_ValueOf) { (yyval) = (NodeStar)special(STD_VALUEOF, num_arg); } else if ((yyvsp[-2]) -> id_str_table_index == indx_assign) { (yyval) = (NodeStar)special(STD_ASSIGN, num_arg); } else if ((yyvsp[-2]) -> id_str_table_index == indx_put) { (yyval) = (NodeStar)special(STD_PUT, num_arg); } else if ((yyvsp[-2]) -> id_str_table_index == indx_Callcc) { (yyval) = (NodeStar)special(STD_CALLCC, num_arg); } else if ((yyvsp[-2]) -> id_str_table_index == indx_Array) { (yyval) = (NodeStar)special(STD_ARRAY, num_arg); } else if ((yyvsp[-2]) -> id_str_table_index == indx_passign) { (yyval) = (NodeStar)special(STD_PASSIGN, num_arg); } else if ((yyvsp[-2]) -> id_str_table_index == indx_massign) { (yyval) = (NodeStar)special(STD_MASSIGN, num_arg); } else { yywarn("Bad standard directive"); (yyval) = 0; } } else { yywarn("Compiler directive not understood"); (yyval) = NIL; } vfree((yyvsp[-3])); vfree((yyvsp[-2])); } #line 2117 "grammar.tab.c" /* yacc.c:1646 */ break; case 35: #line 462 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = mknode(FUNCSIGNATURE,(yyvsp[-5]),(yyvsp[-3]),(yyvsp[-1])); (yyval) -> fsig_special = (int)(yyvsp[-6]); } #line 2126 "grammar.tab.c" /* yacc.c:1646 */ break; case 36: #line 467 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = mknode(FUNCSIGNATURE,(yyvsp[-5]),(yyvsp[-3]),(yyvsp[-1])); if ((yyvsp[-5]) != NIL) { /* Remember that this is a primitive other than put or callcc */ (yyval) -> fsig_special = special(OTHER_BUILTIN, 0); } } #line 2138 "grammar.tab.c" /* yacc.c:1646 */ break; case 37: #line 477 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } #line 2144 "grammar.tab.c" /* yacc.c:1646 */ break; case 38: #line 479 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = emptylist(); } #line 2150 "grammar.tab.c" /* yacc.c:1646 */ break; case 39: #line 483 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } #line 2156 "grammar.tab.c" /* yacc.c:1646 */ break; case 40: #line 485 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = conc((yyvsp[-3]),(yyvsp[-1])); } #line 2162 "grammar.tab.c" /* yacc.c:1646 */ break; case 41: #line 489 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } #line 2168 "grammar.tab.c" /* yacc.c:1646 */ break; case 42: #line 491 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = NIL; } #line 2174 "grammar.tab.c" /* yacc.c:1646 */ break; case 43: #line 495 "pass1/parser/grammar.y" /* yacc.c:1646 */ { if (!(yyvsp[-2])) { yyperror("Missing colon in type component"); } lock((yyvsp[-3])); lock((yyvsp[-1])); if ((yyvsp[-1]) -> kind == VARSIGNATURE) { yyperror("Variable as type signature component"); } (yyval) = split(TSCOMPONENT, (yyvsp[-3]), (yyvsp[-1])); vfree(unlock((yyvsp[-3]))); vfree(unlock((yyvsp[-1]))); } #line 2190 "grammar.tab.c" /* yacc.c:1646 */ break; case 44: #line 507 "pass1/parser/grammar.y" /* yacc.c:1646 */ { NODE * vl_field_sig; NODE * vr_field_sig; if (!(yyvsp[-4])) { yyperror("Missing colon in field specification"); } vl_field_sig = mknode(FUNCSIGNATURE, NIL, /* in-line code */ mklist(mknode(PARAMETER, NIL, mknode(VALSIGNATURE, mknode(LETTERID,-1))), -1), mknode(VALSIGNATURE, (yyvsp[-1]))); lock((yyvsp[-5])); lock((yyvsp[-1])); if ( is_present((yyvsp[-3])) ) { (yyval) = split(TSCOMPONENT,(yyvsp[-5]),vl_field_sig); } else { vr_field_sig = mknode(FUNCSIGNATURE, NIL, /* in-line code */ mklist(mknode(PARAMETER, NIL, mknode(VARSIGNATURE, mknode(LETTERID,-1))), -1), mknode(VARSIGNATURE, (yyvsp[-1]))); (yyval) = conc(split(TSCOMPONENT,(yyvsp[-5]),vl_field_sig), split(TSCOMPONENT,(yyvsp[-5]),vr_field_sig)); } vfree(unlock((yyvsp[-5]))); vfree(unlock((yyvsp[-1]))); } #line 2227 "grammar.tab.c" /* yacc.c:1646 */ break; case 45: #line 540 "pass1/parser/grammar.y" /* yacc.c:1646 */ { NODE * result; switch ((yyvsp[-1]) -> kind) { case OPRID: i = (yyvsp[-1]) -> id_str_table_index; if ( i == indx_assign ) result = mknode(TSCOMPONENT,(yyvsp[-1]),sig_assign); else if (i == indx_less || i == indx_le ) result = mknode(TSCOMPONENT,(yyvsp[-1]),sig_less); else if ( i == indx_greater || i == indx_ge ) result = mknode(TSCOMPONENT,(yyvsp[-1]),sig_greater); else if ( i == indx_equals || i == indx_ne ) result = mknode(TSCOMPONENT,(yyvsp[-1]),sig_equals); else if ( i == indx_sconc ) result = mknode(TSCOMPONENT,(yyvsp[-1]),sig_sconc); else if ( i == indx_pconc ) result = mknode(TSCOMPONENT,(yyvsp[-1]),sig_pconc); else yyperror("Missing signature"); break; case LETTERID: i = (yyvsp[-1]) -> id_str_table_index; if ( i == indx_New ) result = mknode(TSCOMPONENT,(yyvsp[-1]),sig_New); else if ( i == indx_ValueOf ) result = mknode(TSCOMPONENT,(yyvsp[-1]),sig_ValueOf); else if ( *(getname(i)) == '\'' ) /* quoted id */ result = mknode(TSCOMPONENT,(yyvsp[-1]),sig_const); else yyperror("Missing signature"); break; # ifdef DEBUG default: dbgmsg("parser: incorrect id structure"); # endif } (yyval) = mklist(result,-1); } #line 2272 "grammar.tab.c" /* yacc.c:1646 */ break; case 46: #line 581 "pass1/parser/grammar.y" /* yacc.c:1646 */ { /* return a singleton list containing a DEFCHARSIGS node with */ /* all bits corresponding to valid RUSSELL characters set. */ /* Note machine dependence. */ (yyval) = mklist(mknode(DEFCHARSIGS, RCS0, RCS1, RCS2, RCS3), -1); } #line 2283 "grammar.tab.c" /* yacc.c:1646 */ break; case 47: #line 588 "pass1/parser/grammar.y" /* yacc.c:1646 */ { yyperror("Error in type signature component"); (yyval) = emptylist(); } #line 2292 "grammar.tab.c" /* yacc.c:1646 */ break; case 48: #line 595 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = PRESENT; } #line 2298 "grammar.tab.c" /* yacc.c:1646 */ break; case 49: #line 597 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = NOTPRESENT; } #line 2304 "grammar.tab.c" /* yacc.c:1646 */ break; case 50: #line 601 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } #line 2310 "grammar.tab.c" /* yacc.c:1646 */ break; case 52: #line 606 "pass1/parser/grammar.y" /* yacc.c:1646 */ { # ifdef BAD if (BADflag) flcheck(0,0); else flcheck(0,1); # endif lock((yyvsp[-1])); (yyval) = mkappl((yyvsp[-1])); lock((yyval)); vfree(unlock((yyvsp[-1]))); unlock((yyval)); # ifdef BAD if (BADflag) flcheck(0,0); else flcheck(0,1); # endif } #line 2334 "grammar.tab.c" /* yacc.c:1646 */ break; case 53: #line 627 "pass1/parser/grammar.y" /* yacc.c:1646 */ { if (!initflag) { yyperror("use of insertion character in non-initialization run"); } else { (yyval) = insrtptr = mknode(BLOCKDENOTATION,emptylist(),NIL); insrtptr -> bld_precedence = INFINITE; } } #line 2347 "grammar.tab.c" /* yacc.c:1646 */ break; case 54: #line 638 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = mklist((yyvsp[-1]), -1); } #line 2353 "grammar.tab.c" /* yacc.c:1646 */ break; case 55: #line 640 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = mklist((yyvsp[0]), -1); } #line 2359 "grammar.tab.c" /* yacc.c:1646 */ break; case 56: #line 642 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = addright((yyvsp[-1]),(yyvsp[0])); } #line 2365 "grammar.tab.c" /* yacc.c:1646 */ break; case 57: #line 644 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = addright((yyvsp[-1]),(yyvsp[0])); } #line 2371 "grammar.tab.c" /* yacc.c:1646 */ break; case 58: #line 648 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } #line 2377 "grammar.tab.c" /* yacc.c:1646 */ break; case 59: #line 650 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } #line 2383 "grammar.tab.c" /* yacc.c:1646 */ break; case 60: #line 652 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = mknode(WORDCAND); } #line 2389 "grammar.tab.c" /* yacc.c:1646 */ break; case 61: #line 654 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = mknode(WORDCOR); } #line 2395 "grammar.tab.c" /* yacc.c:1646 */ break; case 62: #line 656 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } #line 2401 "grammar.tab.c" /* yacc.c:1646 */ break; case 63: #line 658 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = mknode(MODPRIMARY,(yyvsp[-1]),(yyvsp[0]),NIL); } #line 2407 "grammar.tab.c" /* yacc.c:1646 */ break; case 64: #line 660 "pass1/parser/grammar.y" /* yacc.c:1646 */ { int prec; NODE *p; # ifdef DEBUG if ( is_empty((yyvsp[-1])) ) { dbgmsg("parser: empty denotation seq\n"); abort(); } # endif if (first((yyvsp[-1])) == last((yyvsp[-1]))) { /* just return the single denotation in the sequence */ (yyval) = p = last((yyvsp[-1])); lock(p); vfree((yyvsp[-1])); unlock(p); } else { prec = precedence( last((yyvsp[-1])) ); (yyval) = p = mknode(BLOCKDENOTATION,emptylist(),(yyvsp[-1])); p -> bld_precedence = prec; } } #line 2433 "grammar.tab.c" /* yacc.c:1646 */ break; case 65: #line 682 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = mknode(GUARDEDLIST,(yyvsp[-2])); } #line 2439 "grammar.tab.c" /* yacc.c:1646 */ break; case 66: #line 684 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = mknode(LOOPDENOTATION,(yyvsp[-2])); } #line 2445 "grammar.tab.c" /* yacc.c:1646 */ break; case 67: #line 686 "pass1/parser/grammar.y" /* yacc.c:1646 */ { int prec; NODE *p; prec = precedence( last((yyvsp[-2])) ); (yyval) = p = mknode(BLOCKDENOTATION,(yyvsp[-4]),(yyvsp[-2])); p -> bld_precedence = prec; } #line 2455 "grammar.tab.c" /* yacc.c:1646 */ break; case 68: #line 692 "pass1/parser/grammar.y" /* yacc.c:1646 */ { int prec; NODE *p; prec = precedence( last((yyvsp[-2])) ); (yyval) = p = mknode(USELIST,(yyvsp[-4]),(yyvsp[-2])); p -> usl_precedence = prec; } #line 2465 "grammar.tab.c" /* yacc.c:1646 */ break; case 69: #line 698 "pass1/parser/grammar.y" /* yacc.c:1646 */ { has_externs = TRUE; (yyval) = mknode(REXTERNDEF, read_signature((yyvsp[-2])), (yyvsp[-2])); (yyval) -> sig_done = SIG_DONE; } #line 2475 "grammar.tab.c" /* yacc.c:1646 */ break; case 70: #line 706 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = addright((yyvsp[-3]),(yyvsp[-1])); } #line 2481 "grammar.tab.c" /* yacc.c:1646 */ break; case 71: #line 708 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = mklist((yyvsp[-1]), -1); } #line 2487 "grammar.tab.c" /* yacc.c:1646 */ break; case 72: #line 710 "pass1/parser/grammar.y" /* yacc.c:1646 */ { int c; yyperror("Error in Expression Sequence"); for (c = yychar; !in(c, denseqstop); c = yylex()); yyclearin; switch(c) { case ';': case '#': case FI: case ELSIF: case ELSE: case OD: case ')': case 'NI': case '}': yyunlex(c); break; case IF: case DO: case LET: case FUNC: case '(': yyunlex(c); yyunlex(';'); break; case WITH: yyunlex(c); yyunlex(WORDID); yyunlex(';'); break; case IN: yyunlex(c); yyunlex(LET); yyunlex(';'); break; case EOF: exit(1); default: yyunlex(c); } # ifdef DEBUG if (yydebug) rec_on(c); # endif (yyval) = mklist(id_Integer, -1); /* fake it */ } #line 2537 "grammar.tab.c" /* yacc.c:1646 */ break; case 73: #line 758 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } #line 2543 "grammar.tab.c" /* yacc.c:1646 */ break; case 74: #line 760 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = NIL; } #line 2549 "grammar.tab.c" /* yacc.c:1646 */ break; case 75: #line 764 "pass1/parser/grammar.y" /* yacc.c:1646 */ { if (length((yyvsp[-2])) == 1) { (yyval) = mknode(FUNCCONSTR,(yyvsp[-4]),first((yyvsp[-2]))); } else { (yyval) = mknode(FUNCCONSTR,(yyvsp[-4]), mknode(BLOCKDENOTATION,emptylist(),(yyvsp[-2]))); (yyval)->fc_body->bld_precedence = INFINITE; /* doesn't matter */ } (yyvsp[-4]) -> fsig_construction = (yyval); if (initflag) { /* Make sure that global functions receive the same name */ /* in all compilations. */ char * name = (char *)malloc(15); static int global_fn_count; sprintf(name, "fn_global_%d", ++ global_fn_count); (yyval) -> fc_code_label = name; } } #line 2572 "grammar.tab.c" /* yacc.c:1646 */ break; case 76: #line 783 "pass1/parser/grammar.y" /* yacc.c:1646 */ { if ((yyvsp[-5]) -> fsig_result_sig == NIL) { yyperror("Must specify result signature for extern"); } (yyval) = mknode(FUNCCONSTR, (yyvsp[-5]), mknode(EXTERNDEF, (yyvsp[-2]))); } #line 2583 "grammar.tab.c" /* yacc.c:1646 */ break; case 77: #line 792 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } #line 2589 "grammar.tab.c" /* yacc.c:1646 */ break; case 78: #line 794 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = mknode(FUNCSIGNATURE, (yyvsp[-4]), (yyvsp[-2]), NIL); (yyval) -> fsig_special = (int)(yyvsp[-5]); } #line 2598 "grammar.tab.c" /* yacc.c:1646 */ break; case 79: #line 799 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = mknode(FUNCSIGNATURE, (yyvsp[-4]), (yyvsp[-2]), NIL); } #line 2604 "grammar.tab.c" /* yacc.c:1646 */ break; case 80: #line 803 "pass1/parser/grammar.y" /* yacc.c:1646 */ { initfld(&((yyvsp[-2])->sel_type), (yyvsp[-4])); initfld(&((yyvsp[-2])->signature), (yyvsp[-1])); (yyval) = (yyvsp[-2]); } #line 2614 "grammar.tab.c" /* yacc.c:1646 */ break; case 81: #line 809 "pass1/parser/grammar.y" /* yacc.c:1646 */ { initfld(&((yyvsp[-1])->sel_type), (yyvsp[-3])); (yyval) = (yyvsp[-1]); } #line 2623 "grammar.tab.c" /* yacc.c:1646 */ break; case 82: #line 814 "pass1/parser/grammar.y" /* yacc.c:1646 */ { initfld(&((yyvsp[-2])->signature), (yyvsp[-1])); (yyval) = (yyvsp[-2]); } #line 2632 "grammar.tab.c" /* yacc.c:1646 */ break; case 83: #line 819 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } #line 2640 "grammar.tab.c" /* yacc.c:1646 */ break; case 84: #line 825 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } #line 2646 "grammar.tab.c" /* yacc.c:1646 */ break; case 85: #line 827 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } #line 2652 "grammar.tab.c" /* yacc.c:1646 */ break; case 86: #line 829 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } #line 2658 "grammar.tab.c" /* yacc.c:1646 */ break; case 87: #line 831 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } #line 2664 "grammar.tab.c" /* yacc.c:1646 */ break; case 88: #line 833 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } #line 2670 "grammar.tab.c" /* yacc.c:1646 */ break; case 89: #line 837 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } #line 2676 "grammar.tab.c" /* yacc.c:1646 */ break; case 90: #line 839 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = mknode(WORDELSE); } #line 2682 "grammar.tab.c" /* yacc.c:1646 */ break; case 91: #line 841 "pass1/parser/grammar.y" /* yacc.c:1646 */ { yyperror("Error while trying to parse guard"); } #line 2688 "grammar.tab.c" /* yacc.c:1646 */ break; case 92: #line 845 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-2]); } #line 2694 "grammar.tab.c" /* yacc.c:1646 */ break; case 93: #line 849 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = mklist((yyvsp[-1]), -1); } #line 2700 "grammar.tab.c" /* yacc.c:1646 */ break; case 94: #line 851 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = addleft((yyvsp[-1]),(yyvsp[-3])); } #line 2706 "grammar.tab.c" /* yacc.c:1646 */ break; case 95: #line 853 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = emptylist(); } #line 2712 "grammar.tab.c" /* yacc.c:1646 */ break; case 96: #line 857 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } #line 2718 "grammar.tab.c" /* yacc.c:1646 */ break; case 97: #line 859 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = conc((yyvsp[-3]),(yyvsp[-1])); } #line 2724 "grammar.tab.c" /* yacc.c:1646 */ break; case 98: #line 863 "pass1/parser/grammar.y" /* yacc.c:1646 */ { lock((yyvsp[-4])); lock((yyvsp[-3])); lock((yyvsp[-1])); (yyval) = split(DECLARATION,(yyvsp[-4]),(yyvsp[-1]),(yyvsp[-3])); vfree(unlock((yyvsp[-4]))); vfree(unlock((yyvsp[-3]))); vfree(unlock((yyvsp[-1]))); } #line 2734 "grammar.tab.c" /* yacc.c:1646 */ break; case 99: #line 869 "pass1/parser/grammar.y" /* yacc.c:1646 */ { NODE *q; lock((yyvsp[-4])); lock((yyvsp[-3])); lock((yyvsp[-1])); (yyval) = q = split(DECLARATION,(yyvsp[-4]),(yyvsp[-1]),(yyvsp[-3])); maplist(p, q, { p -> decl_sig_transp = TRUE; }); vfree(unlock((yyvsp[-4]))); vfree(unlock((yyvsp[-3]))); vfree(unlock((yyvsp[-1]))); } #line 2748 "grammar.tab.c" /* yacc.c:1646 */ break; case 100: #line 879 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = emptylist(); } #line 2754 "grammar.tab.c" /* yacc.c:1646 */ break; case 101: #line 880 "pass1/parser/grammar.y" /* yacc.c:1646 */ { int c; int i = 0; yyperror("Error in declaration"); for ( c = yychar; !in(c, declstop); c = yylex() ) if ( ++i > maxskip ) break; yyclearin; switch (c) { case EQUALS_EQUALS: yyunlex(c); yyunlex(WORDID); yyunlex(';'); break; case ';' : case '}' : case IN: yyunlex(c); break; case NI: yyunlex(c); yyunlex(WORDID); yyunlex(IN); break; case IF: case DO: case LET: case '(': yyunlex(c); yyunlex(EQUALS_EQUALS); yyunlex(WORDID); break; case EOF: exit(1); default : yyunlex(c); yyunlex(NI); yyunlex(IN); } # ifdef DEBUG if (yydebug) rec_on(c); # endif (yyval) = emptylist(); } #line 2802 "grammar.tab.c" /* yacc.c:1646 */ break; case 102: #line 926 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } #line 2808 "grammar.tab.c" /* yacc.c:1646 */ break; case 103: #line 928 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = NIL; } #line 2814 "grammar.tab.c" /* yacc.c:1646 */ break; case 104: #line 932 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = mknode(ENUMERATION,(yyvsp[-2])); } #line 2820 "grammar.tab.c" /* yacc.c:1646 */ break; case 105: #line 936 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = mknode(EXTENSION,(yyvsp[-2])); } #line 2826 "grammar.tab.c" /* yacc.c:1646 */ break; case 106: #line 940 "pass1/parser/grammar.y" /* yacc.c:1646 */ { maplist (s, (yyvsp[-2]), { if (s -> par_id == NIL) { yyperror("Anonymous fields not allowed in product"); } }); (yyval) = mknode(PRODCONSTRUCTION,(yyvsp[-4]),(yyvsp[-2])); } #line 2839 "grammar.tab.c" /* yacc.c:1646 */ break; case 107: #line 949 "pass1/parser/grammar.y" /* yacc.c:1646 */ { yyperror("Error in product construction"); } #line 2845 "grammar.tab.c" /* yacc.c:1646 */ break; case 108: #line 953 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = mknode(RECORDCONSTRUCTION,(yyvsp[-2])); } #line 2851 "grammar.tab.c" /* yacc.c:1646 */ break; case 109: #line 955 "pass1/parser/grammar.y" /* yacc.c:1646 */ { yyperror("Error in record construction"); } #line 2857 "grammar.tab.c" /* yacc.c:1646 */ break; case 110: #line 959 "pass1/parser/grammar.y" /* yacc.c:1646 */ { maplist (s, (yyvsp[-2]), { if (s -> par_id == NIL) { yyperror("Anonymous fields not allowed in union"); } }); (yyval) = mknode(UNIONCONSTRUCTION,(yyvsp[-4]),(yyvsp[-2])); } #line 2870 "grammar.tab.c" /* yacc.c:1646 */ break; case 111: #line 968 "pass1/parser/grammar.y" /* yacc.c:1646 */ { yyperror("Error in union construction"); } #line 2876 "grammar.tab.c" /* yacc.c:1646 */ break; case 112: #line 972 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } #line 2882 "grammar.tab.c" /* yacc.c:1646 */ break; case 113: #line 974 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = conc((yyvsp[-3]),(yyvsp[-1])); } #line 2888 "grammar.tab.c" /* yacc.c:1646 */ break; case 114: #line 978 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } #line 2894 "grammar.tab.c" /* yacc.c:1646 */ break; case 115: #line 980 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = emptylist(); } #line 2900 "grammar.tab.c" /* yacc.c:1646 */ break; case 116: #line 984 "pass1/parser/grammar.y" /* yacc.c:1646 */ { if (!(yyvsp[-2])) { yyperror("Missing colon in record element specification"); } lock((yyvsp[-3])); lock((yyvsp[-1])); (yyval) = split(RECORDELEMENT,(yyvsp[-3]),(yyvsp[-1])); vfree(unlock((yyvsp[-3]))); vfree(unlock((yyvsp[-1]))); } #line 2913 "grammar.tab.c" /* yacc.c:1646 */ break; case 117: #line 995 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } #line 2919 "grammar.tab.c" /* yacc.c:1646 */ break; case 118: #line 997 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } #line 2925 "grammar.tab.c" /* yacc.c:1646 */ break; case 119: #line 1001 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = mknode(WITHLIST,(yyvsp[-4]),(yyvsp[-2])); } #line 2931 "grammar.tab.c" /* yacc.c:1646 */ break; case 120: #line 1003 "pass1/parser/grammar.y" /* yacc.c:1646 */ { yyperror("Error in \"with\" type modification"); } #line 2937 "grammar.tab.c" /* yacc.c:1646 */ break; case 121: #line 1007 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = mknode((yyvsp[-5]),(yyvsp[-4]),(yyvsp[-2])); } #line 2943 "grammar.tab.c" /* yacc.c:1646 */ break; case 122: #line 1009 "pass1/parser/grammar.y" /* yacc.c:1646 */ { yyperror("Error in \"export\" type modification"); } #line 2949 "grammar.tab.c" /* yacc.c:1646 */ break; case 123: #line 1011 "pass1/parser/grammar.y" /* yacc.c:1646 */ { yyperror("Error in \"hide\" type modification"); } #line 2955 "grammar.tab.c" /* yacc.c:1646 */ break; case 124: #line 1015 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = (NODE *)EXPORTLIST; } #line 2961 "grammar.tab.c" /* yacc.c:1646 */ break; case 125: #line 1017 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = (NODE *)HIDELIST; } #line 2967 "grammar.tab.c" /* yacc.c:1646 */ break; case 126: #line 1021 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = mklist((yyvsp[-1]), -1); } #line 2973 "grammar.tab.c" /* yacc.c:1646 */ break; case 127: #line 1023 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = addleft((yyvsp[-1]),(yyvsp[-3])); } #line 2979 "grammar.tab.c" /* yacc.c:1646 */ break; case 128: #line 1025 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = emptylist(); } #line 2985 "grammar.tab.c" /* yacc.c:1646 */ break; case 129: #line 1029 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = mknode(EXPORTELEMENT,(yyvsp[-3]),(yyvsp[-2]),(yyvsp[-1])); } #line 2991 "grammar.tab.c" /* yacc.c:1646 */ break; case 130: #line 1031 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = mknode(ALLCONSTANTS); } #line 2997 "grammar.tab.c" /* yacc.c:1646 */ break; case 131: #line 1033 "pass1/parser/grammar.y" /* yacc.c:1646 */ { yyperror("Error in \"export\"ed or hidden element specification"); } #line 3003 "grammar.tab.c" /* yacc.c:1646 */ break; case 132: #line 1037 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-1]); } #line 3009 "grammar.tab.c" /* yacc.c:1646 */ break; case 133: #line 1039 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = NIL; } #line 3015 "grammar.tab.c" /* yacc.c:1646 */ break; case 134: #line 1043 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[-2]); } #line 3021 "grammar.tab.c" /* yacc.c:1646 */ break; case 135: #line 1045 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = NIL; } #line 3027 "grammar.tab.c" /* yacc.c:1646 */ break; case 136: #line 1049 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = (yyvsp[0]); } #line 3033 "grammar.tab.c" /* yacc.c:1646 */ break; case 137: #line 1051 "pass1/parser/grammar.y" /* yacc.c:1646 */ { extern NODE * appl_Null; (yyval) = appl_Null; } #line 3042 "grammar.tab.c" /* yacc.c:1646 */ break; case 138: #line 1058 "pass1/parser/grammar.y" /* yacc.c:1646 */ { if (length((yyvsp[0])) == 1) { (yyval) = first((yyvsp[0])); } else { NODE *p = mknode(BLOCKDENOTATION, emptylist(), (yyvsp[0])); (yyval) = p; p -> bld_precedence = INFINITE; /* doesnt matter */ } } #line 3056 "grammar.tab.c" /* yacc.c:1646 */ break; case 139: #line 1068 "pass1/parser/grammar.y" /* yacc.c:1646 */ { NODE * ge1; /* First guarded element */ NODE * ge2; /* Second guarded element */ if (length((yyvsp[-1])) == 1) { ge1 = mknode(GUARDEDELEMENT,(yyvsp[-3]),first((yyvsp[-1]))); } else { ge1 = mknode(GUARDEDELEMENT,(yyvsp[-3]), mknode(BLOCKDENOTATION,emptylist(),(yyvsp[-1]))); ge1->ge_element->bld_precedence = INFINITE; /* doesn't matter */ } /* $5 is a denotation to be executed if orignal */ /* guard does not apply */ ge2 = mknode(GUARDEDELEMENT, mknode(WORDELSE), (yyvsp[0])); (yyval) = mknode(GUARDEDLIST, mklist(ge1, ge2, -1)); } #line 3077 "grammar.tab.c" /* yacc.c:1646 */ break; case 140: #line 1087 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = mklist((yyvsp[-1]), -1); } #line 3083 "grammar.tab.c" /* yacc.c:1646 */ break; case 141: #line 1089 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = addright((yyvsp[-3]),(yyvsp[-1])); } #line 3089 "grammar.tab.c" /* yacc.c:1646 */ break; case 142: #line 1091 "pass1/parser/grammar.y" /* yacc.c:1646 */ { NODE * ge1; /* First guarded element */ NODE * ge2; /* Second guarded element */ if (length((yyvsp[-1])) == 1) { ge1 = mknode(GUARDEDELEMENT,(yyvsp[-3]),first((yyvsp[-1]))); } else { ge1 = mknode(GUARDEDELEMENT,(yyvsp[-3]), mknode(BLOCKDENOTATION,emptylist(),(yyvsp[-1]))); ge1->ge_element->bld_precedence = INFINITE; /* doesn't matter */ } /* $4 is a denotation to be executed if orignal */ /* guard does not apply */ ge2 = mknode(GUARDEDELEMENT, mknode(WORDELSE), (yyvsp[0])); (yyval) = mklist(ge1, ge2, -1); } #line 3110 "grammar.tab.c" /* yacc.c:1646 */ break; case 143: #line 1108 "pass1/parser/grammar.y" /* yacc.c:1646 */ { int i = 0; int c; yyperror("Error in Loop or If"); for (c = yychar; !in(c,condstop); c = yylex() ) if ( ++i > maxskip ) break; yyclearin; switch(c) { case '#' : case FI : case OD : yyunlex(c); break; case RIGHT_ARROW : case ELSE : case THEN : case ';' : yyunlex(RIGHT_ARROW); yyunlex(WORDID); yyunlex('#'); break; case LET : case '(' : case DO : case IF : yyunlex(c); yyunlex(RIGHT_ARROW); yyunlex(WORDID); yyunlex('#'); break; case EOF: exit(1); default : yyunlex(c); yyunlex(END); } # ifdef DEBUG if (yydebug) rec_on(c); # endif (yyval) = emptylist(); } #line 3152 "grammar.tab.c" /* yacc.c:1646 */ break; case 144: #line 1148 "pass1/parser/grammar.y" /* yacc.c:1646 */ { if (length((yyvsp[-1])) == 1) { (yyval) = mknode(GUARDEDELEMENT,(yyvsp[-3]),first((yyvsp[-1]))); } else { NODE *p = mknode(GUARDEDELEMENT,(yyvsp[-3]), mknode(BLOCKDENOTATION,emptylist(),(yyvsp[-1]))); (yyval)= p; p->ge_element->bld_precedence = INFINITE; /* doesn't matter */ } } #line 3166 "grammar.tab.c" /* yacc.c:1646 */ break; case 145: #line 1160 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = mknode(LETTERID,(yyvsp[-1])); } #line 3172 "grammar.tab.c" /* yacc.c:1646 */ break; case 146: #line 1162 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = mknode(OPRID,(yyvsp[-1])); } #line 3178 "grammar.tab.c" /* yacc.c:1646 */ break; case 147: #line 1166 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = mknode(QSTR,(yyvsp[-1])); } #line 3184 "grammar.tab.c" /* yacc.c:1646 */ break; case 148: #line 1168 "pass1/parser/grammar.y" /* yacc.c:1646 */ { (yyval) = mknode(UQSTR,(yyvsp[-1])); } #line 3190 "grammar.tab.c" /* yacc.c:1646 */ break; #line 3194 "grammar.tab.c" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires that yytoken be updated with the new translation. We take the approach of translating immediately before every use of yytoken. One alternative is translating here after every semantic action, but that translation would be missed if the semantic action invokes YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an incorrect destructor might then be invoked immediately. In the case of YYERROR or YYBACKUP, subsequent parser actions might lead to an incorrect destructor call or verbose syntax error message before the lookahead is translated. */ YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; /* Now 'shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ yyn = yyr1[yyn]; yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else yystate = yydefgoto[yyn - YYNTOKENS]; goto yynewstate; /*--------------------------------------. | yyerrlab -- here on detecting error. | `--------------------------------------*/ yyerrlab: /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; #if ! YYERROR_VERBOSE yyerror (YY_("syntax error")); #else # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ yyssp, yytoken) { char const *yymsgp = YY_("syntax error"); int yysyntax_error_status; yysyntax_error_status = YYSYNTAX_ERROR; if (yysyntax_error_status == 0) yymsgp = yymsg; else if (yysyntax_error_status == 1) { if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); if (!yymsg) { yymsg = yymsgbuf; yymsg_alloc = sizeof yymsgbuf; yysyntax_error_status = 2; } else { yysyntax_error_status = YYSYNTAX_ERROR; yymsgp = yymsg; } } yyerror (yymsgp); if (yysyntax_error_status == 2) goto yyexhaustedlab; } # undef YYSYNTAX_ERROR #endif } if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ if (yychar <= YYEOF) { /* Return failure if at end of input. */ if (yychar == YYEOF) YYABORT; } else { yydestruct ("Error: discarding", yytoken, &yylval); yychar = YYEMPTY; } } /* Else will try to reuse lookahead token after shifting the error token. */ goto yyerrlab1; /*---------------------------------------------------. | yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ yyerrorlab: /* Pacify compilers like GCC when the user code never invokes YYERROR and the label yyerrorlab therefore never appears in user code. */ if (/*CONSTCOND*/ 0) goto yyerrorlab; /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); yystate = *yyssp; goto yyerrlab1; /*-------------------------------------------------------------. | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (!yypact_value_is_default (yyn)) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) { yyn = yytable[yyn]; if (0 < yyn) break; } } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) YYABORT; yydestruct ("Error: popping", yystos[yystate], yyvsp); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; YY_IGNORE_MAYBE_UNINITIALIZED_END /* Shift the error token. */ YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); yystate = yyn; goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: yyresult = 0; goto yyreturn; /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: yyresult = 1; goto yyreturn; #if !defined yyoverflow || YYERROR_VERBOSE /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ yyexhaustedlab: yyerror (YY_("memory exhausted")); yyresult = 2; /* Fall through. */ #endif yyreturn: if (yychar != YYEMPTY) { /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ yytoken = YYTRANSLATE (yychar); yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval); } /* Do not reclaim the symbols of the rule whose action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", yystos[*yyssp], yyvsp); YYPOPSTACK (1); } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif #if YYERROR_VERBOSE if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); #endif return yyresult; } #line 1170 "pass1/parser/grammar.y" /* yacc.c:1906 */ in(element,list) int element; int list[]; { int i; i = 0; while (element != list[i] && list[i] != LIST_END) ++i; return (element == list[i]); } # ifdef DEBUG rec_on(c) int c; { if ( c < 0400 ) { dbgmsg ( "recovery attempted on %c\n", c); } else { dbgmsg ( "recovery attempted on token number %d\n", c); } } # endif