diff -ur bacisrc.old/ccomp/lex.c bacisrc/ccomp/lex.c --- bacisrc.old/ccomp/lex.c 2005-11-06 13:40:54.054437774 +0100 +++ bacisrc/ccomp/lex.c 2005-10-27 15:02:05.000000000 +0200 @@ -2287,6 +2287,9 @@ /* * * $Log$ + * Revision 2.15 2005/10/26 20:03:23 bynum + * remove extraneous test in get_escape + * * Revision 2.14 2004/04/13 15:39:50 bynum * add \r case to get rid of errors when reading MS-DOS/WIN source files * diff -ur bacisrc.old/pascomp/bapascal.l bacisrc/pascomp/bapascal.l --- bacisrc.old/pascomp/bapascal.l 2004-04-15 13:31:24.000000000 +0200 +++ bacisrc/pascomp/bapascal.l 2005-10-27 15:02:05.000000000 +0200 @@ -388,7 +388,7 @@ } } while (reading); } - return ((esc < 256) ? esc : 0x20); + return esc; } void get_string(char termch) @@ -437,6 +437,9 @@ /* * * $Log$ + * Revision 2.11 2005/10/27 12:56:33 bynum + * remove extraneous test in get_escape + * * Revision 2.10 2004/04/13 15:43:15 bynum * add \r case to get rid of errors when readin MS-DOS/WIN prepared source * diff -ur bacisrc.old/pascomp/bapascal.y bacisrc/pascomp/bapascal.y --- bacisrc.old/pascomp/bapascal.y 2004-04-15 13:31:24.000000000 +0200 +++ bacisrc/pascomp/bapascal.y 2005-10-27 15:02:05.000000000 +0200 @@ -1077,10 +1077,6 @@ (tab[last_pf].adr == SP_WRITELN))){ emit1(WRITE_RAWSTRING,tmp); } - else if (first_stringerr){ - yyerror("RAW STRING parameter not allowed"); - first_stringerr = 0; - } parmct++; } ; @@ -1101,7 +1097,7 @@ else{ pfstack[toppfs].tix = last_pf = last_pfv; pfstack[toppfs].pct = parmct = 0; - first_stringerr = first_parmcterr = 1; + first_parmcterr = 1; if (tab[last_pf].lev != -1){ /* regular proc call */ if ((tab[last_pf].mon)&&(tab[prt].mon)&& (tab[last_pf].mon != tab[prt].mon)) @@ -1492,7 +1488,7 @@ else{ /* legal func call */ pfstack[toppfs].tix = last_pf = last_pfv; pfstack[toppfs].pct = parmct = 0; - first_stringerr = first_parmcterr = 1; + first_parmcterr = 1; if (tab[last_pf].lev != -1){ /* regular proc call */ if ((tab[last_pf].mon)&&(tab[prt].mon)&& (tab[last_pf].mon != tab[prt].mon)) @@ -1773,6 +1769,9 @@ /* * * $Log$ + * Revision 2.17 2005/10/27 12:58:24 bynum + * remove first_stringerr, correct minor errors + * * Revision 2.16 2003/05/13 14:01:23 bynum * add boolean initializers, fix proc nesting * diff -ur bacisrc.old/pascomp/gram.c bacisrc/pascomp/gram.c --- bacisrc.old/pascomp/gram.c 2004-04-15 13:31:24.000000000 +0200 +++ bacisrc/pascomp/gram.c 2005-10-27 15:02:05.000000000 +0200 @@ -1,62 +1,171 @@ -/* A Bison parser, made from bapascal.y - by GNU bison 1.35. */ +/* A Bison parser, made by GNU Bison 1.875. */ -#define YYBISON 1 /* Identify Bison output. */ +/* Skeleton parser for Yacc-like parsing with Bison, + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc. -# define UNSIGNED_INT 257 -# define STRING 258 -# define RAWSTRING 259 -# define STRINGCONCAT 260 -# define STRINGCOMPARE 261 -# define STRINGCOPY 262 -# define STRINGLENGTH 263 -# define SSCANF 264 -# define SPRINTF 265 -# define IDENTIFIER 266 -# define CHAR 267 -# define INT 268 -# define NE 269 -# define LE 270 -# define GE 271 -# define BECOMES 272 -# define DIV 273 -# define MOD 274 -# define OR 275 -# define AND 276 -# define NOT 277 -# define DOTDOT 278 -# define IF 279 -# define THEN 280 -# define ELSE 281 -# define CASE 282 -# define OF 283 -# define REPEAT 284 -# define UNTIL 285 -# define WHILE 286 -# define DO 287 -# define FOR 288 -# define TO 289 -# define CBEGIN 290 -# define SBEGIN 291 -# define END 292 -# define CEND 293 -# define CONST 294 -# define VAR 295 -# define TYPE 296 -# define ARRAY 297 -# define FUNCTION 298 -# define MONITOR 299 -# define PROCEDURE 300 -# define PROGRAM 301 -# define INCLUDE 302 -# define ATOMIC 303 -# define FNSTRING 304 -# define SEND 305 -# define RECEIVE 306 -# define BROADCAST 307 -# define EXTERNAL 308 -# define LOWER_THAN_ELSE 309 + 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 2, 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, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* As a special exception, when this file is copied by Bison into a + Bison output file, you may use that output file without restriction. + This special exception was added by the Free Software Foundation + in version 1.24 of Bison. */ + +/* 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 + +/* Skeleton name. */ +#define YYSKELETON_NAME "yacc.c" +/* Pure parsers. */ +#define YYPURE 0 + +/* Using locations. */ +#define YYLSP_NEEDED 0 + + + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + UNSIGNED_INT = 258, + STRING = 259, + RAWSTRING = 260, + STRINGCONCAT = 261, + STRINGCOMPARE = 262, + STRINGCOPY = 263, + STRINGLENGTH = 264, + SSCANF = 265, + SPRINTF = 266, + IDENTIFIER = 267, + CHAR = 268, + INT = 269, + NE = 270, + LE = 271, + GE = 272, + BECOMES = 273, + DIV = 274, + MOD = 275, + OR = 276, + AND = 277, + NOT = 278, + DOTDOT = 279, + IF = 280, + THEN = 281, + ELSE = 282, + CASE = 283, + OF = 284, + REPEAT = 285, + UNTIL = 286, + WHILE = 287, + DO = 288, + FOR = 289, + TO = 290, + CBEGIN = 291, + SBEGIN = 292, + END = 293, + CEND = 294, + CONST = 295, + VAR = 296, + TYPE = 297, + ARRAY = 298, + FUNCTION = 299, + MONITOR = 300, + PROCEDURE = 301, + PROGRAM = 302, + INCLUDE = 303, + ATOMIC = 304, + FNSTRING = 305, + SEND = 306, + RECEIVE = 307, + BROADCAST = 308, + EXTERNAL = 309, + LOWER_THAN_ELSE = 310 + }; +#endif +#define UNSIGNED_INT 258 +#define STRING 259 +#define RAWSTRING 260 +#define STRINGCONCAT 261 +#define STRINGCOMPARE 262 +#define STRINGCOPY 263 +#define STRINGLENGTH 264 +#define SSCANF 265 +#define SPRINTF 266 +#define IDENTIFIER 267 +#define CHAR 268 +#define INT 269 +#define NE 270 +#define LE 271 +#define GE 272 +#define BECOMES 273 +#define DIV 274 +#define MOD 275 +#define OR 276 +#define AND 277 +#define NOT 278 +#define DOTDOT 279 +#define IF 280 +#define THEN 281 +#define ELSE 282 +#define CASE 283 +#define OF 284 +#define REPEAT 285 +#define UNTIL 286 +#define WHILE 287 +#define DO 288 +#define FOR 289 +#define TO 290 +#define CBEGIN 291 +#define SBEGIN 292 +#define END 293 +#define CEND 294 +#define CONST 295 +#define VAR 296 +#define TYPE 297 +#define ARRAY 298 +#define FUNCTION 299 +#define MONITOR 300 +#define PROCEDURE 301 +#define PROGRAM 302 +#define INCLUDE 303 +#define ATOMIC 304 +#define FNSTRING 305 +#define SEND 306 +#define RECEIVE 307 +#define BROADCAST 308 +#define EXTERNAL 309 +#define LOWER_THAN_ELSE 310 + + + + +/* Copy the first part of user declarations. */ #line 1 "bapascal.y" /* yacc grammar for BenAri Concurrent Pascal */ @@ -183,25 +292,153 @@ #define emit_push_addr(x) (\ emit2(((x).normal ? LOAD_ADDR : LOAD_VALUE), (x).lev, (x).adr)) -#ifndef YYSTYPE -# define YYSTYPE int -# define YYSTYPE_IS_TRIVIAL 1 -#endif + + +/* Enabling traces. */ #ifndef YYDEBUG # define YYDEBUG 1 #endif +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 +#else +# define YYERROR_VERBOSE 0 +#endif + +#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) +typedef int YYSTYPE; +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 +# define YYSTYPE_IS_TRIVIAL 1 +#endif + + + +/* Copy the second part of user declarations. */ + + +/* Line 214 of yacc.c. */ +#line 323 "y.tab.c" + +#if ! defined (yyoverflow) || YYERROR_VERBOSE + +/* The parser invokes alloca or malloc; define the necessary symbols. */ + +# if YYSTACK_USE_ALLOCA +# define YYSTACK_ALLOC alloca +# else +# ifndef YYSTACK_USE_ALLOCA +# if defined (alloca) || defined (_ALLOCA_H) +# define YYSTACK_ALLOC alloca +# else +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# endif +# endif +# endif +# endif +# ifdef YYSTACK_ALLOC + /* Pacify GCC's `empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) +# else +# if defined (__STDC__) || defined (__cplusplus) +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# endif +# define YYSTACK_ALLOC malloc +# define YYSTACK_FREE free +# endif +#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ -#define YYFINAL 368 -#define YYFLAG -32768 -#define YYNTBASE 71 -/* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */ -#define YYTRANSLATE(x) ((unsigned)(x) <= 309 ? yytranslate[x] : 192) +#if (! defined (yyoverflow) \ + && (! defined (__cplusplus) \ + || (YYSTYPE_IS_TRIVIAL))) -/* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */ -static const char yytranslate[] = +/* A type that is properly aligned for any stack member. */ +union yyalloc +{ + short yyss; + YYSTYPE yyvs; + }; + +/* 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 (short) + sizeof (YYSTYPE)) \ + + YYSTACK_GAP_MAXIMUM) + +/* Copy COUNT objects from FROM to TO. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if 1 < __GNUC__ +# define YYCOPY(To, From, Count) \ + __builtin_memcpy (To, From, (Count) * sizeof (*(From))) +# else +# define YYCOPY(To, From, Count) \ + do \ + { \ + register YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (To)[yyi] = (From)[yyi]; \ + } \ + while (0) +# endif +# endif + +/* 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) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack, Stack, yysize); \ + Stack = &yyptr->Stack; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (0) + +#endif + +#if defined (__STDC__) || defined (__cplusplus) + typedef signed char yysigned_char; +#else + typedef short yysigned_char; +#endif + +/* YYFINAL -- State number of the termination state. */ +#define YYFINAL 3 +/* YYLAST -- Last index in YYTABLE. */ +#define YYLAST 545 + +/* YYNTOKENS -- Number of terminals. */ +#define YYNTOKENS 71 +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS 122 +/* YYNRULES -- Number of rules. */ +#define YYNRULES 217 +/* YYNRULES -- Number of states. */ +#define YYNSTATES 368 + +/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +#define YYUNDEFTOK 2 +#define YYMAXUTOK 310 + +#define YYTRANSLATE(YYX) \ + ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) + +/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ +static const unsigned char yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -228,144 +465,146 @@ 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, 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, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55 + 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, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55 }; #if YYDEBUG -static const short yyprhs[] = -{ - 0, 0, 3, 7, 10, 11, 13, 16, 18, 20, - 22, 24, 26, 28, 30, 32, 34, 36, 41, 44, - 46, 48, 50, 56, 58, 61, 65, 69, 72, 73, - 75, 78, 80, 82, 84, 86, 88, 90, 92, 95, - 98, 101, 105, 109, 111, 115, 117, 120, 123, 125, - 128, 131, 133, 135, 139, 143, 145, 149, 151, 153, - 155, 157, 165, 169, 171, 174, 177, 178, 183, 187, - 191, 193, 198, 200, 204, 206, 207, 210, 212, 216, - 220, 223, 227, 228, 230, 233, 236, 239, 243, 248, - 251, 252, 256, 260, 262, 264, 266, 268, 272, 277, - 281, 286, 290, 292, 294, 296, 300, 302, 304, 308, - 310, 313, 316, 317, 319, 321, 323, 325, 328, 333, - 338, 343, 346, 350, 353, 356, 358, 360, 362, 364, - 367, 372, 376, 378, 381, 385, 388, 392, 393, 397, - 401, 403, 405, 407, 409, 410, 412, 414, 416, 418, - 420, 426, 429, 432, 435, 439, 443, 447, 449, 453, - 458, 464, 466, 470, 472, 476, 478, 480, 482, 484, - 486, 488, 490, 493, 496, 500, 502, 504, 506, 508, - 510, 514, 516, 518, 520, 522, 524, 526, 528, 530, - 534, 537, 541, 543, 545, 547, 548, 550, 552, 554, - 556, 560, 563, 567, 571, 575, 581, 586, 592, 594, - 598, 603, 605, 609, 611, 616, 618 +/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in + YYRHS. */ +static const unsigned short yyprhs[] = +{ + 0, 0, 3, 6, 10, 13, 14, 16, 19, 21, + 23, 25, 27, 29, 31, 33, 35, 37, 39, 44, + 47, 49, 51, 53, 59, 61, 64, 68, 72, 75, + 76, 78, 81, 83, 85, 87, 89, 91, 93, 95, + 98, 101, 104, 108, 112, 114, 118, 120, 123, 126, + 128, 131, 134, 136, 138, 142, 146, 148, 152, 154, + 156, 158, 160, 168, 172, 174, 177, 180, 181, 186, + 190, 194, 196, 201, 203, 207, 209, 210, 213, 215, + 219, 223, 226, 230, 231, 233, 236, 239, 242, 246, + 251, 254, 255, 259, 263, 265, 267, 269, 271, 275, + 280, 284, 289, 293, 295, 297, 299, 303, 305, 307, + 311, 313, 316, 319, 320, 322, 324, 326, 328, 331, + 336, 341, 346, 349, 353, 356, 359, 361, 363, 365, + 367, 370, 375, 379, 381, 384, 388, 391, 395, 396, + 400, 404, 406, 408, 410, 412, 413, 415, 417, 419, + 421, 423, 429, 432, 435, 438, 442, 446, 450, 452, + 456, 461, 467, 469, 473, 475, 479, 481, 483, 485, + 487, 489, 491, 493, 496, 499, 503, 505, 507, 509, + 511, 513, 517, 519, 521, 523, 525, 527, 529, 531, + 533, 537, 540, 544, 546, 548, 550, 551, 553, 555, + 557, 559, 563, 566, 570, 574, 578, 584, 589, 595, + 597, 601, 606, 608, 612, 614, 619, 621 }; + +/* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const short yyrhs[] = { - 72, 73, 0, 72, 73, 82, 0, 72, 82, 0, - 0, 74, 0, 73, 74, 0, 88, 0, 112, 0, - 129, 0, 95, 0, 90, 0, 106, 0, 75, 0, - 76, 0, 77, 0, 80, 0, 78, 41, 107, 56, - 0, 78, 79, 0, 54, 0, 115, 0, 120, 0, - 78, 130, 81, 38, 56, 0, 79, 0, 81, 79, - 0, 83, 135, 57, 0, 84, 56, 85, 0, 47, - 191, 0, 0, 86, 0, 86, 87, 0, 87, 0, - 88, 0, 90, 0, 95, 0, 106, 0, 112, 0, - 129, 0, 89, 5, 0, 58, 48, 0, 89, 50, - 0, 40, 91, 56, 0, 91, 56, 92, 0, 92, - 0, 191, 59, 93, 0, 94, 0, 60, 94, 0, - 61, 94, 0, 190, 0, 60, 190, 0, 61, 190, - 0, 13, 0, 3, 0, 42, 96, 56, 0, 96, - 56, 97, 0, 97, 0, 191, 59, 98, 0, 99, - 0, 100, 0, 105, 0, 190, 0, 43, 62, 101, - 63, 104, 29, 98, 0, 101, 64, 102, 0, 102, - 0, 103, 93, 0, 93, 24, 0, 0, 4, 62, - 93, 63, 0, 41, 107, 56, 0, 107, 56, 108, - 0, 108, 0, 109, 65, 98, 111, 0, 110, 0, - 110, 64, 191, 0, 191, 0, 0, 18, 93, 0, - 113, 0, 114, 135, 56, 0, 119, 135, 56, 0, - 115, 85, 0, 116, 117, 56, 0, 0, 49, 0, - 118, 123, 0, 46, 12, 0, 120, 85, 0, 116, - 121, 56, 0, 122, 123, 65, 190, 0, 44, 12, - 0, 0, 66, 124, 67, 0, 124, 56, 125, 0, - 125, 0, 126, 0, 127, 0, 128, 0, 109, 65, - 190, 0, 41, 109, 65, 190, 0, 109, 65, 4, - 0, 130, 131, 132, 56, 0, 45, 191, 56, 0, - 85, 0, 38, 0, 133, 0, 134, 136, 38, 0, - 37, 0, 133, 0, 136, 56, 137, 0, 137, 0, - 1, 56, 0, 1, 38, 0, 0, 133, 0, 148, - 0, 150, 0, 156, 0, 138, 139, 0, 138, 139, - 140, 137, 0, 141, 142, 33, 137, 0, 143, 136, - 31, 167, 0, 145, 137, 0, 147, 136, 39, 0, - 25, 167, 0, 26, 137, 0, 27, 0, 32, 0, - 167, 0, 30, 0, 34, 190, 0, 146, 35, 167, - 33, 0, 144, 18, 167, 0, 36, 0, 149, 167, - 0, 186, 18, 167, 0, 190, 18, 0, 154, 155, - 151, 0, 0, 66, 152, 67, 0, 152, 64, 153, - 0, 153, 0, 167, 0, 5, 0, 190, 0, 0, - 157, 0, 159, 0, 160, 0, 163, 0, 164, 0, - 51, 158, 64, 167, 67, 0, 66, 162, 0, 66, - 167, 0, 53, 181, 0, 6, 158, 161, 0, 64, - 167, 67, 0, 64, 162, 67, 0, 5, 0, 8, - 158, 161, 0, 165, 64, 166, 67, 0, 11, 66, - 167, 64, 162, 0, 167, 0, 166, 64, 167, 0, - 169, 0, 170, 168, 169, 0, 59, 0, 68, 0, - 69, 0, 16, 0, 17, 0, 15, 0, 172, 0, - 60, 172, 0, 61, 172, 0, 170, 171, 172, 0, - 169, 0, 60, 0, 61, 0, 21, 0, 175, 0, - 173, 174, 175, 0, 172, 0, 70, 0, 19, 0, - 20, 0, 22, 0, 176, 0, 94, 0, 13, 0, - 66, 167, 67, 0, 23, 175, 0, 154, 177, 151, - 0, 178, 0, 186, 0, 189, 0, 0, 179, 0, - 180, 0, 182, 0, 183, 0, 7, 158, 161, 0, - 9, 181, 0, 66, 167, 67, 0, 66, 5, 67, - 0, 52, 158, 67, 0, 52, 158, 64, 167, 67, - 0, 184, 64, 185, 67, 0, 10, 66, 167, 64, - 162, 0, 167, 0, 185, 64, 167, 0, 187, 62, - 188, 63, 0, 190, 0, 188, 64, 167, 0, 167, - 0, 14, 66, 167, 67, 0, 12, 0, 12, 0 + 72, 0, -1, 73, 74, -1, 73, 74, 83, -1, + 73, 83, -1, -1, 75, -1, 74, 75, -1, 89, + -1, 113, -1, 130, -1, 96, -1, 91, -1, 107, + -1, 76, -1, 77, -1, 78, -1, 81, -1, 79, + 41, 108, 56, -1, 79, 80, -1, 54, -1, 116, + -1, 121, -1, 79, 131, 82, 38, 56, -1, 80, + -1, 82, 80, -1, 84, 136, 57, -1, 85, 56, + 86, -1, 47, 192, -1, -1, 87, -1, 87, 88, + -1, 88, -1, 89, -1, 91, -1, 96, -1, 107, + -1, 113, -1, 130, -1, 90, 5, -1, 58, 48, + -1, 90, 50, -1, 40, 92, 56, -1, 92, 56, + 93, -1, 93, -1, 192, 59, 94, -1, 95, -1, + 60, 95, -1, 61, 95, -1, 191, -1, 60, 191, + -1, 61, 191, -1, 13, -1, 3, -1, 42, 97, + 56, -1, 97, 56, 98, -1, 98, -1, 192, 59, + 99, -1, 100, -1, 101, -1, 106, -1, 191, -1, + 43, 62, 102, 63, 105, 29, 99, -1, 102, 64, + 103, -1, 103, -1, 104, 94, -1, 94, 24, -1, + -1, 4, 62, 94, 63, -1, 41, 108, 56, -1, + 108, 56, 109, -1, 109, -1, 110, 65, 99, 112, + -1, 111, -1, 111, 64, 192, -1, 192, -1, -1, + 18, 94, -1, 114, -1, 115, 136, 56, -1, 120, + 136, 56, -1, 116, 86, -1, 117, 118, 56, -1, + -1, 49, -1, 119, 124, -1, 46, 12, -1, 121, + 86, -1, 117, 122, 56, -1, 123, 124, 65, 191, + -1, 44, 12, -1, -1, 66, 125, 67, -1, 125, + 56, 126, -1, 126, -1, 127, -1, 128, -1, 129, + -1, 110, 65, 191, -1, 41, 110, 65, 191, -1, + 110, 65, 4, -1, 131, 132, 133, 56, -1, 45, + 192, 56, -1, 86, -1, 38, -1, 134, -1, 135, + 137, 38, -1, 37, -1, 134, -1, 137, 56, 138, + -1, 138, -1, 1, 56, -1, 1, 38, -1, -1, + 134, -1, 149, -1, 151, -1, 157, -1, 139, 140, + -1, 139, 140, 141, 138, -1, 142, 143, 33, 138, + -1, 144, 137, 31, 168, -1, 146, 138, -1, 148, + 137, 39, -1, 25, 168, -1, 26, 138, -1, 27, + -1, 32, -1, 168, -1, 30, -1, 34, 191, -1, + 147, 35, 168, 33, -1, 145, 18, 168, -1, 36, + -1, 150, 168, -1, 187, 18, 168, -1, 191, 18, + -1, 155, 156, 152, -1, -1, 66, 153, 67, -1, + 153, 64, 154, -1, 154, -1, 168, -1, 5, -1, + 191, -1, -1, 158, -1, 160, -1, 161, -1, 164, + -1, 165, -1, 51, 159, 64, 168, 67, -1, 66, + 163, -1, 66, 168, -1, 53, 182, -1, 6, 159, + 162, -1, 64, 168, 67, -1, 64, 163, 67, -1, + 5, -1, 8, 159, 162, -1, 166, 64, 167, 67, + -1, 11, 66, 168, 64, 163, -1, 168, -1, 167, + 64, 168, -1, 170, -1, 171, 169, 170, -1, 59, + -1, 68, -1, 69, -1, 16, -1, 17, -1, 15, + -1, 173, -1, 60, 173, -1, 61, 173, -1, 171, + 172, 173, -1, 170, -1, 60, -1, 61, -1, 21, + -1, 176, -1, 174, 175, 176, -1, 173, -1, 70, + -1, 19, -1, 20, -1, 22, -1, 177, -1, 95, + -1, 13, -1, 66, 168, 67, -1, 23, 176, -1, + 155, 178, 152, -1, 179, -1, 187, -1, 190, -1, + -1, 180, -1, 181, -1, 183, -1, 184, -1, 7, + 159, 162, -1, 9, 182, -1, 66, 168, 67, -1, + 66, 5, 67, -1, 52, 159, 67, -1, 52, 159, + 64, 168, 67, -1, 185, 64, 186, 67, -1, 10, + 66, 168, 64, 163, -1, 168, -1, 186, 64, 168, + -1, 188, 62, 189, 63, -1, 191, -1, 189, 64, + 168, -1, 168, -1, 14, 66, 168, 67, -1, 12, + -1, 12, -1 }; -#endif - -#if YYDEBUG -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const short yyrline[] = +/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ +static const unsigned short yyrline[] = { - 0, 145, 158, 165, 174, 188, 189, 192, 193, 194, - 195, 196, 197, 198, 201, 202, 203, 206, 210, 216, - 220, 222, 226, 235, 236, 239, 260, 269, 282, 283, - 286, 287, 290, 291, 292, 293, 294, 295, 298, 310, - 316, 328, 331, 332, 335, 343, 345, 347, 349, 351, - 359, 367, 371, 375, 378, 379, 382, 401, 402, 403, - 406, 431, 475, 477, 480, 497, 507, 511, 526, 529, - 530, 533, 598, 601, 602, 605, 607, 615, 618, 625, - 634, 642, 649, 651, 656, 659, 676, 684, 691, 703, - 720, 722, 726, 727, 730, 731, 732, 735, 759, 783, - 803, 814, 833, 840, 846, 849, 852, 862, 865, 866, - 867, 869, 873, 874, 875, 876, 877, 878, 880, 882, - 884, 886, 888, 892, 896, 900, 904, 908, 912, 916, - 930, 940, 949, 961, 977, 995, 1020, 1056, 1057, 1060, - 1061, 1064, 1073, 1088, 1092, 1119, 1120, 1121, 1122, 1123, - 1126, 1153, 1155, 1169, 1183, 1196, 1208, 1212, 1225, 1238, - 1246, 1257, 1269, 1283, 1284, 1301, 1302, 1303, 1304, 1305, - 1306, 1309, 1310, 1319, 1330, 1353, 1357, 1358, 1359, 1362, - 1363, 1390, 1394, 1395, 1396, 1397, 1400, 1401, 1409, 1417, - 1418, 1431, 1481, 1482, 1483, 1486, 1507, 1508, 1509, 1510, - 1513, 1532, 1551, 1562, 1574, 1588, 1613, 1628, 1639, 1648, - 1659, 1672, 1703, 1713, 1725, 1732, 1736 + 0, 145, 145, 158, 165, 175, 188, 189, 192, 193, + 194, 195, 196, 197, 198, 201, 202, 203, 206, 210, + 216, 220, 222, 226, 235, 236, 239, 260, 269, 282, + 283, 286, 287, 290, 291, 292, 293, 294, 295, 298, + 310, 316, 328, 331, 332, 335, 343, 345, 347, 349, + 351, 359, 367, 371, 375, 378, 379, 382, 401, 402, + 403, 406, 431, 475, 477, 480, 497, 508, 511, 526, + 529, 530, 533, 598, 601, 602, 606, 607, 615, 618, + 625, 634, 642, 650, 651, 656, 659, 676, 684, 691, + 703, 721, 722, 726, 727, 730, 731, 732, 735, 759, + 783, 803, 814, 833, 840, 846, 849, 852, 862, 865, + 866, 867, 869, 873, 874, 875, 876, 877, 878, 880, + 882, 884, 886, 888, 892, 896, 900, 904, 908, 912, + 916, 930, 940, 949, 961, 977, 995, 1020, 1056, 1057, + 1060, 1061, 1064, 1073, 1084, 1089, 1115, 1116, 1117, 1118, + 1119, 1122, 1149, 1151, 1165, 1179, 1192, 1204, 1208, 1221, + 1234, 1242, 1253, 1265, 1279, 1280, 1297, 1298, 1299, 1300, + 1301, 1302, 1305, 1306, 1315, 1326, 1349, 1353, 1354, 1355, + 1358, 1359, 1386, 1390, 1391, 1392, 1393, 1396, 1397, 1405, + 1413, 1414, 1427, 1477, 1478, 1479, 1483, 1503, 1504, 1505, + 1506, 1509, 1528, 1547, 1558, 1570, 1584, 1609, 1624, 1635, + 1644, 1655, 1668, 1699, 1709, 1721, 1728, 1732 }; #endif - -#if (YYDEBUG) || defined YYERROR_VERBOSE - -/* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */ +#if YYDEBUG || YYERROR_VERBOSE +/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { - "$", "error", "$undefined.", "UNSIGNED_INT", "STRING", "RAWSTRING", + "$end", "error", "$undefined", "UNSIGNED_INT", "STRING", "RAWSTRING", "STRINGCONCAT", "STRINGCOMPARE", "STRINGCOPY", "STRINGLENGTH", "SSCANF", "SPRINTF", "IDENTIFIER", "CHAR", "INT", "NE", "LE", "GE", "BECOMES", "DIV", "MOD", "OR", "AND", "NOT", "DOTDOT", "IF", "THEN", "ELSE", @@ -374,24 +613,24 @@ "MONITOR", "PROCEDURE", "PROGRAM", "INCLUDE", "ATOMIC", "FNSTRING", "SEND", "RECEIVE", "BROADCAST", "EXTERNAL", "LOWER_THAN_ELSE", "';'", "'.'", "'#'", "'='", "'+'", "'-'", "'['", "']'", "','", "':'", "'('", - "')'", "'<'", "'>'", "'*'", "program", "init_outerscope", "outer_decls", - "outer_decl", "extern_decl", "extern_var_decl", "extern_proc_decl", - "the_external", "proc_or_func_proto", "extern_mon_decl", "proto_list", - "pgm_decl", "pgm_hdg_decls", "pgm_heading", "opt_declarations", - "declarations", "declaration", "include_dcl_part", "start_include", - "const_dcl_part", "const_defs", "const_def", "constant", "unsigned_num", - "type_dcl_part", "type_defs", "type_def", "type", "simple_type", - "struct_type", "index_type", "dimension", "low", "last_atab", - "string_type", "var_dcl_part", "variable_dcls", "variable_dcl", - "newident_list", "new_id_list", "opt_initializer", "proc_dcl_part", - "proc_or_func", "proc_hdg_decl", "proc_proto", "opt_atomic", - "proc_heading", "proc_id", "func_hdg_decl", "func_proto", - "func_heading", "func_id", "formal_params", "formal_p_sects", - "formal_p_sect", "param_group", "var_param_group", "string_param_group", - "mon_dcl_part", "mon_heading", "mon_decl", "opt_stmt_part", - "compound_stmt", "the_begin", "statement_part", "statements", - "statement", "if_expr", "then_stmt", "the_else", "the_while", - "while_expr", "the_repeat", "for_id", "for_header", + "')'", "'<'", "'>'", "'*'", "$accept", "program", "init_outerscope", + "outer_decls", "outer_decl", "extern_decl", "extern_var_decl", + "extern_proc_decl", "the_external", "proc_or_func_proto", + "extern_mon_decl", "proto_list", "pgm_decl", "pgm_hdg_decls", + "pgm_heading", "opt_declarations", "declarations", "declaration", + "include_dcl_part", "start_include", "const_dcl_part", "const_defs", + "const_def", "constant", "unsigned_num", "type_dcl_part", "type_defs", + "type_def", "type", "simple_type", "struct_type", "index_type", + "dimension", "low", "last_atab", "string_type", "var_dcl_part", + "variable_dcls", "variable_dcl", "newident_list", "new_id_list", + "opt_initializer", "proc_dcl_part", "proc_or_func", "proc_hdg_decl", + "proc_proto", "opt_atomic", "proc_heading", "proc_id", "func_hdg_decl", + "func_proto", "func_heading", "func_id", "formal_params", + "formal_p_sects", "formal_p_sect", "param_group", "var_param_group", + "string_param_group", "mon_dcl_part", "mon_heading", "mon_decl", + "opt_stmt_part", "compound_stmt", "the_begin", "statement_part", + "statements", "statement", "if_expr", "then_stmt", "the_else", + "the_while", "while_expr", "the_repeat", "for_id", "for_header", "for_id_becomes_expr", "cbegin", "assignment", "id_becomes", "procedure_call", "actual_params", "actuals_list", "actual_param", "pfv_id", "check_proc", "special_proc_call", "send_call", @@ -406,282 +645,304 @@ }; #endif -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const short yyr1[] = +# ifdef YYPRINT +/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to + token YYLEX-NUM. */ +static const unsigned short 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, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 59, 46, 35, 61, + 43, 45, 91, 93, 44, 58, 40, 41, 60, 62, + 42 +}; +# endif + +/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const unsigned char yyr1[] = { - 0, 71, 71, 71, 72, 73, 73, 74, 74, 74, - 74, 74, 74, 74, 75, 75, 75, 76, 77, 78, - 79, 79, 80, 81, 81, 82, 83, 84, 85, 85, - 86, 86, 87, 87, 87, 87, 87, 87, 88, 89, - 88, 90, 91, 91, 92, 93, 93, 93, 93, 93, - 93, 93, 94, 95, 96, 96, 97, 98, 98, 98, - 99, 100, 101, 101, 102, 103, 104, 105, 106, 107, - 107, 108, 109, 110, 110, 111, 111, 112, 113, 113, - 114, 115, 116, 116, 117, 118, 119, 120, 121, 122, - 123, 123, 124, 124, 125, 125, 125, 126, 127, 128, - 129, 130, 131, 132, 132, 133, 134, 135, 136, 136, - 136, 136, 137, 137, 137, 137, 137, 137, 137, 137, - 137, 137, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 148, 149, 150, 151, 151, 152, - 152, 153, 153, 154, 155, 156, 156, 156, 156, 156, - 157, 158, 158, 159, 160, 161, 161, 162, 163, 164, - 165, 166, 166, 167, 167, 168, 168, 168, 168, 168, - 168, 169, 169, 169, 169, 170, 171, 171, 171, 172, - 172, 173, 174, 174, 174, 174, 175, 175, 175, 175, - 175, 176, 176, 176, 176, 177, 178, 178, 178, 178, - 179, 180, 181, 181, 182, 182, 183, 184, 185, 185, - 186, 187, 188, 188, 189, 190, 191 + 0, 71, 72, 72, 72, 73, 74, 74, 75, 75, + 75, 75, 75, 75, 75, 76, 76, 76, 77, 78, + 79, 80, 80, 81, 82, 82, 83, 84, 85, 86, + 86, 87, 87, 88, 88, 88, 88, 88, 88, 89, + 90, 89, 91, 92, 92, 93, 94, 94, 94, 94, + 94, 94, 94, 95, 96, 97, 97, 98, 99, 99, + 99, 100, 101, 102, 102, 103, 104, 105, 106, 107, + 108, 108, 109, 110, 111, 111, 112, 112, 113, 114, + 114, 115, 116, 117, 117, 118, 119, 120, 121, 122, + 123, 124, 124, 125, 125, 126, 126, 126, 127, 128, + 129, 130, 131, 132, 133, 133, 134, 135, 136, 137, + 137, 137, 137, 138, 138, 138, 138, 138, 138, 138, + 138, 138, 138, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 149, 150, 151, 152, 152, + 153, 153, 154, 154, 155, 156, 157, 157, 157, 157, + 157, 158, 159, 159, 160, 161, 162, 162, 163, 164, + 165, 166, 167, 167, 168, 168, 169, 169, 169, 169, + 169, 169, 170, 170, 170, 170, 171, 172, 172, 172, + 173, 173, 174, 175, 175, 175, 175, 176, 176, 176, + 176, 176, 177, 177, 177, 177, 178, 179, 179, 179, + 179, 180, 181, 182, 182, 183, 183, 184, 185, 186, + 186, 187, 188, 189, 189, 190, 191, 192 }; -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const short yyr2[] = +/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ +static const unsigned char yyr2[] = { - 0, 2, 3, 2, 0, 1, 2, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 4, 2, 1, - 1, 1, 5, 1, 2, 3, 3, 2, 0, 1, - 2, 1, 1, 1, 1, 1, 1, 1, 2, 2, - 2, 3, 3, 1, 3, 1, 2, 2, 1, 2, - 2, 1, 1, 3, 3, 1, 3, 1, 1, 1, - 1, 7, 3, 1, 2, 2, 0, 4, 3, 3, - 1, 4, 1, 3, 1, 0, 2, 1, 3, 3, - 2, 3, 0, 1, 2, 2, 2, 3, 4, 2, - 0, 3, 3, 1, 1, 1, 1, 3, 4, 3, - 4, 3, 1, 1, 1, 3, 1, 1, 3, 1, - 2, 2, 0, 1, 1, 1, 1, 2, 4, 4, - 4, 2, 3, 2, 2, 1, 1, 1, 1, 2, - 4, 3, 1, 2, 3, 2, 3, 0, 3, 3, - 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, - 5, 2, 2, 2, 3, 3, 3, 1, 3, 4, - 5, 1, 3, 1, 3, 1, 1, 1, 1, 1, - 1, 1, 2, 2, 3, 1, 1, 1, 1, 1, - 3, 1, 1, 1, 1, 1, 1, 1, 1, 3, - 2, 3, 1, 1, 1, 0, 1, 1, 1, 1, - 3, 2, 3, 3, 3, 5, 4, 5, 1, 3, - 4, 1, 3, 1, 4, 1, 1 + 0, 2, 2, 3, 2, 0, 1, 2, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 4, 2, + 1, 1, 1, 5, 1, 2, 3, 3, 2, 0, + 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, + 2, 2, 3, 3, 1, 3, 1, 2, 2, 1, + 2, 2, 1, 1, 3, 3, 1, 3, 1, 1, + 1, 1, 7, 3, 1, 2, 2, 0, 4, 3, + 3, 1, 4, 1, 3, 1, 0, 2, 1, 3, + 3, 2, 3, 0, 1, 2, 2, 2, 3, 4, + 2, 0, 3, 3, 1, 1, 1, 1, 3, 4, + 3, 4, 3, 1, 1, 1, 3, 1, 1, 3, + 1, 2, 2, 0, 1, 1, 1, 1, 2, 4, + 4, 4, 2, 3, 2, 2, 1, 1, 1, 1, + 2, 4, 3, 1, 2, 3, 2, 3, 0, 3, + 3, 1, 1, 1, 1, 0, 1, 1, 1, 1, + 1, 5, 2, 2, 2, 3, 3, 3, 1, 3, + 4, 5, 1, 3, 1, 3, 1, 1, 1, 1, + 1, 1, 1, 2, 2, 3, 1, 1, 1, 1, + 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, + 3, 2, 3, 1, 1, 1, 0, 1, 1, 1, + 1, 3, 2, 3, 3, 3, 5, 4, 5, 1, + 3, 4, 1, 3, 1, 4, 1, 1 }; -/* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE - doesn't specify something else to do. Zero means the default is an - error. */ -static const short yydefact[] = -{ - 4, 82, 0, 0, 0, 0, 0, 83, 19, 0, - 82, 5, 13, 14, 15, 82, 16, 3, 0, 0, - 7, 0, 11, 10, 12, 8, 77, 0, 82, 0, - 0, 82, 9, 28, 216, 0, 43, 0, 0, 70, - 0, 72, 74, 0, 55, 0, 0, 27, 39, 6, - 2, 0, 18, 20, 21, 82, 106, 107, 0, 0, - 82, 38, 40, 0, 80, 29, 31, 32, 33, 34, - 35, 36, 37, 0, 0, 0, 90, 0, 90, 0, - 86, 102, 0, 41, 0, 68, 0, 0, 53, 0, - 101, 0, 23, 82, 0, 0, 0, 0, 215, 0, - 128, 126, 0, 132, 0, 0, 113, 0, 109, 0, - 0, 0, 0, 112, 0, 0, 114, 0, 115, 144, - 116, 145, 146, 147, 148, 149, 0, 0, 0, 143, - 25, 26, 78, 30, 89, 85, 81, 0, 84, 87, - 0, 79, 103, 0, 104, 42, 52, 51, 0, 0, - 44, 45, 48, 69, 0, 0, 75, 57, 58, 59, - 60, 73, 54, 56, 17, 0, 24, 111, 110, 0, - 0, 0, 0, 0, 0, 0, 188, 0, 0, 0, - 0, 0, 0, 187, 195, 123, 163, 0, 171, 0, - 179, 186, 192, 196, 197, 198, 199, 0, 193, 194, - 143, 129, 0, 0, 153, 105, 112, 112, 117, 0, - 127, 0, 0, 121, 0, 0, 133, 137, 0, 0, - 0, 135, 0, 0, 0, 93, 94, 95, 96, 0, - 100, 46, 49, 47, 50, 0, 0, 0, 71, 22, - 157, 151, 152, 0, 154, 158, 0, 0, 201, 0, - 0, 190, 0, 172, 173, 0, 137, 170, 168, 169, - 178, 165, 176, 177, 166, 167, 0, 0, 183, 184, - 185, 182, 0, 0, 0, 0, 0, 108, 124, 125, - 112, 112, 0, 131, 0, 122, 0, 136, 0, 161, - 134, 213, 0, 0, 0, 0, 91, 88, 0, 0, - 0, 63, 0, 76, 0, 0, 0, 200, 0, 0, - 0, 204, 189, 191, 164, 0, 174, 180, 208, 0, - 0, 203, 202, 118, 119, 120, 130, 142, 0, 140, - 141, 0, 159, 210, 0, 0, 99, 97, 92, 67, - 65, 66, 0, 64, 156, 155, 160, 0, 214, 0, - 0, 206, 150, 0, 138, 162, 212, 98, 0, 62, - 207, 205, 209, 139, 0, 61, 0, 0, 0 +/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state + STATE-NUM when YYTABLE doesn't specify something else to do. Zero + means the default is an error. */ +static const unsigned char yydefact[] = +{ + 5, 0, 83, 1, 0, 0, 0, 0, 0, 84, + 20, 0, 83, 6, 14, 15, 16, 83, 17, 4, + 0, 0, 8, 0, 12, 11, 13, 9, 78, 0, + 83, 0, 0, 83, 10, 29, 217, 0, 44, 0, + 0, 71, 0, 73, 75, 0, 56, 0, 0, 28, + 40, 7, 3, 0, 19, 21, 22, 83, 107, 108, + 0, 0, 83, 39, 41, 0, 81, 30, 32, 33, + 34, 35, 36, 37, 38, 0, 0, 0, 91, 0, + 91, 0, 87, 103, 0, 42, 0, 69, 0, 0, + 54, 0, 102, 0, 24, 83, 0, 0, 0, 0, + 216, 0, 129, 127, 0, 133, 0, 0, 114, 0, + 110, 0, 0, 0, 0, 113, 0, 0, 115, 0, + 116, 145, 117, 146, 147, 148, 149, 150, 0, 0, + 0, 144, 26, 27, 79, 31, 90, 86, 82, 0, + 85, 88, 0, 80, 104, 0, 105, 43, 53, 52, + 0, 0, 45, 46, 49, 70, 0, 0, 76, 58, + 59, 60, 61, 74, 55, 57, 18, 0, 25, 112, + 111, 0, 0, 0, 0, 0, 0, 0, 189, 0, + 0, 0, 0, 0, 0, 188, 196, 124, 164, 0, + 172, 0, 180, 187, 193, 197, 198, 199, 200, 0, + 194, 195, 144, 130, 0, 0, 154, 106, 113, 113, + 118, 0, 128, 0, 0, 122, 0, 0, 134, 138, + 0, 0, 0, 136, 0, 0, 0, 94, 95, 96, + 97, 0, 101, 47, 50, 48, 51, 0, 0, 0, + 72, 23, 158, 152, 153, 0, 155, 159, 0, 0, + 202, 0, 0, 191, 0, 173, 174, 0, 138, 171, + 169, 170, 179, 166, 177, 178, 167, 168, 0, 0, + 184, 185, 186, 183, 0, 0, 0, 0, 0, 109, + 125, 126, 113, 113, 0, 132, 0, 123, 0, 137, + 0, 162, 135, 214, 0, 0, 0, 0, 92, 89, + 0, 0, 0, 64, 0, 77, 0, 0, 0, 201, + 0, 0, 0, 205, 190, 192, 165, 0, 175, 181, + 209, 0, 0, 204, 203, 119, 120, 121, 131, 143, + 0, 141, 142, 0, 160, 211, 0, 0, 100, 98, + 93, 68, 66, 67, 0, 65, 157, 156, 161, 0, + 215, 0, 0, 207, 151, 0, 139, 163, 213, 99, + 0, 63, 208, 206, 210, 140, 0, 62 }; +/* YYDEFGOTO[NTERM-NUM]. */ static const short yydefgoto[] = { - 366, 1, 10, 11, 12, 13, 14, 15, 52, 16, - 93, 17, 18, 19, 64, 65, 66, 67, 21, 68, - 35, 36, 299, 183, 69, 43, 44, 156, 157, 158, - 300, 301, 302, 358, 159, 70, 38, 39, 40, 41, - 238, 71, 26, 27, 28, 29, 75, 76, 30, 31, - 77, 78, 138, 224, 225, 226, 227, 228, 72, 33, - 82, 143, 106, 58, 59, 107, 108, 109, 208, 280, - 110, 209, 111, 112, 113, 114, 115, 116, 117, 118, - 287, 328, 329, 184, 217, 120, 121, 170, 122, 123, - 244, 241, 124, 125, 126, 288, 330, 266, 186, 187, - 267, 188, 189, 272, 190, 191, 256, 192, 193, 194, - 204, 195, 196, 197, 319, 198, 128, 292, 199, 200, - 42 + -1, 1, 2, 12, 13, 14, 15, 16, 17, 54, + 18, 95, 19, 20, 21, 66, 67, 68, 69, 23, + 70, 37, 38, 301, 185, 71, 45, 46, 158, 159, + 160, 302, 303, 304, 360, 161, 72, 40, 41, 42, + 43, 240, 73, 28, 29, 30, 31, 77, 78, 32, + 33, 79, 80, 140, 226, 227, 228, 229, 230, 74, + 35, 84, 145, 108, 60, 61, 109, 110, 111, 210, + 282, 112, 211, 113, 114, 115, 116, 117, 118, 119, + 120, 289, 330, 331, 186, 219, 122, 123, 172, 124, + 125, 246, 243, 126, 127, 128, 290, 332, 268, 188, + 189, 269, 190, 191, 274, 192, 193, 258, 194, 195, + 196, 206, 197, 198, 199, 321, 200, 130, 294, 201, + 202, 44 }; +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +#define YYPACT_NINF -238 static const short yypact[] = { - -32768, 224, 38, 38, 38, 38, 38,-32768,-32768, -32, - 88,-32768,-32768,-32768,-32768, 190,-32768,-32768, 77, 85, - -32768, 20,-32768,-32768,-32768,-32768,-32768, 77, 170, 78, - 77, 170,-32768, 160,-32768, 87,-32768, 6, 103,-32768, - 74, 99,-32768, 114,-32768, 127, 147,-32768,-32768,-32768, - -32768, 38,-32768,-32768,-32768, 172,-32768,-32768, 366, 167, - 170,-32768,-32768, 158,-32768, 160,-32768,-32768,-32768,-32768, - -32768,-32768,-32768, 222, 228, 191, 182, 193, 182, 194, - -32768,-32768, -1, 38, 71, 38, 101, 38, 38, 101, - -32768, 197,-32768, 96, -17, 189, 189, 201,-32768, 304, - -32768,-32768, 256,-32768, 189, 204,-32768, 5,-32768, 248, - 304, 400, 257, 492, 245, 427,-32768, 304,-32768,-32768, - -32768,-32768,-32768,-32768,-32768,-32768, 223, 273, 230, 0, - -32768,-32768,-32768,-32768,-32768,-32768,-32768, 23,-32768,-32768, - 229,-32768,-32768, 237,-32768,-32768,-32768,-32768, 83, 83, - -32768,-32768,-32768,-32768, 233, 234, 279,-32768,-32768,-32768, - -32768,-32768,-32768,-32768, 38, 242,-32768,-32768,-32768, 185, - 236, 236, 304, 189, 204, 238,-32768, 239, 331, 189, - 331, 331, 304,-32768,-32768,-32768, 425, 428, 26, 32, - -32768,-32768,-32768,-32768,-32768,-32768,-32768, 244,-32768,-32768, - 240,-32768, 255, 249,-32768,-32768, 492, 492, 285, 270, - -32768, -9, 304,-32768, 304, 67,-32768, 254, 304, 304, - 304,-32768, 38, 258, 53,-32768,-32768,-32768,-32768, 256, - -32768,-32768,-32768,-32768,-32768, 71, 71, 71,-32768,-32768, - -32768,-32768,-32768, 185,-32768,-32768, 260, 236,-32768, 304, - 304,-32768, 18, 26, 26, 259, 254,-32768,-32768,-32768, - -32768,-32768,-32768,-32768,-32768,-32768, 304, 331,-32768,-32768, - -32768,-32768, 331, 304, 304, 262, 263,-32768,-32768,-32768, - 492, 492, 304,-32768, 288,-32768, 276,-32768, 97,-32768, - -32768,-32768, 166, 266, 68, 23,-32768,-32768, 269, 298, - 169,-32768, 71,-32768, 268, 272, 320,-32768, 282, 280, - 304,-32768,-32768,-32768, 47, 57, 26,-32768,-32768, 120, - 281,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 129,-32768, - -32768, 304,-32768,-32768, 304, 256,-32768,-32768,-32768,-32768, - -32768,-32768, 71,-32768,-32768,-32768,-32768, 320,-32768, 283, - 304,-32768,-32768, 276,-32768,-32768,-32768,-32768, 322,-32768, - -32768,-32768,-32768,-32768, 101,-32768, 333, 349,-32768 + -238, 21, 224, -238, 24, 24, 24, 24, 24, -238, + -238, 97, 88, -238, -238, -238, -238, 98, -238, -238, + 69, 107, -238, 11, -238, -238, -238, -238, -238, 69, + 170, 147, 69, 170, -238, 160, -238, 126, -238, 100, + 140, -238, 138, 152, -238, 165, -238, 174, 178, -238, + -238, -238, -238, 24, -238, -238, -238, 175, -238, -238, + 366, 182, 170, -238, -238, 179, -238, 160, -238, -238, + -238, -238, -238, -238, -238, 228, 235, 192, 183, 194, + 183, 197, -238, -238, 176, 24, 71, 24, 35, 24, + 24, 35, -238, 199, -238, -1, -16, 201, 201, 202, + -238, 304, -238, -238, 258, -238, 201, 208, -238, 58, + -238, 254, 304, 400, 257, 492, 252, 427, -238, 304, + -238, -238, -238, -238, -238, -238, -238, -238, 227, 274, + 231, 0, -238, -238, -238, -238, -238, -238, -238, 83, + -238, -238, 229, -238, -238, 239, -238, -238, -238, -238, + 105, 105, -238, -238, -238, -238, 234, 236, 279, -238, + -238, -238, -238, -238, -238, -238, 24, 244, -238, -238, + -238, 185, 238, 238, 304, 201, 208, 237, -238, 242, + 331, 201, 331, 331, 304, -238, -238, -238, 425, 428, + 32, 50, -238, -238, -238, -238, -238, -238, -238, 240, + -238, -238, 243, -238, 248, 249, -238, -238, 492, 492, + 292, 287, -238, 12, 304, -238, 304, 66, -238, 255, + 304, 304, 304, -238, 24, 259, 51, -238, -238, -238, + -238, 258, -238, -238, -238, -238, -238, 71, 71, 71, + -238, -238, -238, -238, -238, 185, -238, -238, 261, 238, + -238, 304, 304, -238, 74, 32, 32, 256, 255, -238, + -238, -238, -238, -238, -238, -238, -238, -238, 304, 331, + -238, -238, -238, -238, 331, 304, 304, 262, 263, -238, + -238, -238, 492, 492, 304, -238, 289, -238, 276, -238, + 94, -238, -238, -238, 166, 266, 38, 83, -238, -238, + 269, 302, 168, -238, 71, -238, 268, 272, 328, -238, + 282, 280, 304, -238, -238, -238, 4, 25, 32, -238, + -238, 103, 281, -238, -238, -238, -238, -238, -238, -238, + 119, -238, -238, 304, -238, -238, 304, 258, -238, -238, + -238, -238, -238, -238, 71, -238, -238, -238, -238, 328, + -238, 283, 304, -238, -238, 276, -238, -238, -238, -238, + 320, -238, -238, -238, -238, -238, 35, -238 }; +/* YYPGOTO[NTERM-NUM]. */ static const short yypgoto[] = { - -32768,-32768,-32768, 342,-32768,-32768,-32768,-32768, -44,-32768, - -32768, 343,-32768,-32768, 9,-32768, 290, 137,-32768, 157, - -32768, 274, -75, -82, 165,-32768, 271, -88,-32768,-32768, - -32768, 16,-32768,-32768,-32768, 173, 309, -70, -130,-32768, - -32768, 175,-32768,-32768, 4,-32768,-32768,-32768,-32768, 8, - -32768,-32768, 284,-32768, 66,-32768,-32768,-32768, 181, 348, - -32768,-32768, 11,-32768, 186, 25, -108,-32768,-32768,-32768, - -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, - 110,-32768, 15, -55,-32768,-32768,-32768, -92,-32768,-32768, - -144, -235,-32768,-32768,-32768,-32768, -93,-32768, 105, 107, - -32768, -167,-32768,-32768, -168,-32768,-32768,-32768,-32768,-32768, - 195,-32768,-32768,-32768,-32768, -38,-32768,-32768,-32768, -58, - 28 + -238, -238, -238, -238, 339, -238, -238, -238, -238, -46, + -238, -238, 340, -238, -238, 47, -238, 286, 33, -238, + 111, -238, 270, -77, -84, 132, -238, 267, -90, -238, + -238, -238, 14, -238, -238, -238, 162, 306, -72, -132, + -238, -238, 164, -238, -238, 2, -238, -238, -238, -238, + 6, -238, -238, 288, -238, 63, -238, -238, -238, 173, + 344, -238, -238, 9, -238, 155, 23, -110, -238, -238, + -238, -238, -238, -238, -238, -238, -238, -238, -238, -238, + -238, 104, -238, 8, -57, -238, -238, -238, -94, -238, + -238, -146, -237, -238, -238, -238, -238, -95, -238, 101, + 108, -238, -169, -238, -238, -170, -238, -238, -238, -238, + -238, 190, -238, -238, -238, -238, -40, -238, -238, -238, + -60, 26 }; - -#define YYLAST 545 - - +/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule which + number is the opposite. If zero, do what YYDEFACT says. + If YYTABLE_NINF, syntax error. */ +#define YYTABLE_NINF -213 static const short yytable[] = { - 129, 163, 151, 119, 171, 213, 185, 223, 304, 150, - 251, 92, 202, 253, 254, 153, 48, 210, 221, 53, - 127, 167, 282, 54, 216, 61, 152, 245, 160, 57, - 37, 160, 45, 46, 47, 34, 56, 142, 57, 168, - 80, 57, 81, 205, 201, -181, -181, 206, -181, 166, - 34, 268, 269, 129, 270, 129, 119, 129, 119, 53, - 119, 206, -211, 54, 222, 84, 231, 233, -175, 131, - 62, 346, 336, 127, 146, 127, 242, 127, 260, 246, - 98, 247, 310, 98, 147, 311, 146, 252, -1, 255, - 232, 234, 293, 144, 153, 98, -181, 53, 277, 278, - 316, 54, 271, 307, 317, 154, 285, -175, -175, 295, - 276, 37, 360, 98, 56, 161, 45, 262, 263, 283, - 296, 284, 73, 206, 74, 289, 290, 291, 2, 3, - 4, 148, 149, 5, 165, 6, 211, 7, 20, 86, - 215, 60, 8, 83, 155, 7, 9, 20, 129, 129, - 305, 119, 119, 151, 151, 151, 308, 309, 22, 85, - 298, 331, 303, 87, 332, 223, 23, 22, 127, 127, - 88, 297, 323, 324, 24, 23, 25, 152, 152, 152, - 318, 320, 32, 24, 350, 25, 89, 351, 146, 325, - 240, 32, 173, 353, 174, 175, 354, 98, 176, 177, - 2, 3, 4, 90, -82, 5, -82, -28, 178, 7, - 2, 3, 4, 63, 132, 5, 79, 349, 9, 7, - 151, 7, 129, 129, 130, 119, 119, 343, 9, 333, - 334, 51, 341, 342, 134, 5, 337, 179, 355, 7, - 135, 356, 127, 127, 152, 180, 181, 136, 137, 139, - 141, 182, 146, 164, 275, 169, 173, 362, 174, 175, - 151, 98, 176, 177, 2, 3, 4, 172, 98, 5, - 203, 6, 178, 7, 207, 212, 365, 357, 8, 146, - 214, 327, 9, 173, 152, 174, 175, 218, 98, 176, - 177, 219, 220, 230, 229, 235, 236, 237, 239, 178, - 243, 179, -211, 281, 249, 250, 160, 146, 273, 180, - 181, 173, 279, 174, 175, 182, 98, 176, 177, 274, - 286, 326, 340, 294, 306, 240, 312, 178, 179, 321, - 322, 335, 339, 367, 146, 344, 180, 181, 173, 345, - 174, 175, 182, 98, 176, 177, 347, 348, 352, 368, - 361, 364, 49, 50, 178, 133, 179, 145, 359, 162, - 91, 338, 140, 55, 180, 181, 313, 94, 363, 248, - 182, 314, 95, 315, 96, 0, 0, 97, 98, 0, - 0, 0, 0, 179, 0, 0, 0, 0, 0, 0, - 0, 99, 0, 0, 0, 0, 100, 182, 101, 0, - 102, 94, 103, 56, -112, 0, 95, 0, 96, 0, - 0, 97, 98, 0, 0, 0, 0, 104, 0, 105, - 0, 0, -112, 0, 0, 99, 0, 0, 94, 0, - 100, -112, 101, 95, 102, 96, 103, 56, 97, 98, - -175, -175, -175, 257, 258, 259, -175, 0, 0, 260, - 0, 104, 99, 105, 0, 0, -112, 100, 0, 101, - 0, 102, 0, 103, 56, 0, -112, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 104, 0, - 105, 0, 0, -112, -175, -175, -175, 261, 262, 263, - 0, 0, 0, -175, -175, 0, 264, 265, 95, 0, - 96, 0, 0, 97, 98, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 99, 0, 0, - 0, 0, 100, 0, 101, 0, 102, 0, 103, 56, + 131, 165, 153, 121, 173, 215, 187, 225, 306, 152, + 253, 94, 204, 255, 256, 155, 63, 212, 223, 55, + 129, 3, 169, 56, 218, -176, 154, 247, 162, 59, + 39, 162, 47, 48, 49, 22, 36, 167, 59, 156, + 170, 59, 338, 284, 203, 22, 262, 100, 9, 168, + 100, -182, -182, 131, -182, 131, 121, 131, 121, 55, + 121, 64, -212, 56, -176, -176, 233, 235, 208, 270, + 271, 348, 272, 129, 148, 129, 244, 129, 157, 248, + 82, 249, 83, 100, 149, 264, 265, 254, -2, 257, + 234, 236, 295, 146, 155, 36, 207, 55, 279, 280, + 318, 56, -182, 309, 319, 287, 58, 297, 148, 133, + 278, 39, 362, 24, 208, 163, 47, 100, 298, 285, + 273, 286, 208, 24, 224, 291, 292, 293, 4, 5, + 6, 150, 151, 7, 25, 8, 213, 9, 312, 53, + 217, 313, 10, 7, 25, 50, 11, 9, 131, 131, + 307, 121, 121, 153, 153, 153, 310, 311, 333, 86, + 300, 334, 305, 62, 26, 225, 27, 352, 129, 129, + 353, 299, 325, 326, 26, 34, 27, 154, 154, 154, + 320, 322, 85, 355, 65, 34, 356, 81, 148, 327, + 242, 75, 175, 76, 176, 177, 87, 100, 178, 179, + 4, 5, 6, 88, -83, 7, -83, -29, 180, 9, + 4, 5, 6, 58, 144, 7, 89, 351, 11, 9, + 153, 90, 131, 131, 9, 121, 121, 345, 11, 335, + 336, 343, 344, 91, 92, 134, 339, 181, 357, 132, + 136, 358, 129, 129, 154, 182, 183, 137, 138, 139, + 141, 184, 148, 143, 277, 166, 175, 364, 176, 177, + 153, 100, 178, 179, 4, 5, 6, 171, 174, 7, + 100, 8, 180, 9, 205, 214, 367, 359, 10, 148, + 209, 329, 11, 175, 154, 176, 177, 216, 100, 178, + 179, 220, 221, 222, 231, 232, 237, 239, 238, 180, + 241, 181, 245, 251, 275, -212, 162, 148, 252, 182, + 183, 175, 276, 176, 177, 184, 100, 178, 179, 281, + 283, 288, 328, 314, 296, 308, 342, 180, 181, 323, + 324, 337, 341, 242, 148, 346, 182, 183, 175, 347, + 176, 177, 184, 100, 178, 179, 349, 350, 354, 366, + 363, 51, 52, 135, 180, 147, 181, 164, 361, 93, + 340, 57, 315, 365, 182, 183, 250, 96, 142, 316, + 184, 0, 97, 0, 98, 0, 317, 99, 100, 0, + 0, 0, 0, 181, 0, 0, 0, 0, 0, 0, + 0, 101, 0, 0, 0, 0, 102, 184, 103, 0, + 104, 96, 105, 58, -113, 0, 97, 0, 98, 0, + 0, 99, 100, 0, 0, 0, 0, 106, 0, 107, + 0, 0, -113, 0, 0, 101, 0, 0, 96, 0, + 102, -113, 103, 97, 104, 98, 105, 58, 99, 100, + -176, -176, -176, 259, 260, 261, -176, 0, 0, 262, + 0, 106, 101, 107, 0, 0, -113, 102, 0, 103, + 0, 104, 0, 105, 58, 0, -113, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 106, 0, + 107, 0, 0, -113, -176, -176, -176, 263, 264, 265, + 0, 0, 0, -176, -176, 0, 266, 267, 97, 0, + 98, 0, 0, 99, 100, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 101, 0, 0, + 0, 0, 102, 0, 103, 0, 104, 0, 105, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 104, 0, 105 + 0, 0, 0, 106, 0, 107 }; static const short yycheck[] = { - 58, 89, 84, 58, 96, 113, 99, 137, 243, 84, - 178, 55, 104, 180, 181, 85, 48, 110, 18, 15, - 58, 38, 31, 15, 117, 5, 84, 171, 86, 18, - 2, 89, 4, 5, 6, 12, 37, 38, 27, 56, - 31, 30, 33, 38, 102, 19, 20, 56, 22, 93, - 12, 19, 20, 111, 22, 113, 111, 115, 113, 55, - 115, 56, 62, 55, 41, 59, 148, 149, 21, 60, - 50, 306, 4, 111, 3, 113, 169, 115, 21, 172, - 12, 173, 64, 12, 13, 67, 3, 179, 0, 182, - 148, 149, 222, 82, 164, 12, 70, 93, 206, 207, - 267, 93, 70, 247, 272, 4, 39, 60, 61, 56, - 203, 83, 347, 12, 37, 87, 88, 60, 61, 212, - 67, 214, 44, 56, 46, 218, 219, 220, 40, 41, - 42, 60, 61, 45, 38, 47, 111, 49, 1, 65, - 115, 56, 54, 56, 43, 49, 58, 10, 206, 207, - 243, 206, 207, 235, 236, 237, 249, 250, 1, 56, - 235, 64, 237, 64, 67, 295, 1, 10, 206, 207, - 56, 229, 280, 281, 1, 10, 1, 235, 236, 237, - 273, 274, 1, 10, 64, 10, 59, 67, 3, 282, - 5, 10, 7, 64, 9, 10, 67, 12, 13, 14, - 40, 41, 42, 56, 44, 45, 46, 37, 23, 49, - 40, 41, 42, 27, 56, 45, 30, 310, 58, 49, - 302, 49, 280, 281, 57, 280, 281, 302, 58, 63, - 64, 41, 63, 64, 12, 45, 294, 52, 331, 49, - 12, 334, 280, 281, 302, 60, 61, 56, 66, 56, - 56, 66, 3, 56, 5, 66, 7, 350, 9, 10, - 342, 12, 13, 14, 40, 41, 42, 66, 12, 45, - 66, 47, 23, 49, 26, 18, 364, 335, 54, 3, - 35, 5, 58, 7, 342, 9, 10, 64, 12, 13, - 14, 18, 62, 56, 65, 62, 62, 18, 56, 23, - 64, 52, 62, 33, 66, 66, 364, 3, 64, 60, - 61, 7, 27, 9, 10, 66, 12, 13, 14, 64, - 66, 33, 24, 65, 64, 5, 67, 23, 52, 67, - 67, 65, 63, 0, 3, 67, 60, 61, 7, 67, - 9, 10, 66, 12, 13, 14, 64, 67, 67, 0, - 67, 29, 10, 10, 23, 65, 52, 83, 342, 88, - 51, 295, 78, 15, 60, 61, 256, 1, 353, 174, - 66, 266, 6, 266, 8, -1, -1, 11, 12, -1, + 60, 91, 86, 60, 98, 115, 101, 139, 245, 86, + 180, 57, 106, 182, 183, 87, 5, 112, 18, 17, + 60, 0, 38, 17, 119, 21, 86, 173, 88, 20, + 4, 91, 6, 7, 8, 2, 12, 38, 29, 4, + 56, 32, 4, 31, 104, 12, 21, 12, 49, 95, + 12, 19, 20, 113, 22, 115, 113, 117, 115, 57, + 117, 50, 62, 57, 60, 61, 150, 151, 56, 19, + 20, 308, 22, 113, 3, 115, 171, 117, 43, 174, + 33, 175, 35, 12, 13, 60, 61, 181, 0, 184, + 150, 151, 224, 84, 166, 12, 38, 95, 208, 209, + 269, 95, 70, 249, 274, 39, 37, 56, 3, 62, + 205, 85, 349, 2, 56, 89, 90, 12, 67, 214, + 70, 216, 56, 12, 41, 220, 221, 222, 40, 41, + 42, 60, 61, 45, 2, 47, 113, 49, 64, 41, + 117, 67, 54, 45, 12, 48, 58, 49, 208, 209, + 245, 208, 209, 237, 238, 239, 251, 252, 64, 59, + 237, 67, 239, 56, 2, 297, 2, 64, 208, 209, + 67, 231, 282, 283, 12, 2, 12, 237, 238, 239, + 275, 276, 56, 64, 29, 12, 67, 32, 3, 284, + 5, 44, 7, 46, 9, 10, 56, 12, 13, 14, + 40, 41, 42, 65, 44, 45, 46, 37, 23, 49, + 40, 41, 42, 37, 38, 45, 64, 312, 58, 49, + 304, 56, 282, 283, 49, 282, 283, 304, 58, 63, + 64, 63, 64, 59, 56, 56, 296, 52, 333, 57, + 12, 336, 282, 283, 304, 60, 61, 12, 56, 66, + 56, 66, 3, 56, 5, 56, 7, 352, 9, 10, + 344, 12, 13, 14, 40, 41, 42, 66, 66, 45, + 12, 47, 23, 49, 66, 18, 366, 337, 54, 3, + 26, 5, 58, 7, 344, 9, 10, 35, 12, 13, + 14, 64, 18, 62, 65, 56, 62, 18, 62, 23, + 56, 52, 64, 66, 64, 62, 366, 3, 66, 60, + 61, 7, 64, 9, 10, 66, 12, 13, 14, 27, + 33, 66, 33, 67, 65, 64, 24, 23, 52, 67, + 67, 65, 63, 5, 3, 67, 60, 61, 7, 67, + 9, 10, 66, 12, 13, 14, 64, 67, 67, 29, + 67, 12, 12, 67, 23, 85, 52, 90, 344, 53, + 297, 17, 258, 355, 60, 61, 176, 1, 80, 268, + 66, -1, 6, -1, 8, -1, 268, 11, 12, -1, -1, -1, -1, 52, -1, -1, -1, -1, -1, -1, -1, 25, -1, -1, -1, -1, 30, 66, 32, -1, 34, 1, 36, 37, 38, -1, 6, -1, 8, -1, @@ -700,144 +961,50 @@ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 51, -1, 53 }; -/* -*-C-*- Note some compilers choke on comments on `#line' lines. */ -#line 3 "/usr/share/bison/bison.simple" - -/* Skeleton output parser for bison, - - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 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 2, 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, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ - -/* This is the parser code that is written into each bison parser when - the %semantic_parser declaration is not specified in the grammar. - It was written by Richard Stallman by simplifying the hairy parser - used when %semantic_parser is specified. */ - -/* 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. */ - -#if ! defined (yyoverflow) || defined (YYERROR_VERBOSE) - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# if YYSTACK_USE_ALLOCA -# define YYSTACK_ALLOC alloca -# else -# ifndef YYSTACK_USE_ALLOCA -# if defined (alloca) || defined (_ALLOCA_H) -# define YYSTACK_ALLOC alloca -# else -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) -# else -# if defined (__STDC__) || defined (__cplusplus) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# endif -# define YYSTACK_ALLOC malloc -# define YYSTACK_FREE free -# endif -#endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */ - - -#if (! defined (yyoverflow) \ - && (! defined (__cplusplus) \ - || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - short yyss; - YYSTYPE yyvs; -# if YYLSP_NEEDED - YYLTYPE yyls; -# endif +/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ +static const unsigned char yystos[] = +{ + 0, 72, 73, 0, 40, 41, 42, 45, 47, 49, + 54, 58, 74, 75, 76, 77, 78, 79, 81, 83, + 84, 85, 89, 90, 91, 96, 107, 113, 114, 115, + 116, 117, 120, 121, 130, 131, 12, 92, 93, 192, + 108, 109, 110, 111, 192, 97, 98, 192, 192, 192, + 48, 75, 83, 41, 80, 116, 121, 131, 37, 134, + 135, 136, 56, 5, 50, 136, 86, 87, 88, 89, + 91, 96, 107, 113, 130, 44, 46, 118, 119, 122, + 123, 136, 86, 86, 132, 56, 59, 56, 65, 64, + 56, 59, 56, 108, 80, 82, 1, 6, 8, 11, + 12, 25, 30, 32, 34, 36, 51, 53, 134, 137, + 138, 139, 142, 144, 145, 146, 147, 148, 149, 150, + 151, 155, 157, 158, 160, 161, 164, 165, 166, 187, + 188, 191, 57, 86, 56, 88, 12, 12, 56, 66, + 124, 56, 124, 56, 38, 133, 134, 93, 3, 13, + 60, 61, 94, 95, 191, 109, 4, 43, 99, 100, + 101, 106, 191, 192, 98, 99, 56, 38, 80, 38, + 56, 66, 159, 159, 66, 7, 9, 10, 13, 14, + 23, 52, 60, 61, 66, 95, 155, 168, 170, 171, + 173, 174, 176, 177, 179, 180, 181, 183, 184, 185, + 187, 190, 191, 191, 159, 66, 182, 38, 56, 26, + 140, 143, 168, 137, 18, 138, 35, 137, 168, 156, + 64, 18, 62, 18, 41, 110, 125, 126, 127, 128, + 129, 65, 56, 95, 191, 95, 191, 62, 62, 18, + 112, 56, 5, 163, 168, 64, 162, 162, 168, 159, + 182, 66, 66, 176, 159, 173, 173, 168, 178, 15, + 16, 17, 21, 59, 60, 61, 68, 69, 169, 172, + 19, 20, 22, 70, 175, 64, 64, 5, 168, 138, + 138, 27, 141, 33, 31, 168, 168, 39, 66, 152, + 167, 168, 168, 168, 189, 110, 65, 56, 67, 191, + 94, 94, 102, 103, 104, 94, 163, 168, 64, 162, + 168, 168, 64, 67, 67, 152, 170, 171, 173, 176, + 168, 186, 168, 67, 67, 138, 138, 168, 33, 5, + 153, 154, 168, 64, 67, 63, 64, 65, 4, 191, + 126, 63, 24, 63, 64, 94, 67, 67, 163, 64, + 67, 168, 64, 67, 67, 64, 67, 168, 168, 191, + 105, 103, 163, 67, 168, 154, 29, 99 }; -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# if YYLSP_NEEDED -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ - + 2 * YYSTACK_GAP_MAX) -# else -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAX) -# endif - -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) -# else -# define YYCOPY(To, From, Count) \ - do \ - { \ - register YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (0) -# endif -# endif - -/* 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) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack, Stack, yysize); \ - Stack = &yyptr->Stack; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (0) - -#endif - - #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) # define YYSIZE_T __SIZE_TYPE__ #endif @@ -856,29 +1023,34 @@ #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) -#define YYEMPTY -2 +#define YYEMPTY (-2) #define YYEOF 0 + #define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab +#define YYABORT goto yyabortlab #define YYERROR goto yyerrlab1 + /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ + #define YYFAIL goto yyerrlab + #define YYRECOVERING() (!!yyerrstatus) + #define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ { \ yychar = (Token); \ yylval = (Value); \ - yychar1 = YYTRANSLATE (yychar); \ + yytoken = YYTRANSLATE (yychar); \ YYPOPSTACK; \ goto yybackup; \ } \ else \ { \ - yyerror ("syntax error: cannot back up"); \ + yyerror ("syntax error: cannot back up");\ YYERROR; \ } \ while (0) @@ -886,41 +1058,24 @@ #define YYTERROR 1 #define YYERRCODE 256 - /* YYLLOC_DEFAULT -- Compute the default location (before the actions - are run). - - When YYLLOC_DEFAULT is run, CURRENT is set the location of the - first token. By default, to implement support for ranges, extend - its range to the last symbol. */ + are run). */ #ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - Current.last_line = Rhs[N].last_line; \ - Current.last_column = Rhs[N].last_column; +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + Current.first_line = Rhs[1].first_line; \ + Current.first_column = Rhs[1].first_column; \ + Current.last_line = Rhs[N].last_line; \ + Current.last_column = Rhs[N].last_column; #endif - /* YYLEX -- calling `yylex' with the right arguments. */ -#if YYPURE -# if YYLSP_NEEDED -# ifdef YYLEX_PARAM -# define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM) -# else -# define YYLEX yylex (&yylval, &yylloc) -# endif -# else /* !YYLSP_NEEDED */ -# ifdef YYLEX_PARAM -# define YYLEX yylex (&yylval, YYLEX_PARAM) -# else -# define YYLEX yylex (&yylval) -# endif -# endif /* !YYLSP_NEEDED */ -#else /* !YYPURE */ -# define YYLEX yylex () -#endif /* !YYPURE */ - +#ifdef YYLEX_PARAM +# define YYLEX yylex (YYLEX_PARAM) +#else +# define YYLEX yylex () +#endif /* Enable debugging if requested. */ #if YYDEBUG @@ -935,13 +1090,93 @@ if (yydebug) \ YYFPRINTF Args; \ } while (0) + +# define YYDSYMPRINT(Args) \ +do { \ + if (yydebug) \ + yysymprint Args; \ +} while (0) + +# define YYDSYMPRINTF(Title, Token, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yysymprint (stderr, \ + Token, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (0) + +/*------------------------------------------------------------------. +| yy_stack_print -- Print the state stack from its BOTTOM up to its | +| TOP (cinluded). | +`------------------------------------------------------------------*/ + +#if defined (__STDC__) || defined (__cplusplus) +static void +yy_stack_print (short *bottom, short *top) +#else +static void +yy_stack_print (bottom, top) + short *bottom; + short *top; +#endif +{ + YYFPRINTF (stderr, "Stack now"); + for (/* Nothing. */; bottom <= top; ++bottom) + YYFPRINTF (stderr, " %d", *bottom); + 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. | +`------------------------------------------------*/ + +#if defined (__STDC__) || defined (__cplusplus) +static void +yy_reduce_print (int yyrule) +#else +static void +yy_reduce_print (yyrule) + int yyrule; +#endif +{ + int yyi; + unsigned int yylineno = yyrline[yyrule]; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ", + yyrule - 1, yylineno); + /* Print the symbols being reduced, and their result. */ + for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) + YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]); + YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]); +} + +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (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 YYDSYMPRINT(Args) +# define YYDSYMPRINTF(Title, Token, 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 @@ -961,8 +1196,10 @@ #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif + -#ifdef YYERROR_VERBOSE + +#if YYERROR_VERBOSE # ifndef yystrlen # if defined (__GLIBC__) && defined (_STRING_H) @@ -1012,86 +1249,134 @@ } # endif # endif -#endif + +#endif /* !YYERROR_VERBOSE */ + -#line 315 "/usr/share/bison/bison.simple" +#if YYDEBUG +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +#if defined (__STDC__) || defined (__cplusplus) +static void +yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) +#else +static void +yysymprint (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE *yyvaluep; +#endif +{ + /* Pacify ``unused variable'' warnings. */ + (void) yyvaluep; + + if (yytype < YYNTOKENS) + { + YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); +# ifdef YYPRINT + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +# endif + } + else + YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + + switch (yytype) + { + default: + break; + } + YYFPRINTF (yyoutput, ")"); +} + +#endif /* ! YYDEBUG */ +/*-----------------------------------------------. +| Release the memory associated to this symbol. | +`-----------------------------------------------*/ + +#if defined (__STDC__) || defined (__cplusplus) +static void +yydestruct (int yytype, YYSTYPE *yyvaluep) +#else +static void +yydestruct (yytype, yyvaluep) + int yytype; + YYSTYPE *yyvaluep; +#endif +{ + /* Pacify ``unused variable'' warnings. */ + (void) yyvaluep; + + switch (yytype) + { + + default: + break; + } +} + -/* The user can define YYPARSE_PARAM as the name of an argument to be passed - into yyparse. The argument should have type void *. - It should actually point to an object. - Grammar actions can access the variable by casting it - to the proper pointer type. */ +/* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM # if defined (__STDC__) || defined (__cplusplus) -# define YYPARSE_PARAM_ARG void *YYPARSE_PARAM -# define YYPARSE_PARAM_DECL +int yyparse (void *YYPARSE_PARAM); # else -# define YYPARSE_PARAM_ARG YYPARSE_PARAM -# define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; +int yyparse (); # endif -#else /* !YYPARSE_PARAM */ -# define YYPARSE_PARAM_ARG -# define YYPARSE_PARAM_DECL -#endif /* !YYPARSE_PARAM */ - -/* Prevent warning if -Wstrict-prototypes. */ -#ifdef __GNUC__ -# ifdef YYPARSE_PARAM -int yyparse (void *); -# else +#else /* ! YYPARSE_PARAM */ +#if defined (__STDC__) || defined (__cplusplus) int yyparse (void); -# endif +#else +int yyparse (); #endif +#endif /* ! YYPARSE_PARAM */ -/* YY_DECL_VARIABLES -- depending whether we use a pure parser, - variables are global, or local to YYPARSE. */ -#define YY_DECL_NON_LSP_VARIABLES \ -/* The lookahead symbol. */ \ -int yychar; \ - \ -/* The semantic value of the lookahead symbol. */ \ -YYSTYPE yylval; \ - \ -/* Number of parse errors so far. */ \ -int yynerrs; -#if YYLSP_NEEDED -# define YY_DECL_VARIABLES \ -YY_DECL_NON_LSP_VARIABLES \ - \ -/* Location data for the lookahead symbol. */ \ -YYLTYPE yylloc; -#else -# define YY_DECL_VARIABLES \ -YY_DECL_NON_LSP_VARIABLES -#endif +/* The lookahead symbol. */ +int yychar; +/* The semantic value of the lookahead symbol. */ +YYSTYPE yylval; -/* If nonreentrant, generate the variables here. */ +/* Number of syntax errors so far. */ +int yynerrs; -#if !YYPURE -YY_DECL_VARIABLES -#endif /* !YYPURE */ + +/*----------. +| yyparse. | +`----------*/ + +#ifdef YYPARSE_PARAM +# if defined (__STDC__) || defined (__cplusplus) +int yyparse (void *YYPARSE_PARAM) +# else +int yyparse (YYPARSE_PARAM) + void *YYPARSE_PARAM; +# endif +#else /* ! YYPARSE_PARAM */ +#if defined (__STDC__) || defined (__cplusplus) int -yyparse (YYPARSE_PARAM_ARG) - YYPARSE_PARAM_DECL -{ - /* If reentrant, generate the variables here. */ -#if YYPURE - YY_DECL_VARIABLES -#endif /* !YYPURE */ +yyparse (void) +#else +int +yyparse () +#endif +#endif +{ + register int yystate; register int yyn; int yyresult; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* Lookahead token as an internal (translated) token number. */ - int yychar1 = 0; + int yytoken = 0; /* Three stacks and their tools: `yyss': related to states, @@ -1101,7 +1386,7 @@ Refer to the stacks thru separate pointers, to allow yyoverflow to reallocate them elsewhere. */ - /* The state stack. */ + /* The state stack. */ short yyssa[YYINITDEPTH]; short *yyss = yyssa; register short *yyssp; @@ -1111,31 +1396,19 @@ YYSTYPE *yyvs = yyvsa; register YYSTYPE *yyvsp; -#if YYLSP_NEEDED - /* The location stack. */ - YYLTYPE yylsa[YYINITDEPTH]; - YYLTYPE *yyls = yylsa; - YYLTYPE *yylsp; -#endif -#if YYLSP_NEEDED -# define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) -#else -# define YYPOPSTACK (yyvsp--, yyssp--) -#endif - YYSIZE_T yystacksize = YYINITDEPTH; +#define YYPOPSTACK (yyvsp--, yyssp--) + YYSIZE_T yystacksize = YYINITDEPTH; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; -#if YYLSP_NEEDED - YYLTYPE yyloc; -#endif + /* When reducing, the number of symbols on the RHS of the reduced - rule. */ + rule. */ int yylen; YYDPRINTF ((stderr, "Starting parse\n")); @@ -1152,9 +1425,7 @@ yyssp = yyss; yyvsp = yyvs; -#if YYLSP_NEEDED - yylsp = yyls; -#endif + goto yysetstate; /*------------------------------------------------------------. @@ -1169,7 +1440,7 @@ yysetstate: *yyssp = yystate; - if (yyssp >= yyss + yystacksize - 1) + if (yyss + yystacksize - 1 <= yyssp) { /* Get the current used size of the three stacks, in elements. */ YYSIZE_T yysize = yyssp - yyss + 1; @@ -1182,24 +1453,17 @@ YYSTYPE *yyvs1 = yyvs; short *yyss1 = yyss; + /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. */ -# if YYLSP_NEEDED - YYLTYPE *yyls1 = yyls; - /* This used to be a conditional around just the two extra args, - but that might be undefined if yyoverflow is a macro. */ - yyoverflow ("parser stack overflow", - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yyls1, yysize * sizeof (*yylsp), - &yystacksize); - yyls = yyls1; -# else + 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 ("parser stack overflow", &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), + &yystacksize); -# endif + yyss = yyss1; yyvs = yyvs1; } @@ -1208,10 +1472,10 @@ goto yyoverflowlab; # else /* Extend the stack our own way. */ - if (yystacksize >= YYMAXDEPTH) + if (YYMAXDEPTH <= yystacksize) goto yyoverflowlab; yystacksize *= 2; - if (yystacksize > YYMAXDEPTH) + if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { @@ -1222,10 +1486,8 @@ goto yyoverflowlab; YYSTACK_RELOCATE (yyss); YYSTACK_RELOCATE (yyvs); -# if YYLSP_NEEDED - YYSTACK_RELOCATE (yyls); -# endif -# undef YYSTACK_RELOCATE + +# undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } @@ -1234,14 +1496,12 @@ yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; -#if YYLSP_NEEDED - yylsp = yyls + yysize - 1; -#endif + YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); - if (yyssp >= yyss + yystacksize - 1) + if (yyss + yystacksize - 1 <= yyssp) YYABORT; } @@ -1249,7 +1509,6 @@ goto yybackup; - /*-----------. | yybackup. | `-----------*/ @@ -1262,88 +1521,55 @@ /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; - if (yyn == YYFLAG) + if (yyn == YYPACT_NINF) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ - /* yychar is either YYEMPTY or YYEOF - or a valid token in external form. */ - + /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); yychar = YYLEX; } - /* Convert token to internal form (in yychar1) for indexing tables with */ - - if (yychar <= 0) /* This means end of input. */ + if (yychar <= YYEOF) { - yychar1 = 0; - yychar = YYEOF; /* Don't call YYLEX any more */ - + yychar = yytoken = YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } else { - yychar1 = YYTRANSLATE (yychar); - -#if YYDEBUG - /* We have to keep this `#if YYDEBUG', since we use variables - which are defined only if `YYDEBUG' is set. */ - if (yydebug) - { - YYFPRINTF (stderr, "Next token is %d (%s", - yychar, yytname[yychar1]); - /* Give the individual parser a way to print the precise - meaning of a token, for further debugging info. */ -# ifdef YYPRINT - YYPRINT (stderr, yychar, yylval); -# endif - YYFPRINTF (stderr, ")\n"); - } -#endif + yytoken = YYTRANSLATE (yychar); + YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc); } - yyn += yychar1; - if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) + /* 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]; - - /* yyn is what to do for this token type in this state. - Negative => reduce, -yyn is rule number. - Positive => shift, yyn is new state. - New state is final state => don't bother to shift, - just return success. - 0, or most negative number => error. */ - - if (yyn < 0) + if (yyn <= 0) { - if (yyn == YYFLAG) + if (yyn == 0 || yyn == YYTABLE_NINF) goto yyerrlab; yyn = -yyn; goto yyreduce; } - else if (yyn == 0) - goto yyerrlab; if (yyn == YYFINAL) YYACCEPT; /* Shift the lookahead token. */ - YYDPRINTF ((stderr, "Shifting token %d (%s), ", - yychar, yytname[yychar1])); + YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken])); /* Discard the token being shifted unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; *++yyvsp = yylval; -#if YYLSP_NEEDED - *++yylsp = yylloc; -#endif + /* Count tokens shifted since error; after three, turn off error status. */ @@ -1374,42 +1600,20 @@ /* If YYLEN is nonzero, implement the default value of the action: `$$ = $1'. - Otherwise, the following line sets YYVAL to the semantic value of - the lookahead token. This behavior is undocumented and Bison + 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]; -#if YYLSP_NEEDED - /* Similarly for the default location. Let the user run additional - commands if for instance locations are ranges. */ - yyloc = yylsp[1-yylen]; - YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); -#endif - -#if YYDEBUG - /* We have to keep this `#if YYDEBUG', since we use variables which - are defined only if `YYDEBUG' is set. */ - if (yydebug) - { - int yyi; - - YYFPRINTF (stderr, "Reducing via rule %d (line %d), ", - yyn, yyrline[yyn]); - - /* Print the symbols being reduced, and their result. */ - for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++) - YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); - YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]); - } -#endif - - switch (yyn) { -case 1: + YY_REDUCE_PRINT (yyn); + switch (yyn) + { + case 2: #line 146 "bapascal.y" -{ + { int i; tab[ob_tix].adr = lc; /* outerblock entry pt */ for (i = 0; i <= mon; i++){ @@ -1422,27 +1626,30 @@ process_var_inits(level); } break; -case 2: + + case 3: #line 159 "bapascal.y" -{ + { if (!making_objfile&&!main_declared) yyerror("No 'main' function declared"); if (main_declared) emit(SHORTRET); } break; -case 3: + + case 4: #line 166 "bapascal.y" -{ + { if (!making_objfile&&!main_declared) yyerror("No 'main' function declared"); if (main_declared) emit(SHORTRET); } break; -case 4: + + case 5: #line 175 "bapascal.y" -{ + { level = 0; enter(outerblock_name,outerblock,level,level); ob_tix = last_tab; @@ -1454,40 +1661,47 @@ display[last_btab] = level; } break; -case 17: + + case 18: #line 207 "bapascal.y" -{ external = 0; } + { external = 0; } break; -case 18: + + case 19: #line 211 "bapascal.y" -{ + { external = 0; } break; -case 19: + + case 20: #line 217 "bapascal.y" -{ external = 1; } + { external = 1; } break; -case 20: + + case 21: #line 221 "bapascal.y" -{ leave_block(&level); } + { leave_block(&level); } break; -case 21: + + case 22: #line 223 "bapascal.y" -{ leave_block(&level); } + { leave_block(&level); } break; -case 22: + + case 23: #line 227 "bapascal.y" -{ + { tab[yyvsp[-3]].adr = -1; in_mon_decl = 0; external = 0; leave_block(&level); } break; -case 25: + + case 26: #line 240 "bapascal.y" -{ + { int i; emit(HALT); /* need to backpatch location of outer block code */ @@ -1505,18 +1719,20 @@ process_var_inits(level-1); } break; -case 26: + + case 27: #line 261 "bapascal.y" -{ + { tab[yyvsp[-2]].adr = lc; /* main pgm entry point */ process_var_inits(level); /* process any var inits */ outer_call_lc = lc; /* loc of SHORTCALL instr */ emit(SHORTCALL); /* target addr is backpatched later */ } break; -case 27: + + case 28: #line 270 "bapascal.y" -{ /* pgm name is last symbol in outer scope */ + { /* pgm name is last symbol in outer scope */ yyval = yyvsp[0]; main_declared = 1; external = 0; @@ -1527,9 +1743,10 @@ btab[last_btab].lastpar = last_tab; /* no parms */ } break; -case 38: + + case 39: #line 299 "bapascal.y" -{ + { if (strcmp(laststring,infile[curr_infile].fname) == 0) yyerror("Recursive file inclusion"); else { @@ -1539,15 +1756,17 @@ in_include = 0; } break; -case 39: + + case 40: #line 311 "bapascal.y" -{ + { in_include = 1; } break; -case 40: + + case 41: #line 317 "bapascal.y" -{ + { if (strcmp(laststring,infile[curr_infile].fname) == 0) yyerror("Recursive file inclusion"); else { @@ -1557,33 +1776,39 @@ in_include = 0; } break; -case 44: + + case 45: #line 336 "bapascal.y" -{ + { tab[last_tab].typ = consttype; tab[last_tab].adr = yyvsp[0]; tab[last_tab].ref = 0; } break; -case 45: + + case 46: #line 344 "bapascal.y" -{ consttype = ints; } + { consttype = ints; } break; -case 46: + + case 47: #line 346 "bapascal.y" -{ yyval = yyvsp[0]; consttype = ints; } + { yyval = yyvsp[0]; consttype = ints; } break; -case 47: + + case 48: #line 348 "bapascal.y" -{ yyval = - yyvsp[0]; consttype = ints; } + { yyval = - yyvsp[0]; consttype = ints; } break; -case 48: + + case 49: #line 350 "bapascal.y" -{ yyval = get_constant(lastident,level,&consttype); } + { yyval = get_constant(lastident,level,&consttype); } break; -case 49: + + case 50: #line 352 "bapascal.y" -{ yyval = get_constant(lastident,level,&consttype); + { yyval = get_constant(lastident,level,&consttype); if (consttype != ints) { sprintf(pbuf,"Identifier '%s' not INTEGER type",lastident); yyerror(pbuf); @@ -1591,9 +1816,10 @@ } } break; -case 50: + + case 51: #line 360 "bapascal.y" -{ yyval = - get_constant(lastident,level,&consttype); + { yyval = - get_constant(lastident,level,&consttype); if (consttype != ints) { sprintf(pbuf,"Identifier '%s' not INTEGER type",lastident); yyerror(pbuf); @@ -1601,17 +1827,20 @@ } } break; -case 51: + + case 52: #line 368 "bapascal.y" -{ consttype = chars; yyval = laststring[0]; } + { consttype = chars; yyval = laststring[0]; } break; -case 52: + + case 53: #line 372 "bapascal.y" -{yyval = strtoi(numbertext,numberbase);} + {yyval = strtoi(numbertext,numberbase);} break; -case 56: + + case 57: #line 383 "bapascal.y" -{ + { tab[yyvsp[-2]].obj = type; if (expr[yyvsp[0]].typ == arrays) { tab[yyvsp[-2]].typ = arrays; @@ -1628,9 +1857,10 @@ free_expr(yyvsp[0]); } break; -case 60: + + case 61: #line 407 "bapascal.y" -{ + { if (yyvsp[0] != 0) { if ((tab[yyvsp[0]].obj != type)||(tab[yyvsp[0]].typ == notyp)){ sprintf(pbuf,"Identifier '%s' is not a valid type",lastident); @@ -1652,9 +1882,10 @@ yyval = NO_EXPR; } break; -case 61: + + case 62: #line 432 "bapascal.y" -{ + { int i; TYPES eltyp; int elsize,elref,last; @@ -1695,9 +1926,10 @@ free_expr(yyvsp[0]); } break; -case 64: + + case 65: #line 481 "bapascal.y" -{ + { if (consttype != atab[last_atab].inxtyp) yyerror("Array index type mismatch"); else { @@ -1712,9 +1944,10 @@ yyval = last_atab; } break; -case 65: + + case 66: #line 498 "bapascal.y" -{ + { if (last_atab == AMAX) cfatal("Array table full with %d entries",AMAX); atab[++last_atab].inxtyp = consttype; @@ -1722,13 +1955,15 @@ yyval = last_atab; /* pass the array start up the parse tree */ } break; -case 66: + + case 67: #line 508 "bapascal.y" -{ yyval = last_atab; } + { yyval = last_atab; } break; -case 67: + + case 68: #line 512 "bapascal.y" -{ + { yyval = new_expr(); if (consttype != ints) yyerror("Size of 'string' type must be an integer"); @@ -1741,9 +1976,10 @@ } } break; -case 71: + + case 72: #line 534 "bapascal.y" -{ + { int i,vartyp,varref,varsize,dx = btab[display[level]].vsize; int val; if (yyvsp[0] != NO_EXPR) { @@ -1806,66 +2042,76 @@ free_expr(yyvsp[-1]); free_expr(yyvsp[0]); } break; -case 74: + + case 75: #line 602 "bapascal.y" -{ yyval = yyvsp[0]; } + { yyval = yyvsp[0]; } break; -case 75: + + case 76: #line 606 "bapascal.y" -{ yyval = NO_EXPR; } + { yyval = NO_EXPR; } break; -case 76: + + case 77: #line 608 "bapascal.y" -{ + { yyval = new_expr(); expr[yyval].typ = consttype; expr[yyval].adr = yyvsp[0]; } break; -case 78: + + case 79: #line 619 "bapascal.y" -{ + { if (tab[yyvsp[-2]].mon) emit(EXITMON); emit(EXIT_PROC); leave_block(&level); in_proc_decl = 0; } break; -case 79: + + case 80: #line 626 "bapascal.y" -{ + { if (tab[yyvsp[-2]].mon) emit(EXITMON); emit(EXIT_FCN); leave_block(&level); in_proc_decl = 0; } break; -case 80: + + case 81: #line 635 "bapascal.y" -{ + { tab[yyvsp[-1]].adr = (external? -1 : lc); if (tab[yyvsp[-1]].mon) emit1(ENTERMON,tab[yyvsp[-1]].mon); process_var_inits(level); } break; -case 81: + + case 82: #line 643 "bapascal.y" -{ + { yyval = yyvsp[-1]; tab[yyvsp[-1]].atomic = atomic; } break; -case 82: + + case 83: #line 650 "bapascal.y" -{ atomic = FALSE; } + { atomic = FALSE; } break; -case 83: + + case 84: #line 652 "bapascal.y" -{ atomic = TRUE; } + { atomic = TRUE; } break; -case 85: + + case 86: #line 660 "bapascal.y" -{ int vis_level,real_level; + { int vis_level,real_level; in_proc_decl = 1; if (in_mon_decl) { real_level = level; @@ -1880,24 +2126,27 @@ enter_block(&last_btab,&level,prt); } break; -case 86: + + case 87: #line 677 "bapascal.y" -{ + { tab[yyvsp[-1]].adr = (external? -1 : lc); if (tab[yyvsp[-1]].mon) emit1(ENTERMON,tab[yyvsp[-1]].mon); process_var_inits(level); } break; -case 87: + + case 88: #line 685 "bapascal.y" -{ + { tab[yyvsp[-1]].atomic = atomic; yyval = yyvsp[-1]; } break; -case 88: + + case 89: #line 692 "bapascal.y" -{ TYPES ft = tab[yyvsp[0]].typ; + { TYPES ft = tab[yyvsp[0]].typ; if (tab[yyvsp[0]].obj != type){ sprintf(pbuf,"'%s' is not a valid type",tab[yyvsp[0]].name); yyerror(pbuf); @@ -1907,9 +2156,10 @@ tab[yyvsp[-3]].typ = tab[yyvsp[0]].typ; } break; -case 89: + + case 90: #line 704 "bapascal.y" -{ int vis_level,real_level; + { int vis_level,real_level; in_proc_decl = 1; if (in_mon_decl) { real_level = level; @@ -1924,17 +2174,20 @@ enter_block(&last_btab,&level,prt); } break; -case 90: + + case 91: #line 721 "bapascal.y" -{ btab[display[level]].lastpar = last_tab;} + { btab[display[level]].lastpar = last_tab;} break; -case 91: + + case 92: #line 723 "bapascal.y" -{ btab[display[level]].lastpar = last_tab;} + { btab[display[level]].lastpar = last_tab;} break; -case 97: + + case 98: #line 736 "bapascal.y" -{ int i,dx,dv,j,elem_size,stack_dx; + { int i,dx,dv,j,elem_size,stack_dx; if (tab[yyvsp[0]].obj != type) { sprintf(pbuf,"'%s' is not a valid type",tab[yyvsp[0]].name); yyerror(pbuf); @@ -1956,9 +2209,10 @@ btab[j].vsize = dx + dv; } break; -case 98: + + case 99: #line 760 "bapascal.y" -{ int i,dx,dv,j,elem_size; + { int i,dx,dv,j,elem_size; if (tab[yyvsp[0]].obj != type) { sprintf(pbuf,"'%s' is not a valid type",tab[yyvsp[0]].name); yyerror(pbuf); @@ -1980,9 +2234,10 @@ btab[j].vsize = dx + dv; } break; -case 99: + + case 100: #line 784 "bapascal.y" -{ int i,dx,dv,j,stack_dx; + { int i,dx,dv,j,stack_dx; j = display[level]; stack_dx = 1; /* strings always pass by reference */ dx = btab[j].vsize; @@ -2000,9 +2255,10 @@ btab[j].vsize = dx + dv; } break; -case 100: + + case 101: #line 804 "bapascal.y" -{ + { if (tab[mtab[mon]].obj == monitor) { /* don't do the following for ext_monitor objects */ /* main pgm will CALL_MONINIT, even if no init code */ @@ -2011,9 +2267,10 @@ leave_block(&level); } break; -case 101: + + case 102: #line 815 "bapascal.y" -{ + { if (mon == MAXMON) cfatal("No more than %d monitors can be declared",MAXMON); if (level > 1) { @@ -2030,24 +2287,27 @@ btab[last_btab].lastpar = last_tab; /* no parms */ } break; -case 102: + + case 103: #line 834 "bapascal.y" -{ + { in_mon_decl = 0; /* optional declarations are over */ in_mon_init = 1; /* could have some init code */ } break; -case 103: + + case 104: #line 841 "bapascal.y" -{ + { tab[mtab[mon]].adr = lc; process_var_inits(level); in_mon_init = 0; } break; -case 106: + + case 107: #line 853 "bapascal.y" -{ + { if (in_mon_init) { /* beginning of the mon init code */ tab[mtab[mon]].adr = lc; process_var_inits(level); @@ -2055,65 +2315,80 @@ } } break; -case 110: + + case 111: #line 868 "bapascal.y" -{ yyerrok; } + { yyerrok; } break; -case 111: + + case 112: #line 870 "bapascal.y" -{ yyerrok; } + { yyerrok; } break; -case 117: + + case 118: #line 879 "bapascal.y" -{ code[yyvsp[-1]].y = yyvsp[0]; } + { code[yyvsp[-1]].y = yyvsp[0]; } break; -case 118: + + case 119: #line 881 "bapascal.y" -{ code[yyvsp[-3]].y = yyvsp[-1]; code[yyvsp[-2]].y = lc; } + { code[yyvsp[-3]].y = yyvsp[-1]; code[yyvsp[-2]].y = lc; } break; -case 119: + + case 120: #line 883 "bapascal.y" -{ emit1(JUMP,yyvsp[-3]); code[yyvsp[-2]].y = lc; } + { emit1(JUMP,yyvsp[-3]); code[yyvsp[-2]].y = lc; } break; -case 120: + + case 121: #line 885 "bapascal.y" -{ gen_exprval(yyvsp[0]); emit1(JZER,yyvsp[-3]); free_expr(yyvsp[0]); } + { gen_exprval(yyvsp[0]); emit1(JZER,yyvsp[-3]); free_expr(yyvsp[0]); } break; -case 121: + + case 122: #line 887 "bapascal.y" -{ emit1(ENDFOR,1+yyvsp[-1]); code[yyvsp[-1]].y = lc; } + { emit1(ENDFOR,1+yyvsp[-1]); code[yyvsp[-1]].y = lc; } break; -case 122: + + case 123: #line 889 "bapascal.y" -{ if (level == 1) emit(COEND); in_cobegin = 0; } + { if (level == 1) emit(COEND); in_cobegin = 0; } break; -case 123: + + case 124: #line 893 "bapascal.y" -{ gen_exprval(yyvsp[0]); yyval = lc; emit(JZER); free_expr(yyvsp[0]); } + { gen_exprval(yyvsp[0]); yyval = lc; emit(JZER); free_expr(yyvsp[0]); } break; -case 124: + + case 125: #line 897 "bapascal.y" -{ yyval = lc; } + { yyval = lc; } break; -case 125: + + case 126: #line 901 "bapascal.y" -{ emit(JUMP); yyval = lc; } + { emit(JUMP); yyval = lc; } break; -case 126: + + case 127: #line 905 "bapascal.y" -{ yyval = lc; } + { yyval = lc; } break; -case 127: + + case 128: #line 909 "bapascal.y" -{ gen_exprval(yyvsp[0]); free_expr(yyvsp[0]); yyval = lc; emit(JZER);} + { gen_exprval(yyvsp[0]); free_expr(yyvsp[0]); yyval = lc; emit(JZER);} break; -case 128: + + case 129: #line 913 "bapascal.y" -{ yyval = lc; } + { yyval = lc; } break; -case 129: + + case 130: #line 917 "bapascal.y" -{ + { yyval = yyvsp[0]; if (tab[yyvsp[0]].obj != variable) yyerror("FOR loop index must be a VARIABLE"); @@ -2125,9 +2400,10 @@ yyerror("FOR loop index must be of type INTEGER, BOOLEAN, or CHAR"); } break; -case 130: + + case 131: #line 931 "bapascal.y" -{ + { if (expr[yyvsp[-3]].typ != expr[yyvsp[-1]].typ) yyerror("Type mismatch in FOR loop limits"); gen_exprval(yyvsp[-1]); @@ -2135,18 +2411,20 @@ free_expr(yyvsp[-3]); free_expr(yyvsp[-1]); } break; -case 131: + + case 132: #line 941 "bapascal.y" -{ + { if ((tab[yyvsp[-2]].typ != expr[yyvsp[0]].typ)&&(tab[yyvsp[-2]].typ != notyp)) yyerror("Type mismatch in FOR loop limits"); gen_exprval(yyvsp[0]); yyval = yyvsp[0]; /* pass expr index back to previous rule for type chk*/ } break; -case 132: + + case 133: #line 950 "bapascal.y" -{ + { if (level != 1) yyerror("COBEGIN-COEND block allowed only in main program"); else if (in_cobegin) @@ -2156,9 +2434,10 @@ in_cobegin = 1; } break; -case 133: + + case 134: #line 962 "bapascal.y" -{ + { gen_exprval(yyvsp[0]); if (tab[yyvsp[-1]].typ == expr[yyvsp[0]].typ) { if ((tab[yyvsp[-1]].typ == sems)||(tab[yyvsp[-1]].typ == bsems)|| @@ -2174,9 +2453,10 @@ free_expr(yyvsp[0]); } break; -case 134: + + case 135: #line 978 "bapascal.y" -{ + { gen_exprval(yyvsp[0]); if (expr[yyvsp[-2]].typ == expr[yyvsp[0]].typ) { if ((expr[yyvsp[-2]].typ == sems)||(expr[yyvsp[-2]].typ == bsems)|| @@ -2192,9 +2472,10 @@ free_expr(yyvsp[-2]); free_expr(yyvsp[0]); } break; -case 135: + + case 136: #line 996 "bapascal.y" -{ + { switch (tab[yyvsp[-1]].obj) { case ext_variable: case variable: @@ -2217,9 +2498,10 @@ } /* switch */ } break; -case 136: + + case 137: #line 1021 "bapascal.y" -{ int k; + { int k; if ((tab[yyvsp[-2]].obj == procedure)|| (tab[yyvsp[-2]].obj == ext_procedure)) { if (tab[yyvsp[-2]].lev == -1) { /* std proc unfinished business */ @@ -2253,9 +2535,10 @@ } } break; -case 141: + + case 142: #line 1065 "bapascal.y" -{ + { parmct = ++pfstack[toppfs].pct; if (tab[last_pf].lev == -1) stdproc_parm(last_pf,yyvsp[0],parmct); @@ -2264,28 +2547,27 @@ free_expr(yyvsp[0]); } break; -case 142: + + case 143: #line 1074 "bapascal.y" -{ int tmp = store_string(laststring,&stab_size); + { int tmp = store_string(laststring,&stab_size); if ((tab[last_pf].lev == -1)&& ((tab[last_pf].adr == SP_WRITE)|| (tab[last_pf].adr == SP_WRITELN))){ emit1(WRITE_RAWSTRING,tmp); } - else if (first_stringerr){ - yyerror("RAW STRING parameter not allowed"); - first_stringerr = 0; - } parmct++; } break; -case 143: -#line 1089 "bapascal.y" -{ yyval = last_pfv = yyvsp[0]; } + + case 144: +#line 1085 "bapascal.y" + { yyval = last_pfv = yyvsp[0]; } break; -case 144: -#line 1093 "bapascal.y" -{ + + case 145: +#line 1089 "bapascal.y" + { if ((tab[last_pfv].obj == procedure)|| (tab[last_pfv].obj == ext_procedure)){ if ((++toppfs) > 0){ @@ -2296,7 +2578,7 @@ else{ pfstack[toppfs].tix = last_pf = last_pfv; pfstack[toppfs].pct = parmct = 0; - first_stringerr = first_parmcterr = 1; + first_parmcterr = 1; if (tab[last_pf].lev != -1){ /* regular proc call */ if ((tab[last_pf].mon)&&(tab[prt].mon)&& (tab[last_pf].mon != tab[prt].mon)) @@ -2310,9 +2592,10 @@ } } break; -case 150: -#line 1127 "bapascal.y" -{ + + case 151: +#line 1123 "bapascal.y" + { yyval = new_expr(); expr[yyval].obj = function; expr[yyval].typ = ints; @@ -2337,13 +2620,15 @@ free_expr(yyvsp[-3]); free_expr(yyvsp[-1]); } break; -case 151: -#line 1154 "bapascal.y" -{ yyval = yyvsp[0]; } - break; -case 152: -#line 1156 "bapascal.y" -{ + + case 152: +#line 1150 "bapascal.y" + { yyval = yyvsp[0]; } + break; + + case 153: +#line 1152 "bapascal.y" + { if (expr[yyvsp[0]].typ == strings) { /* left parm is a string. If it's not an array elt, */ /* put the address of the string n the stack */ @@ -2355,9 +2640,10 @@ yyval = yyvsp[0]; } break; -case 153: -#line 1170 "bapascal.y" -{ + + case 154: +#line 1166 "bapascal.y" + { if (expr[yyvsp[0]].typ == rawstrings) /* raw str message */ emit1(BROADCAST_RAWSTRING,expr[yyvsp[0]].adr); else if (expr[yyvsp[0]].typ == strings) /* msg is a string var */ @@ -2369,9 +2655,10 @@ free_expr(yyvsp[0]); } break; -case 154: -#line 1184 "bapascal.y" -{ + + case 155: +#line 1180 "bapascal.y" + { if (expr[yyvsp[-1]].typ != strings) yyerror("left parameter is not of type 'string'"); yyval = NO_EXPR; /* for free_expr() call up the parse tree */ @@ -2382,9 +2669,10 @@ free_expr(yyvsp[-1]); free_expr(yyvsp[0]); } break; -case 155: -#line 1197 "bapascal.y" -{ + + case 156: +#line 1193 "bapascal.y" + { if (expr[yyvsp[-1]].typ != strings) { yyerror("right parameter is not of type 'string'"); } @@ -2396,13 +2684,15 @@ } } break; -case 156: -#line 1209 "bapascal.y" -{ yyval = yyvsp[-1]; } + + case 157: +#line 1205 "bapascal.y" + { yyval = yyvsp[-1]; } break; -case 157: -#line 1213 "bapascal.y" -{ + + case 158: +#line 1209 "bapascal.y" + { yyval = new_expr(); expr[yyval].obj = variable; expr[yyval].typ = rawstrings; @@ -2412,9 +2702,10 @@ expr[yyval].tix = -1; } break; -case 158: -#line 1226 "bapascal.y" -{ + + case 159: +#line 1222 "bapascal.y" + { if (expr[yyvsp[-1]].typ != strings) yyerror("left parameter is not of type 'string'"); yyval = NO_EXPR; /* for free_expr() call up the parse tree */ @@ -2425,17 +2716,19 @@ free_expr(yyvsp[-1]); free_expr(yyvsp[0]); } break; -case 159: -#line 1239 "bapascal.y" -{ + + case 160: +#line 1235 "bapascal.y" + { /* push the parm count for interp's SPRINTF_OP to use */ emit1(PUSH_LIT,sprintf_cnt); emit1(SPRINTF_OP,yyvsp[-3]); } break; -case 160: -#line 1247 "bapascal.y" -{ + + case 161: +#line 1243 "bapascal.y" + { if (expr[yyvsp[-2]].typ != strings) yyerror("Leftmost sprintf parameter must be of type 'string'"); yyval = expr[yyvsp[0]].adr; /* pass raw string index up the tree */ @@ -2444,9 +2737,10 @@ sprintf_cnt = 0; } break; -case 161: -#line 1258 "bapascal.y" -{ + + case 162: +#line 1254 "bapascal.y" + { if ((expr[yyvsp[0]].typ != ints)&&(expr[yyvsp[0]].typ != strings)) yyerror( "sprintf parameter must be either of type 'int' or type 'string'"); @@ -2458,9 +2752,10 @@ free_expr(yyvsp[0]); } break; -case 162: -#line 1270 "bapascal.y" -{ + + case 163: +#line 1266 "bapascal.y" + { if ((expr[yyvsp[0]].typ != ints)&&(expr[yyvsp[0]].typ != strings)) yyerror( "sprintf parameter must be either of type 'int' or type 'string'"); @@ -2472,9 +2767,10 @@ free_expr(yyvsp[0]); } break; -case 164: -#line 1285 "bapascal.y" -{ + + case 165: +#line 1281 "bapascal.y" + { gen_exprval(yyvsp[0]); if (expr[yyvsp[-2]].typ == expr[yyvsp[0]].typ){ if ((expr[yyvsp[-2]].typ == ints)||(expr[yyvsp[-2]].typ == bools)|| @@ -2489,33 +2785,40 @@ free_expr(yyvsp[0]); } break; -case 165: + + case 166: +#line 1297 "bapascal.y" + { yyval = TEST_EQ; } + break; + + case 167: +#line 1298 "bapascal.y" + { yyval = TEST_LT; } + break; + + case 168: +#line 1299 "bapascal.y" + { yyval = TEST_GT; } + break; + + case 169: +#line 1300 "bapascal.y" + { yyval = TEST_LE; } + break; + + case 170: #line 1301 "bapascal.y" -{ yyval = TEST_EQ; } + { yyval = TEST_GE; } break; -case 166: + + case 171: #line 1302 "bapascal.y" -{ yyval = TEST_LT; } + { yyval = TEST_NE; } break; -case 167: -#line 1303 "bapascal.y" -{ yyval = TEST_GT; } - break; -case 168: -#line 1304 "bapascal.y" -{ yyval = TEST_LE; } - break; -case 169: -#line 1305 "bapascal.y" -{ yyval = TEST_GE; } - break; -case 170: -#line 1306 "bapascal.y" -{ yyval = TEST_NE; } - break; -case 172: -#line 1311 "bapascal.y" -{ + + case 173: +#line 1307 "bapascal.y" + { yyval = yyvsp[0]; gen_exprval(yyval); if ((expr[yyval].typ != ints)&&(expr[yyval].typ != notyp)){ @@ -2524,9 +2827,10 @@ } } break; -case 173: -#line 1320 "bapascal.y" -{ + + case 174: +#line 1316 "bapascal.y" + { yyval = yyvsp[0]; gen_exprval(yyval); if ((expr[yyval].typ != ints)&&(expr[yyval].typ != notyp)){ @@ -2537,9 +2841,10 @@ emit(NEGATE); } break; -case 174: -#line 1331 "bapascal.y" -{ + + case 175: +#line 1327 "bapascal.y" + { gen_exprval(yyvsp[0]); switch (yyvsp[-1]) { case DO_OR: @@ -2560,25 +2865,30 @@ free_expr(yyvsp[0]); } break; -case 175: + + case 176: +#line 1350 "bapascal.y" + { gen_exprval(yyvsp[0]); } + break; + + case 177: +#line 1353 "bapascal.y" + { yyval = DO_ADD; } + break; + + case 178: #line 1354 "bapascal.y" -{ gen_exprval(yyvsp[0]); } + { yyval = DO_SUB; } break; -case 176: -#line 1357 "bapascal.y" -{ yyval = DO_ADD; } - break; -case 177: -#line 1358 "bapascal.y" -{ yyval = DO_SUB; } - break; -case 178: -#line 1359 "bapascal.y" -{ yyval = DO_OR; } + + case 179: +#line 1355 "bapascal.y" + { yyval = DO_OR; } break; -case 180: -#line 1364 "bapascal.y" -{ + + case 181: +#line 1360 "bapascal.y" + { gen_exprval(yyvsp[0]); switch(yyvsp[-1]) { case DO_AND: @@ -2603,29 +2913,35 @@ free_expr(yyvsp[0]); } break; -case 181: + + case 182: +#line 1387 "bapascal.y" + { gen_exprval(yyvsp[0]); } + break; + + case 183: +#line 1390 "bapascal.y" + { yyval = DO_MUL; } + break; + + case 184: #line 1391 "bapascal.y" -{ gen_exprval(yyvsp[0]); } + { yyval = DO_DIV; } break; -case 182: -#line 1394 "bapascal.y" -{ yyval = DO_MUL; } - break; -case 183: -#line 1395 "bapascal.y" -{ yyval = DO_DIV; } - break; -case 184: -#line 1396 "bapascal.y" -{ yyval = DO_MOD; } - break; -case 185: -#line 1397 "bapascal.y" -{ yyval = DO_AND; } + + case 185: +#line 1392 "bapascal.y" + { yyval = DO_MOD; } break; -case 187: -#line 1402 "bapascal.y" -{ + + case 186: +#line 1393 "bapascal.y" + { yyval = DO_AND; } + break; + + case 188: +#line 1398 "bapascal.y" + { yyval = new_expr(); expr[yyval].obj = constant; expr[yyval].adr = yyvsp[0]; @@ -2633,9 +2949,10 @@ expr[yyval].lev = level; } break; -case 188: -#line 1410 "bapascal.y" -{ + + case 189: +#line 1406 "bapascal.y" + { yyval = new_expr(); expr[yyval].obj = constant; expr[yyval].adr = laststring[0]; @@ -2643,13 +2960,15 @@ expr[yyval].lev = level; } break; -case 189: -#line 1417 "bapascal.y" -{ yyval = yyvsp[-1];} + + case 190: +#line 1413 "bapascal.y" + { yyval = yyvsp[-1];} break; -case 190: -#line 1419 "bapascal.y" -{ + + case 191: +#line 1415 "bapascal.y" + { yyval = yyvsp[0]; gen_exprval(yyval); if (expr[yyval].typ == bools) @@ -2660,9 +2979,10 @@ } } break; -case 191: -#line 1432 "bapascal.y" -{ int k; + + case 192: +#line 1428 "bapascal.y" + { int k; yyval = new_expr(); expr[yyval].obj = tab[yyvsp[-2]].obj; expr[yyval].typ = tab[yyvsp[-2]].typ; @@ -2712,9 +3032,10 @@ } } break; -case 195: -#line 1487 "bapascal.y" -{ + + case 196: +#line 1483 "bapascal.y" + { if ((tab[last_pfv].obj == function)|| (tab[last_pfv].obj == ext_function)) { if ((++toppfs) == MAXPFNEST) @@ -2722,7 +3043,7 @@ else{ /* legal func call */ pfstack[toppfs].tix = last_pf = last_pfv; pfstack[toppfs].pct = parmct = 0; - first_stringerr = first_parmcterr = 1; + first_parmcterr = 1; if (tab[last_pf].lev != -1){ /* regular proc call */ if ((tab[last_pf].mon)&&(tab[prt].mon)&& (tab[last_pf].mon != tab[prt].mon)) @@ -2733,9 +3054,10 @@ } /* if func */ } break; -case 200: -#line 1514 "bapascal.y" -{ + + case 201: +#line 1510 "bapascal.y" + { if (expr[yyvsp[-1]].typ != strings) yyerror("left parameter is not of type 'string'"); yyval = new_expr(); @@ -2752,9 +3074,10 @@ free_expr(yyvsp[0]); } break; -case 201: -#line 1533 "bapascal.y" -{ + + case 202: +#line 1529 "bapascal.y" + { yyval = new_expr(); expr[yyval].obj = function; expr[yyval].typ = ints; @@ -2771,9 +3094,10 @@ free_expr(yyvsp[0]); } break; -case 202: -#line 1552 "bapascal.y" -{ + + case 203: +#line 1548 "bapascal.y" + { if (expr[yyvsp[-1]].typ == strings) { if (!expr[yyvsp[-1]].arelt) /* addr of array ref is already on the stack */ @@ -2784,9 +3108,10 @@ /* parent rule will free_expr($2) */ } break; -case 203: -#line 1563 "bapascal.y" -{ + + case 204: +#line 1559 "bapascal.y" + { yyval = new_expr(); expr[yyval].obj = variable; expr[yyval].typ = rawstrings; @@ -2796,9 +3121,10 @@ expr[yyval].tix = -1; } break; -case 204: -#line 1575 "bapascal.y" -{ + + case 205: +#line 1571 "bapascal.y" + { if (expr[yyvsp[-1]].typ != strings) yyerror("Left parameter must be of type 'string'"); emit(RECEIVE_OP); @@ -2812,9 +3138,10 @@ expr[yyval].adr = expr[yyval].lev = -1; } break; -case 205: -#line 1589 "bapascal.y" -{ + + case 206: +#line 1585 "bapascal.y" + { if (expr[yyvsp[-3]].typ != strings) yyerror("Left parameter must be of type 'string'"); /* implements receive(string,int&) call */ @@ -2837,9 +3164,10 @@ expr[yyval].adr = expr[yyval].lev = -1; } break; -case 206: -#line 1614 "bapascal.y" -{ + + case 207: +#line 1610 "bapascal.y" + { yyval = new_expr(); expr[yyval].obj = function; expr[yyval].typ = ints; @@ -2852,9 +3180,10 @@ emit1(SSCANF_OP,yyvsp[-3]); } break; -case 207: -#line 1629 "bapascal.y" -{ + + case 208: +#line 1625 "bapascal.y" + { if (expr[yyvsp[-2]].typ != strings) yyerror("Leftmost sscanf parameter must be of type 'string'"); yyval = expr[yyvsp[0]].adr; /* pass rawstring index up the tree */ @@ -2863,9 +3192,10 @@ sscanf_cnt = 0; } break; -case 208: -#line 1640 "bapascal.y" -{ + + case 209: +#line 1636 "bapascal.y" + { if ((expr[yyvsp[0]].typ != ints)&&(expr[yyvsp[0]].typ != strings)) yyerror( "sscanf parameter must be either of type 'int' or type 'string'"); @@ -2874,9 +3204,10 @@ free_expr(yyvsp[0]); } break; -case 209: -#line 1649 "bapascal.y" -{ + + case 210: +#line 1645 "bapascal.y" + { if ((expr[yyvsp[0]].typ != ints)&&(expr[yyvsp[0]].typ != strings)) yyerror( "sscanf parameter must be either of type 'int' or type 'string'"); @@ -2885,9 +3216,10 @@ free_expr(yyvsp[0]); } break; -case 210: -#line 1660 "bapascal.y" -{ + + case 211: +#line 1656 "bapascal.y" + { expr[yyvsp[-3]].ref = sizeof(int)*atab[last_aref].elsize; expr[yyvsp[-3]].arelt = 1; expr[yyvsp[-3]].typ = last_eltyp; @@ -2898,9 +3230,10 @@ } } break; -case 211: -#line 1673 "bapascal.y" -{ + + case 212: +#line 1669 "bapascal.y" + { if (tab[yyvsp[0]].typ != arrays) { sprintf(pbuf,"'%s' is not of type ARRAY",tab[yyvsp[0]].name); yyerror(pbuf); @@ -2929,9 +3262,10 @@ expr[yyval].normal = tab[yyvsp[0]].normal; } break; -case 212: -#line 1704 "bapascal.y" -{ + + case 213: +#line 1700 "bapascal.y" + { gen_exprval(yyvsp[0]); last_aref = arstack[topars].aref; last_eltyp = arstack[topars].eltyp; @@ -2941,9 +3275,10 @@ free_expr(yyvsp[0]); } break; -case 213: -#line 1714 "bapascal.y" -{ + + case 214: +#line 1710 "bapascal.y" + { gen_exprval(yyvsp[0]); last_aref = arstack[topars].aref; last_eltyp = arstack[topars].eltyp; @@ -2953,47 +3288,39 @@ free_expr(yyvsp[0]); } break; -case 214: -#line 1726 "bapascal.y" -{ + + case 215: +#line 1722 "bapascal.y" + { expr[yyvsp[-1]].typ = ints; yyval = yyvsp[-1]; } break; -case 215: -#line 1733 "bapascal.y" -{ yyval = loc(lastident,level); } + + case 216: +#line 1729 "bapascal.y" + { yyval = loc(lastident,level); } break; -case 216: -#line 1737 "bapascal.y" -{ yyval = enter(lastident,constant,level,level); } + + case 217: +#line 1733 "bapascal.y" + { yyval = enter(lastident,constant,level,level); } break; -} -#line 705 "/usr/share/bison/bison.simple" + } + +/* Line 991 of yacc.c. */ +#line 3314 "y.tab.c" yyvsp -= yylen; yyssp -= yylen; -#if YYLSP_NEEDED - yylsp -= yylen; -#endif -#if YYDEBUG - if (yydebug) - { - short *yyssp1 = yyss - 1; - YYFPRINTF (stderr, "state stack now"); - while (yyssp1 != yyssp) - YYFPRINTF (stderr, " %d", *++yyssp1); - YYFPRINTF (stderr, "\n"); - } -#endif + + YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; -#if YYLSP_NEEDED - *++yylsp = yyloc; -#endif + /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule @@ -3001,11 +3328,11 @@ yyn = yyr1[yyn]; - yystate = yypgoto[yyn - YYNTBASE] + *yyssp; - if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; + if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else - yystate = yydefgoto[yyn - YYNTBASE]; + yystate = yydefgoto[yyn - YYNTOKENS]; goto yynewstate; @@ -3018,13 +3345,13 @@ if (!yyerrstatus) { ++yynerrs; - -#ifdef YYERROR_VERBOSE +#if YYERROR_VERBOSE yyn = yypact[yystate]; - if (yyn > YYFLAG && yyn < YYLAST) + if (YYPACT_NINF < yyn && yyn < YYLAST) { YYSIZE_T yysize = 0; + int yytype = YYTRANSLATE (yychar); char *yymsg; int yyx, yycount; @@ -3033,15 +3360,15 @@ YYCHECK. */ for (yyx = yyn < 0 ? -yyn : 0; yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) - if (yycheck[yyx + yyn] == yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) yysize += yystrlen (yytname[yyx]) + 15, yycount++; - yysize += yystrlen ("parse error, unexpected ") + 1; - yysize += yystrlen (yytname[YYTRANSLATE (yychar)]); + yysize += yystrlen ("syntax error, unexpected ") + 1; + yysize += yystrlen (yytname[yytype]); yymsg = (char *) YYSTACK_ALLOC (yysize); if (yymsg != 0) { - char *yyp = yystpcpy (yymsg, "parse error, unexpected "); - yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]); + char *yyp = yystpcpy (yymsg, "syntax error, unexpected "); + yyp = yystpcpy (yyp, yytname[yytype]); if (yycount < 5) { @@ -3049,7 +3376,7 @@ for (yyx = yyn < 0 ? -yyn : 0; yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) - if (yycheck[yyx + yyn] == yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) { const char *yyq = ! yycount ? ", expecting " : " or "; yyp = yystpcpy (yyp, yyq); @@ -3061,102 +3388,93 @@ YYSTACK_FREE (yymsg); } else - yyerror ("parse error; also virtual memory exhausted"); + yyerror ("syntax error; also virtual memory exhausted"); } else -#endif /* defined (YYERROR_VERBOSE) */ - yyerror ("parse error"); +#endif /* YYERROR_VERBOSE */ + yyerror ("syntax error"); } - goto yyerrlab1; -/*--------------------------------------------------. -| yyerrlab1 -- error raised explicitly by an action | -`--------------------------------------------------*/ -yyerrlab1: + if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ - /* return failure if at end of input */ + /* Return failure if at end of input. */ if (yychar == YYEOF) - YYABORT; - YYDPRINTF ((stderr, "Discarding token %d (%s).\n", - yychar, yytname[yychar1])); + { + /* Pop the error token. */ + YYPOPSTACK; + /* Pop the rest of the stack. */ + while (yyss < yyssp) + { + YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); + yydestruct (yystos[*yyssp], yyvsp); + YYPOPSTACK; + } + YYABORT; + } + + YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc); + yydestruct (yytoken, &yylval); yychar = YYEMPTY; + } /* Else will try to reuse lookahead token after shifting the error token. */ + goto yyerrlab2; - yyerrstatus = 3; /* Each real token shifted decrements this */ - goto yyerrhandle; +/*----------------------------------------------------. +| yyerrlab1 -- error raised explicitly by an action. | +`----------------------------------------------------*/ +yyerrlab1: + /* Suppress GCC warning that yyerrlab1 is unused when no action + invokes YYERROR. */ +#if defined (__GNUC_MINOR__) && 2093 <= (__GNUC__ * 1000 + __GNUC_MINOR__) \ + && !defined __cplusplus + __attribute__ ((__unused__)) +#endif -/*-------------------------------------------------------------------. -| yyerrdefault -- current state does not do anything special for the | -| error token. | -`-------------------------------------------------------------------*/ -yyerrdefault: -#if 0 - /* This is wrong; only states that explicitly want error tokens - should shift them. */ - /* If its default is to accept any token, ok. Otherwise pop it. */ - yyn = yydefact[yystate]; - if (yyn) - goto yydefault; -#endif + goto yyerrlab2; /*---------------------------------------------------------------. -| yyerrpop -- pop the current state because it cannot handle the | -| error token | +| yyerrlab2 -- pop states until the error token can be shifted. | `---------------------------------------------------------------*/ -yyerrpop: - if (yyssp == yyss) - YYABORT; - yyvsp--; - yystate = *--yyssp; -#if YYLSP_NEEDED - yylsp--; -#endif +yyerrlab2: + yyerrstatus = 3; /* Each real token shifted decrements this. */ -#if YYDEBUG - if (yydebug) + for (;;) { - short *yyssp1 = yyss - 1; - YYFPRINTF (stderr, "Error: state stack now"); - while (yyssp1 != yyssp) - YYFPRINTF (stderr, " %d", *++yyssp1); - YYFPRINTF (stderr, "\n"); - } -#endif + yyn = yypact[yystate]; + if (yyn != YYPACT_NINF) + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } -/*--------------. -| yyerrhandle. | -`--------------*/ -yyerrhandle: - yyn = yypact[yystate]; - if (yyn == YYFLAG) - goto yyerrdefault; + /* Pop the current state because it cannot handle the error token. */ + if (yyssp == yyss) + YYABORT; - yyn += YYTERROR; - if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) - goto yyerrdefault; + YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); + yydestruct (yystos[yystate], yyvsp); + yyvsp--; + yystate = *--yyssp; - yyn = yytable[yyn]; - if (yyn < 0) - { - if (yyn == YYFLAG) - goto yyerrpop; - yyn = -yyn; - goto yyreduce; + YY_STACK_PRINT (yyss, yyssp); } - else if (yyn == 0) - goto yyerrpop; if (yyn == YYFINAL) YYACCEPT; @@ -3164,9 +3482,7 @@ YYDPRINTF ((stderr, "Shifting error token, ")); *++yyvsp = yylval; -#if YYLSP_NEEDED - *++yylsp = yylloc; -#endif + yystate = yyn; goto yynewstate; @@ -3186,13 +3502,15 @@ yyresult = 1; goto yyreturn; -/*---------------------------------------------. -| yyoverflowab -- parser overflow comes here. | -`---------------------------------------------*/ +#ifndef yyoverflow +/*----------------------------------------------. +| yyoverflowlab -- parser overflow comes here. | +`----------------------------------------------*/ yyoverflowlab: yyerror ("parser stack overflow"); yyresult = 2; /* Fall through. */ +#endif yyreturn: #ifndef yyoverflow @@ -3201,7 +3519,9 @@ #endif return yyresult; } -#line 1741 "bapascal.y" + + +#line 1737 "bapascal.y" /*start of routines*/ void process_var_inits(int levl) @@ -3237,6 +3557,9 @@ /* * * $Log$ + * Revision 2.17 2005/10/27 12:58:24 bynum + * remove first_stringerr, correct minor errors + * * Revision 2.16 2003/05/13 14:01:23 bynum * add boolean initializers, fix proc nesting * @@ -3345,3 +3668,4 @@ * * */ + diff -ur bacisrc.old/pascomp/lex.c bacisrc/pascomp/lex.c --- bacisrc.old/pascomp/lex.c 2004-04-15 13:31:24.000000000 +0200 +++ bacisrc/pascomp/lex.c 2005-10-27 15:02:05.000000000 +0200 @@ -9,9 +9,6 @@ #define YY_FLEX_MINOR_VERSION 5 #include -#if !defined(DOS) -#include -#endif /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ @@ -25,6 +22,9 @@ #ifdef __cplusplus #include +#if !defined(DOS) +#include +#endif /* Use prototypes in function declarations. */ #define YY_USE_PROTOS @@ -714,7 +714,7 @@ YY_DECL { register yy_state_type yy_current_state; - register char *yy_cp = NULL, *yy_bp = NULL; + register char *yy_cp, *yy_bp; register int yy_act; #line 91 "bapascal.l" @@ -1600,7 +1600,6 @@ #endif /* ifndef YY_NO_UNPUT */ -#ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput() #else @@ -1672,7 +1671,7 @@ return c; } -#endif /* YY_NO_INPUT */ + #ifdef YY_USE_PROTOS void yyrestart( FILE *input_file ) @@ -1783,6 +1782,11 @@ } +#ifndef YY_ALWAYS_INTERACTIVE +#ifndef YY_NEVER_INTERACTIVE +extern int isatty YY_PROTO(( int )); +#endif +#endif #ifdef YY_USE_PROTOS void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) @@ -2251,7 +2255,7 @@ } } while (reading); } - return ((esc < 256) ? esc : 0x20); + return esc; } void get_string(char termch) @@ -2300,6 +2304,9 @@ /* * * $Log$ + * Revision 2.11 2005/10/27 12:56:33 bynum + * remove extraneous test in get_escape + * * Revision 2.10 2004/04/13 15:43:15 bynum * add \r case to get rid of errors when readin MS-DOS/WIN prepared source * diff -ur bacisrc.old/pascomp/ytab.h bacisrc/pascomp/ytab.h --- bacisrc.old/pascomp/ytab.h 2004-04-15 13:31:24.000000000 +0200 +++ bacisrc/pascomp/ytab.h 2005-10-27 15:02:05.000000000 +0200 @@ -1,65 +1,154 @@ -#ifndef BISON_Y_TAB_H -# define BISON_Y_TAB_H +/* A Bison parser, made by GNU Bison 1.875. */ -# ifndef YYSTYPE -# define YYSTYPE int -# define YYSTYPE_IS_TRIVIAL 1 -# endif -# define UNSIGNED_INT 257 -# define STRING 258 -# define RAWSTRING 259 -# define STRINGCONCAT 260 -# define STRINGCOMPARE 261 -# define STRINGCOPY 262 -# define STRINGLENGTH 263 -# define SSCANF 264 -# define SPRINTF 265 -# define IDENTIFIER 266 -# define CHAR 267 -# define INT 268 -# define NE 269 -# define LE 270 -# define GE 271 -# define BECOMES 272 -# define DIV 273 -# define MOD 274 -# define OR 275 -# define AND 276 -# define NOT 277 -# define DOTDOT 278 -# define IF 279 -# define THEN 280 -# define ELSE 281 -# define CASE 282 -# define OF 283 -# define REPEAT 284 -# define UNTIL 285 -# define WHILE 286 -# define DO 287 -# define FOR 288 -# define TO 289 -# define CBEGIN 290 -# define SBEGIN 291 -# define END 292 -# define CEND 293 -# define CONST 294 -# define VAR 295 -# define TYPE 296 -# define ARRAY 297 -# define FUNCTION 298 -# define MONITOR 299 -# define PROCEDURE 300 -# define PROGRAM 301 -# define INCLUDE 302 -# define ATOMIC 303 -# define FNSTRING 304 -# define SEND 305 -# define RECEIVE 306 -# define BROADCAST 307 -# define EXTERNAL 308 -# define LOWER_THAN_ELSE 309 +/* Skeleton parser for Yacc-like parsing with Bison, + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 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 2, 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, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* As a special exception, when this file is copied by Bison into a + Bison output file, you may use that output file without restriction. + This special exception was added by the Free Software Foundation + in version 1.24 of Bison. */ + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + UNSIGNED_INT = 258, + STRING = 259, + RAWSTRING = 260, + STRINGCONCAT = 261, + STRINGCOMPARE = 262, + STRINGCOPY = 263, + STRINGLENGTH = 264, + SSCANF = 265, + SPRINTF = 266, + IDENTIFIER = 267, + CHAR = 268, + INT = 269, + NE = 270, + LE = 271, + GE = 272, + BECOMES = 273, + DIV = 274, + MOD = 275, + OR = 276, + AND = 277, + NOT = 278, + DOTDOT = 279, + IF = 280, + THEN = 281, + ELSE = 282, + CASE = 283, + OF = 284, + REPEAT = 285, + UNTIL = 286, + WHILE = 287, + DO = 288, + FOR = 289, + TO = 290, + CBEGIN = 291, + SBEGIN = 292, + END = 293, + CEND = 294, + CONST = 295, + VAR = 296, + TYPE = 297, + ARRAY = 298, + FUNCTION = 299, + MONITOR = 300, + PROCEDURE = 301, + PROGRAM = 302, + INCLUDE = 303, + ATOMIC = 304, + FNSTRING = 305, + SEND = 306, + RECEIVE = 307, + BROADCAST = 308, + EXTERNAL = 309, + LOWER_THAN_ELSE = 310 + }; +#endif +#define UNSIGNED_INT 258 +#define STRING 259 +#define RAWSTRING 260 +#define STRINGCONCAT 261 +#define STRINGCOMPARE 262 +#define STRINGCOPY 263 +#define STRINGLENGTH 264 +#define SSCANF 265 +#define SPRINTF 266 +#define IDENTIFIER 267 +#define CHAR 268 +#define INT 269 +#define NE 270 +#define LE 271 +#define GE 272 +#define BECOMES 273 +#define DIV 274 +#define MOD 275 +#define OR 276 +#define AND 277 +#define NOT 278 +#define DOTDOT 279 +#define IF 280 +#define THEN 281 +#define ELSE 282 +#define CASE 283 +#define OF 284 +#define REPEAT 285 +#define UNTIL 286 +#define WHILE 287 +#define DO 288 +#define FOR 289 +#define TO 290 +#define CBEGIN 291 +#define SBEGIN 292 +#define END 293 +#define CEND 294 +#define CONST 295 +#define VAR 296 +#define TYPE 297 +#define ARRAY 298 +#define FUNCTION 299 +#define MONITOR 300 +#define PROCEDURE 301 +#define PROGRAM 302 +#define INCLUDE 303 +#define ATOMIC 304 +#define FNSTRING 305 +#define SEND 306 +#define RECEIVE 307 +#define BROADCAST 308 +#define EXTERNAL 309 +#define LOWER_THAN_ELSE 310 + + + + +#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) +typedef int YYSTYPE; +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 +# define YYSTYPE_IS_TRIVIAL 1 +#endif extern YYSTYPE yylval; -#endif /* not BISON_Y_TAB_H */ + +