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