/* A Bison parser, made by GNU Bison 1.875c. */ /* Skeleton parser for Yacc-like parsing with Bison, Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 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. */ /* 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 { NOMBRE = 258, PLUS = 259, SUB = 260, POINTV = 261, MULT = 262, PARO = 263, PARF = 264, ID = 265, EGAL = 266, ACCO = 267, ACCF = 268, EOF = 269, COMP = 270, SUP = 271, INF = 272, DIFF = 273, LE = 274, GE = 275, ET = 276, OU = 277, NON = 278, VIRGULE = 279, DECL = 280, PAR = 281, CROO = 282, CROF = 283, DEBUT = 284, FIN = 285, PROGRAMME = 286, ENTIER = 287, CAR = 288, BOOLEEN = 289, REEL = 290, TYPE = 291, TABLEAU = 292, DE = 293, VAR = 294, EXIT = 295, RETOURNE = 296, SI = 297, ALORS = 298, SINON = 299, FINSI = 300, SELONQUE = 301, CAS = 302, AUTREMENT = 303, FINSELONQUE = 304, TANTQUE = 305, FAIRE = 306, FINTANTQUE = 307, POUR = 308, ALLANT = 309, A = 310, PAS = 311, FINPOUR = 312, REPETER = 313, JUSQUA = 314, FINREPETER = 315, PROCEDURE = 316, FINPROCEDURE = 317, FONCTION = 318, FINFONCTION = 319, VAL = 320, REF = 321, ENREG = 322, FINENREG = 323, ALLOUER = 324, DESALLOUER = 325, DEUXPOINTS = 326, POINTPOINT = 327, CARACTERE = 328, STRING = 329, DIV = 330, MOD = 331, DEREF = 332, POINT = 333, NUL = 334, VRAI = 335, FAUX = 336 }; #endif #define NOMBRE 258 #define PLUS 259 #define SUB 260 #define POINTV 261 #define MULT 262 #define PARO 263 #define PARF 264 #define ID 265 #define EGAL 266 #define ACCO 267 #define ACCF 268 #define EOF 269 #define COMP 270 #define SUP 271 #define INF 272 #define DIFF 273 #define LE 274 #define GE 275 #define ET 276 #define OU 277 #define NON 278 #define VIRGULE 279 #define DECL 280 #define PAR 281 #define CROO 282 #define CROF 283 #define DEBUT 284 #define FIN 285 #define PROGRAMME 286 #define ENTIER 287 #define CAR 288 #define BOOLEEN 289 #define REEL 290 #define TYPE 291 #define TABLEAU 292 #define DE 293 #define VAR 294 #define EXIT 295 #define RETOURNE 296 #define SI 297 #define ALORS 298 #define SINON 299 #define FINSI 300 #define SELONQUE 301 #define CAS 302 #define AUTREMENT 303 #define FINSELONQUE 304 #define TANTQUE 305 #define FAIRE 306 #define FINTANTQUE 307 #define POUR 308 #define ALLANT 309 #define A 310 #define PAS 311 #define FINPOUR 312 #define REPETER 313 #define JUSQUA 314 #define FINREPETER 315 #define PROCEDURE 316 #define FINPROCEDURE 317 #define FONCTION 318 #define FINFONCTION 319 #define VAL 320 #define REF 321 #define ENREG 322 #define FINENREG 323 #define ALLOUER 324 #define DESALLOUER 325 #define DEUXPOINTS 326 #define POINTPOINT 327 #define CARACTERE 328 #define STRING 329 #define DIV 330 #define MOD 331 #define DEREF 332 #define POINT 333 #define NUL 334 #define VRAI 335 #define FAUX 336 /* Copy the first part of user declarations. */ #line 2 "Exalgov3a.y" #define YYSTYPE int #include #include #include "symtab.c" #define refparam 1 #define structtab 5 #define varcont 3 int indent = 0, ligne=1, puissance, refflags, flagstack[10], depth=0, errors=0; char *VarIndex, tampon[80], *pointertype=0, *referredtype=0, *structuretype=0; struct Tab *proc; void printparams(struct Tab *p,int n, int typ, char *add) {char spec[80]; if (n>1) {printparams(p->prec,n-1,typ, add);strcat(tampon,", ");} sprintf(spec,"%s %s%s",typ==1||typ==2?"int":typ==3?"double":(char*)typ,add,p->id); strcat(tampon,spec); } void printvars(struct Tab *p, int n) { /*printf("a list of %i variable names;\n",n);*/ if (n>1) {printvars(p->prec,n-1);printf(", ");} printf("%s",p->id); } /* Enabling traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #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 278 "Exalgov3a.tab.c" #if ! defined (yyoverflow) || YYERROR_VERBOSE # ifndef YYFREE # define YYFREE free # endif # ifndef YYMALLOC # define YYMALLOC malloc # endif /* The parser invokes alloca or malloc; define the necessary symbols. */ # ifdef YYSTACK_USE_ALLOCA # if YYSTACK_USE_ALLOCA # define YYSTACK_ALLOC alloca # endif # else # if defined (alloca) || defined (_ALLOCA_H) # define YYSTACK_ALLOC alloca # else # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca # 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 YYMALLOC # define YYSTACK_FREE YYFREE # endif #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ #if (! defined (yyoverflow) \ && (! defined (__cplusplus) \ || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { 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 defined (__GNUC__) && 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 4 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 392 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 82 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 114 /* YYNRULES -- Number of rules. */ #define YYNRULES 202 /* YYNRULES -- Number of states. */ #define YYNSTATES 317 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 336 #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, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81 }; #if YYDEBUG /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */ static const unsigned short yyprhs[] = { 0, 0, 3, 4, 5, 6, 17, 18, 23, 25, 27, 29, 31, 34, 35, 38, 39, 40, 47, 49, 50, 51, 52, 67, 68, 69, 70, 86, 88, 91, 94, 95, 97, 100, 102, 104, 106, 109, 111, 113, 115, 116, 121, 122, 124, 126, 131, 136, 140, 142, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 175, 182, 183, 192, 196, 198, 202, 206, 209, 212, 214, 216, 218, 220, 222, 224, 226, 228, 230, 231, 232, 239, 240, 241, 248, 249, 250, 258, 259, 260, 261, 262, 276, 277, 284, 286, 288, 290, 292, 294, 297, 300, 301, 304, 307, 310, 311, 315, 318, 321, 323, 325, 326, 331, 334, 335, 336, 340, 341, 342, 343, 344, 353, 354, 355, 356, 365, 366, 367, 372, 373, 378, 383, 384, 390, 392, 396, 398, 400, 402, 404, 408, 410, 412, 414, 416, 418, 420, 422, 423, 428, 429, 434, 436, 437, 442, 443, 448, 449, 454, 456, 458, 459, 463, 464, 468, 470, 471, 476, 478, 479, 485, 488, 489, 494, 496, 497, 499, 500, 501, 507, 509, 511, 513, 515, 517, 519, 521, 523, 525, 526, 527, 528, 533, 534, 538, 539, 541, 543, 544, 546, 547, 550 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const short yyrhs[] = { 83, 0, -1, -1, -1, -1, 31, 84, 10, 194, 91, 89, 85, 121, 90, 86, -1, -1, 89, 88, 121, 90, -1, 29, -1, 12, -1, 30, -1, 13, -1, 95, 91, -1, -1, 93, 92, -1, -1, -1, 39, 112, 71, 114, 94, 194, -1, 93, -1, -1, -1, -1, 61, 10, 96, 8, 107, 9, 194, 97, 92, 29, 121, 105, 194, 98, -1, -1, -1, -1, 63, 10, 99, 8, 107, 9, 102, 194, 100, 92, 29, 121, 103, 194, 101, -1, 117, -1, 1, 6, -1, 71, 114, -1, -1, 104, -1, 30, 104, -1, 64, -1, 62, -1, 106, -1, 30, 106, -1, 62, -1, 64, -1, 109, -1, -1, 107, 6, 108, 109, -1, -1, 110, -1, 111, -1, 65, 112, 71, 114, -1, 66, 113, 71, 114, -1, 112, 24, 10, -1, 10, -1, 113, 24, 10, -1, 10, -1, 115, -1, 185, -1, 32, -1, 33, -1, 35, -1, 34, -1, 115, -1, 10, -1, 36, 10, 71, 37, 3, 72, 3, 38, 114, 194, -1, 36, 10, 71, 77, 116, 194, -1, -1, 36, 10, 71, 67, 118, 119, 68, 194, -1, 120, 194, 119, -1, 120, -1, 10, 71, 114, -1, 140, 6, 121, -1, 140, 121, -1, 140, 6, -1, 122, -1, 140, -1, 123, -1, 124, -1, 127, -1, 130, -1, 133, -1, 138, -1, 41, -1, -1, -1, 50, 125, 192, 143, 126, 121, -1, -1, -1, 58, 128, 121, 59, 129, 161, -1, -1, -1, 42, 131, 192, 193, 132, 121, 145, -1, -1, -1, -1, -1, 53, 10, 134, 195, 161, 135, 55, 161, 136, 144, 137, 143, 121, -1, -1, 46, 147, 48, 71, 139, 121, -1, 155, -1, 158, -1, 159, -1, 181, -1, 87, -1, 124, 52, -1, 127, 60, -1, -1, 40, 141, -1, 130, 45, -1, 41, 6, -1, -1, 41, 142, 161, -1, 133, 57, -1, 138, 49, -1, 1, -1, 51, -1, -1, 26, 56, 38, 161, -1, 26, 161, -1, -1, -1, 44, 146, 121, -1, -1, -1, -1, -1, 47, 148, 161, 71, 149, 121, 150, 151, -1, -1, -1, -1, 47, 152, 161, 71, 153, 121, 154, 151, -1, -1, -1, 175, 11, 156, 161, -1, -1, 175, 15, 157, 161, -1, 69, 8, 184, 9, -1, -1, 70, 160, 8, 184, 9, -1, 163, -1, 163, 162, 161, -1, 1, -1, 21, -1, 22, -1, 165, -1, 165, 164, 165, -1, 15, -1, 18, -1, 16, -1, 17, -1, 20, -1, 19, -1, 168, -1, -1, 165, 4, 166, 168, -1, -1, 165, 5, 167, 168, -1, 172, -1, -1, 172, 7, 169, 168, -1, -1, 172, 75, 170, 168, -1, -1, 172, 76, 171, 168, -1, 183, -1, 175, -1, -1, 5, 173, 172, -1, -1, 23, 174, 172, -1, 184, -1, -1, 8, 176, 161, 179, -1, 181, -1, -1, 175, 27, 177, 161, 180, -1, 175, 77, -1, -1, 175, 78, 178, 184, -1, 9, -1, -1, 28, -1, -1, -1, 184, 8, 182, 186, 9, -1, 3, -1, 73, -1, 74, -1, 80, -1, 81, -1, 79, -1, 10, -1, 10, -1, 187, -1, -1, -1, -1, 188, 161, 189, 190, -1, -1, 24, 191, 187, -1, -1, 161, -1, 43, -1, -1, 6, -1, -1, 54, 38, -1, 38, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const unsigned short yyrline[] = { 0, 42, 42, 43, 44, 42, 52, 52, 56, 56, 58, 58, 60, 61, 64, 65, 68, 68, 77, 78, 81, 83, 78, 85, 89, 92, 85, 94, 95, 98, 99, 103, 103, 104, 105, 109, 109, 110, 111, 116, 117, 117, 118, 121, 122, 125, 131, 137, 138, 141, 142, 145, 146, 149, 150, 151, 152, 155, 156, 159, 163, 171, 170, 183, 184, 187, 197, 198, 199, 200, 203, 204, 207, 208, 209, 210, 211, 212, 215, 216, 215, 220, 221, 220, 225, 226, 225, 232, 236, 237, 238, 232, 246, 244, 250, 251, 252, 253, 254, 255, 256, 257, 257, 258, 259, 260, 260, 261, 262, 263, 266, 267, 270, 271, 274, 278, 278, 281, 284, 285, 286, 284, 290, 291, 292, 290, 293, 296, 296, 297, 297, 303, 306, 306, 310, 311, 312, 315, 316, 319, 320, 323, 324, 325, 326, 327, 328, 331, 332, 332, 333, 333, 336, 337, 337, 338, 338, 339, 339, 342, 343, 344, 344, 345, 345, 348, 349, 349, 350, 351, 351, 352, 353, 353, 356, 357, 360, 361, 364, 364, 370, 371, 372, 373, 374, 375, 378, 393, 398, 399, 403, 404, 403, 409, 409, 410, 413, 416, 417, 420, 421, 424, 425 }; #endif #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[] = { "$end", "error", "$undefined", "NOMBRE", "PLUS", "SUB", "POINTV", "MULT", "PARO", "PARF", "ID", "EGAL", "ACCO", "ACCF", "EOF", "COMP", "SUP", "INF", "DIFF", "LE", "GE", "ET", "OU", "NON", "VIRGULE", "DECL", "PAR", "CROO", "CROF", "DEBUT", "FIN", "PROGRAMME", "ENTIER", "CAR", "BOOLEEN", "REEL", "TYPE", "TABLEAU", "DE", "VAR", "EXIT", "RETOURNE", "SI", "ALORS", "SINON", "FINSI", "SELONQUE", "CAS", "AUTREMENT", "FINSELONQUE", "TANTQUE", "FAIRE", "FINTANTQUE", "POUR", "ALLANT", "A", "PAS", "FINPOUR", "REPETER", "JUSQUA", "FINREPETER", "PROCEDURE", "FINPROCEDURE", "FONCTION", "FINFONCTION", "VAL", "REF", "ENREG", "FINENREG", "ALLOUER", "DESALLOUER", "DEUXPOINTS", "POINTPOINT", "CARACTERE", "STRING", "DIV", "MOD", "DEREF", "POINT", "NUL", "VRAI", "FAUX", "$accept", "prog", "@1", "@2", "@3", "bloc", "@4", "debut", "fin", "decls", "vardecls", "vardecl", "@5", "decl", "@6", "@7", "@8", "@9", "@10", "@11", "restype", "finfonction", "finfonc", "finprocedure", "finproc", "listeparams", "@12", "paramdecl", "valparam", "refparam", "listevar", "listeref", "type", "typebase", "typep", "typedef", "@13", "champs", "champ", "liste", "inst", "openinst", "tantque", "@14", "@15", "repeter", "@16", "@17", "si", "@18", "@19", "pour", "@20", "@21", "@22", "@23", "selonque", "@24", "closedinst", "@25", "@26", "faire", "parpasde", "unless", "@27", "casliste", "@28", "@29", "@30", "casqueue", "@31", "@32", "@33", "affectation", "@34", "@35", "allocation", "desallocation", "@36", "exp", "opbool", "teste", "comp", "arith", "@37", "@38", "term", "@39", "@40", "@41", "fact", "@42", "@43", "gauche", "@44", "@45", "@46", "parf", "crof", "appel", "@47", "constante", "id_declare", "ID_declare", "params", "params_non_vide", "@48", "@49", "plus_de_params", "@50", "condition", "alors", "pv", "allantde", 0 }; #endif # 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, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const unsigned char yyr1[] = { 0, 82, 84, 85, 86, 83, 88, 87, 89, 89, 90, 90, 91, 91, 92, 92, 94, 93, 95, 96, 97, 98, 95, 99, 100, 101, 95, 95, 95, 102, 102, 103, 103, 104, 104, 105, 105, 106, 106, 107, 108, 107, 107, 109, 109, 110, 111, 112, 112, 113, 113, 114, 114, 115, 115, 115, 115, 116, 116, 117, 117, 118, 117, 119, 119, 120, 121, 121, 121, 121, 122, 122, 123, 123, 123, 123, 123, 123, 125, 126, 124, 128, 129, 127, 131, 132, 130, 134, 135, 136, 137, 133, 139, 138, 140, 140, 140, 140, 140, 140, 140, 141, 140, 140, 140, 142, 140, 140, 140, 140, 143, 143, 144, 144, 144, 146, 145, 145, 148, 149, 150, 147, 152, 153, 154, 151, 151, 156, 155, 157, 155, 158, 160, 159, 161, 161, 161, 162, 162, 163, 163, 164, 164, 164, 164, 164, 164, 165, 166, 165, 167, 165, 168, 169, 168, 170, 168, 171, 168, 172, 172, 173, 172, 174, 172, 175, 176, 175, 175, 177, 175, 175, 178, 175, 179, 179, 180, 180, 182, 181, 183, 183, 183, 183, 183, 183, 184, 185, 186, 186, 188, 189, 187, 191, 190, 190, 192, 193, 193, 194, 194, 195, 195 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const unsigned char yyr2[] = { 0, 2, 0, 0, 0, 10, 0, 4, 1, 1, 1, 1, 2, 0, 2, 0, 0, 6, 1, 0, 0, 0, 14, 0, 0, 0, 15, 1, 2, 2, 0, 1, 2, 1, 1, 1, 2, 1, 1, 1, 0, 4, 0, 1, 1, 4, 4, 3, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 10, 6, 0, 8, 3, 1, 3, 3, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 6, 0, 0, 6, 0, 0, 7, 0, 0, 0, 0, 13, 0, 6, 1, 1, 1, 1, 1, 2, 2, 0, 2, 2, 2, 0, 3, 2, 2, 1, 1, 0, 4, 2, 0, 0, 3, 0, 0, 0, 0, 8, 0, 0, 0, 8, 0, 0, 4, 0, 4, 4, 0, 5, 1, 3, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 0, 4, 0, 4, 1, 0, 4, 0, 4, 0, 4, 1, 1, 0, 3, 0, 3, 1, 0, 4, 1, 0, 5, 2, 0, 4, 1, 0, 1, 0, 0, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 4, 0, 3, 0, 1, 1, 0, 1, 0, 2, 1 }; /* 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[] = { 0, 2, 0, 0, 1, 200, 199, 0, 0, 0, 0, 0, 0, 0, 18, 0, 27, 28, 0, 48, 0, 19, 23, 9, 8, 3, 12, 0, 0, 0, 0, 0, 0, 0, 61, 0, 47, 187, 53, 54, 56, 55, 16, 51, 52, 42, 42, 109, 166, 186, 101, 77, 84, 0, 78, 0, 81, 0, 132, 98, 6, 0, 69, 71, 72, 73, 74, 75, 76, 0, 94, 95, 96, 0, 97, 165, 0, 0, 58, 57, 200, 200, 0, 0, 0, 39, 43, 44, 0, 0, 102, 104, 0, 0, 118, 0, 0, 87, 0, 0, 0, 0, 11, 10, 4, 99, 100, 103, 107, 108, 0, 67, 127, 129, 169, 171, 172, 178, 0, 0, 0, 64, 60, 17, 0, 50, 0, 40, 200, 30, 136, 180, 161, 163, 181, 182, 185, 183, 184, 175, 134, 139, 147, 152, 160, 168, 159, 106, 196, 198, 0, 0, 111, 0, 0, 0, 0, 0, 5, 66, 0, 0, 0, 0, 190, 0, 0, 200, 0, 0, 0, 0, 0, 20, 0, 200, 0, 0, 174, 167, 137, 138, 0, 148, 150, 141, 143, 144, 142, 146, 145, 0, 153, 155, 157, 197, 85, 0, 92, 110, 79, 202, 0, 0, 82, 131, 0, 7, 128, 130, 177, 173, 0, 188, 0, 0, 65, 62, 63, 45, 49, 46, 41, 15, 29, 24, 162, 164, 135, 0, 0, 140, 0, 0, 0, 0, 119, 0, 0, 201, 88, 0, 133, 176, 170, 179, 191, 200, 0, 15, 15, 149, 151, 154, 156, 158, 117, 0, 93, 80, 0, 83, 195, 59, 0, 14, 0, 115, 86, 120, 0, 193, 192, 0, 0, 0, 126, 89, 190, 0, 37, 38, 200, 35, 0, 116, 122, 121, 114, 194, 36, 21, 0, 34, 33, 200, 31, 0, 0, 90, 22, 32, 25, 0, 0, 113, 111, 26, 123, 0, 0, 0, 112, 91, 124, 126, 125 }; /* YYDEFGOTO[NTERM-NUM]. */ static const short yydefgoto[] = { -1, 2, 3, 32, 158, 59, 101, 60, 104, 13, 248, 249, 81, 15, 30, 223, 300, 31, 250, 307, 175, 295, 296, 282, 283, 84, 172, 85, 86, 87, 20, 126, 42, 43, 80, 16, 77, 120, 121, 61, 62, 63, 64, 96, 238, 65, 98, 241, 66, 93, 235, 67, 153, 260, 288, 306, 68, 237, 69, 90, 92, 200, 299, 268, 275, 95, 150, 257, 276, 287, 297, 311, 315, 70, 160, 161, 71, 72, 100, 148, 182, 140, 191, 141, 229, 230, 142, 232, 233, 234, 143, 176, 177, 144, 89, 162, 163, 179, 244, 145, 164, 146, 75, 44, 212, 213, 214, 262, 272, 278, 149, 196, 7, 203 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ #define YYPACT_NINF -121 static const short yypact[] = { 34, -121, 94, 86, -121, 97, -121, 101, 104, 108, 112, 118, 124, 9, -121, 101, -121, -121, -52, -121, -15, -121, -121, -121, -121, -121, -121, -6, 129, 0, 133, 146, 322, 109, -121, 110, -121, -121, -121, -121, -121, -121, -121, -121, -121, -2, -2, -121, -121, -121, -121, 19, -121, 121, -121, 149, -121, 164, -121, -121, -121, -7, -121, -121, 122, 117, 138, 127, 139, 244, -121, -121, -121, -10, 3, 170, 120, 179, -121, -121, 97, 97, 112, 180, 152, -121, -121, -121, 154, 106, -121, -121, 106, 106, -121, 151, 106, -121, 322, 187, 192, 322, -121, -121, -121, -121, -121, -121, -121, -121, 297, -121, -121, -121, -121, -121, -121, -121, 198, 137, 147, 95, -121, -121, -13, -121, -12, -121, 97, 143, -121, -121, -121, -121, -121, -121, -121, -121, -121, 207, 102, 131, -121, 1, 13, -121, -121, -121, -121, 175, 106, 148, 169, 50, 165, 214, 187, -7, -121, -121, 106, 106, 106, 187, 217, 189, 0, 97, 179, 0, 218, 0, -2, -121, 0, 97, 188, 188, -121, -121, -121, -121, 106, -121, -121, -121, -121, -121, -121, -121, -121, 188, -121, -121, -121, -121, -121, 159, -121, -121, -121, -121, 193, 106, -121, -121, 225, -121, -121, -121, 209, -121, 226, -121, 106, 0, -121, -121, -121, -121, -121, -121, -121, 199, -121, -121, -121, -121, -121, 188, 188, 162, 188, 188, 188, 322, -121, 322, 322, -121, -121, 106, -121, -121, -121, -121, -121, 97, 210, 199, 199, -121, -121, -121, -121, -121, 196, 322, -121, -121, 186, -121, 220, -121, 322, -121, 222, -121, -121, -121, 106, -121, -121, 53, 322, 322, 206, -121, -121, -36, -121, -121, 97, -121, 57, -121, -121, -121, 229, -121, -121, -121, -17, -121, -121, 97, -121, 106, 52, -121, -121, -121, -121, 194, 221, -121, 169, -121, -121, 106, 322, 322, -121, -121, -121, 206, -121 }; /* YYPGOTO[NTERM-NUM]. */ static const short yypgoto[] = { -121, -121, -121, -121, -121, -121, -121, 245, 103, 248, -79, 37, -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, -26, -121, -9, 230, -121, 92, -121, -121, 190, -121, -120, 236, -121, -121, -121, 107, -121, -62, -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, -121, -29, -121, -121, -121, -121, -121, -121, -121, -35, -121, -121, -121, -121, -121, -121, -121, -121, -121, -76, -121, -121, -121, 90, -121, -121, -77, -121, -121, -121, 5, -121, -121, -32, -121, -121, -121, -121, -121, -28, -121, -121, -84, -121, -121, 17, -121, -121, -121, -121, 191, -121, -78, -121 }; /* 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 -201 static const short yytable[] = { 73, 112, 122, 123, 74, 113, 102, 111, 192, 28, 37, 28, 170, 139, -168, 155, 147, 114, -168, 27, -105, 23, -105, 103, -105, 91, 280, -105, 281, -105, -168, 33, 38, 39, 40, 41, 154, 73, 24, 157, 114, 74, -105, 168, 14, 293, 216, 294, 159, 219, 173, 221, 14, 130, 224, 131, 29, 132, 169, 171, 48, 34, 49, 82, 83, 1, 73, 115, 116, 73, 74, 35, 206, 74, 197, 133, 193, 194, 73, 211, -168, -168, 74, 279, 208, 209, 210, 292, 201, 217, 115, 116, -105, -105, 4, 247, 5, 225, -105, -105, -105, 6, 8, 6, 202, -200, 228, 130, 304, 131, 17, 132, 76, -13, 48, 280, 49, 281, 18, 293, 78, 294, 19, 180, 181, 134, 135, 240, 21, 133, -13, 136, 137, 138, 22, 183, 184, 9, 246, 36, 10, 45, 38, 39, 40, 41, 185, 186, 187, 188, 189, 190, 251, 252, 46, 253, 254, 255, 127, 97, 127, 128, 11, 129, 12, 261, 183, 184, 94, 263, 265, 266, 99, 256, 105, 258, 259, 106, 117, 134, 135, 226, 227, 107, 108, 136, 137, 138, 109, 119, 125, 131, 118, 132, 277, 269, 48, 49, 49, 151, 156, 165, 273, 73, 291, 73, 73, 74, 166, 74, 74, 133, 284, 285, 174, 167, 178, 302, 195, 198, 199, 303, 305, 205, 204, 73, -189, 215, 220, 74, 236, 239, 73, 312, 242, 245, 74, 243, 10, 264, 267, 270, 73, 73, 271, 47, 74, 74, 313, 314, 110, 274, 48, 286, 49, 298, 23, -70, 25, 309, 207, 134, 135, 26, 222, 308, 301, 136, 137, 138, 290, 79, 124, 24, -70, 218, 88, 310, 73, 73, 316, 231, 74, 74, 50, 51, 52, 152, -70, -70, 53, -70, -70, -70, 54, 289, -70, 55, 47, 0, 0, -70, 56, -70, 0, 48, -70, 49, -70, 23, -68, 0, 0, 57, 58, 0, 0, 0, 0, 0, 0, 0, 0, 47, 0, 0, 24, -68, 0, 0, 48, 0, 49, 0, 23, 0, 0, 50, 51, 52, 0, -68, -68, 53, -68, -68, -68, 54, 0, -68, 55, 24, 0, 0, -68, 56, -68, 0, 0, -68, 0, -68, 50, 51, 52, 0, 57, 58, 53, 0, 0, 0, 54, 0, 0, 55, 0, 0, 0, 0, 56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 57, 58 }; static const short yycheck[] = { 32, 11, 80, 81, 32, 15, 13, 69, 7, 24, 10, 24, 24, 89, 11, 99, 92, 27, 15, 71, 1, 12, 3, 30, 5, 6, 62, 8, 64, 10, 27, 37, 32, 33, 34, 35, 98, 69, 29, 101, 27, 69, 23, 121, 7, 62, 166, 64, 110, 169, 128, 171, 15, 1, 174, 3, 71, 5, 71, 71, 8, 67, 10, 65, 66, 31, 98, 77, 78, 101, 98, 77, 156, 101, 150, 23, 75, 76, 110, 163, 77, 78, 110, 30, 160, 161, 162, 30, 38, 167, 77, 78, 73, 74, 0, 215, 10, 175, 79, 80, 81, 6, 1, 6, 54, 10, 182, 1, 56, 3, 6, 5, 3, 12, 8, 62, 10, 64, 10, 62, 10, 64, 10, 21, 22, 73, 74, 203, 10, 23, 29, 79, 80, 81, 10, 4, 5, 36, 214, 10, 39, 8, 32, 33, 34, 35, 15, 16, 17, 18, 19, 20, 229, 230, 8, 232, 233, 234, 6, 10, 6, 9, 61, 9, 63, 241, 4, 5, 47, 247, 249, 250, 8, 235, 52, 237, 238, 60, 8, 73, 74, 176, 177, 45, 57, 79, 80, 81, 49, 10, 10, 3, 72, 5, 270, 257, 8, 10, 10, 48, 8, 3, 264, 235, 282, 237, 238, 235, 71, 237, 238, 23, 274, 275, 71, 68, 9, 295, 43, 71, 51, 297, 298, 9, 59, 257, 9, 38, 10, 257, 71, 38, 264, 309, 9, 9, 264, 28, 39, 29, 44, 55, 274, 275, 24, 1, 274, 275, 310, 311, 6, 29, 8, 47, 10, 26, 12, 13, 13, 38, 157, 73, 74, 15, 172, 71, 292, 79, 80, 81, 279, 35, 82, 29, 30, 168, 46, 306, 310, 311, 315, 191, 310, 311, 40, 41, 42, 96, 44, 45, 46, 47, 48, 49, 50, 278, 52, 53, 1, -1, -1, 57, 58, 59, -1, 8, 62, 10, 64, 12, 13, -1, -1, 69, 70, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, 29, 30, -1, -1, 8, -1, 10, -1, 12, -1, -1, 40, 41, 42, -1, 44, 45, 46, 47, 48, 49, 50, -1, 52, 53, 29, -1, -1, 57, 58, 59, -1, -1, 62, -1, 64, 40, 41, 42, -1, 69, 70, 46, -1, -1, -1, 50, -1, -1, 53, -1, -1, -1, -1, 58, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 69, 70 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const unsigned char yystos[] = { 0, 31, 83, 84, 0, 10, 6, 194, 1, 36, 39, 61, 63, 91, 93, 95, 117, 6, 10, 10, 112, 10, 10, 12, 29, 89, 91, 71, 24, 71, 96, 99, 85, 37, 67, 77, 10, 10, 32, 33, 34, 35, 114, 115, 185, 8, 8, 1, 8, 10, 40, 41, 42, 46, 50, 53, 58, 69, 70, 87, 89, 121, 122, 123, 124, 127, 130, 133, 138, 140, 155, 158, 159, 175, 181, 184, 3, 118, 10, 115, 116, 94, 65, 66, 107, 109, 110, 111, 107, 176, 141, 6, 142, 131, 47, 147, 125, 10, 128, 8, 160, 88, 13, 30, 90, 52, 60, 45, 57, 49, 6, 121, 11, 15, 27, 77, 78, 8, 72, 10, 119, 120, 194, 194, 112, 10, 113, 6, 9, 9, 1, 3, 5, 23, 73, 74, 79, 80, 81, 161, 163, 165, 168, 172, 175, 181, 183, 161, 161, 192, 148, 48, 192, 134, 121, 184, 8, 121, 86, 121, 156, 157, 177, 178, 182, 3, 71, 68, 194, 71, 24, 71, 108, 194, 71, 102, 173, 174, 9, 179, 21, 22, 162, 4, 5, 15, 16, 17, 18, 19, 20, 164, 7, 75, 76, 43, 193, 161, 71, 51, 143, 38, 54, 195, 59, 9, 184, 90, 161, 161, 161, 184, 186, 187, 188, 38, 114, 194, 119, 114, 10, 114, 109, 97, 114, 194, 172, 172, 161, 166, 167, 165, 169, 170, 171, 132, 71, 139, 126, 38, 161, 129, 9, 28, 180, 9, 161, 114, 92, 93, 100, 168, 168, 168, 168, 168, 121, 149, 121, 121, 135, 161, 189, 194, 29, 92, 92, 44, 145, 121, 55, 24, 190, 121, 29, 146, 150, 161, 191, 30, 62, 64, 105, 106, 121, 121, 47, 151, 136, 187, 106, 194, 30, 62, 64, 103, 104, 152, 26, 144, 98, 104, 194, 161, 56, 161, 137, 101, 71, 38, 143, 153, 161, 121, 121, 154, 151 }; #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) # define YYSIZE_T __SIZE_TYPE__ #endif #if ! defined (YYSIZE_T) && defined (size_t) # define YYSIZE_T size_t #endif #if ! defined (YYSIZE_T) # if defined (__STDC__) || defined (__cplusplus) # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # endif #endif #if ! defined (YYSIZE_T) # define YYSIZE_T unsigned int #endif #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY (-2) #define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab /* 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); \ yytoken = YYTRANSLATE (yychar); \ YYPOPSTACK; \ goto yybackup; \ } \ else \ { \ yyerror ("syntax error: cannot back up");\ YYERROR; \ } \ while (0) #define YYTERROR 1 #define YYERRCODE 256 /* YYLLOC_DEFAULT -- Compute the default location (before the actions are run). */ #ifndef YYLLOC_DEFAULT # 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. */ #ifdef YYLEX_PARAM # define YYLEX yylex (YYLEX_PARAM) #else # define YYLEX yylex () #endif /* Enable debugging if requested. */ #if YYDEBUG # ifndef YYFPRINTF # include /* INFRINGES ON USER NAME SPACE */ # define YYFPRINTF fprintf # endif # define YYDPRINTF(Args) \ do { \ if (yydebug) \ YYFPRINTF Args; \ } while (0) # 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 (included). | `------------------------------------------------------------------*/ #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 yylno = yyrline[yyrule]; YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ", yyrule - 1, yylno); /* 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 #endif /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only if the built-in stack extension method is used). Do not make this value too large; the results are undefined if SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #if defined (YYMAXDEPTH) && YYMAXDEPTH == 0 # undef YYMAXDEPTH #endif #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif #if YYERROR_VERBOSE # ifndef yystrlen # if defined (__GLIBC__) && defined (_STRING_H) # define yystrlen strlen # else /* Return the length of YYSTR. */ static YYSIZE_T # if defined (__STDC__) || defined (__cplusplus) yystrlen (const char *yystr) # else yystrlen (yystr) const char *yystr; # endif { register const char *yys = yystr; while (*yys++ != '\0') continue; return yys - yystr - 1; } # endif # endif # ifndef yystpcpy # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ static char * # if defined (__STDC__) || defined (__cplusplus) yystpcpy (char *yydest, const char *yysrc) # else yystpcpy (yydest, yysrc) char *yydest; const char *yysrc; # endif { register char *yyd = yydest; register const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; return yyd - 1; } # endif # endif #endif /* !YYERROR_VERBOSE */ #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; } } /* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM # if defined (__STDC__) || defined (__cplusplus) int yyparse (void *YYPARSE_PARAM); # else int yyparse (); # endif #else /* ! YYPARSE_PARAM */ #if defined (__STDC__) || defined (__cplusplus) int yyparse (void); #else int yyparse (); #endif #endif /* ! YYPARSE_PARAM */ /* The lookahead symbol. */ int yychar; /* The semantic value of the lookahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ int yynerrs; /*----------. | 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 (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 yytoken = 0; /* Three stacks and their tools: `yyss': related to states, `yyvs': related to semantic values, `yyls': related to locations. Refer to the stacks thru separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ short yyssa[YYINITDEPTH]; short *yyss = yyssa; register short *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs = yyvsa; register YYSTYPE *yyvsp; #define YYPOPSTACK (yyvsp--, yyssp--) YYSIZE_T yystacksize = YYINITDEPTH; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; /* When reducing, the number of symbols on the RHS of the reduced rule. */ int yylen; YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ yyssp = yyss; yyvsp = yyvs; goto yysetstate; /*------------------------------------------------------------. | yynewstate -- Push a new state, which is found in yystate. | `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. so pushing a state here evens the stacks. */ yyssp++; yysetstate: *yyssp = yystate; if (yyss + yystacksize - 1 <= yyssp) { /* Get the current used size of the three stacks, in elements. */ YYSIZE_T yysize = yyssp - yyss + 1; #ifdef yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; short *yyss1 = yyss; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow ("parser stack overflow", &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yystacksize); yyss = yyss1; yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE goto yyoverflowlab; # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) goto yyoverflowlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { short *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyoverflowlab; YYSTACK_RELOCATE (yyss); YYSTACK_RELOCATE (yyvs); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); goto yybackup; /*-----------. | yybackup. | `-----------*/ yybackup: /* Do appropriate processing given the current state. */ /* Read a lookahead token if we need one and don't already have one. */ /* yyresume: */ /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; 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 lookahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); yychar = YYLEX; } if (yychar <= YYEOF) { yychar = yytoken = YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } else { yytoken = YYTRANSLATE (yychar); YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to detect an error, take that action. */ yyn += yytoken; if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault; yyn = yytable[yyn]; if (yyn <= 0) { if (yyn == 0 || yyn == YYTABLE_NINF) goto yyerrlab; yyn = -yyn; goto yyreduce; } if (yyn == YYFINAL) YYACCEPT; /* Shift the lookahead token. */ YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken])); /* Discard the token being shifted unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; *++yyvsp = yylval; /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; yystate = yyn; goto yynewstate; /*-----------------------------------------------------------. | yydefault -- do the default action for the current state. | `-----------------------------------------------------------*/ yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; goto yyreduce; /*-----------------------------. | yyreduce -- Do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: `$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ yyval = yyvsp[1-yylen]; YY_REDUCE_PRINT (yyn); switch (yyn) { case 2: #line 42 "Exalgov3a.y" {mmdebut();;} break; case 3: #line 43 "Exalgov3a.y" {printf("main()\n {\n");indent+=3;ind();;} break; case 4: #line 44 "Exalgov3a.y" {printf("}\n");;} break; case 5: #line 44 "Exalgov3a.y" {mmfin(); if (errors==0) fprintf(stderr,"traduction complétée\n"); else fprintf(stderr,"erreurs de programme\n"); return;;} break; case 6: #line 52 "Exalgov3a.y" {printf(" {\n");indent+=3;ind();;} break; case 7: #line 53 "Exalgov3a.y" {;printf("}");indent-=3;;} break; case 14: #line 64 "Exalgov3a.y" {yyval=yyvsp[-1]+yyvsp[0];;} break; case 15: #line 65 "Exalgov3a.y" {yyval=0;;} break; case 16: #line 68 "Exalgov3a.y" { if (yyvsp[0]>3 && rechercher((char*)yyvsp[0],Symboles) && rechercher((char*)yyvsp[0],Symboles)->typ==structtab) printf("struct "); printf("%s ", yyvsp[0]==1?"int":yyvsp[0]==2?"char":yyvsp[0]==3?"double":(char*)yyvsp[0]); printvars(Symboles,yyvsp[-2]);;} break; case 17: #line 74 "Exalgov3a.y" {printf(";\n");ind(); yyval=yyvsp[-4];;} break; case 19: #line 78 "Exalgov3a.y" {inserer((char*)yyvsp[0],0,0,0,0,&Symboles); tampon[0]='\0'; proc=Symboles; proc->flags=0; puissance=1; ;} break; case 20: #line 81 "Exalgov3a.y" {printf("void %s(%s)\n{\n",(char*)yyvsp[-5],tampon);ind();;} break; case 21: #line 83 "Exalgov3a.y" {printf("}\n\n");;} break; case 22: #line 84 "Exalgov3a.y" {int i; for (i=yyvsp[-9]+yyvsp[-5];i;i--) effacer1(&Symboles);indent=0;;} break; case 23: #line 85 "Exalgov3a.y" {inserer((char*)yyvsp[0],0,0,0,0,&Symboles); tampon[0]='\0'; proc=Symboles; proc->flags=0; puissance=1; ;} break; case 24: #line 89 "Exalgov3a.y" {printf("%s %s(%s)\n{\n",yyvsp[-1]==1||yyvsp[-1]==2?"int":yyvsp[-1]==3?"double":(char*) yyvsp[-1], (char*)yyvsp[-6],tampon);ind();;} break; case 25: #line 92 "Exalgov3a.y" {printf("}\n\n");;} break; case 26: #line 93 "Exalgov3a.y" {int i; for (i=yyvsp[-10]+yyvsp[-5];i;i--) effacer1(&Symboles);indent=0;;} break; case 28: #line 95 "Exalgov3a.y" {errors=1;;} break; case 29: #line 98 "Exalgov3a.y" {yyval=yyvsp[0];;} break; case 30: #line 99 "Exalgov3a.y" {yyval=2; /*int*/ fprintf(stderr,"type de fonction omis à la ligne %i\n",ligne);;} break; case 34: #line 106 "Exalgov3a.y" {fprintf(stderr,"Fonction terminée par FINPROCEDURE à la ligne %i\n" ,ligne);;} break; case 38: #line 112 "Exalgov3a.y" {fprintf(stderr,"Procédure terminée par FINFONCTION à la ligne %i\n" ,ligne);;} break; case 39: #line 116 "Exalgov3a.y" {yyval=yyvsp[0];;} break; case 40: #line 117 "Exalgov3a.y" {strcat(tampon,", ");;} break; case 41: #line 117 "Exalgov3a.y" {yyval=yyvsp[-3]+yyvsp[0];;} break; case 42: #line 118 "Exalgov3a.y" {yyval=0;;} break; case 43: #line 121 "Exalgov3a.y" {yyval=yyvsp[0];;} break; case 44: #line 122 "Exalgov3a.y" {yyval=yyvsp[0];;} break; case 45: #line 125 "Exalgov3a.y" {int i; struct Tab *p=Symboles; yyval=yyvsp[-2]; for (i=0;iflags+=puissance; puissance*=2;} printparams(Symboles,yyvsp[-2],yyvsp[0],"*"); ;} break; case 47: #line 137 "Exalgov3a.y" {inserer((char*)yyvsp[0],0,0,0,0,&Symboles);yyval=yyvsp[-2]+1;;} break; case 48: #line 138 "Exalgov3a.y" {inserer((char*)yyvsp[0],0,0,0,0,&Symboles);yyval=1;;} break; case 49: #line 141 "Exalgov3a.y" {inserer((char*)yyvsp[0],refparam,0,0,0,&Symboles);yyval=yyvsp[-2]+1;;} break; case 50: #line 142 "Exalgov3a.y" {inserer((char*)yyvsp[0],refparam,0,0,0,&Symboles);yyval=1;;} break; case 51: #line 145 "Exalgov3a.y" {yyval=yyvsp[0];;} break; case 52: #line 146 "Exalgov3a.y" {yyval=yyvsp[0];;} break; case 53: #line 149 "Exalgov3a.y" {yyval=1;;} break; case 54: #line 150 "Exalgov3a.y" {yyval=2;;} break; case 55: #line 151 "Exalgov3a.y" {yyval=3;;} break; case 56: #line 152 "Exalgov3a.y" {yyval=1;;} break; case 57: #line 155 "Exalgov3a.y" {yyval=yyvsp[0];;} break; case 58: #line 156 "Exalgov3a.y" {yyval=yyvsp[0];;} break; case 59: #line 160 "Exalgov3a.y" {printf("typedef %s %s[1+%s];\n",yyvsp[-1]==1||yyvsp[-1]==2?"int": yyvsp[-1]==3? "double":(char*)yyvsp[-1],yyvsp[-8],yyvsp[-3]); inserer((char*)yyvsp[-8],2,0,0,0,&Symboles);;} break; case 60: #line 164 "Exalgov3a.y" { printf("typedef %s %s *%s;\n", yyvsp[-1]>=1&&yyvsp[-1]<=3||rechercher((char*)yyvsp[-1],Symboles)?"":" struct ", yyvsp[-1]==1||yyvsp[-1]==2?"int": yyvsp[-1]==3? "double":(char*)yyvsp[-1],yyvsp[-4]); inserer((char*)yyvsp[-4],2,0,0,0,&Symboles); ;} break; case 61: #line 171 "Exalgov3a.y" {inserer((char*)yyvsp[-2],structtab,0,0,0,&Symboles); if (pointertype && (strcmp(referredtype,(char*)yyvsp[-2])==0)) {inserer(pointertype,2,0,0,0,&Symboles); structuretype=(char*)yyvsp[-2]; } printf("typedef struct %s {\n",yyvsp[-2]);;} break; case 62: #line 177 "Exalgov3a.y" {printf("} %s",(char*)yyvsp[-6]); if (pointertype && (strcmp(referredtype,(char*)yyvsp[-6])==0)) {printf(", *%s",pointertype);pointertype=0;} printf(";\n");;} break; case 65: #line 187 "Exalgov3a.y" { if ((yyvsp[0]>3||yyvsp[0]<0) && pointertype && strcmp(pointertype,(char*)yyvsp[0])==0) printf("struct %s *%s;\n",structuretype, yyvsp[-2]); else printf("%s %s;\n",yyvsp[0]==1||yyvsp[0]==2?"int": yyvsp[0]==3? "double": (char*)yyvsp[0], yyvsp[-2]); inserer((char*)yyvsp[-2],2,0,0,0,&Symboles);;} break; case 71: #line 204 "Exalgov3a.y" {printf(";\n");ind();;} break; case 77: #line 212 "Exalgov3a.y" {printf("return;\n");ind();;} break; case 78: #line 215 "Exalgov3a.y" {printf("while (");;} break; case 79: #line 216 "Exalgov3a.y" {indent+=3;printf(")\n");ind();printf("{\n");ind();;} break; case 80: #line 217 "Exalgov3a.y" {printf("}");indent-=3;;} break; case 81: #line 220 "Exalgov3a.y" {indent+=3;printf("do\n");ind();printf("{\n");ind();;} break; case 82: #line 221 "Exalgov3a.y" {printf("} while (!(");;} break; case 83: #line 222 "Exalgov3a.y" {printf("))");indent-=3;;} break; case 84: #line 225 "Exalgov3a.y" {printf("if (");;} break; case 85: #line 226 "Exalgov3a.y" {indent+=3;printf(")\n");ind();printf("{\n");ind();;} break; case 86: #line 229 "Exalgov3a.y" {printf("}");indent-=3;;} break; case 87: #line 232 "Exalgov3a.y" {VarIndex=strdup((char*)yylval); printf("{int %s=",VarIndex); inserer(VarIndex,varcont,0,0,0,&Symboles); ;} break; case 88: #line 236 "Exalgov3a.y" {printf(", boucle_lim=");;} break; case 89: #line 237 "Exalgov3a.y" {printf(",boucle_pas=");;} break; case 90: #line 238 "Exalgov3a.y" {printf(";\n");ind();indent+=3; printf("for (;(boucle_lim-%s)*boucle_pas>=0; %s+=boucle_pas) \n",VarIndex,VarIndex);ind();printf("{");;} break; case 91: #line 240 "Exalgov3a.y" {printf("}\n");indent-=3;ind();printf("}"); effacer1(&Symboles); ;} break; case 92: #line 246 "Exalgov3a.y" {printf("\n");ind();printf("else\n");indent+=3;ind();printf("{\n");ind();;} break; case 93: #line 247 "Exalgov3a.y" {indent-=3;printf("}");;} break; case 94: #line 250 "Exalgov3a.y" {printf(";\n");ind();;} break; case 95: #line 251 "Exalgov3a.y" {printf(";\n");ind();;} break; case 96: #line 252 "Exalgov3a.y" {printf(";\n");ind();;} break; case 97: #line 253 "Exalgov3a.y" {printf(";\n");ind();;} break; case 98: #line 254 "Exalgov3a.y" {printf("\n");ind();;} break; case 99: #line 255 "Exalgov3a.y" {printf(";\n");ind();;} break; case 100: #line 256 "Exalgov3a.y" {printf(";\n");ind();;} break; case 101: #line 257 "Exalgov3a.y" {printf("break");;} break; case 102: #line 257 "Exalgov3a.y" {printf(";\n");ind();;} break; case 103: #line 258 "Exalgov3a.y" {printf(";\n");ind();;} break; case 104: #line 259 "Exalgov3a.y" {printf("return;\n");ind();;} break; case 105: #line 260 "Exalgov3a.y" {printf("return ");;} break; case 106: #line 260 "Exalgov3a.y" {printf(";\n");ind();;} break; case 107: #line 261 "Exalgov3a.y" {printf(";\n");ind();;} break; case 108: #line 262 "Exalgov3a.y" {printf(";\n");ind();;} break; case 109: #line 263 "Exalgov3a.y" {errors=1;;} break; case 111: #line 267 "Exalgov3a.y" {/*fprintf(stderr,"FAIRE omis à la ligne %i\n",ligne);*/;} break; case 113: #line 272 "Exalgov3a.y" {/*fprintf(stderr,"PAS DE omis dans une boucle à la ligne %i\n", ligne);*/;} break; case 114: #line 274 "Exalgov3a.y" {/*fprintf(stderr,"PAR PAS DE omis dans une boucle à la ligne %i\n", ligne);*/ printf(" 1 ");;} break; case 115: #line 278 "Exalgov3a.y" {printf("}\n");indent-=3;ind();printf("else\n"); indent+=3;ind();printf("{\n");ind();;} break; case 116: #line 280 "Exalgov3a.y" {indent-=3;ind();;} break; case 118: #line 284 "Exalgov3a.y" {printf("if (");;} break; case 119: #line 285 "Exalgov3a.y" {printf(")\n");indent+=3;ind();printf("{\n");ind();;} break; case 120: #line 286 "Exalgov3a.y" {printf("}");indent-=3;ind();;} break; case 122: #line 290 "Exalgov3a.y" {printf("\n");ind();printf("else if (");;} break; case 123: #line 291 "Exalgov3a.y" {printf(")\n");indent+=3;ind();printf("{\n");ind();;} break; case 124: #line 292 "Exalgov3a.y" {printf("}");indent-=3;ind();;} break; case 127: #line 296 "Exalgov3a.y" {printf("=");;} break; case 129: #line 297 "Exalgov3a.y" {printf("="); /*fprintf(stderr, "erreur: \":\" omis dans une affectation à la ligne %i\n", ligne);*/;} break; case 131: #line 303 "Exalgov3a.y" {printf("=malloc(sizeof *%s)",yyvsp[-1]);;} break; case 132: #line 306 "Exalgov3a.y" {printf("free(");;} break; case 133: #line 307 "Exalgov3a.y" {printf(")");;} break; case 136: #line 312 "Exalgov3a.y" {errors=1;;} break; case 137: #line 315 "Exalgov3a.y" {printf("&&");;} break; case 138: #line 316 "Exalgov3a.y" {printf("||");;} break; case 141: #line 323 "Exalgov3a.y" {yyval=1;printf("==");;} break; case 142: #line 324 "Exalgov3a.y" {yyval=2;printf("!=");;} break; case 143: #line 325 "Exalgov3a.y" {yyval=3;printf(">");;} break; case 144: #line 326 "Exalgov3a.y" {yyval=4;printf("<");;} break; case 145: #line 327 "Exalgov3a.y" {yyval=5;printf(">=");;} break; case 146: #line 328 "Exalgov3a.y" {yyval=6;printf("<=");;} break; case 148: #line 332 "Exalgov3a.y" {printf("+");;} break; case 150: #line 333 "Exalgov3a.y" {printf("-");;} break; case 153: #line 337 "Exalgov3a.y" {printf("*");;} break; case 155: #line 338 "Exalgov3a.y" {printf("/");;} break; case 157: #line 339 "Exalgov3a.y" {printf("%s","%");;} break; case 161: #line 344 "Exalgov3a.y" {printf("-");;} break; case 163: #line 345 "Exalgov3a.y" {printf("!");;} break; case 166: #line 349 "Exalgov3a.y" {printf("(");;} break; case 167: #line 349 "Exalgov3a.y" {printf(")");;} break; case 169: #line 351 "Exalgov3a.y" {printf("[");;} break; case 170: #line 351 "Exalgov3a.y" {printf("]");;} break; case 171: #line 352 "Exalgov3a.y" {printf("[0]");;} break; case 172: #line 353 "Exalgov3a.y" {printf(".");;} break; case 175: #line 357 "Exalgov3a.y" {fprintf(stderr,") omis à la ligne %i\n",ligne);;} break; case 177: #line 361 "Exalgov3a.y" {fprintf(stderr,"] omis à la ligne %i\n",ligne);;} break; case 178: #line 364 "Exalgov3a.y" {flagstack[depth++]=refflags; refflags=rechercher((char*)yyvsp[-1],Symboles) ? rechercher((char*)yyvsp[-1],Symboles)->flags : 0; printf("(");;} break; case 179: #line 368 "Exalgov3a.y" {refflags=flagstack[--depth];printf(")");;} break; case 180: #line 370 "Exalgov3a.y" {echo();;} break; case 181: #line 371 "Exalgov3a.y" {echo();;} break; case 182: #line 372 "Exalgov3a.y" {echo();;} break; case 183: #line 373 "Exalgov3a.y" {printf("vrai");;} break; case 184: #line 374 "Exalgov3a.y" {printf("faux");;} break; case 185: #line 375 "Exalgov3a.y" {printf("nul");;} break; case 186: #line 378 "Exalgov3a.y" {if(!rechercher((char*)yyvsp[0],Symboles)) { fprintf(stderr,"Identificateur %s non-déclaré à la ligne %i:\n" ,(char*)yyvsp[0],ligne); echo(); } else { if (rechercher((char*)yyvsp[0],Symboles)->typ==refparam) {printf("(*");echo();printf(")");} else echo(); } ;} break; case 187: #line 393 "Exalgov3a.y" {if(!rechercher((char*)yyvsp[0],Symboles)) fprintf(stderr,"Identificateur %s non-déclaré à la ligne %i:\n",(char*)yyvsp[0],ligne); ;} break; case 190: #line 403 "Exalgov3a.y" {if (refflags%2) printf("&(");;} break; case 191: #line 404 "Exalgov3a.y" {if (refflags%2) printf(")"); refflags/=2;;} break; case 192: #line 405 "Exalgov3a.y" {yyval=1;;} break; case 193: #line 409 "Exalgov3a.y" {printf(",");;} break; case 194: #line 409 "Exalgov3a.y" {yyval=yyvsp[-1];;} break; case 195: #line 410 "Exalgov3a.y" {yyval=0;;} break; case 198: #line 417 "Exalgov3a.y" {/*fprintf(stderr,"ALORS omis à la ligne %i\n",ligne);*/;} break; case 200: #line 421 "Exalgov3a.y" {/*fprintf(stderr,"\";\" omis à la ligne %i?\n",ligne); */;} break; case 202: #line 425 "Exalgov3a.y" {/*fprintf(stderr,"ALLANT omis à la ligne %i\n",ligne);*/;} break; } /* Line 1000 of yacc.c. */ #line 2295 "Exalgov3a.tab.c" yyvsp -= yylen; yyssp -= yylen; YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ yyn = yyr1[yyn]; yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else yystate = yydefgoto[yyn - YYNTOKENS]; goto yynewstate; /*------------------------------------. | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; #if YYERROR_VERBOSE yyn = yypact[yystate]; if (YYPACT_NINF < yyn && yyn < YYLAST) { YYSIZE_T yysize = 0; int yytype = YYTRANSLATE (yychar); const char* yyprefix; char *yymsg; int yyx; /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. */ int yyxbegin = yyn < 0 ? -yyn : 0; /* Stay within bounds of both yycheck and yytname. */ int yychecklim = YYLAST - yyn; int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; int yycount = 0; yyprefix = ", expecting "; for (yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) { yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]); yycount += 1; if (yycount == 5) { yysize = 0; break; } } yysize += (sizeof ("syntax error, unexpected ") + yystrlen (yytname[yytype])); yymsg = (char *) YYSTACK_ALLOC (yysize); if (yymsg != 0) { char *yyp = yystpcpy (yymsg, "syntax error, unexpected "); yyp = yystpcpy (yyp, yytname[yytype]); if (yycount < 5) { yyprefix = ", expecting "; for (yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) { yyp = yystpcpy (yyp, yyprefix); yyp = yystpcpy (yyp, yytname[yyx]); yyprefix = " or "; } } yyerror (yymsg); YYSTACK_FREE (yymsg); } else yyerror ("syntax error; also virtual memory exhausted"); } else #endif /* YYERROR_VERBOSE */ yyerror ("syntax error"); } if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ if (yychar <= YYEOF) { /* If at end of input, pop the error token, then the rest of the stack, then return failure. */ if (yychar == YYEOF) for (;;) { YYPOPSTACK; if (yyssp == yyss) YYABORT; YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); yydestruct (yystos[*yyssp], yyvsp); } } else { YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc); yydestruct (yytoken, &yylval); yychar = YYEMPTY; } } /* Else will try to reuse lookahead token after shifting the error token. */ goto yyerrlab1; /*---------------------------------------------------. | yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ yyerrorlab: #ifdef __GNUC__ /* Pacify GCC when the user code never invokes YYERROR and the label yyerrorlab therefore never appears in user code. */ if (0) goto yyerrorlab; #endif yyvsp -= yylen; yyssp -= yylen; yystate = *yyssp; goto yyerrlab1; /*-------------------------------------------------------------. | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (yyn != YYPACT_NINF) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) { yyn = yytable[yyn]; if (0 < yyn) break; } } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) YYABORT; YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); yydestruct (yystos[yystate], yyvsp); YYPOPSTACK; yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } if (yyn == YYFINAL) YYACCEPT; YYDPRINTF ((stderr, "Shifting error token, ")); *++yyvsp = yylval; yystate = yyn; goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: yyresult = 0; goto yyreturn; /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: yyresult = 1; goto yyreturn; #ifndef yyoverflow /*----------------------------------------------. | yyoverflowlab -- parser overflow comes here. | `----------------------------------------------*/ yyoverflowlab: yyerror ("parser stack overflow"); yyresult = 2; /* Fall through. */ #endif yyreturn: #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif return yyresult; } #line 428 "Exalgov3a.y" #include #include "lex.yy.c" main() { inserer("afficher",1,1,1,0,&Symboles); yyparse(); } yyerror(char *s) { fprintf (stderr,"Erreur de syntaxe à la ligne %i:\n",ligne); } mmdebut() { indent=0; printf("#define vrai 1\n#define faux 0\n#define nul 0\n"); inserer("vrai",0,0,0,0,&Symboles); inserer("faux",0,0,0,0,&Symboles); inserer("nul",0,0,0,0,&Symboles); inserer("printf",0,0,0,0,&Symboles); inserer("scanf",0,0,0,1024*1024*1024-2,&Symboles); } mmfin() { } ind(){int i; for (i=0;i