OpenCOBOL 1.1pre-rel
|
00001 /* A Bison parser, made by GNU Bison 1.875. */ 00002 00003 /* Skeleton parser for Yacc-like parsing with Bison, 00004 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc. 00005 00006 This program is free software; you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License as published by 00008 the Free Software Foundation; either version 2, or (at your option) 00009 any later version. 00010 00011 This program is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with this program; if not, write to the Free Software 00018 Foundation, Inc., 59 Temple Place - Suite 330, 00019 Boston, MA 02111-1307, USA. */ 00020 00021 /* As a special exception, when this file is copied by Bison into a 00022 Bison output file, you may use that output file without restriction. 00023 This special exception was added by the Free Software Foundation 00024 in version 1.24 of Bison. */ 00025 00026 /* Written by Richard Stallman by simplifying the original so called 00027 ``semantic'' parser. */ 00028 00029 /* All symbols defined below should begin with yy or YY, to avoid 00030 infringing on user name space. This should be done even for local 00031 variables, as they might otherwise be expanded by user macros. 00032 There are some unavoidable exceptions within include files to 00033 define necessary library symbols; they are noted "INFRINGES ON 00034 USER NAME SPACE" below. */ 00035 00036 /* Identify Bison output. */ 00037 #define YYBISON 1 00038 00039 /* Skeleton name. */ 00040 #define YYSKELETON_NAME "yacc.c" 00041 00042 /* Pure parsers. */ 00043 #define YYPURE 0 00044 00045 /* Using locations. */ 00046 #define YYLSP_NEEDED 0 00047 00048 /* If NAME_PREFIX is specified substitute the variables and functions 00049 names. */ 00050 #define yyparse ppparse 00051 #define yylex pplex 00052 #define yyerror pperror 00053 #define yylval pplval 00054 #define yychar ppchar 00055 #define yydebug ppdebug 00056 #define yynerrs ppnerrs 00057 00058 00059 /* Tokens. */ 00060 #ifndef YYTOKENTYPE 00061 # define YYTOKENTYPE 00062 /* Put the tokens into the symbol table, so that GDB and other debuggers 00063 know about them. */ 00064 enum yytokentype { 00065 TOKEN_EOF = 0, 00066 COPY = 258, 00067 REPLACE = 259, 00068 SUPPRESS = 260, 00069 PRINTING = 261, 00070 REPLACING = 262, 00071 OFF = 263, 00072 IN = 264, 00073 OF = 265, 00074 BY = 266, 00075 EQEQ = 267, 00076 TOKEN = 268 00077 }; 00078 #endif 00079 #define TOKEN_EOF 0 00080 #define COPY 258 00081 #define REPLACE 259 00082 #define SUPPRESS 260 00083 #define PRINTING 261 00084 #define REPLACING 262 00085 #define OFF 263 00086 #define IN 264 00087 #define OF 265 00088 #define BY 266 00089 #define EQEQ 267 00090 #define TOKEN 268 00091 00092 00093 00094 00095 /* Copy the first part of user declarations. */ 00096 #line 26 "ppparse.y" 00097 00098 #include "config.h" 00099 00100 #include <stdio.h> 00101 #include <stdarg.h> 00102 #include <stdlib.h> 00103 #include <string.h> 00104 #include <ctype.h> 00105 00106 #include "cobc.h" 00107 00108 #define YYDEBUG 1 00109 #define YYERROR_VERBOSE 1 00110 #define pperror cb_error 00111 00112 static char *fix_filename (char *name); 00113 static char *fold_lower (char *name); 00114 static char *fold_upper (char *name); 00115 00116 static struct cb_replace_list *cb_replace_list_add (struct cb_replace_list *replace_list, struct cb_text_list *old_text, struct cb_text_list *new_text); 00117 00118 00119 /* Enabling traces. */ 00120 #ifndef YYDEBUG 00121 # define YYDEBUG 0 00122 #endif 00123 00124 /* Enabling verbose error messages. */ 00125 #ifdef YYERROR_VERBOSE 00126 # undef YYERROR_VERBOSE 00127 # define YYERROR_VERBOSE 1 00128 #else 00129 # define YYERROR_VERBOSE 0 00130 #endif 00131 00132 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) 00133 #line 48 "ppparse.y" 00134 typedef union YYSTYPE { 00135 char *s; 00136 struct cb_text_list *l; 00137 struct cb_replace_list *r; 00138 } YYSTYPE; 00139 /* Line 191 of yacc.c. */ 00140 #line 140 "ppparse.c" 00141 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ 00142 # define YYSTYPE_IS_DECLARED 1 00143 # define YYSTYPE_IS_TRIVIAL 1 00144 #endif 00145 00146 00147 00148 /* Copy the second part of user declarations. */ 00149 00150 00151 /* Line 214 of yacc.c. */ 00152 #line 152 "ppparse.c" 00153 00154 #if ! defined (yyoverflow) || YYERROR_VERBOSE 00155 00156 /* The parser invokes alloca or malloc; define the necessary symbols. */ 00157 00158 # if YYSTACK_USE_ALLOCA 00159 # define YYSTACK_ALLOC alloca 00160 # else 00161 # ifndef YYSTACK_USE_ALLOCA 00162 # if defined (alloca) || defined (_ALLOCA_H) 00163 # define YYSTACK_ALLOC alloca 00164 # else 00165 # ifdef __GNUC__ 00166 # define YYSTACK_ALLOC __builtin_alloca 00167 # endif 00168 # endif 00169 # endif 00170 # endif 00171 00172 # ifdef YYSTACK_ALLOC 00173 /* Pacify GCC's `empty if-body' warning. */ 00174 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) 00175 # else 00176 # if defined (__STDC__) || defined (__cplusplus) 00177 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 00178 # define YYSIZE_T size_t 00179 # endif 00180 # define YYSTACK_ALLOC malloc 00181 # define YYSTACK_FREE free 00182 # endif 00183 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ 00184 00185 00186 #if (! defined (yyoverflow) \ 00187 && (! defined (__cplusplus) \ 00188 || (YYSTYPE_IS_TRIVIAL))) 00189 00190 /* A type that is properly aligned for any stack member. */ 00191 union yyalloc 00192 { 00193 short yyss; 00194 YYSTYPE yyvs; 00195 }; 00196 00197 /* The size of the maximum gap between one aligned stack and the next. */ 00198 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) 00199 00200 /* The size of an array large to enough to hold all stacks, each with 00201 N elements. */ 00202 # define YYSTACK_BYTES(N) \ 00203 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ 00204 + YYSTACK_GAP_MAXIMUM) 00205 00206 /* Copy COUNT objects from FROM to TO. The source and destination do 00207 not overlap. */ 00208 # ifndef YYCOPY 00209 # if 1 < __GNUC__ 00210 # define YYCOPY(To, From, Count) \ 00211 __builtin_memcpy (To, From, (Count) * sizeof (*(From))) 00212 # else 00213 # define YYCOPY(To, From, Count) \ 00214 do \ 00215 { \ 00216 register YYSIZE_T yyi; \ 00217 for (yyi = 0; yyi < (Count); yyi++) \ 00218 (To)[yyi] = (From)[yyi]; \ 00219 } \ 00220 while (0) 00221 # endif 00222 # endif 00223 00224 /* Relocate STACK from its old location to the new one. The 00225 local variables YYSIZE and YYSTACKSIZE give the old and new number of 00226 elements in the stack, and YYPTR gives the new location of the 00227 stack. Advance YYPTR to a properly aligned location for the next 00228 stack. */ 00229 # define YYSTACK_RELOCATE(Stack) \ 00230 do \ 00231 { \ 00232 YYSIZE_T yynewbytes; \ 00233 YYCOPY (&yyptr->Stack, Stack, yysize); \ 00234 Stack = &yyptr->Stack; \ 00235 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ 00236 yyptr += yynewbytes / sizeof (*yyptr); \ 00237 } \ 00238 while (0) 00239 00240 #endif 00241 00242 #if defined (__STDC__) || defined (__cplusplus) 00243 typedef signed char yysigned_char; 00244 #else 00245 typedef short yysigned_char; 00246 #endif 00247 00248 /* YYFINAL -- State number of the termination state. */ 00249 #define YYFINAL 2 00250 /* YYLAST -- Last index in YYTABLE. */ 00251 #define YYLAST 41 00252 00253 /* YYNTOKENS -- Number of terminals. */ 00254 #define YYNTOKENS 17 00255 /* YYNNTS -- Number of nonterminals. */ 00256 #define YYNNTS 15 00257 /* YYNRULES -- Number of rules. */ 00258 #define YYNRULES 31 00259 /* YYNRULES -- Number of states. */ 00260 #define YYNSTATES 50 00261 00262 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ 00263 #define YYUNDEFTOK 2 00264 #define YYMAXUTOK 268 00265 00266 #define YYTRANSLATE(YYX) \ 00267 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) 00268 00269 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ 00270 static const unsigned char yytranslate[] = 00271 { 00272 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00273 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00274 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00275 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00276 15, 16, 2, 2, 2, 2, 14, 2, 2, 2, 00277 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00278 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00279 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00280 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00281 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00282 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00283 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00284 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00285 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00286 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00287 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00288 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00289 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00290 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00291 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00292 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00293 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00294 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00295 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00296 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00297 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 00298 5, 6, 7, 8, 9, 10, 11, 12, 13 00299 }; 00300 00301 #if YYDEBUG 00302 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in 00303 YYRHS. */ 00304 static const unsigned char yyprhs[] = 00305 { 00306 0, 0, 3, 4, 7, 9, 11, 18, 19, 22, 00307 25, 26, 29, 30, 33, 37, 41, 45, 50, 52, 00308 54, 57, 61, 63, 66, 68, 72, 76, 81, 83, 00309 86, 87 00310 }; 00311 00312 /* YYRHS -- A `-1'-separated list of the rules' RHS. */ 00313 static const yysigned_char yyrhs[] = 00314 { 00315 18, 0, -1, -1, 18, 19, -1, 20, -1, 24, 00316 -1, 3, 13, 21, 22, 23, 14, -1, -1, 9, 00317 13, -1, 10, 13, -1, -1, 5, 31, -1, -1, 00318 7, 25, -1, 4, 25, 14, -1, 4, 8, 14, 00319 -1, 26, 11, 26, -1, 25, 26, 11, 26, -1, 00320 27, -1, 29, -1, 12, 12, -1, 12, 28, 12, 00321 -1, 13, -1, 28, 13, -1, 13, -1, 29, 9, 00322 13, -1, 29, 10, 13, -1, 29, 15, 30, 16, 00323 -1, 13, -1, 30, 13, -1, -1, 6, -1 00324 }; 00325 00326 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ 00327 static const unsigned char yyrline[] = 00328 { 00329 0, 63, 63, 63, 64, 64, 67, 89, 90, 91, 00330 94, 95, 99, 100, 104, 105, 109, 110, 114, 115, 00331 119, 120, 124, 125, 129, 130, 137, 144, 157, 158, 00332 165, 165 00333 }; 00334 #endif 00335 00336 #if YYDEBUG || YYERROR_VERBOSE 00337 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. 00338 First, the terminals, then, starting at YYNTOKENS, nonterminals. */ 00339 static const char *const yytname[] = 00340 { 00341 "\"end of file\"", "error", "$undefined", "COPY", "REPLACE", "SUPPRESS", 00342 "PRINTING", "REPLACING", "OFF", "IN", "OF", "BY", "EQEQ", "TOKEN", 00343 "'.'", "'('", "')'", "$accept", "statement_list", "statement", 00344 "copy_statement", "copy_in", "copy_suppress", "copy_replacing", 00345 "replace_statement", "replacing_list", "text", "pseudo_text", 00346 "token_list", "identifier", "subscripts", "_printing", 0 00347 }; 00348 #endif 00349 00350 # ifdef YYPRINT 00351 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to 00352 token YYLEX-NUM. */ 00353 static const unsigned short yytoknum[] = 00354 { 00355 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 00356 265, 266, 267, 268, 46, 40, 41 00357 }; 00358 # endif 00359 00360 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ 00361 static const unsigned char yyr1[] = 00362 { 00363 0, 17, 18, 18, 19, 19, 20, 21, 21, 21, 00364 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 00365 27, 27, 28, 28, 29, 29, 29, 29, 30, 30, 00366 31, 31 00367 }; 00368 00369 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ 00370 static const unsigned char yyr2[] = 00371 { 00372 0, 2, 0, 2, 1, 1, 6, 0, 2, 2, 00373 0, 2, 0, 2, 3, 3, 3, 4, 1, 1, 00374 2, 3, 1, 2, 1, 3, 3, 4, 1, 2, 00375 0, 1 00376 }; 00377 00378 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state 00379 STATE-NUM when YYTABLE doesn't specify something else to do. Zero 00380 means the default is an error. */ 00381 static const unsigned char yydefact[] = 00382 { 00383 2, 0, 1, 0, 0, 3, 4, 5, 7, 0, 00384 0, 24, 0, 0, 18, 19, 0, 0, 10, 15, 00385 20, 22, 0, 14, 0, 0, 0, 0, 0, 8, 00386 9, 30, 12, 21, 23, 0, 16, 25, 26, 28, 00387 0, 31, 11, 0, 0, 17, 29, 27, 13, 6 00388 }; 00389 00390 /* YYDEFGOTO[NTERM-NUM]. */ 00391 static const yysigned_char yydefgoto[] = 00392 { 00393 -1, 1, 5, 6, 18, 32, 44, 7, 12, 13, 00394 14, 22, 15, 40, 42 00395 }; 00396 00397 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing 00398 STATE-NUM. */ 00399 #define YYPACT_NINF -13 00400 static const yysigned_char yypact[] = 00401 { 00402 -13, 11, -13, -3, -4, -13, -13, -13, 10, -9, 00403 9, -13, 4, 1, -13, -8, 15, 16, 25, -13, 00404 -13, -13, 12, -13, 20, 14, 19, 21, 22, -13, 00405 -13, 27, 30, -13, -13, 14, -13, -13, -13, -13, 00406 -10, -13, -13, 14, 24, -13, -13, -13, 14, -13 00407 }; 00408 00409 /* YYPGOTO[NTERM-NUM]. */ 00410 static const yysigned_char yypgoto[] = 00411 { 00412 -13, -13, -13, -13, -13, -13, -13, -13, -2, -12, 00413 -13, -13, -13, -13, -13 00414 }; 00415 00416 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If 00417 positive, shift that token. If negative, reduce the rule which 00418 number is the opposite. If zero, do what YYDEFACT says. 00419 If YYTABLE_NINF, syntax error. */ 00420 #define YYTABLE_NINF -1 00421 static const unsigned char yytable[] = 00422 { 00423 24, 26, 27, 46, 9, 19, 47, 28, 10, 11, 00424 8, 2, 25, 36, 3, 4, 10, 11, 23, 16, 00425 17, 20, 21, 45, 33, 34, 10, 11, 29, 30, 00426 31, 35, 37, 41, 38, 39, 24, 43, 49, 0, 00427 0, 48 00428 }; 00429 00430 static const yysigned_char yycheck[] = 00431 { 00432 12, 9, 10, 13, 8, 14, 16, 15, 12, 13, 00433 13, 0, 11, 25, 3, 4, 12, 13, 14, 9, 00434 10, 12, 13, 35, 12, 13, 12, 13, 13, 13, 00435 5, 11, 13, 6, 13, 13, 48, 7, 14, -1, 00436 -1, 43 00437 }; 00438 00439 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing 00440 symbol of state STATE-NUM. */ 00441 static const unsigned char yystos[] = 00442 { 00443 0, 18, 0, 3, 4, 19, 20, 24, 13, 8, 00444 12, 13, 25, 26, 27, 29, 9, 10, 21, 14, 00445 12, 13, 28, 14, 26, 11, 9, 10, 15, 13, 00446 13, 5, 22, 12, 13, 11, 26, 13, 13, 13, 00447 30, 6, 31, 7, 23, 26, 13, 16, 25, 14 00448 }; 00449 00450 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) 00451 # define YYSIZE_T __SIZE_TYPE__ 00452 #endif 00453 #if ! defined (YYSIZE_T) && defined (size_t) 00454 # define YYSIZE_T size_t 00455 #endif 00456 #if ! defined (YYSIZE_T) 00457 # if defined (__STDC__) || defined (__cplusplus) 00458 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ 00459 # define YYSIZE_T size_t 00460 # endif 00461 #endif 00462 #if ! defined (YYSIZE_T) 00463 # define YYSIZE_T unsigned int 00464 #endif 00465 00466 #define yyerrok (yyerrstatus = 0) 00467 #define yyclearin (yychar = YYEMPTY) 00468 #define YYEMPTY (-2) 00469 #define YYEOF 0 00470 00471 #define YYACCEPT goto yyacceptlab 00472 #define YYABORT goto yyabortlab 00473 #define YYERROR goto yyerrlab1 00474 00475 /* Like YYERROR except do call yyerror. This remains here temporarily 00476 to ease the transition to the new meaning of YYERROR, for GCC. 00477 Once GCC version 2 has supplanted version 1, this can go. */ 00478 00479 #define YYFAIL goto yyerrlab 00480 00481 #define YYRECOVERING() (!!yyerrstatus) 00482 00483 #define YYBACKUP(Token, Value) \ 00484 do \ 00485 if (yychar == YYEMPTY && yylen == 1) \ 00486 { \ 00487 yychar = (Token); \ 00488 yylval = (Value); \ 00489 yytoken = YYTRANSLATE (yychar); \ 00490 YYPOPSTACK; \ 00491 goto yybackup; \ 00492 } \ 00493 else \ 00494 { \ 00495 yyerror ("syntax error: cannot back up");\ 00496 YYERROR; \ 00497 } \ 00498 while (0) 00499 00500 #define YYTERROR 1 00501 #define YYERRCODE 256 00502 00503 /* YYLLOC_DEFAULT -- Compute the default location (before the actions 00504 are run). */ 00505 00506 #ifndef YYLLOC_DEFAULT 00507 # define YYLLOC_DEFAULT(Current, Rhs, N) \ 00508 Current.first_line = Rhs[1].first_line; \ 00509 Current.first_column = Rhs[1].first_column; \ 00510 Current.last_line = Rhs[N].last_line; \ 00511 Current.last_column = Rhs[N].last_column; 00512 #endif 00513 00514 /* YYLEX -- calling `yylex' with the right arguments. */ 00515 00516 #ifdef YYLEX_PARAM 00517 # define YYLEX yylex (YYLEX_PARAM) 00518 #else 00519 # define YYLEX yylex () 00520 #endif 00521 00522 /* Enable debugging if requested. */ 00523 #if YYDEBUG 00524 00525 # ifndef YYFPRINTF 00526 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */ 00527 # define YYFPRINTF fprintf 00528 # endif 00529 00530 # define YYDPRINTF(Args) \ 00531 do { \ 00532 if (yydebug) \ 00533 YYFPRINTF Args; \ 00534 } while (0) 00535 00536 # define YYDSYMPRINT(Args) \ 00537 do { \ 00538 if (yydebug) \ 00539 yysymprint Args; \ 00540 } while (0) 00541 00542 # define YYDSYMPRINTF(Title, Token, Value, Location) \ 00543 do { \ 00544 if (yydebug) \ 00545 { \ 00546 YYFPRINTF (stderr, "%s ", Title); \ 00547 yysymprint (stderr, \ 00548 Token, Value); \ 00549 YYFPRINTF (stderr, "\n"); \ 00550 } \ 00551 } while (0) 00552 00553 /*------------------------------------------------------------------. 00554 | yy_stack_print -- Print the state stack from its BOTTOM up to its | 00555 | TOP (cinluded). | 00556 `------------------------------------------------------------------*/ 00557 00558 #if defined (__STDC__) || defined (__cplusplus) 00559 static void 00560 yy_stack_print (short *bottom, short *top) 00561 #else 00562 static void 00563 yy_stack_print (bottom, top) 00564 short *bottom; 00565 short *top; 00566 #endif 00567 { 00568 YYFPRINTF (stderr, "Stack now"); 00569 for (/* Nothing. */; bottom <= top; ++bottom) 00570 YYFPRINTF (stderr, " %d", *bottom); 00571 YYFPRINTF (stderr, "\n"); 00572 } 00573 00574 # define YY_STACK_PRINT(Bottom, Top) \ 00575 do { \ 00576 if (yydebug) \ 00577 yy_stack_print ((Bottom), (Top)); \ 00578 } while (0) 00579 00580 00581 /*------------------------------------------------. 00582 | Report that the YYRULE is going to be reduced. | 00583 `------------------------------------------------*/ 00584 00585 #if defined (__STDC__) || defined (__cplusplus) 00586 static void 00587 yy_reduce_print (int yyrule) 00588 #else 00589 static void 00590 yy_reduce_print (yyrule) 00591 int yyrule; 00592 #endif 00593 { 00594 int yyi; 00595 unsigned int yylineno = yyrline[yyrule]; 00596 YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ", 00597 yyrule - 1, yylineno); 00598 /* Print the symbols being reduced, and their result. */ 00599 for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) 00600 YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]); 00601 YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]); 00602 } 00603 00604 # define YY_REDUCE_PRINT(Rule) \ 00605 do { \ 00606 if (yydebug) \ 00607 yy_reduce_print (Rule); \ 00608 } while (0) 00609 00610 /* Nonzero means print parse trace. It is left uninitialized so that 00611 multiple parsers can coexist. */ 00612 int yydebug; 00613 #else /* !YYDEBUG */ 00614 # define YYDPRINTF(Args) 00615 # define YYDSYMPRINT(Args) 00616 # define YYDSYMPRINTF(Title, Token, Value, Location) 00617 # define YY_STACK_PRINT(Bottom, Top) 00618 # define YY_REDUCE_PRINT(Rule) 00619 #endif /* !YYDEBUG */ 00620 00621 00622 /* YYINITDEPTH -- initial size of the parser's stacks. */ 00623 #ifndef YYINITDEPTH 00624 # define YYINITDEPTH 200 00625 #endif 00626 00627 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only 00628 if the built-in stack extension method is used). 00629 00630 Do not make this value too large; the results are undefined if 00631 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) 00632 evaluated with infinite-precision integer arithmetic. */ 00633 00634 #if YYMAXDEPTH == 0 00635 # undef YYMAXDEPTH 00636 #endif 00637 00638 #ifndef YYMAXDEPTH 00639 # define YYMAXDEPTH 10000 00640 #endif 00641 00642 00643 00644 #if YYERROR_VERBOSE 00645 00646 # ifndef yystrlen 00647 # if defined (__GLIBC__) && defined (_STRING_H) 00648 # define yystrlen strlen 00649 # else 00650 /* Return the length of YYSTR. */ 00651 static YYSIZE_T 00652 # if defined (__STDC__) || defined (__cplusplus) 00653 yystrlen (const char *yystr) 00654 # else 00655 yystrlen (yystr) 00656 const char *yystr; 00657 # endif 00658 { 00659 register const char *yys = yystr; 00660 00661 while (*yys++ != '\0') 00662 continue; 00663 00664 return yys - yystr - 1; 00665 } 00666 # endif 00667 # endif 00668 00669 # ifndef yystpcpy 00670 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) 00671 # define yystpcpy stpcpy 00672 # else 00673 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in 00674 YYDEST. */ 00675 static char * 00676 # if defined (__STDC__) || defined (__cplusplus) 00677 yystpcpy (char *yydest, const char *yysrc) 00678 # else 00679 yystpcpy (yydest, yysrc) 00680 char *yydest; 00681 const char *yysrc; 00682 # endif 00683 { 00684 register char *yyd = yydest; 00685 register const char *yys = yysrc; 00686 00687 while ((*yyd++ = *yys++) != '\0') 00688 continue; 00689 00690 return yyd - 1; 00691 } 00692 # endif 00693 # endif 00694 00695 #endif /* !YYERROR_VERBOSE */ 00696 00697 00698 00699 #if YYDEBUG 00700 /*--------------------------------. 00701 | Print this symbol on YYOUTPUT. | 00702 `--------------------------------*/ 00703 00704 #if defined (__STDC__) || defined (__cplusplus) 00705 static void 00706 yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) 00707 #else 00708 static void 00709 yysymprint (yyoutput, yytype, yyvaluep) 00710 FILE *yyoutput; 00711 int yytype; 00712 YYSTYPE *yyvaluep; 00713 #endif 00714 { 00715 /* Pacify ``unused variable'' warnings. */ 00716 (void) yyvaluep; 00717 00718 if (yytype < YYNTOKENS) 00719 { 00720 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); 00721 # ifdef YYPRINT 00722 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); 00723 # endif 00724 } 00725 else 00726 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); 00727 00728 switch (yytype) 00729 { 00730 default: 00731 break; 00732 } 00733 YYFPRINTF (yyoutput, ")"); 00734 } 00735 00736 #endif /* ! YYDEBUG */ 00737 /*-----------------------------------------------. 00738 | Release the memory associated to this symbol. | 00739 `-----------------------------------------------*/ 00740 00741 #if defined (__STDC__) || defined (__cplusplus) 00742 static void 00743 yydestruct (int yytype, YYSTYPE *yyvaluep) 00744 #else 00745 static void 00746 yydestruct (yytype, yyvaluep) 00747 int yytype; 00748 YYSTYPE *yyvaluep; 00749 #endif 00750 { 00751 /* Pacify ``unused variable'' warnings. */ 00752 (void) yyvaluep; 00753 00754 switch (yytype) 00755 { 00756 00757 default: 00758 break; 00759 } 00760 } 00761 00762 00763 /* Prevent warnings from -Wmissing-prototypes. */ 00764 00765 #ifdef YYPARSE_PARAM 00766 # if defined (__STDC__) || defined (__cplusplus) 00767 int yyparse (void *YYPARSE_PARAM); 00768 # else 00769 int yyparse (); 00770 # endif 00771 #else /* ! YYPARSE_PARAM */ 00772 #if defined (__STDC__) || defined (__cplusplus) 00773 int yyparse (void); 00774 #else 00775 int yyparse (); 00776 #endif 00777 #endif /* ! YYPARSE_PARAM */ 00778 00779 00780 00781 /* The lookahead symbol. */ 00782 int yychar; 00783 00784 /* The semantic value of the lookahead symbol. */ 00785 YYSTYPE yylval; 00786 00787 /* Number of syntax errors so far. */ 00788 int yynerrs; 00789 00790 00791 00792 /*----------. 00793 | yyparse. | 00794 `----------*/ 00795 00796 #ifdef YYPARSE_PARAM 00797 # if defined (__STDC__) || defined (__cplusplus) 00798 int yyparse (void *YYPARSE_PARAM) 00799 # else 00800 int yyparse (YYPARSE_PARAM) 00801 void *YYPARSE_PARAM; 00802 # endif 00803 #else /* ! YYPARSE_PARAM */ 00804 #if defined (__STDC__) || defined (__cplusplus) 00805 int 00806 yyparse (void) 00807 #else 00808 int 00809 yyparse () 00810 00811 #endif 00812 #endif 00813 { 00814 00815 register int yystate; 00816 register int yyn; 00817 int yyresult; 00818 /* Number of tokens to shift before error messages enabled. */ 00819 int yyerrstatus; 00820 /* Lookahead token as an internal (translated) token number. */ 00821 int yytoken = 0; 00822 00823 /* Three stacks and their tools: 00824 `yyss': related to states, 00825 `yyvs': related to semantic values, 00826 `yyls': related to locations. 00827 00828 Refer to the stacks thru separate pointers, to allow yyoverflow 00829 to reallocate them elsewhere. */ 00830 00831 /* The state stack. */ 00832 short yyssa[YYINITDEPTH]; 00833 short *yyss = yyssa; 00834 register short *yyssp; 00835 00836 /* The semantic value stack. */ 00837 YYSTYPE yyvsa[YYINITDEPTH]; 00838 YYSTYPE *yyvs = yyvsa; 00839 register YYSTYPE *yyvsp; 00840 00841 00842 00843 #define YYPOPSTACK (yyvsp--, yyssp--) 00844 00845 YYSIZE_T yystacksize = YYINITDEPTH; 00846 00847 /* The variables used to return semantic value and location from the 00848 action routines. */ 00849 YYSTYPE yyval; 00850 00851 00852 /* When reducing, the number of symbols on the RHS of the reduced 00853 rule. */ 00854 int yylen; 00855 00856 YYDPRINTF ((stderr, "Starting parse\n")); 00857 00858 yystate = 0; 00859 yyerrstatus = 0; 00860 yynerrs = 0; 00861 yychar = YYEMPTY; /* Cause a token to be read. */ 00862 00863 /* Initialize stack pointers. 00864 Waste one element of value and location stack 00865 so that they stay on the same level as the state stack. 00866 The wasted elements are never initialized. */ 00867 00868 yyssp = yyss; 00869 yyvsp = yyvs; 00870 00871 goto yysetstate; 00872 00873 /*------------------------------------------------------------. 00874 | yynewstate -- Push a new state, which is found in yystate. | 00875 `------------------------------------------------------------*/ 00876 yynewstate: 00877 /* In all cases, when you get here, the value and location stacks 00878 have just been pushed. so pushing a state here evens the stacks. 00879 */ 00880 yyssp++; 00881 00882 yysetstate: 00883 *yyssp = yystate; 00884 00885 if (yyss + yystacksize - 1 <= yyssp) 00886 { 00887 /* Get the current used size of the three stacks, in elements. */ 00888 YYSIZE_T yysize = yyssp - yyss + 1; 00889 00890 #ifdef yyoverflow 00891 { 00892 /* Give user a chance to reallocate the stack. Use copies of 00893 these so that the &'s don't force the real ones into 00894 memory. */ 00895 YYSTYPE *yyvs1 = yyvs; 00896 short *yyss1 = yyss; 00897 00898 00899 /* Each stack pointer address is followed by the size of the 00900 data in use in that stack, in bytes. This used to be a 00901 conditional around just the two extra args, but that might 00902 be undefined if yyoverflow is a macro. */ 00903 yyoverflow ("parser stack overflow", 00904 &yyss1, yysize * sizeof (*yyssp), 00905 &yyvs1, yysize * sizeof (*yyvsp), 00906 00907 &yystacksize); 00908 00909 yyss = yyss1; 00910 yyvs = yyvs1; 00911 } 00912 #else /* no yyoverflow */ 00913 # ifndef YYSTACK_RELOCATE 00914 goto yyoverflowlab; 00915 # else 00916 /* Extend the stack our own way. */ 00917 if (YYMAXDEPTH <= yystacksize) 00918 goto yyoverflowlab; 00919 yystacksize *= 2; 00920 if (YYMAXDEPTH < yystacksize) 00921 yystacksize = YYMAXDEPTH; 00922 00923 { 00924 short *yyss1 = yyss; 00925 union yyalloc *yyptr = 00926 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); 00927 if (! yyptr) 00928 goto yyoverflowlab; 00929 YYSTACK_RELOCATE (yyss); 00930 YYSTACK_RELOCATE (yyvs); 00931 00932 # undef YYSTACK_RELOCATE 00933 if (yyss1 != yyssa) 00934 YYSTACK_FREE (yyss1); 00935 } 00936 # endif 00937 #endif /* no yyoverflow */ 00938 00939 yyssp = yyss + yysize - 1; 00940 yyvsp = yyvs + yysize - 1; 00941 00942 00943 YYDPRINTF ((stderr, "Stack size increased to %lu\n", 00944 (unsigned long int) yystacksize)); 00945 00946 if (yyss + yystacksize - 1 <= yyssp) 00947 YYABORT; 00948 } 00949 00950 YYDPRINTF ((stderr, "Entering state %d\n", yystate)); 00951 00952 goto yybackup; 00953 00954 /*-----------. 00955 | yybackup. | 00956 `-----------*/ 00957 yybackup: 00958 00959 /* Do appropriate processing given the current state. */ 00960 /* Read a lookahead token if we need one and don't already have one. */ 00961 /* yyresume: */ 00962 00963 /* First try to decide what to do without reference to lookahead token. */ 00964 00965 yyn = yypact[yystate]; 00966 if (yyn == YYPACT_NINF) 00967 goto yydefault; 00968 00969 /* Not known => get a lookahead token if don't already have one. */ 00970 00971 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ 00972 if (yychar == YYEMPTY) 00973 { 00974 YYDPRINTF ((stderr, "Reading a token: ")); 00975 yychar = YYLEX; 00976 } 00977 00978 if (yychar <= YYEOF) 00979 { 00980 yychar = yytoken = YYEOF; 00981 YYDPRINTF ((stderr, "Now at end of input.\n")); 00982 } 00983 else 00984 { 00985 yytoken = YYTRANSLATE (yychar); 00986 YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc); 00987 } 00988 00989 /* If the proper action on seeing token YYTOKEN is to reduce or to 00990 detect an error, take that action. */ 00991 yyn += yytoken; 00992 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) 00993 goto yydefault; 00994 yyn = yytable[yyn]; 00995 if (yyn <= 0) 00996 { 00997 if (yyn == 0 || yyn == YYTABLE_NINF) 00998 goto yyerrlab; 00999 yyn = -yyn; 01000 goto yyreduce; 01001 } 01002 01003 if (yyn == YYFINAL) 01004 YYACCEPT; 01005 01006 /* Shift the lookahead token. */ 01007 YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken])); 01008 01009 /* Discard the token being shifted unless it is eof. */ 01010 if (yychar != YYEOF) 01011 yychar = YYEMPTY; 01012 01013 *++yyvsp = yylval; 01014 01015 01016 /* Count tokens shifted since error; after three, turn off error 01017 status. */ 01018 if (yyerrstatus) 01019 yyerrstatus--; 01020 01021 yystate = yyn; 01022 goto yynewstate; 01023 01024 01025 /*-----------------------------------------------------------. 01026 | yydefault -- do the default action for the current state. | 01027 `-----------------------------------------------------------*/ 01028 yydefault: 01029 yyn = yydefact[yystate]; 01030 if (yyn == 0) 01031 goto yyerrlab; 01032 goto yyreduce; 01033 01034 01035 /*-----------------------------. 01036 | yyreduce -- Do a reduction. | 01037 `-----------------------------*/ 01038 yyreduce: 01039 /* yyn is the number of a rule to reduce with. */ 01040 yylen = yyr2[yyn]; 01041 01042 /* If YYLEN is nonzero, implement the default value of the action: 01043 `$$ = $1'. 01044 01045 Otherwise, the following line sets YYVAL to garbage. 01046 This behavior is undocumented and Bison 01047 users should not rely upon it. Assigning to YYVAL 01048 unconditionally makes the parser a bit smaller, and it avoids a 01049 GCC warning that YYVAL may be used uninitialized. */ 01050 yyval = yyvsp[1-yylen]; 01051 01052 01053 YY_REDUCE_PRINT (yyn); 01054 switch (yyn) 01055 { 01056 case 6: 01057 #line 68 "ppparse.y" 01058 { 01059 fputc ('\n', ppout); 01060 yyvsp[-4].s = fix_filename (yyvsp[-4].s); 01061 if (cb_flag_fold_copy_lower) { 01062 yyvsp[-4].s = fold_lower (yyvsp[-4].s); 01063 } else if (cb_flag_fold_copy_upper) { 01064 yyvsp[-4].s = fold_upper (yyvsp[-4].s); 01065 } 01066 if (yyvsp[-3].s) { 01067 yyvsp[-3].s = fix_filename (yyvsp[-3].s); 01068 if (cb_flag_fold_copy_lower) { 01069 yyvsp[-3].s = fold_lower (yyvsp[-3].s); 01070 } else if (cb_flag_fold_copy_upper) { 01071 yyvsp[-3].s = fold_upper (yyvsp[-3].s); 01072 } 01073 } 01074 ppcopy (yyvsp[-4].s, yyvsp[-3].s, yyvsp[-1].r); 01075 ;} 01076 break; 01077 01078 case 7: 01079 #line 89 "ppparse.y" 01080 { yyval.s = NULL; ;} 01081 break; 01082 01083 case 8: 01084 #line 90 "ppparse.y" 01085 { yyval.s = yyvsp[0].s; ;} 01086 break; 01087 01088 case 9: 01089 #line 91 "ppparse.y" 01090 { yyval.s = yyvsp[0].s; ;} 01091 break; 01092 01093 case 12: 01094 #line 99 "ppparse.y" 01095 { yyval.r = NULL; ;} 01096 break; 01097 01098 case 13: 01099 #line 100 "ppparse.y" 01100 { yyval.r = yyvsp[0].r; ;} 01101 break; 01102 01103 case 14: 01104 #line 104 "ppparse.y" 01105 { pp_set_replace_list (yyvsp[-1].r); ;} 01106 break; 01107 01108 case 15: 01109 #line 105 "ppparse.y" 01110 { pp_set_replace_list (NULL); ;} 01111 break; 01112 01113 case 16: 01114 #line 109 "ppparse.y" 01115 { yyval.r = cb_replace_list_add (NULL, yyvsp[-2].l, yyvsp[0].l); ;} 01116 break; 01117 01118 case 17: 01119 #line 110 "ppparse.y" 01120 { yyval.r = cb_replace_list_add (yyvsp[-3].r, yyvsp[-2].l, yyvsp[0].l); ;} 01121 break; 01122 01123 case 18: 01124 #line 114 "ppparse.y" 01125 { yyval.l = yyvsp[0].l; ;} 01126 break; 01127 01128 case 19: 01129 #line 115 "ppparse.y" 01130 { yyval.l = yyvsp[0].l; ;} 01131 break; 01132 01133 case 20: 01134 #line 119 "ppparse.y" 01135 { yyval.l = NULL; ;} 01136 break; 01137 01138 case 21: 01139 #line 120 "ppparse.y" 01140 { yyval.l = yyvsp[-1].l; ;} 01141 break; 01142 01143 case 22: 01144 #line 124 "ppparse.y" 01145 { yyval.l = cb_text_list_add (NULL, yyvsp[0].s); ;} 01146 break; 01147 01148 case 23: 01149 #line 125 "ppparse.y" 01150 { yyval.l = cb_text_list_add (yyvsp[-1].l, yyvsp[0].s); ;} 01151 break; 01152 01153 case 24: 01154 #line 129 "ppparse.y" 01155 { yyval.l = cb_text_list_add (NULL, yyvsp[0].s); ;} 01156 break; 01157 01158 case 25: 01159 #line 131 "ppparse.y" 01160 { 01161 yyval.l = cb_text_list_add (yyvsp[-2].l, " "); 01162 yyval.l = cb_text_list_add (yyval.l, "IN"); 01163 yyval.l = cb_text_list_add (yyval.l, " "); 01164 yyval.l = cb_text_list_add (yyval.l, yyvsp[0].s); 01165 ;} 01166 break; 01167 01168 case 26: 01169 #line 138 "ppparse.y" 01170 { 01171 yyval.l = cb_text_list_add (yyvsp[-2].l, " "); 01172 yyval.l = cb_text_list_add (yyval.l, "OF"); 01173 yyval.l = cb_text_list_add (yyval.l, " "); 01174 yyval.l = cb_text_list_add (yyval.l, yyvsp[0].s); 01175 ;} 01176 break; 01177 01178 case 27: 01179 #line 145 "ppparse.y" 01180 { 01181 struct cb_text_list *l; 01182 01183 yyval.l = cb_text_list_add (yyvsp[-3].l, " "); 01184 yyval.l = cb_text_list_add (yyval.l, "("); 01185 yyvsp[-1].l = cb_text_list_add (yyvsp[-1].l, ")"); 01186 for (l = yyval.l; l->next; l = l->next); 01187 l->next = yyvsp[-1].l; 01188 ;} 01189 break; 01190 01191 case 28: 01192 #line 157 "ppparse.y" 01193 { yyval.l = cb_text_list_add (NULL, yyvsp[0].s); ;} 01194 break; 01195 01196 case 29: 01197 #line 159 "ppparse.y" 01198 { 01199 yyval.l = cb_text_list_add (yyvsp[-1].l, " "); 01200 yyval.l = cb_text_list_add (yyval.l, yyvsp[0].s); 01201 ;} 01202 break; 01203 01204 01205 } 01206 01207 /* Line 991 of yacc.c. */ 01208 #line 1208 "ppparse.c" 01209 01210 yyvsp -= yylen; 01211 yyssp -= yylen; 01212 01213 01214 YY_STACK_PRINT (yyss, yyssp); 01215 01216 *++yyvsp = yyval; 01217 01218 01219 /* Now `shift' the result of the reduction. Determine what state 01220 that goes to, based on the state we popped back to and the rule 01221 number reduced by. */ 01222 01223 yyn = yyr1[yyn]; 01224 01225 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; 01226 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) 01227 yystate = yytable[yystate]; 01228 else 01229 yystate = yydefgoto[yyn - YYNTOKENS]; 01230 01231 goto yynewstate; 01232 01233 01234 /*------------------------------------. 01235 | yyerrlab -- here on detecting error | 01236 `------------------------------------*/ 01237 yyerrlab: 01238 /* If not already recovering from an error, report this error. */ 01239 if (!yyerrstatus) 01240 { 01241 ++yynerrs; 01242 #if YYERROR_VERBOSE 01243 yyn = yypact[yystate]; 01244 01245 if (YYPACT_NINF < yyn && yyn < YYLAST) 01246 { 01247 YYSIZE_T yysize = 0; 01248 int yytype = YYTRANSLATE (yychar); 01249 char *yymsg; 01250 int yyx, yycount; 01251 01252 yycount = 0; 01253 /* Start YYX at -YYN if negative to avoid negative indexes in 01254 YYCHECK. */ 01255 for (yyx = yyn < 0 ? -yyn : 0; 01256 yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) 01257 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) 01258 yysize += yystrlen (yytname[yyx]) + 15, yycount++; 01259 yysize += yystrlen ("syntax error, unexpected ") + 1; 01260 yysize += yystrlen (yytname[yytype]); 01261 yymsg = (char *) YYSTACK_ALLOC (yysize); 01262 if (yymsg != 0) 01263 { 01264 char *yyp = yystpcpy (yymsg, "syntax error, unexpected "); 01265 yyp = yystpcpy (yyp, yytname[yytype]); 01266 01267 if (yycount < 5) 01268 { 01269 yycount = 0; 01270 for (yyx = yyn < 0 ? -yyn : 0; 01271 yyx < (int) (sizeof (yytname) / sizeof (char *)); 01272 yyx++) 01273 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) 01274 { 01275 const char *yyq = ! yycount ? ", expecting " : " or "; 01276 yyp = yystpcpy (yyp, yyq); 01277 yyp = yystpcpy (yyp, yytname[yyx]); 01278 yycount++; 01279 } 01280 } 01281 yyerror (yymsg); 01282 YYSTACK_FREE (yymsg); 01283 } 01284 else 01285 yyerror ("syntax error; also virtual memory exhausted"); 01286 } 01287 else 01288 #endif /* YYERROR_VERBOSE */ 01289 yyerror ("syntax error"); 01290 } 01291 01292 01293 01294 if (yyerrstatus == 3) 01295 { 01296 /* If just tried and failed to reuse lookahead token after an 01297 error, discard it. */ 01298 01299 /* Return failure if at end of input. */ 01300 if (yychar == YYEOF) 01301 { 01302 /* Pop the error token. */ 01303 YYPOPSTACK; 01304 /* Pop the rest of the stack. */ 01305 while (yyss < yyssp) 01306 { 01307 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); 01308 yydestruct (yystos[*yyssp], yyvsp); 01309 YYPOPSTACK; 01310 } 01311 YYABORT; 01312 } 01313 01314 YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc); 01315 yydestruct (yytoken, &yylval); 01316 yychar = YYEMPTY; 01317 01318 } 01319 01320 /* Else will try to reuse lookahead token after shifting the error 01321 token. */ 01322 goto yyerrlab2; 01323 01324 01325 /*----------------------------------------------------. 01326 | yyerrlab1 -- error raised explicitly by an action. | 01327 `----------------------------------------------------*/ 01328 yyerrlab1: 01329 01330 /* Suppress GCC warning that yyerrlab1 is unused when no action 01331 invokes YYERROR. */ 01332 #if defined (__GNUC_MINOR__) && 2093 <= (__GNUC__ * 1000 + __GNUC_MINOR__) \ 01333 && !defined __cplusplus 01334 __attribute__ ((__unused__)) 01335 #endif 01336 01337 01338 goto yyerrlab2; 01339 01340 01341 /*---------------------------------------------------------------. 01342 | yyerrlab2 -- pop states until the error token can be shifted. | 01343 `---------------------------------------------------------------*/ 01344 yyerrlab2: 01345 yyerrstatus = 3; /* Each real token shifted decrements this. */ 01346 01347 for (;;) 01348 { 01349 yyn = yypact[yystate]; 01350 if (yyn != YYPACT_NINF) 01351 { 01352 yyn += YYTERROR; 01353 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) 01354 { 01355 yyn = yytable[yyn]; 01356 if (0 < yyn) 01357 break; 01358 } 01359 } 01360 01361 /* Pop the current state because it cannot handle the error token. */ 01362 if (yyssp == yyss) 01363 YYABORT; 01364 01365 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); 01366 yydestruct (yystos[yystate], yyvsp); 01367 yyvsp--; 01368 yystate = *--yyssp; 01369 01370 YY_STACK_PRINT (yyss, yyssp); 01371 } 01372 01373 if (yyn == YYFINAL) 01374 YYACCEPT; 01375 01376 YYDPRINTF ((stderr, "Shifting error token, ")); 01377 01378 *++yyvsp = yylval; 01379 01380 01381 yystate = yyn; 01382 goto yynewstate; 01383 01384 01385 /*-------------------------------------. 01386 | yyacceptlab -- YYACCEPT comes here. | 01387 `-------------------------------------*/ 01388 yyacceptlab: 01389 yyresult = 0; 01390 goto yyreturn; 01391 01392 /*-----------------------------------. 01393 | yyabortlab -- YYABORT comes here. | 01394 `-----------------------------------*/ 01395 yyabortlab: 01396 yyresult = 1; 01397 goto yyreturn; 01398 01399 #ifndef yyoverflow 01400 /*----------------------------------------------. 01401 | yyoverflowlab -- parser overflow comes here. | 01402 `----------------------------------------------*/ 01403 yyoverflowlab: 01404 yyerror ("parser stack overflow"); 01405 yyresult = 2; 01406 /* Fall through. */ 01407 #endif 01408 01409 yyreturn: 01410 #ifndef yyoverflow 01411 if (yyss != yyssa) 01412 YYSTACK_FREE (yyss); 01413 #endif 01414 return yyresult; 01415 } 01416 01417 01418 #line 167 "ppparse.y" 01419 01420 static char * 01421 fix_filename (char *name) 01422 { 01423 /* remove quotation from alphanumeric literals */ 01424 if (name[0] == '\'' || name[0] == '\"') { 01425 name++; 01426 name[strlen (name) - 1] = 0; 01427 } 01428 return name; 01429 } 01430 01431 static char * 01432 fold_lower (char *name) 01433 { 01434 unsigned char *p; 01435 01436 for (p = (unsigned char *)name; *p; p++) { 01437 if (isupper (*p)) { 01438 *p = tolower (*p); 01439 } 01440 } 01441 return name; 01442 } 01443 01444 static char * 01445 fold_upper (char *name) 01446 { 01447 unsigned char *p; 01448 01449 for (p = (unsigned char *)name; *p; p++) { 01450 if (islower (*p)) { 01451 *p = toupper (*p); 01452 } 01453 } 01454 return name; 01455 } 01456 01457 static struct cb_replace_list * 01458 cb_replace_list_add (struct cb_replace_list *list, 01459 struct cb_text_list *old_text, 01460 struct cb_text_list *new_text) 01461 { 01462 struct cb_replace_list *p; 01463 struct cb_replace_list *l; 01464 01465 p = cobc_malloc (sizeof (struct cb_replace_list)); 01466 p->old_text = old_text; 01467 p->new_text = new_text; 01468 p->next = NULL; 01469 if (!list) { 01470 return p; 01471 } else { 01472 for (l = list; l->next; l = l->next) ; 01473 l->next = p; 01474 return list; 01475 } 01476 } 01477