khtml Library API Documentation

parser.cpp

00001 /* A Bison parser, made from parser.y, by GNU bison 1.75. */ 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 /* Pure parsers. */ 00040 #define YYPURE 1 00041 00042 /* Using locations. */ 00043 #define YYLSP_NEEDED 0 00044 00045 /* If NAME_PREFIX is specified substitute the variables and functions 00046 names. */ 00047 #define yyparse cssyyparse 00048 #define yylex cssyylex 00049 #define yyerror cssyyerror 00050 #define yylval cssyylval 00051 #define yychar cssyychar 00052 #define yydebug cssyydebug 00053 #define yynerrs cssyynerrs 00054 00055 00056 /* Tokens. */ 00057 #ifndef YYTOKENTYPE 00058 # define YYTOKENTYPE 00059 /* Put the tokens into the symbol table, so that GDB and other debuggers 00060 know about them. */ 00061 enum yytokentype { 00062 S = 258, 00063 SGML_CD = 259, 00064 INCLUDES = 260, 00065 DASHMATCH = 261, 00066 BEGINSWITH = 262, 00067 ENDSWITH = 263, 00068 CONTAINS = 264, 00069 STRING = 265, 00070 IDENT = 266, 00071 HASH = 267, 00072 IMPORT_SYM = 268, 00073 PAGE_SYM = 269, 00074 MEDIA_SYM = 270, 00075 FONT_FACE_SYM = 271, 00076 CHARSET_SYM = 272, 00077 NAMESPACE_SYM = 273, 00078 KHTML_RULE_SYM = 274, 00079 KHTML_DECLS_SYM = 275, 00080 KHTML_VALUE_SYM = 276, 00081 IMPORTANT_SYM = 277, 00082 QEMS = 278, 00083 EMS = 279, 00084 EXS = 280, 00085 PXS = 281, 00086 CMS = 282, 00087 MMS = 283, 00088 INS = 284, 00089 PTS = 285, 00090 PCS = 286, 00091 DEGS = 287, 00092 RADS = 288, 00093 GRADS = 289, 00094 MSECS = 290, 00095 SECS = 291, 00096 HERZ = 292, 00097 KHERZ = 293, 00098 DIMEN = 294, 00099 PERCENTAGE = 295, 00100 NUMBER = 296, 00101 URI = 297, 00102 FUNCTION = 298, 00103 UNICODERANGE = 299 00104 }; 00105 #endif 00106 #define S 258 00107 #define SGML_CD 259 00108 #define INCLUDES 260 00109 #define DASHMATCH 261 00110 #define BEGINSWITH 262 00111 #define ENDSWITH 263 00112 #define CONTAINS 264 00113 #define STRING 265 00114 #define IDENT 266 00115 #define HASH 267 00116 #define IMPORT_SYM 268 00117 #define PAGE_SYM 269 00118 #define MEDIA_SYM 270 00119 #define FONT_FACE_SYM 271 00120 #define CHARSET_SYM 272 00121 #define NAMESPACE_SYM 273 00122 #define KHTML_RULE_SYM 274 00123 #define KHTML_DECLS_SYM 275 00124 #define KHTML_VALUE_SYM 276 00125 #define IMPORTANT_SYM 277 00126 #define QEMS 278 00127 #define EMS 279 00128 #define EXS 280 00129 #define PXS 281 00130 #define CMS 282 00131 #define MMS 283 00132 #define INS 284 00133 #define PTS 285 00134 #define PCS 286 00135 #define DEGS 287 00136 #define RADS 288 00137 #define GRADS 289 00138 #define MSECS 290 00139 #define SECS 291 00140 #define HERZ 292 00141 #define KHERZ 293 00142 #define DIMEN 294 00143 #define PERCENTAGE 295 00144 #define NUMBER 296 00145 #define URI 297 00146 #define FUNCTION 298 00147 #define UNICODERANGE 299 00148 00149 00150 00151 00152 /* Copy the first part of user declarations. */ 00153 #line 1 "parser.y" 00154 00155 00156 /* 00157 * This file is part of the KDE libraries 00158 * Copyright (C) 2002-2003 Lars Knoll (knoll@kde.org) 00159 * Copyright (c) 2003 Apple Computer 00160 * Copyright (C) 2003 Dirk Mueller (mueller@kde.org) 00161 * 00162 * This library is free software; you can redistribute it and/or 00163 * modify it under the terms of the GNU Lesser General Public 00164 * License as published by the Free Software Foundation; either 00165 * version 2 of the License, or (at your option) any later version. 00166 * 00167 * This library is distributed in the hope that it will be useful, 00168 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00169 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00170 * Lesser General Public License for more details. 00171 * 00172 * You should have received a copy of the GNU Lesser General Public 00173 * License along with this library; if not, write to the Free Software 00174 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00175 * 00176 */ 00177 00178 #ifdef HAVE_CONFIG_H 00179 #include <config.h> 00180 #endif 00181 #include <string.h> 00182 #include <stdlib.h> 00183 00184 #include <dom/dom_string.h> 00185 #include <xml/dom_docimpl.h> 00186 #include <css/css_ruleimpl.h> 00187 #include <css/css_stylesheetimpl.h> 00188 #include <css/css_valueimpl.h> 00189 #include <misc/htmlhashes.h> 00190 #include "cssparser.h" 00191 00192 #include <assert.h> 00193 #include <kdebug.h> 00194 //#define CSS_DEBUG 00195 00196 using namespace DOM; 00197 00198 // 00199 // The following file defines the function 00200 // const struct props *findProp(const char *word, int len) 00201 // 00202 // with 'props->id' a CSS property in the range from CSS_PROP_MIN to 00203 // (and including) CSS_PROP_TOTAL-1 00204 00205 // turn off inlining to void warning with newer gcc 00206 #undef __inline 00207 #define __inline 00208 #include "cssproperties.c" 00209 #include "cssvalues.c" 00210 #undef __inline 00211 00212 int DOM::getPropertyID(const char *tagStr, int len) 00213 { 00214 const struct props *propsPtr = findProp(tagStr, len); 00215 if (!propsPtr) 00216 return 0; 00217 00218 return propsPtr->id; 00219 } 00220 00221 static inline int getValueID(const char *tagStr, int len) 00222 { 00223 const struct css_value *val = findValue(tagStr, len); 00224 if (!val) 00225 return 0; 00226 00227 return val->id; 00228 } 00229 00230 00231 #define YYDEBUG 0 00232 #define YYMAXDEPTH 0 00233 #define YYPARSE_PARAM parser 00234 00235 00236 /* Enabling traces. */ 00237 #ifndef YYDEBUG 00238 # define YYDEBUG 0 00239 #endif 00240 00241 /* Enabling verbose error messages. */ 00242 #ifdef YYERROR_VERBOSE 00243 # undef YYERROR_VERBOSE 00244 # define YYERROR_VERBOSE 1 00245 #else 00246 # define YYERROR_VERBOSE 0 00247 #endif 00248 00249 #ifndef YYSTYPE 00250 #line 85 "parser.y" 00251 typedef union { 00252 CSSRuleImpl *rule; 00253 CSSSelector *selector; 00254 QPtrList<CSSSelector> *selectorList; 00255 bool ok; 00256 MediaListImpl *mediaList; 00257 CSSMediaRuleImpl *mediaRule; 00258 CSSRuleListImpl *ruleList; 00259 ParseString string; 00260 float val; 00261 int prop_id; 00262 unsigned int attribute; 00263 unsigned int element; 00264 unsigned int ns; 00265 CSSSelector::Relation relation; 00266 bool b; 00267 char tok; 00268 Value value; 00269 ValueList *valueList; 00270 } yystype; 00271 /* Line 193 of /usr/share/bison/yacc.c. */ 00272 #line 273 "parser.tab.c" 00273 # define YYSTYPE yystype 00274 # define YYSTYPE_IS_TRIVIAL 1 00275 #endif 00276 00277 #ifndef YYLTYPE 00278 typedef struct yyltype 00279 { 00280 int first_line; 00281 int first_column; 00282 int last_line; 00283 int last_column; 00284 } yyltype; 00285 # define YYLTYPE yyltype 00286 # define YYLTYPE_IS_TRIVIAL 1 00287 #endif 00288 00289 /* Copy the second part of user declarations. */ 00290 #line 106 "parser.y" 00291 00292 00293 static inline int cssyyerror(const char *x ) 00294 { 00295 #ifdef CSS_DEBUG 00296 qDebug( "%s", x ); 00297 #else 00298 Q_UNUSED( x ); 00299 #endif 00300 return 1; 00301 } 00302 00303 static int cssyylex( YYSTYPE *yylval ) { 00304 return CSSParser::current()->lex( yylval ); 00305 } 00306 00307 #define null 1 00308 00309 00310 00311 /* Line 213 of /usr/share/bison/yacc.c. */ 00312 #line 313 "parser.tab.c" 00313 00314 #if ! defined (yyoverflow) || YYERROR_VERBOSE 00315 00316 /* The parser invokes alloca or malloc; define the necessary symbols. */ 00317 00318 # if YYSTACK_USE_ALLOCA 00319 # define YYSTACK_ALLOC alloca 00320 # else 00321 # ifndef YYSTACK_USE_ALLOCA 00322 # if defined (alloca) || defined (_ALLOCA_H) 00323 # define YYSTACK_ALLOC alloca 00324 # else 00325 # ifdef __GNUC__ 00326 # define YYSTACK_ALLOC __builtin_alloca 00327 # endif 00328 # endif 00329 # endif 00330 # endif 00331 00332 # ifdef YYSTACK_ALLOC 00333 /* Pacify GCC's `empty if-body' warning. */ 00334 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) 00335 # else 00336 # if defined (__STDC__) || defined (__cplusplus) 00337 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 00338 # define YYSIZE_T size_t 00339 # endif 00340 # define YYSTACK_ALLOC malloc 00341 # define YYSTACK_FREE free 00342 # endif 00343 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ 00344 00345 00346 #if (! defined (yyoverflow) \ 00347 && (! defined (__cplusplus) \ 00348 || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) 00349 00350 /* A type that is properly aligned for any stack member. */ 00351 union yyalloc 00352 { 00353 short yyss; 00354 YYSTYPE yyvs; 00355 }; 00356 00357 /* The size of the maximum gap between one aligned stack and the next. */ 00358 # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1) 00359 00360 /* The size of an array large to enough to hold all stacks, each with 00361 N elements. */ 00362 # define YYSTACK_BYTES(N) \ 00363 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ 00364 + YYSTACK_GAP_MAX) 00365 00366 /* Copy COUNT objects from FROM to TO. The source and destination do 00367 not overlap. */ 00368 # ifndef YYCOPY 00369 # if 1 < __GNUC__ 00370 # define YYCOPY(To, From, Count) \ 00371 __builtin_memcpy (To, From, (Count) * sizeof (*(From))) 00372 # else 00373 # define YYCOPY(To, From, Count) \ 00374 do \ 00375 { \ 00376 register YYSIZE_T yyi; \ 00377 for (yyi = 0; yyi < (Count); yyi++) \ 00378 (To)[yyi] = (From)[yyi]; \ 00379 } \ 00380 while (0) 00381 # endif 00382 # endif 00383 00384 /* Relocate STACK from its old location to the new one. The 00385 local variables YYSIZE and YYSTACKSIZE give the old and new number of 00386 elements in the stack, and YYPTR gives the new location of the 00387 stack. Advance YYPTR to a properly aligned location for the next 00388 stack. */ 00389 # define YYSTACK_RELOCATE(Stack) \ 00390 do \ 00391 { \ 00392 YYSIZE_T yynewbytes; \ 00393 YYCOPY (&yyptr->Stack, Stack, yysize); \ 00394 Stack = &yyptr->Stack; \ 00395 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \ 00396 yyptr += yynewbytes / sizeof (*yyptr); \ 00397 } \ 00398 while (0) 00399 00400 #endif 00401 00402 #if defined (__STDC__) || defined (__cplusplus) 00403 typedef signed char yysigned_char; 00404 #else 00405 typedef short yysigned_char; 00406 #endif 00407 00408 /* YYFINAL -- State number of the termination state. */ 00409 #define YYFINAL 16 00410 #define YYLAST 414 00411 00412 /* YYNTOKENS -- Number of terminals. */ 00413 #define YYNTOKENS 62 00414 /* YYNNTS -- Number of nonterminals. */ 00415 #define YYNNTS 57 00416 /* YYNRULES -- Number of rules. */ 00417 #define YYNRULES 153 00418 /* YYNRULES -- Number of states. */ 00419 #define YYNSTATES 279 00420 00421 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ 00422 #define YYUNDEFTOK 2 00423 #define YYMAXUTOK 299 00424 00425 #define YYTRANSLATE(X) \ 00426 ((unsigned)(X) <= YYMAXUTOK ? yytranslate[X] : YYUNDEFTOK) 00427 00428 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ 00429 static const unsigned char yytranslate[] = 00430 { 00431 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00432 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00433 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00434 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00435 2, 59, 17, 54, 53, 56, 14, 60, 2, 2, 00436 2, 2, 2, 2, 2, 2, 2, 2, 13, 52, 00437 2, 58, 55, 2, 61, 2, 2, 2, 2, 2, 00438 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00439 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00440 2, 15, 2, 57, 2, 2, 2, 2, 2, 2, 00441 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00442 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00443 2, 2, 2, 50, 16, 51, 2, 2, 2, 2, 00444 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00445 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00446 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00447 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00448 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00449 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00450 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00451 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00452 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00453 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00454 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00455 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00456 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 00457 5, 6, 7, 8, 9, 10, 11, 12, 18, 19, 00458 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 00459 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 00460 40, 41, 42, 43, 44, 45, 46, 47, 48, 49 00461 }; 00462 00463 #if YYDEBUG 00464 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in 00465 YYRHS. */ 00466 static const unsigned short yyprhs[] = 00467 { 00468 0, 0, 3, 9, 12, 15, 18, 25, 28, 34, 00469 35, 38, 39, 42, 45, 46, 52, 56, 60, 61, 00470 65, 72, 76, 80, 81, 84, 91, 93, 94, 97, 00471 98, 102, 104, 106, 108, 110, 112, 114, 116, 118, 00472 119, 121, 123, 128, 131, 139, 140, 144, 147, 151, 00473 155, 159, 163, 166, 169, 170, 172, 174, 177, 179, 00474 184, 187, 189, 193, 196, 199, 203, 206, 209, 211, 00475 213, 216, 219, 221, 223, 225, 228, 231, 233, 235, 00476 237, 239, 242, 245, 247, 250, 255, 264, 266, 268, 00477 270, 272, 274, 276, 278, 280, 283, 287, 293, 298, 00478 303, 308, 314, 320, 324, 328, 333, 338, 344, 347, 00479 350, 353, 354, 356, 360, 363, 366, 367, 369, 372, 00480 375, 378, 381, 384, 387, 389, 391, 394, 397, 400, 00481 403, 406, 409, 412, 415, 418, 421, 424, 427, 430, 00482 433, 436, 439, 442, 445, 451, 455, 458, 462, 466, 00483 469, 475, 479, 481 00484 }; 00485 00486 /* YYRHS -- A `-1'-separated list of the rules' RHS. */ 00487 static const yysigned_char yyrhs[] = 00488 { 00489 63, 0, -1, 69, 68, 70, 72, 76, -1, 64, 00490 67, -1, 65, 67, -1, 66, 67, -1, 24, 50, 00491 67, 88, 67, 51, -1, 25, 104, -1, 26, 50, 00492 67, 109, 51, -1, -1, 67, 3, -1, -1, 68, 00493 4, -1, 68, 3, -1, -1, 22, 67, 10, 67, 00494 52, -1, 22, 1, 117, -1, 22, 1, 52, -1, 00495 -1, 70, 71, 68, -1, 18, 67, 78, 67, 79, 00496 52, -1, 18, 1, 117, -1, 18, 1, 52, -1, 00497 -1, 73, 68, -1, 23, 67, 75, 78, 67, 52, 00498 -1, 11, -1, -1, 74, 67, -1, -1, 76, 77, 00499 68, -1, 88, -1, 81, -1, 84, -1, 85, -1, 00500 116, -1, 115, -1, 10, -1, 47, -1, -1, 80, 00501 -1, 83, -1, 80, 53, 67, 83, -1, 80, 1, 00502 -1, 20, 67, 80, 50, 67, 82, 51, -1, -1, 00503 82, 88, 67, -1, 11, 67, -1, 19, 1, 117, 00504 -1, 19, 1, 52, -1, 21, 1, 117, -1, 21, 00505 1, 52, -1, 54, 67, -1, 55, 67, -1, -1, 00506 56, -1, 54, -1, 89, 104, -1, 90, -1, 89, 00507 53, 67, 90, -1, 89, 1, -1, 91, -1, 90, 00508 86, 91, -1, 90, 1, -1, 92, 67, -1, 92, 00509 95, 67, -1, 95, 67, -1, 93, 94, -1, 94, 00510 -1, 16, -1, 11, 16, -1, 17, 16, -1, 11, 00511 -1, 17, -1, 96, -1, 95, 96, -1, 95, 1, 00512 -1, 12, -1, 97, -1, 100, -1, 103, -1, 14, 00513 11, -1, 93, 99, -1, 99, -1, 11, 67, -1, 00514 15, 67, 98, 57, -1, 15, 67, 98, 101, 67, 00515 102, 67, 57, -1, 58, -1, 5, -1, 6, -1, 00516 7, -1, 8, -1, 9, -1, 11, -1, 10, -1, 00517 13, 11, -1, 13, 13, 11, -1, 13, 48, 67, 00518 91, 59, -1, 50, 67, 106, 51, -1, 50, 67, 00519 1, 51, -1, 50, 67, 105, 51, -1, 50, 67, 00520 105, 106, 51, -1, 50, 67, 105, 1, 51, -1, 00521 106, 52, 67, -1, 1, 52, 67, -1, 105, 106, 00522 52, 67, -1, 105, 1, 52, 67, -1, 107, 13, 00523 67, 109, 108, -1, 1, 117, -1, 11, 67, -1, 00524 27, 67, -1, -1, 111, -1, 109, 110, 111, -1, 00525 60, 67, -1, 53, 67, -1, -1, 112, -1, 87, 00526 112, -1, 44, 67, -1, 10, 67, -1, 11, 67, 00527 -1, 47, 67, -1, 49, 67, -1, 114, -1, 113, 00528 -1, 46, 67, -1, 45, 67, -1, 31, 67, -1, 00529 32, 67, -1, 33, 67, -1, 34, 67, -1, 35, 00530 67, -1, 36, 67, -1, 37, 67, -1, 38, 67, 00531 -1, 39, 67, -1, 40, 67, -1, 41, 67, -1, 00532 42, 67, -1, 43, 67, -1, 29, 67, -1, 28, 00533 67, -1, 30, 67, -1, 48, 67, 109, 59, 67, 00534 -1, 48, 67, 1, -1, 12, 67, -1, 61, 1, 00535 117, -1, 61, 1, 52, -1, 1, 117, -1, 50, 00536 1, 118, 1, 51, -1, 50, 1, 51, -1, 117, 00537 -1, 118, 1, 117, -1 00538 }; 00539 00540 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ 00541 static const unsigned short yyrline[] = 00542 { 00543 0, 251, 251, 253, 254, 255, 258, 265, 271, 296, 00544 298, 301, 303, 304, 307, 309, 314, 315, 318, 320, 00545 330, 341, 344, 350, 351, 355, 359, 362, 364, 367, 00546 369, 379, 381, 382, 383, 384, 385, 388, 390, 393, 00547 397, 401, 406, 411, 417, 431, 433, 442, 450, 454, 00548 459, 463, 468, 470, 471, 474, 476, 479, 499, 513, 00549 527, 533, 537, 558, 564, 569, 574, 581, 583, 591, 00550 593, 594, 598, 619, 622, 627, 637, 643, 650, 651, 00551 652, 655, 664, 666, 672, 696, 702, 710, 714, 717, 00552 720, 723, 726, 731, 733, 736, 742, 748, 756, 760, 00553 763, 766, 771, 776, 780, 784, 789, 794, 817, 822, 00554 829, 831, 834, 839, 854, 858, 861, 866, 868, 870, 00555 871, 872, 878, 879, 880, 882, 887, 889, 890, 891, 00556 892, 893, 894, 895, 896, 897, 898, 899, 900, 901, 00557 902, 903, 904, 905, 909, 918, 929, 936, 943, 951, 00558 961, 963, 966, 968 00559 }; 00560 #endif 00561 00562 #if YYDEBUG || YYERROR_VERBOSE 00563 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. 00564 First, the terminals, then, starting at YYNTOKENS, nonterminals. */ 00565 static const char *const yytname[] = 00566 { 00567 "$end", "error", "$undefined", "S", "SGML_CD", "INCLUDES", "DASHMATCH", 00568 "BEGINSWITH", "ENDSWITH", "CONTAINS", "STRING", "IDENT", "HASH", "':'", 00569 "'.'", "'['", "'|'", "'*'", "IMPORT_SYM", "PAGE_SYM", "MEDIA_SYM", 00570 "FONT_FACE_SYM", "CHARSET_SYM", "NAMESPACE_SYM", "KHTML_RULE_SYM", 00571 "KHTML_DECLS_SYM", "KHTML_VALUE_SYM", "IMPORTANT_SYM", "QEMS", "EMS", 00572 "EXS", "PXS", "CMS", "MMS", "INS", "PTS", "PCS", "DEGS", "RADS", 00573 "GRADS", "MSECS", "SECS", "HERZ", "KHERZ", "DIMEN", "PERCENTAGE", 00574 "NUMBER", "URI", "FUNCTION", "UNICODERANGE", "'{'", "'}'", "';'", "','", 00575 "'+'", "'>'", "'-'", "']'", "'='", "')'", "'/'", "'@'", "$accept", 00576 "stylesheet", "khtml_rule", "khtml_decls", "khtml_value", "maybe_space", 00577 "maybe_sgml", "maybe_charset", "import_list", "import", 00578 "maybe_namespace", "namespace", "ns_prefix", "maybe_ns_prefix", 00579 "rule_list", "rule", "string_or_uri", "maybe_media_list", "media_list", 00580 "media", "ruleset_list", "medium", "page", "font_face", "combinator", 00581 "unary_operator", "ruleset", "selector_list", "selector", 00582 "simple_selector", "ns_element", "ns_selector", "element_name", 00583 "specifier_list", "specifier", "class", "ns_attrib_id", "attrib_id", 00584 "attrib", "match", "ident_or_string", "pseudo", "declaration_block", 00585 "declaration_list", "declaration", "property", "prio", "expr", 00586 "operator", "term", "unary_term", "function", "hexcolor", "invalid_at", 00587 "invalid_rule", "invalid_block", "invalid_block_list", 0 00588 }; 00589 #endif 00590 00591 # ifdef YYPRINT 00592 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to 00593 token YYLEX-NUM. */ 00594 static const unsigned short yytoknum[] = 00595 { 00596 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 00597 265, 266, 267, 58, 46, 91, 124, 42, 268, 269, 00598 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 00599 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 00600 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 00601 123, 125, 59, 44, 43, 62, 45, 93, 61, 41, 00602 47, 64 00603 }; 00604 # endif 00605 00606 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ 00607 static const unsigned char yyr1[] = 00608 { 00609 0, 62, 63, 63, 63, 63, 64, 65, 66, 67, 00610 67, 68, 68, 68, 69, 69, 69, 69, 70, 70, 00611 71, 71, 71, 72, 72, 73, 74, 75, 75, 76, 00612 76, 77, 77, 77, 77, 77, 77, 78, 78, 79, 00613 79, 80, 80, 80, 81, 82, 82, 83, 84, 84, 00614 85, 85, 86, 86, 86, 87, 87, 88, 89, 89, 00615 89, 90, 90, 90, 91, 91, 91, 92, 92, 93, 00616 93, 93, 94, 94, 95, 95, 95, 96, 96, 96, 00617 96, 97, 98, 98, 99, 100, 100, 101, 101, 101, 00618 101, 101, 101, 102, 102, 103, 103, 103, 104, 104, 00619 104, 104, 104, 105, 105, 105, 105, 106, 106, 107, 00620 108, 108, 109, 109, 110, 110, 110, 111, 111, 111, 00621 111, 111, 111, 111, 111, 111, 112, 112, 112, 112, 00622 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 00623 112, 112, 112, 112, 113, 113, 114, 115, 115, 116, 00624 117, 117, 118, 118 00625 }; 00626 00627 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ 00628 static const unsigned char yyr2[] = 00629 { 00630 0, 2, 5, 2, 2, 2, 6, 2, 5, 0, 00631 2, 0, 2, 2, 0, 5, 3, 3, 0, 3, 00632 6, 3, 3, 0, 2, 6, 1, 0, 2, 0, 00633 3, 1, 1, 1, 1, 1, 1, 1, 1, 0, 00634 1, 1, 4, 2, 7, 0, 3, 2, 3, 3, 00635 3, 3, 2, 2, 0, 1, 1, 2, 1, 4, 00636 2, 1, 3, 2, 2, 3, 2, 2, 1, 1, 00637 2, 2, 1, 1, 1, 2, 2, 1, 1, 1, 00638 1, 2, 2, 1, 2, 4, 8, 1, 1, 1, 00639 1, 1, 1, 1, 1, 2, 3, 5, 4, 4, 00640 4, 5, 5, 3, 3, 4, 4, 5, 2, 2, 00641 2, 0, 1, 3, 2, 2, 0, 1, 2, 2, 00642 2, 2, 2, 2, 1, 1, 2, 2, 2, 2, 00643 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 00644 2, 2, 2, 2, 5, 3, 2, 3, 3, 2, 00645 5, 3, 1, 3 00646 }; 00647 00648 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state 00649 STATE-NUM when YYTABLE doesn't specify something else to do. Zero 00650 means the default is an error. */ 00651 static const unsigned char yydefact[] = 00652 { 00653 14, 0, 0, 0, 0, 0, 9, 9, 9, 11, 00654 0, 0, 9, 9, 7, 9, 1, 3, 4, 5, 00655 18, 0, 17, 16, 10, 9, 0, 0, 0, 13, 00656 12, 23, 0, 0, 72, 77, 0, 0, 9, 69, 00657 73, 9, 0, 0, 61, 9, 0, 68, 0, 74, 00658 78, 79, 80, 0, 9, 0, 0, 0, 9, 9, 00659 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 00660 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 00661 9, 9, 9, 56, 55, 0, 116, 112, 117, 125, 00662 124, 0, 9, 11, 29, 11, 151, 152, 0, 15, 00663 70, 95, 0, 9, 81, 0, 71, 0, 60, 9, 00664 57, 63, 9, 9, 0, 64, 0, 72, 73, 67, 00665 76, 66, 75, 99, 9, 108, 109, 0, 100, 0, 00666 98, 9, 9, 120, 121, 146, 142, 141, 143, 128, 00667 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 00668 139, 140, 119, 127, 126, 122, 0, 123, 118, 8, 00669 9, 9, 0, 0, 0, 27, 19, 0, 24, 0, 00670 96, 0, 9, 0, 0, 0, 83, 6, 0, 52, 00671 53, 62, 65, 104, 102, 9, 101, 9, 103, 0, 00672 145, 116, 115, 114, 113, 22, 21, 37, 38, 9, 00673 26, 9, 0, 0, 0, 9, 0, 0, 11, 32, 00674 33, 34, 31, 36, 35, 150, 153, 0, 84, 9, 00675 82, 88, 89, 90, 91, 92, 85, 87, 9, 0, 00676 106, 105, 116, 9, 39, 28, 9, 149, 0, 0, 00677 0, 0, 30, 97, 0, 9, 107, 144, 9, 0, 00678 0, 41, 0, 49, 48, 0, 51, 50, 148, 147, 00679 94, 93, 9, 110, 47, 20, 43, 9, 25, 9, 00680 0, 0, 45, 86, 42, 0, 44, 9, 46 00681 }; 00682 00683 /* YYDEFGOTO[NTERM-NUM]. */ 00684 static const short yydefgoto[] = 00685 { 00686 -1, 5, 6, 7, 8, 218, 20, 9, 31, 93, 00687 94, 95, 201, 202, 167, 208, 199, 249, 250, 209, 00688 275, 251, 210, 211, 114, 85, 41, 42, 43, 44, 00689 45, 46, 47, 48, 49, 50, 175, 176, 51, 228, 00690 262, 52, 14, 55, 56, 57, 246, 86, 162, 87, 00691 88, 89, 90, 213, 214, 125, 98 00692 }; 00693 00694 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing 00695 STATE-NUM. */ 00696 #define YYPACT_NINF -167 00697 static const short yypact[] = 00698 { 00699 143, 42, -9, 66, 71, 148, -167, -167, -167, -167, 00700 133, 137, -167, -167, -167, -167, -167, 158, 158, 158, 00701 103, 172, -167, -167, -167, -167, 225, 19, 299, -167, 00702 -167, -2, 152, 90, 166, -167, 153, 176, -167, -167, 00703 183, -167, 91, 138, -167, 300, 21, -167, 121, -167, 00704 -167, -167, -167, 174, -167, 38, 106, 177, -167, -167, 00705 -167, -167, -167, -167, -167, -167, -167, -167, -167, -167, 00706 -167, -167, -167, -167, -167, -167, -167, -167, -167, -167, 00707 -167, -167, -167, -167, -167, 368, -5, -167, -167, -167, 00708 -167, 169, -167, -167, -167, -167, -167, -167, 228, -167, 00709 -167, -167, 219, -167, -167, 178, -167, 5, -167, -167, 00710 -167, -167, -167, -167, 258, 158, 121, -167, -167, -167, 00711 -167, 158, -167, -167, -167, -167, 158, 208, -167, 154, 00712 -167, -167, -167, 158, 158, 158, 158, 158, 158, 158, 00713 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 00714 158, 158, 158, 158, 158, 158, 252, 158, -167, -167, 00715 -167, -167, 339, 193, 7, 20, 103, 84, 103, 164, 00716 -167, 225, 166, 183, 237, 120, -167, -167, 225, 158, 00717 158, -167, 158, 158, -167, -167, -167, -167, 158, 299, 00718 -167, 60, 158, 158, -167, -167, -167, -167, -167, -167, 00719 -167, -167, 3, 253, 255, -167, 277, 303, -167, -167, 00720 -167, -167, -167, -167, -167, -167, -167, 246, 158, -167, 00721 -167, -167, -167, -167, -167, -167, -167, -167, -167, 196, 00722 158, 158, -18, -167, 107, 158, -167, -167, 202, 107, 00723 215, 227, 103, -167, 16, -167, -167, 158, -167, 264, 00724 35, -167, 111, -167, -167, 93, -167, -167, -167, -167, 00725 -167, -167, -167, 158, 158, -167, -167, -167, -167, -167, 00726 25, 107, 158, -167, -167, 206, -167, -167, 158 00727 }; 00728 00729 /* YYPGOTO[NTERM-NUM]. */ 00730 static const short yypgoto[] = 00731 { 00732 -167, -167, -167, -167, -167, -1, -91, -167, -167, -167, 00733 -167, -167, -167, -167, -167, -167, 105, -167, 78, -167, 00734 -167, 47, -167, -167, -167, -167, -166, -167, 141, -85, 00735 -167, 216, 274, 278, -33, -167, -167, 150, -167, -167, 00736 -167, -167, 280, -167, 270, -167, -167, -138, -167, 190, 00737 241, -167, -167, -167, -167, -7, -167 00738 }; 00739 00740 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If 00741 positive, shift that token. If negative, reduce the rule which 00742 number is the opposite. If zero, do what YYDEFACT says. 00743 If YYTABLE_NINF, parse error. */ 00744 #define YYTABLE_NINF -112 00745 static const short yytable[] = 00746 { 00747 11, 212, 166, 23, 168, 17, 18, 19, 24, 245, 00748 24, 26, 27, 197, 28, 122, 91, 197, 191, 24, 00749 53, 92, 24, 24, 33, 97, 260, 261, 24, 181, 00750 54, 200, 117, -111, -111, 160, 266, 105, 118, 127, 00751 107, 12, 161, 10, 115, -9, 159, 121, 160, 54, 00752 198, 232, -9, 126, 198, 161, 177, 133, 134, 135, 00753 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 00754 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 00755 156, 157, 273, 122, -2, 203, 217, -40, 267, 128, 00756 164, 165, 108, 24, 266, 34, 35, 36, 37, 38, 00757 39, 40, 171, 204, 205, 206, 29, 30, 178, 277, 00758 24, 179, 180, 160, 24, 182, 13, 242, 248, 233, 00759 161, 15, 120, 183, -9, 221, 222, 223, 224, 225, 00760 188, 189, -9, 35, 36, 37, 38, -9, -9, 111, 00761 24, 13, 99, 269, 109, 207, 267, 25, 16, -54, 00762 -54, -54, -54, -54, -54, -54, 196, 130, 131, 192, 00763 193, 24, 216, 268, 101, 1, 102, 2, 3, 4, 00764 163, -9, -9, 32, -9, -9, -9, 226, 227, -9, 00765 -9, 24, 100, 21, 230, 22, 231, 104, -58, 172, 00766 132, -58, 112, 113, 39, 173, 237, 111, 234, 106, 00767 235, 103, 21, 96, 239, 186, 187, -54, -54, -54, 00768 -54, -54, -54, -54, 21, 215, -9, 34, 35, 36, 00769 37, 38, 39, 40, 21, 123, 124, 244, 24, 169, 00770 170, 254, 247, 257, 259, 252, 34, 35, 36, 37, 00771 38, 39, 40, 21, 263, 195, -59, 264, 219, -59, 00772 112, 113, 21, 190, 253, 24, 238, 276, 21, 184, 00773 185, 270, 58, 59, 60, 21, 271, 256, 272, 34, 00774 35, 36, 37, 38, 39, 40, 278, 21, 240, 258, 00775 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 00776 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 00777 81, 82, 24, 21, 241, 243, 83, 236, 84, 58, 00778 59, 60, 35, 36, 37, 38, 265, 255, 274, 229, 00779 119, 174, 110, 116, 220, 129, 158, 61, 62, 63, 00780 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 00781 74, 75, 76, 77, 78, 79, 80, 81, 82, 58, 00782 59, 60, 194, 83, 0, 84, 0, 0, 0, 0, 00783 0, 0, 0, 0, 0, 0, 0, 61, 62, 63, 00784 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 00785 74, 75, 76, 77, 78, 79, 80, 81, 82, 0, 00786 0, 0, 0, 83, 0, 84, 61, 62, 63, 64, 00787 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 00788 75, 76, 0, 78, 79 00789 }; 00790 00791 static const short yycheck[] = 00792 { 00793 1, 167, 93, 10, 95, 6, 7, 8, 3, 27, 00794 3, 12, 13, 10, 15, 48, 18, 10, 156, 3, 00795 1, 23, 3, 3, 25, 32, 10, 11, 3, 114, 00796 11, 11, 11, 51, 52, 53, 1, 38, 17, 1, 00797 41, 50, 60, 1, 45, 3, 51, 48, 53, 11, 00798 47, 189, 10, 54, 47, 60, 51, 58, 59, 60, 00799 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 00800 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 00801 81, 82, 57, 116, 0, 1, 171, 52, 53, 51, 00802 91, 92, 1, 3, 1, 11, 12, 13, 14, 15, 00803 16, 17, 103, 19, 20, 21, 3, 4, 109, 275, 00804 3, 112, 113, 53, 3, 116, 50, 208, 11, 59, 00805 60, 50, 1, 124, 3, 5, 6, 7, 8, 9, 00806 131, 132, 11, 12, 13, 14, 15, 16, 17, 1, 00807 3, 50, 52, 50, 53, 61, 53, 10, 0, 11, 00808 12, 13, 14, 15, 16, 17, 163, 51, 52, 160, 00809 161, 3, 169, 52, 11, 22, 13, 24, 25, 26, 00810 1, 50, 3, 1, 53, 54, 55, 57, 58, 10, 00811 59, 3, 16, 50, 185, 52, 187, 11, 50, 11, 00812 13, 53, 54, 55, 16, 17, 203, 1, 199, 16, 00813 201, 48, 50, 51, 205, 51, 52, 11, 12, 13, 00814 14, 15, 16, 17, 50, 51, 47, 11, 12, 13, 00815 14, 15, 16, 17, 50, 51, 52, 228, 3, 1, 00816 11, 238, 233, 240, 241, 236, 11, 12, 13, 14, 00817 15, 16, 17, 50, 245, 52, 50, 248, 11, 53, 00818 54, 55, 50, 1, 52, 3, 1, 51, 50, 51, 00819 52, 262, 10, 11, 12, 50, 267, 52, 269, 11, 00820 12, 13, 14, 15, 16, 17, 277, 50, 1, 52, 00821 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 00822 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 00823 48, 49, 3, 50, 1, 59, 54, 202, 56, 10, 00824 11, 12, 12, 13, 14, 15, 52, 239, 271, 178, 00825 46, 105, 42, 45, 174, 55, 85, 28, 29, 30, 00826 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 00827 41, 42, 43, 44, 45, 46, 47, 48, 49, 10, 00828 11, 12, 162, 54, -1, 56, -1, -1, -1, -1, 00829 -1, -1, -1, -1, -1, -1, -1, 28, 29, 30, 00830 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 00831 41, 42, 43, 44, 45, 46, 47, 48, 49, -1, 00832 -1, -1, -1, 54, -1, 56, 28, 29, 30, 31, 00833 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 00834 42, 43, -1, 45, 46 00835 }; 00836 00837 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing 00838 symbol of state STATE-NUM. */ 00839 static const unsigned char yystos[] = 00840 { 00841 0, 22, 24, 25, 26, 63, 64, 65, 66, 69, 00842 1, 67, 50, 50, 104, 50, 0, 67, 67, 67, 00843 68, 50, 52, 117, 3, 10, 67, 67, 67, 3, 00844 4, 70, 1, 67, 11, 12, 13, 14, 15, 16, 00845 17, 88, 89, 90, 91, 92, 93, 94, 95, 96, 00846 97, 100, 103, 1, 11, 105, 106, 107, 10, 11, 00847 12, 28, 29, 30, 31, 32, 33, 34, 35, 36, 00848 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 00849 47, 48, 49, 54, 56, 87, 109, 111, 112, 113, 00850 114, 18, 23, 71, 72, 73, 51, 117, 118, 52, 00851 16, 11, 13, 48, 11, 67, 16, 67, 1, 53, 00852 104, 1, 54, 55, 86, 67, 95, 11, 17, 94, 00853 1, 67, 96, 51, 52, 117, 67, 1, 51, 106, 00854 51, 52, 13, 67, 67, 67, 67, 67, 67, 67, 00855 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 00856 67, 67, 67, 67, 67, 67, 67, 67, 112, 51, 00857 53, 60, 110, 1, 67, 67, 68, 76, 68, 1, 00858 11, 67, 11, 17, 93, 98, 99, 51, 67, 67, 00859 67, 91, 67, 67, 51, 52, 51, 52, 67, 67, 00860 1, 109, 67, 67, 111, 52, 117, 10, 47, 78, 00861 11, 74, 75, 1, 19, 20, 21, 61, 77, 81, 00862 84, 85, 88, 115, 116, 51, 117, 91, 67, 11, 00863 99, 5, 6, 7, 8, 9, 57, 58, 101, 90, 00864 67, 67, 109, 59, 67, 67, 78, 117, 1, 67, 00865 1, 1, 68, 59, 67, 27, 108, 67, 11, 79, 00866 80, 83, 67, 52, 117, 80, 52, 117, 52, 117, 00867 10, 11, 102, 67, 67, 52, 1, 53, 52, 50, 00868 67, 67, 67, 57, 83, 82, 51, 88, 67 00869 }; 00870 00871 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) 00872 # define YYSIZE_T __SIZE_TYPE__ 00873 #endif 00874 #if ! defined (YYSIZE_T) && defined (size_t) 00875 # define YYSIZE_T size_t 00876 #endif 00877 #if ! defined (YYSIZE_T) 00878 # if defined (__STDC__) || defined (__cplusplus) 00879 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ 00880 # define YYSIZE_T size_t 00881 # endif 00882 #endif 00883 #if ! defined (YYSIZE_T) 00884 # define YYSIZE_T unsigned int 00885 #endif 00886 00887 #define yyerrok (yyerrstatus = 0) 00888 #define yyclearin (yychar = YYEMPTY) 00889 #define YYEMPTY -2 00890 #define YYEOF 0 00891 00892 #define YYACCEPT goto yyacceptlab 00893 #define YYABORT goto yyabortlab 00894 #define YYERROR goto yyerrlab1 00895 00896 /* Like YYERROR except do call yyerror. This remains here temporarily 00897 to ease the transition to the new meaning of YYERROR, for GCC. 00898 Once GCC version 2 has supplanted version 1, this can go. */ 00899 00900 #define YYFAIL goto yyerrlab 00901 00902 #define YYRECOVERING() (!!yyerrstatus) 00903 00904 #define YYBACKUP(Token, Value) \ 00905 do \ 00906 if (yychar == YYEMPTY && yylen == 1) \ 00907 { \ 00908 yychar = (Token); \ 00909 yylval = (Value); \ 00910 yychar1 = YYTRANSLATE (yychar); \ 00911 YYPOPSTACK; \ 00912 goto yybackup; \ 00913 } \ 00914 else \ 00915 { \ 00916 yyerror ("syntax error: cannot back up"); \ 00917 YYERROR; \ 00918 } \ 00919 while (0) 00920 00921 #define YYTERROR 1 00922 #define YYERRCODE 256 00923 00924 /* YYLLOC_DEFAULT -- Compute the default location (before the actions 00925 are run). */ 00926 00927 #ifndef YYLLOC_DEFAULT 00928 # define YYLLOC_DEFAULT(Current, Rhs, N) \ 00929 Current.first_line = Rhs[1].first_line; \ 00930 Current.first_column = Rhs[1].first_column; \ 00931 Current.last_line = Rhs[N].last_line; \ 00932 Current.last_column = Rhs[N].last_column; 00933 #endif 00934 00935 /* YYLEX -- calling `yylex' with the right arguments. */ 00936 00937 #ifdef YYLEX_PARAM 00938 # define YYLEX yylex (&yylval, YYLEX_PARAM) 00939 #else 00940 # define YYLEX yylex (&yylval) 00941 #endif 00942 00943 /* Enable debugging if requested. */ 00944 #if YYDEBUG 00945 00946 # ifndef YYFPRINTF 00947 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */ 00948 # define YYFPRINTF fprintf 00949 # endif 00950 00951 # define YYDPRINTF(Args) \ 00952 do { \ 00953 if (yydebug) \ 00954 YYFPRINTF Args; \ 00955 } while (0) 00956 # define YYDSYMPRINT(Args) \ 00957 do { \ 00958 if (yydebug) \ 00959 yysymprint Args; \ 00960 } while (0) 00961 /* Nonzero means print parse trace. It is left uninitialized so that 00962 multiple parsers can coexist. */ 00963 int yydebug; 00964 #else /* !YYDEBUG */ 00965 # define YYDPRINTF(Args) 00966 # define YYDSYMPRINT(Args) 00967 #endif /* !YYDEBUG */ 00968 00969 /* YYINITDEPTH -- initial size of the parser's stacks. */ 00970 #ifndef YYINITDEPTH 00971 # define YYINITDEPTH 200 00972 #endif 00973 00974 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only 00975 if the built-in stack extension method is used). 00976 00977 Do not make this value too large; the results are undefined if 00978 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) 00979 evaluated with infinite-precision integer arithmetic. */ 00980 00981 #if YYMAXDEPTH == 0 00982 # undef YYMAXDEPTH 00983 #endif 00984 00985 #ifndef YYMAXDEPTH 00986 # define YYMAXDEPTH 10000 00987 #endif 00988 00989 00990 00991 #if YYERROR_VERBOSE 00992 00993 # ifndef yystrlen 00994 # if defined (__GLIBC__) && defined (_STRING_H) 00995 # define yystrlen strlen 00996 # else 00997 /* Return the length of YYSTR. */ 00998 static YYSIZE_T 00999 # if defined (__STDC__) || defined (__cplusplus) 01000 yystrlen (const char *yystr) 01001 # else 01002 yystrlen (yystr) 01003 const char *yystr; 01004 # endif 01005 { 01006 register const char *yys = yystr; 01007 01008 while (*yys++ != '\0') 01009 continue; 01010 01011 return yys - yystr - 1; 01012 } 01013 # endif 01014 # endif 01015 01016 # ifndef yystpcpy 01017 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) 01018 # define yystpcpy stpcpy 01019 # else 01020 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in 01021 YYDEST. */ 01022 static char * 01023 # if defined (__STDC__) || defined (__cplusplus) 01024 yystpcpy (char *yydest, const char *yysrc) 01025 # else 01026 yystpcpy (yydest, yysrc) 01027 char *yydest; 01028 const char *yysrc; 01029 # endif 01030 { 01031 register char *yyd = yydest; 01032 register const char *yys = yysrc; 01033 01034 while ((*yyd++ = *yys++) != '\0') 01035 continue; 01036 01037 return yyd - 1; 01038 } 01039 # endif 01040 # endif 01041 01042 #endif /* !YYERROR_VERBOSE */ 01043 01044 01045 01046 #if YYDEBUG 01047 /*-----------------------------. 01048 | Print this symbol on YYOUT. | 01049 `-----------------------------*/ 01050 01051 static void 01052 #if defined (__STDC__) || defined (__cplusplus) 01053 yysymprint (FILE* yyout, int yytype, YYSTYPE yyvalue) 01054 #else 01055 yysymprint (yyout, yytype, yyvalue) 01056 FILE* yyout; 01057 int yytype; 01058 YYSTYPE yyvalue; 01059 #endif 01060 { 01061 /* Pacify ``unused variable'' warnings. */ 01062 (void) yyvalue; 01063 01064 if (yytype < YYNTOKENS) 01065 { 01066 YYFPRINTF (yyout, "token %s (", yytname[yytype]); 01067 # ifdef YYPRINT 01068 YYPRINT (yyout, yytoknum[yytype], yyvalue); 01069 # endif 01070 } 01071 else 01072 YYFPRINTF (yyout, "nterm %s (", yytname[yytype]); 01073 01074 switch (yytype) 01075 { 01076 case 79: /* maybe_media_list */ 01077 #line 0 "parser.y" 01078 (null); 01079 #line 1080 "parser.tab.c" 01080 break; 01081 case 80: /* media_list */ 01082 #line 0 "parser.y" 01083 (null); 01084 #line 1085 "parser.tab.c" 01085 break; 01086 case 82: /* ruleset_list */ 01087 #line 0 "parser.y" 01088 (null); 01089 #line 1090 "parser.tab.c" 01090 break; 01091 case 89: /* selector_list */ 01092 #line 0 "parser.y" 01093 (null); 01094 #line 1095 "parser.tab.c" 01095 break; 01096 case 90: /* selector */ 01097 #line 0 "parser.y" 01098 (null); 01099 #line 1100 "parser.tab.c" 01100 break; 01101 case 91: /* simple_selector */ 01102 #line 0 "parser.y" 01103 (null); 01104 #line 1105 "parser.tab.c" 01105 break; 01106 case 95: /* specifier_list */ 01107 #line 0 "parser.y" 01108 (null); 01109 #line 1110 "parser.tab.c" 01110 break; 01111 case 96: /* specifier */ 01112 #line 0 "parser.y" 01113 (null); 01114 #line 1115 "parser.tab.c" 01115 break; 01116 case 97: /* class */ 01117 #line 0 "parser.y" 01118 (null); 01119 #line 1120 "parser.tab.c" 01120 break; 01121 case 100: /* attrib */ 01122 #line 0 "parser.y" 01123 (null); 01124 #line 1125 "parser.tab.c" 01125 break; 01126 case 103: /* pseudo */ 01127 #line 0 "parser.y" 01128 (null); 01129 #line 1130 "parser.tab.c" 01130 break; 01131 case 109: /* expr */ 01132 #line 0 "parser.y" 01133 (null); 01134 #line 1135 "parser.tab.c" 01135 break; 01136 default: 01137 break; 01138 } 01139 YYFPRINTF (yyout, ")"); 01140 } 01141 #endif /* YYDEBUG. */ 01142 01143 01144 /*-----------------------------------------------. 01145 | Release the memory associated to this symbol. | 01146 `-----------------------------------------------*/ 01147 01148 static void 01149 #if defined (__STDC__) || defined (__cplusplus) 01150 yydestruct (int yytype, YYSTYPE yyvalue) 01151 #else 01152 yydestruct (yytype, yyvalue) 01153 int yytype; 01154 YYSTYPE yyvalue; 01155 #endif 01156 { 01157 /* Pacify ``unused variable'' warnings. */ 01158 (void) yyvalue; 01159 01160 switch (yytype) 01161 { 01162 case 79: /* maybe_media_list */ 01163 #line 127 "parser.y" 01164 { delete yyvalue.mediaList; yyvalue.mediaList = 0; }; 01165 #line 1166 "parser.tab.c" 01166 break; 01167 case 80: /* media_list */ 01168 #line 127 "parser.y" 01169 { delete yyvalue.mediaList; yyvalue.mediaList = 0; }; 01170 #line 1171 "parser.tab.c" 01171 break; 01172 case 82: /* ruleset_list */ 01173 #line 129 "parser.y" 01174 { delete yyvalue.ruleList; yyvalue.ruleList = 0; }; 01175 #line 1176 "parser.tab.c" 01176 break; 01177 case 89: /* selector_list */ 01178 #line 128 "parser.y" 01179 { delete yyvalue.selectorList; yyvalue.selectorList = 0; }; 01180 #line 1181 "parser.tab.c" 01181 break; 01182 case 90: /* selector */ 01183 #line 130 "parser.y" 01184 { delete yyvalue.selector; yyvalue.selector = 0; }; 01185 #line 1186 "parser.tab.c" 01186 break; 01187 case 91: /* simple_selector */ 01188 #line 130 "parser.y" 01189 { delete yyvalue.selector; yyvalue.selector = 0; }; 01190 #line 1191 "parser.tab.c" 01191 break; 01192 case 95: /* specifier_list */ 01193 #line 130 "parser.y" 01194 { delete yyvalue.selector; yyvalue.selector = 0; }; 01195 #line 1196 "parser.tab.c" 01196 break; 01197 case 96: /* specifier */ 01198 #line 130 "parser.y" 01199 { delete yyvalue.selector; yyvalue.selector = 0; }; 01200 #line 1201 "parser.tab.c" 01201 break; 01202 case 97: /* class */ 01203 #line 130 "parser.y" 01204 { delete yyvalue.selector; yyvalue.selector = 0; }; 01205 #line 1206 "parser.tab.c" 01206 break; 01207 case 100: /* attrib */ 01208 #line 130 "parser.y" 01209 { delete yyvalue.selector; yyvalue.selector = 0; }; 01210 #line 1211 "parser.tab.c" 01211 break; 01212 case 103: /* pseudo */ 01213 #line 130 "parser.y" 01214 { delete yyvalue.selector; yyvalue.selector = 0; }; 01215 #line 1216 "parser.tab.c" 01216 break; 01217 case 109: /* expr */ 01218 #line 126 "parser.y" 01219 { delete yyvalue.valueList; yyvalue.valueList = 0; }; 01220 #line 1221 "parser.tab.c" 01221 break; 01222 default: 01223 break; 01224 } 01225 } 01226 01227 01228 01229 /* The user can define YYPARSE_PARAM as the name of an argument to be passed 01230 into yyparse. The argument should have type void *. 01231 It should actually point to an object. 01232 Grammar actions can access the variable by casting it 01233 to the proper pointer type. */ 01234 01235 #ifdef YYPARSE_PARAM 01236 # if defined (__STDC__) || defined (__cplusplus) 01237 # define YYPARSE_PARAM_ARG void *YYPARSE_PARAM 01238 # define YYPARSE_PARAM_DECL 01239 # else 01240 # define YYPARSE_PARAM_ARG YYPARSE_PARAM 01241 # define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; 01242 # endif 01243 #else /* !YYPARSE_PARAM */ 01244 # define YYPARSE_PARAM_ARG 01245 # define YYPARSE_PARAM_DECL 01246 #endif /* !YYPARSE_PARAM */ 01247 01248 /* Prevent warning if -Wstrict-prototypes. */ 01249 #ifdef __GNUC__ 01250 # ifdef YYPARSE_PARAM 01251 int yyparse (void *); 01252 # else 01253 int yyparse (void); 01254 # endif 01255 #endif 01256 01257 01258 01259 01260 int 01261 yyparse (YYPARSE_PARAM_ARG) 01262 YYPARSE_PARAM_DECL 01263 { 01264 /* The lookahead symbol. */ 01265 int yychar; 01266 01267 /* The semantic value of the lookahead symbol. */ 01268 YYSTYPE yylval; 01269 01270 /* Number of parse errors so far. */ 01271 int yynerrs; 01272 01273 register int yystate; 01274 register int yyn; 01275 int yyresult; 01276 /* Number of tokens to shift before error messages enabled. */ 01277 int yyerrstatus; 01278 /* Lookahead token as an internal (translated) token number. */ 01279 int yychar1 = 0; 01280 01281 /* Three stacks and their tools: 01282 `yyss': related to states, 01283 `yyvs': related to semantic values, 01284 `yyls': related to locations. 01285 01286 Refer to the stacks thru separate pointers, to allow yyoverflow 01287 to reallocate them elsewhere. */ 01288 01289 /* The state stack. */ 01290 short yyssa[YYINITDEPTH]; 01291 short *yyss = yyssa; 01292 register short *yyssp; 01293 01294 /* The semantic value stack. */ 01295 YYSTYPE yyvsa[YYINITDEPTH]; 01296 YYSTYPE *yyvs = yyvsa; 01297 register YYSTYPE *yyvsp; 01298 01299 01300 01301 #define YYPOPSTACK (yyvsp--, yyssp--) 01302 01303 YYSIZE_T yystacksize = YYINITDEPTH; 01304 01305 /* The variables used to return semantic value and location from the 01306 action routines. */ 01307 YYSTYPE yyval; 01308 01309 01310 /* When reducing, the number of symbols on the RHS of the reduced 01311 rule. */ 01312 int yylen; 01313 01314 YYDPRINTF ((stderr, "Starting parse\n")); 01315 01316 yystate = 0; 01317 yyerrstatus = 0; 01318 yynerrs = 0; 01319 yychar = YYEMPTY; /* Cause a token to be read. */ 01320 01321 /* Initialize stack pointers. 01322 Waste one element of value and location stack 01323 so that they stay on the same level as the state stack. 01324 The wasted elements are never initialized. */ 01325 01326 yyssp = yyss; 01327 yyvsp = yyvs; 01328 01329 goto yysetstate; 01330 01331 /*------------------------------------------------------------. 01332 | yynewstate -- Push a new state, which is found in yystate. | 01333 `------------------------------------------------------------*/ 01334 yynewstate: 01335 /* In all cases, when you get here, the value and location stacks 01336 have just been pushed. so pushing a state here evens the stacks. 01337 */ 01338 yyssp++; 01339 01340 yysetstate: 01341 *yyssp = yystate; 01342 01343 if (yyssp >= yyss + yystacksize - 1) 01344 { 01345 /* Get the current used size of the three stacks, in elements. */ 01346 YYSIZE_T yysize = yyssp - yyss + 1; 01347 01348 #ifdef yyoverflow 01349 { 01350 /* Give user a chance to reallocate the stack. Use copies of 01351 these so that the &'s don't force the real ones into 01352 memory. */ 01353 YYSTYPE *yyvs1 = yyvs; 01354 short *yyss1 = yyss; 01355 01356 01357 /* Each stack pointer address is followed by the size of the 01358 data in use in that stack, in bytes. This used to be a 01359 conditional around just the two extra args, but that might 01360 be undefined if yyoverflow is a macro. */ 01361 yyoverflow ("parser stack overflow", 01362 &yyss1, yysize * sizeof (*yyssp), 01363 &yyvs1, yysize * sizeof (*yyvsp), 01364 01365 &yystacksize); 01366 01367 yyss = yyss1; 01368 yyvs = yyvs1; 01369 } 01370 #else /* no yyoverflow */ 01371 # ifndef YYSTACK_RELOCATE 01372 goto yyoverflowlab; 01373 # else 01374 /* Extend the stack our own way. */ 01375 if (yystacksize >= YYMAXDEPTH) 01376 goto yyoverflowlab; 01377 yystacksize *= 2; 01378 if (yystacksize > YYMAXDEPTH) 01379 yystacksize = YYMAXDEPTH; 01380 01381 { 01382 short *yyss1 = yyss; 01383 union yyalloc *yyptr = 01384 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); 01385 if (! yyptr) 01386 goto yyoverflowlab; 01387 YYSTACK_RELOCATE (yyss); 01388 YYSTACK_RELOCATE (yyvs); 01389 01390 # undef YYSTACK_RELOCATE 01391 if (yyss1 != yyssa) 01392 YYSTACK_FREE (yyss1); 01393 } 01394 # endif 01395 #endif /* no yyoverflow */ 01396 01397 yyssp = yyss + yysize - 1; 01398 yyvsp = yyvs + yysize - 1; 01399 01400 01401 YYDPRINTF ((stderr, "Stack size increased to %lu\n", 01402 (unsigned long int) yystacksize)); 01403 01404 if (yyssp >= yyss + yystacksize - 1) 01405 YYABORT; 01406 } 01407 01408 YYDPRINTF ((stderr, "Entering state %d\n", yystate)); 01409 01410 goto yybackup; 01411 01412 /*-----------. 01413 | yybackup. | 01414 `-----------*/ 01415 yybackup: 01416 01417 /* Do appropriate processing given the current state. */ 01418 /* Read a lookahead token if we need one and don't already have one. */ 01419 /* yyresume: */ 01420 01421 /* First try to decide what to do without reference to lookahead token. */ 01422 01423 yyn = yypact[yystate]; 01424 if (yyn == YYPACT_NINF) 01425 goto yydefault; 01426 01427 /* Not known => get a lookahead token if don't already have one. */ 01428 01429 /* yychar is either YYEMPTY or YYEOF 01430 or a valid token in external form. */ 01431 01432 if (yychar == YYEMPTY) 01433 { 01434 YYDPRINTF ((stderr, "Reading a token: ")); 01435 yychar = YYLEX; 01436 } 01437 01438 /* Convert token to internal form (in yychar1) for indexing tables with. */ 01439 01440 if (yychar <= 0) /* This means end of input. */ 01441 { 01442 yychar1 = 0; 01443 yychar = YYEOF; /* Don't call YYLEX any more. */ 01444 01445 YYDPRINTF ((stderr, "Now at end of input.\n")); 01446 } 01447 else 01448 { 01449 yychar1 = YYTRANSLATE (yychar); 01450 01451 /* We have to keep this `#if YYDEBUG', since we use variables 01452 which are defined only if `YYDEBUG' is set. */ 01453 YYDPRINTF ((stderr, "Next token is ")); 01454 YYDSYMPRINT ((stderr, yychar1, yylval)); 01455 YYDPRINTF ((stderr, "\n")); 01456 } 01457 01458 /* If the proper action on seeing token YYCHAR1 is to reduce or to 01459 detect an error, take that action. */ 01460 yyn += yychar1; 01461 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yychar1) 01462 goto yydefault; 01463 yyn = yytable[yyn]; 01464 if (yyn <= 0) 01465 { 01466 if (yyn == 0 || yyn == YYTABLE_NINF) 01467 goto yyerrlab; 01468 yyn = -yyn; 01469 goto yyreduce; 01470 } 01471 01472 if (yyn == YYFINAL) 01473 YYACCEPT; 01474 01475 /* Shift the lookahead token. */ 01476 YYDPRINTF ((stderr, "Shifting token %d (%s), ", 01477 yychar, yytname[yychar1])); 01478 01479 /* Discard the token being shifted unless it is eof. */ 01480 if (yychar != YYEOF) 01481 yychar = YYEMPTY; 01482 01483 *++yyvsp = yylval; 01484 01485 01486 /* Count tokens shifted since error; after three, turn off error 01487 status. */ 01488 if (yyerrstatus) 01489 yyerrstatus--; 01490 01491 yystate = yyn; 01492 goto yynewstate; 01493 01494 01495 /*-----------------------------------------------------------. 01496 | yydefault -- do the default action for the current state. | 01497 `-----------------------------------------------------------*/ 01498 yydefault: 01499 yyn = yydefact[yystate]; 01500 if (yyn == 0) 01501 goto yyerrlab; 01502 goto yyreduce; 01503 01504 01505 /*-----------------------------. 01506 | yyreduce -- Do a reduction. | 01507 `-----------------------------*/ 01508 yyreduce: 01509 /* yyn is the number of a rule to reduce with. */ 01510 yylen = yyr2[yyn]; 01511 01512 /* If YYLEN is nonzero, implement the default value of the action: 01513 `$$ = $1'. 01514 01515 Otherwise, the following line sets YYVAL to garbage. 01516 This behavior is undocumented and Bison 01517 users should not rely upon it. Assigning to YYVAL 01518 unconditionally makes the parser a bit smaller, and it avoids a 01519 GCC warning that YYVAL may be used uninitialized. */ 01520 yyval = yyvsp[1-yylen]; 01521 01522 01523 01524 #if YYDEBUG 01525 /* We have to keep this `#if YYDEBUG', since we use variables which 01526 are defined only if `YYDEBUG' is set. */ 01527 if (yydebug) 01528 { 01529 int yyi; 01530 01531 YYFPRINTF (stderr, "Reducing via rule %d (line %d), ", 01532 yyn - 1, yyrline[yyn]); 01533 01534 /* Print the symbols being reduced, and their result. */ 01535 for (yyi = yyprhs[yyn]; yyrhs[yyi] >= 0; yyi++) 01536 YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); 01537 YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]); 01538 } 01539 #endif 01540 switch (yyn) 01541 { 01542 case 6: 01543 { 01544 CSSParser *p = static_cast<CSSParser *>(parser); 01545 p->rule = yyvsp[-2].rule; 01546 } 01547 break; 01548 01549 case 7: 01550 { 01551 /* can be empty */ 01552 } 01553 break; 01554 01555 case 8: 01556 { 01557 CSSParser *p = static_cast<CSSParser *>(parser); 01558 if ( yyvsp[-1].valueList ) { 01559 p->valueList = yyvsp[-1].valueList; 01560 #ifdef CSS_DEBUG 01561 kdDebug( 6080 ) << " got property for " << p->id << 01562 (p->important?" important":"")<< endl; 01563 bool ok = 01564 #endif 01565 p->parseValue( p->id, p->important ); 01566 #ifdef CSS_DEBUG 01567 if ( !ok ) 01568 kdDebug( 6080 ) << " couldn't parse value!" << endl; 01569 #endif 01570 } 01571 #ifdef CSS_DEBUG 01572 else 01573 kdDebug( 6080 ) << " no value found!" << endl; 01574 #endif 01575 delete p->valueList; 01576 p->valueList = 0; 01577 } 01578 break; 01579 01580 case 15: 01581 { 01582 #ifdef CSS_DEBUG 01583 kdDebug( 6080 ) << "charset rule: " << qString(yyvsp[-2].string) << endl; 01584 #endif 01585 } 01586 break; 01587 01588 case 19: 01589 { 01590 CSSParser *p = static_cast<CSSParser *>(parser); 01591 if ( yyvsp[-1].rule && p->styleElement && p->styleElement->isCSSStyleSheet() ) { 01592 p->styleElement->append( yyvsp[-1].rule ); 01593 } else { 01594 delete yyvsp[-1].rule; 01595 } 01596 } 01597 break; 01598 01599 case 20: 01600 { 01601 #ifdef CSS_DEBUG 01602 kdDebug( 6080 ) << "@import: " << qString(yyvsp[-3].string) << endl; 01603 #endif 01604 CSSParser *p = static_cast<CSSParser *>(parser); 01605 if ( yyvsp[-1].mediaList && p->styleElement && p->styleElement->isCSSStyleSheet() ) 01606 yyval.rule = new CSSImportRuleImpl( p->styleElement, domString(yyvsp[-3].string), yyvsp[-1].mediaList ); 01607 else 01608 yyval.rule = 0; 01609 } 01610 break; 01611 01612 case 21: 01613 { 01614 yyval.rule = 0; 01615 } 01616 break; 01617 01618 case 22: 01619 { 01620 yyval.rule = 0; 01621 } 01622 break; 01623 01624 case 27: 01625 { yyval.string.string = 0; yyval.string.length = 0; } 01626 break; 01627 01628 case 30: 01629 { 01630 CSSParser *p = static_cast<CSSParser *>(parser); 01631 if ( yyvsp[-1].rule && p->styleElement && p->styleElement->isCSSStyleSheet() ) { 01632 p->styleElement->append( yyvsp[-1].rule ); 01633 } else { 01634 delete yyvsp[-1].rule; 01635 } 01636 } 01637 break; 01638 01639 case 39: 01640 { 01641 yyval.mediaList = new MediaListImpl(); 01642 } 01643 break; 01644 01645 case 41: 01646 { 01647 yyval.mediaList = new MediaListImpl(); 01648 yyval.mediaList->appendMedium( domString(yyvsp[0].string).lower() ); 01649 } 01650 break; 01651 01652 case 42: 01653 { 01654 yyval.mediaList = yyvsp[-3].mediaList; 01655 if (yyval.mediaList) 01656 yyval.mediaList->appendMedium( domString(yyvsp[0].string).lower() ); 01657 } 01658 break; 01659 01660 case 43: 01661 { 01662 delete yyvsp[-1].mediaList; 01663 yyval.mediaList = 0; 01664 } 01665 break; 01666 01667 case 44: 01668 { 01669 CSSParser *p = static_cast<CSSParser *>(parser); 01670 if ( yyvsp[-4].mediaList && yyvsp[-1].ruleList && 01671 p->styleElement && p->styleElement->isCSSStyleSheet() ) { 01672 yyval.rule = new CSSMediaRuleImpl( static_cast<CSSStyleSheetImpl*>(p->styleElement), yyvsp[-4].mediaList, yyvsp[-1].ruleList ); 01673 } else { 01674 yyval.rule = 0; 01675 delete yyvsp[-4].mediaList; 01676 delete yyvsp[-1].ruleList; 01677 } 01678 } 01679 break; 01680 01681 case 45: 01682 { yyval.ruleList = 0; } 01683 break; 01684 01685 case 46: 01686 { 01687 yyval.ruleList = yyvsp[-2].ruleList; 01688 if ( yyvsp[-1].rule ) { 01689 if ( !yyval.ruleList ) yyval.ruleList = new CSSRuleListImpl(); 01690 yyval.ruleList->append( yyvsp[-1].rule ); 01691 } 01692 } 01693 break; 01694 01695 case 47: 01696 { 01697 yyval.string = yyvsp[-1].string; 01698 } 01699 break; 01700 01701 case 48: 01702 { 01703 yyval.rule = 0; 01704 } 01705 break; 01706 01707 case 49: 01708 { 01709 yyval.rule = 0; 01710 } 01711 break; 01712 01713 case 50: 01714 { 01715 yyval.rule = 0; 01716 } 01717 break; 01718 01719 case 51: 01720 { 01721 yyval.rule = 0; 01722 } 01723 break; 01724 01725 case 52: 01726 { yyval.relation = CSSSelector::Sibling; } 01727 break; 01728 01729 case 53: 01730 { yyval.relation = CSSSelector::Child; } 01731 break; 01732 01733 case 54: 01734 { yyval.relation = CSSSelector::Descendant; } 01735 break; 01736 01737 case 55: 01738 { yyval.val = -1; } 01739 break; 01740 01741 case 56: 01742 { yyval.val = 1; } 01743 break; 01744 01745 case 57: 01746 { 01747 #ifdef CSS_DEBUG 01748 kdDebug( 6080 ) << "got ruleset" << endl << " selector:" << endl; 01749 #endif 01750 CSSParser *p = static_cast<CSSParser *>(parser); 01751 if ( yyvsp[-1].selectorList && yyvsp[0].ok && p->numParsedProperties ) { 01752 CSSStyleRuleImpl *rule = new CSSStyleRuleImpl( p->styleElement ); 01753 CSSStyleDeclarationImpl *decl = p->createStyleDeclaration( rule ); 01754 rule->setSelector( yyvsp[-1].selectorList ); 01755 rule->setDeclaration(decl); 01756 yyval.rule = rule; 01757 } else { 01758 yyval.rule = 0; 01759 delete yyvsp[-1].selectorList; 01760 p->clearProperties(); 01761 } 01762 } 01763 break; 01764 01765 case 58: 01766 { 01767 if ( yyvsp[0].selector ) { 01768 yyval.selectorList = new QPtrList<CSSSelector>; 01769 yyval.selectorList->setAutoDelete( true ); 01770 #ifdef CSS_DEBUG 01771 kdDebug( 6080 ) << " got simple selector:" << endl; 01772 yyvsp[0].selector->print(); 01773 #endif 01774 yyval.selectorList->append( yyvsp[0].selector ); 01775 } else { 01776 yyval.selectorList = 0; 01777 } 01778 } 01779 break; 01780 01781 case 59: 01782 { 01783 if ( yyvsp[-3].selectorList && yyvsp[0].selector ) { 01784 yyval.selectorList = yyvsp[-3].selectorList; 01785 yyval.selectorList->append( yyvsp[0].selector ); 01786 #ifdef CSS_DEBUG 01787 kdDebug( 6080 ) << " got simple selector:" << endl; 01788 yyvsp[0].selector->print(); 01789 #endif 01790 } else { 01791 delete yyvsp[-3].selectorList; 01792 delete yyvsp[0].selector; 01793 yyval.selectorList = 0; 01794 } 01795 } 01796 break; 01797 01798 case 60: 01799 { 01800 delete yyvsp[-1].selectorList; 01801 yyval.selectorList = 0; 01802 } 01803 break; 01804 01805 case 61: 01806 { 01807 yyval.selector = yyvsp[0].selector; 01808 } 01809 break; 01810 01811 case 62: 01812 { 01813 if ( !yyvsp[-2].selector || !yyvsp[0].selector ) { 01814 delete yyvsp[-2].selector; 01815 delete yyvsp[0].selector; 01816 yyval.selector = 0; 01817 } else { 01818 yyval.selector = yyvsp[0].selector; 01819 CSSSelector *end = yyvsp[0].selector; 01820 while( end->tagHistory ) 01821 end = end->tagHistory; 01822 end->relation = yyvsp[-1].relation; 01823 end->tagHistory = yyvsp[-2].selector; 01824 if ( yyvsp[-1].relation == CSSSelector::Descendant || 01825 yyvsp[-1].relation == CSSSelector::Child ) { 01826 CSSParser *p = static_cast<CSSParser *>(parser); 01827 DOM::DocumentImpl *doc = p->document(); 01828 if ( doc ) 01829 doc->setUsesDescendantRules(true); 01830 } 01831 } 01832 } 01833 break; 01834 01835 case 63: 01836 { 01837 delete yyvsp[-1].selector; 01838 yyval.selector = 0; 01839 } 01840 break; 01841 01842 case 64: 01843 { 01844 yyval.selector = new CSSSelector(); 01845 yyval.selector->tag = yyvsp[-1].element; 01846 } 01847 break; 01848 01849 case 65: 01850 { 01851 yyval.selector = yyvsp[-1].selector; 01852 if ( yyval.selector ) 01853 yyval.selector->tag = yyvsp[-2].element; 01854 } 01855 break; 01856 01857 case 66: 01858 { 01859 yyval.selector = yyvsp[-1].selector; 01860 if ( yyval.selector ) 01861 yyval.selector->tag = 0xffffffff; 01862 } 01863 break; 01864 01865 case 67: 01866 { yyval.element = (yyvsp[-1].ns<<16) | yyvsp[0].element; } 01867 break; 01868 01869 case 68: 01870 { 01871 /* according to the specs this one matches all namespaces if no 01872 default namespace has been specified otherwise the default namespace */ 01873 CSSParser *p = static_cast<CSSParser *>(parser); 01874 yyval.element = (p->defaultNamespace<<16) | yyvsp[0].element; 01875 } 01876 break; 01877 01878 case 69: 01879 { yyval.ns = 0; } 01880 break; 01881 01882 case 70: 01883 { yyval.ns = 1; /* #### insert correct namespace id here */ } 01884 break; 01885 01886 case 71: 01887 { yyval.ns = 0xffff; } 01888 break; 01889 01890 case 72: 01891 { 01892 CSSParser *p = static_cast<CSSParser *>(parser); 01893 DOM::DocumentImpl *doc = p->document(); 01894 QString tag = qString(yyvsp[0].string); 01895 if ( doc ) { 01896 if (doc->isHTMLDocument()) 01897 tag = tag.lower(); 01898 const DOMString dtag(tag); 01899 #ifdef APPLE_CHANGES 01900 yyval.element = doc->tagId(0, dtag.implementation(), false); 01901 #else 01902 yyval.element = doc->getId(NodeImpl::ElementId, dtag.implementation(), false, true); 01903 #endif 01904 } else { 01905 yyval.element = khtml::getTagID(tag.lower().ascii(), tag.length()); 01906 // this case should never happen - only when loading 01907 // the default stylesheet - which must not contain unknown tags 01908 // assert($$ != 0); 01909 } 01910 } 01911 break; 01912 01913 case 73: 01914 { yyval.element = 0xffff; } 01915 break; 01916 01917 case 74: 01918 { 01919 yyval.selector = yyvsp[0].selector; 01920 yyval.selector->nonCSSHint = static_cast<CSSParser *>(parser)->nonCSSHint; 01921 } 01922 break; 01923 01924 case 75: 01925 { 01926 yyval.selector = yyvsp[-1].selector; 01927 if ( yyval.selector ) { 01928 CSSSelector *end = yyvsp[-1].selector; 01929 while( end->tagHistory ) 01930 end = end->tagHistory; 01931 end->relation = CSSSelector::SubSelector; 01932 end->tagHistory = yyvsp[0].selector; 01933 } 01934 } 01935 break; 01936 01937 case 76: 01938 { 01939 delete yyvsp[-1].selector; 01940 yyval.selector = 0; 01941 } 01942 break; 01943 01944 case 77: 01945 { 01946 yyval.selector = new CSSSelector(); 01947 yyval.selector->match = CSSSelector::Id; 01948 yyval.selector->attr = ATTR_ID; 01949 yyval.selector->value = domString(yyvsp[0].string); 01950 } 01951 break; 01952 01953 case 81: 01954 { 01955 yyval.selector = new CSSSelector(); 01956 yyval.selector->match = CSSSelector::List; 01957 yyval.selector->attr = ATTR_CLASS; 01958 yyval.selector->value = domString(yyvsp[0].string); 01959 } 01960 break; 01961 01962 case 82: 01963 { yyval.attribute = (yyvsp[-1].ns<<16) | yyvsp[0].attribute; } 01964 break; 01965 01966 case 83: 01967 { 01968 /* opposed to elements, these only match for non namespaced attributes */ 01969 yyval.attribute = yyvsp[0].attribute; 01970 } 01971 break; 01972 01973 case 84: 01974 { 01975 CSSParser *p = static_cast<CSSParser *>(parser); 01976 DOM::DocumentImpl *doc = p->document(); 01977 01978 QString attr = qString(yyvsp[-1].string); 01979 if ( doc ) { 01980 if (doc->isHTMLDocument()) 01981 attr = attr.lower(); 01982 const DOMString dattr(attr); 01983 #ifdef APPLE_CHANGES 01984 yyval.attribute = doc->attrId(0, dattr.implementation(), false); 01985 #else 01986 yyval.attribute = doc->getId(NodeImpl::AttributeId, dattr.implementation(), false, true); 01987 #endif 01988 } else { 01989 yyval.attribute = khtml::getAttrID(attr.lower().ascii(), attr.length()); 01990 // this case should never happen - only when loading 01991 // the default stylesheet - which must not contain unknown attributes 01992 assert(yyval.attribute != 0); 01993 } 01994 } 01995 break; 01996 01997 case 85: 01998 { 01999 yyval.selector = new CSSSelector(); 02000 yyval.selector->attr = yyvsp[-1].attribute; 02001 yyval.selector->match = CSSSelector::Set; 02002 } 02003 break; 02004 02005 case 86: 02006 { 02007 yyval.selector = new CSSSelector(); 02008 yyval.selector->attr = yyvsp[-5].attribute; 02009 yyval.selector->match = (CSSSelector::Match)yyvsp[-4].val; 02010 yyval.selector->value = domString(yyvsp[-2].string); 02011 } 02012 break; 02013 02014 case 87: 02015 { 02016 yyval.val = CSSSelector::Exact; 02017 } 02018 break; 02019 02020 case 88: 02021 { 02022 yyval.val = CSSSelector::List; 02023 } 02024 break; 02025 02026 case 89: 02027 { 02028 yyval.val = CSSSelector::Hyphen; 02029 } 02030 break; 02031 02032 case 90: 02033 { 02034 yyval.val = CSSSelector::Begin; 02035 } 02036 break; 02037 02038 case 91: 02039 { 02040 yyval.val = CSSSelector::End; 02041 } 02042 break; 02043 02044 case 92: 02045 { 02046 yyval.val = CSSSelector::Contain; 02047 } 02048 break; 02049 02050 case 95: 02051 { 02052 yyval.selector = new CSSSelector(); 02053 yyval.selector->match = CSSSelector::Pseudo; 02054 yyval.selector->value = domString(yyvsp[0].string); 02055 } 02056 break; 02057 02058 case 96: 02059 { 02060 yyval.selector = new CSSSelector(); 02061 yyval.selector->match = CSSSelector::Pseudo; 02062 yyval.selector->value = domString(yyvsp[0].string); 02063 } 02064 break; 02065 02066 case 97: 02067 { 02068 yyval.selector = new CSSSelector(); 02069 yyval.selector->match = CSSSelector::Pseudo; 02070 yyval.selector->simpleSelector = yyvsp[-1].selector; 02071 yyval.selector->value = domString(yyvsp[-3].string); 02072 } 02073 break; 02074 02075 case 98: 02076 { 02077 yyval.ok = yyvsp[-1].ok; 02078 } 02079 break; 02080 02081 case 99: 02082 { 02083 yyval.ok = false; 02084 } 02085 break; 02086 02087 case 100: 02088 { 02089 yyval.ok = yyvsp[-1].ok; 02090 } 02091 break; 02092 02093 case 101: 02094 { 02095 yyval.ok = yyvsp[-2].ok; 02096 if ( yyvsp[-1].ok ) 02097 yyval.ok = yyvsp[-1].ok; 02098 } 02099 break; 02100 02101 case 102: 02102 { 02103 yyval.ok = yyvsp[-2].ok; 02104 } 02105 break; 02106 02107 case 103: 02108 { 02109 yyval.ok = yyvsp[-2].ok; 02110 } 02111 break; 02112 02113 case 104: 02114 { 02115 yyval.ok = false; 02116 } 02117 break; 02118 02119 case 105: 02120 { 02121 yyval.ok = yyvsp[-3].ok; 02122 if ( yyvsp[-2].ok ) 02123 yyval.ok = yyvsp[-2].ok; 02124 } 02125 break; 02126 02127 case 106: 02128 { 02129 yyval.ok = yyvsp[-3].ok; 02130 } 02131 break; 02132 02133 case 107: 02134 { 02135 yyval.ok = false; 02136 CSSParser *p = static_cast<CSSParser *>(parser); 02137 if ( yyvsp[-4].prop_id && yyvsp[-1].valueList ) { 02138 p->valueList = yyvsp[-1].valueList; 02139 #ifdef CSS_DEBUG 02140 kdDebug( 6080 ) << " got property: " << yyvsp[-4].prop_id << 02141 (yyvsp[0].b?" important":"")<< endl; 02142 #endif 02143 bool ok = p->parseValue( yyvsp[-4].prop_id, yyvsp[0].b ); 02144 if ( ok ) 02145 yyval.ok = ok; 02146 #ifdef CSS_DEBUG 02147 else 02148 kdDebug( 6080 ) << " couldn't parse value!" << endl; 02149 #endif 02150 } else { 02151 delete yyvsp[-1].valueList; 02152 } 02153 delete p->valueList; 02154 p->valueList = 0; 02155 } 02156 break; 02157 02158 case 108: 02159 { 02160 yyval.ok = false; 02161 } 02162 break; 02163 02164 case 109: 02165 { 02166 QString str = qString(yyvsp[-1].string); 02167 yyval.prop_id = getPropertyID( str.lower().latin1(), str.length() ); 02168 } 02169 break; 02170 02171 case 110: 02172 { yyval.b = true; } 02173 break; 02174 02175 case 111: 02176 { yyval.b = false; } 02177 break; 02178 02179 case 112: 02180 { 02181 yyval.valueList = new ValueList; 02182 yyval.valueList->addValue( yyvsp[0].value ); 02183 } 02184 break; 02185 02186 case 113: 02187 { 02188 yyval.valueList = yyvsp[-2].valueList; 02189 if ( yyval.valueList ) { 02190 if ( yyvsp[-1].tok ) { 02191 Value v; 02192 v.id = 0; 02193 v.unit = Value::Operator; 02194 v.iValue = yyvsp[-1].tok; 02195 yyval.valueList->addValue( v ); 02196 } 02197 yyval.valueList->addValue( yyvsp[0].value ); 02198 } 02199 } 02200 break; 02201 02202 case 114: 02203 { 02204 yyval.tok = '/'; 02205 } 02206 break; 02207 02208 case 115: 02209 { 02210 yyval.tok = ','; 02211 } 02212 break; 02213 02214 case 116: 02215 { 02216 yyval.tok = 0; 02217 } 02218 break; 02219 02220 case 117: 02221 { yyval.value = yyvsp[0].value; } 02222 break; 02223 02224 case 118: 02225 { yyval.value = yyvsp[0].value; yyval.value.fValue *= yyvsp[-1].val; } 02226 break; 02227 02228 case 119: 02229 { yyval.value.id = 0; yyval.value.string = yyvsp[-1].string; yyval.value.unit = CSSPrimitiveValue::CSS_DIMENSION; } 02230 break; 02231 02232 case 120: 02233 { yyval.value.id = 0; yyval.value.string = yyvsp[-1].string; yyval.value.unit = CSSPrimitiveValue::CSS_STRING; } 02234 break; 02235 02236 case 121: 02237 { 02238 QString str = qString( yyvsp[-1].string ); 02239 yyval.value.id = getValueID( str.lower().latin1(), str.length() ); 02240 yyval.value.unit = CSSPrimitiveValue::CSS_IDENT; 02241 yyval.value.string = yyvsp[-1].string; 02242 } 02243 break; 02244 02245 case 122: 02246 { yyval.value.id = 0; yyval.value.string = yyvsp[-1].string; yyval.value.unit = CSSPrimitiveValue::CSS_URI; } 02247 break; 02248 02249 case 123: 02250 { yyval.value.id = 0; yyval.value.iValue = 0; yyval.value.unit = CSSPrimitiveValue::CSS_UNKNOWN;/* ### */ } 02251 break; 02252 02253 case 124: 02254 { yyval.value.id = 0; yyval.value.string = yyvsp[0].string; yyval.value.unit = CSSPrimitiveValue::CSS_RGBCOLOR; } 02255 break; 02256 02257 case 125: 02258 { 02259 yyval.value = yyvsp[0].value; 02260 } 02261 break; 02262 02263 case 126: 02264 { yyval.value.id = 0; yyval.value.fValue = yyvsp[-1].val; yyval.value.unit = CSSPrimitiveValue::CSS_NUMBER; } 02265 break; 02266 02267 case 127: 02268 { yyval.value.id = 0; yyval.value.fValue = yyvsp[-1].val; yyval.value.unit = CSSPrimitiveValue::CSS_PERCENTAGE; } 02269 break; 02270 02271 case 128: 02272 { yyval.value.id = 0; yyval.value.fValue = yyvsp[-1].val; yyval.value.unit = CSSPrimitiveValue::CSS_PX; } 02273 break; 02274 02275 case 129: 02276 { yyval.value.id = 0; yyval.value.fValue = yyvsp[-1].val; yyval.value.unit = CSSPrimitiveValue::CSS_CM; } 02277 break; 02278 02279 case 130: 02280 { yyval.value.id = 0; yyval.value.fValue = yyvsp[-1].val; yyval.value.unit = CSSPrimitiveValue::CSS_MM; } 02281 break; 02282 02283 case 131: 02284 { yyval.value.id = 0; yyval.value.fValue = yyvsp[-1].val; yyval.value.unit = CSSPrimitiveValue::CSS_IN; } 02285 break; 02286 02287 case 132: 02288 { yyval.value.id = 0; yyval.value.fValue = yyvsp[-1].val; yyval.value.unit = CSSPrimitiveValue::CSS_PT; } 02289 break; 02290 02291 case 133: 02292 { yyval.value.id = 0; yyval.value.fValue = yyvsp[-1].val; yyval.value.unit = CSSPrimitiveValue::CSS_PC; } 02293 break; 02294 02295 case 134: 02296 { yyval.value.id = 0; yyval.value.fValue = yyvsp[-1].val; yyval.value.unit = CSSPrimitiveValue::CSS_DEG; } 02297 break; 02298 02299 case 135: 02300 { yyval.value.id = 0; yyval.value.fValue = yyvsp[-1].val; yyval.value.unit = CSSPrimitiveValue::CSS_RAD; } 02301 break; 02302 02303 case 136: 02304 { yyval.value.id = 0; yyval.value.fValue = yyvsp[-1].val; yyval.value.unit = CSSPrimitiveValue::CSS_GRAD; } 02305 break; 02306 02307 case 137: 02308 { yyval.value.id = 0; yyval.value.fValue = yyvsp[-1].val; yyval.value.unit = CSSPrimitiveValue::CSS_MS; } 02309 break; 02310 02311 case 138: 02312 { yyval.value.id = 0; yyval.value.fValue = yyvsp[-1].val; yyval.value.unit = CSSPrimitiveValue::CSS_S; } 02313 break; 02314 02315 case 139: 02316 { yyval.value.id = 0; yyval.value.fValue = yyvsp[-1].val; yyval.value.unit = CSSPrimitiveValue::CSS_HZ; } 02317 break; 02318 02319 case 140: 02320 { yyval.value.id = 0; yyval.value.fValue = yyvsp[-1].val; yyval.value.unit = CSSPrimitiveValue::CSS_KHZ; } 02321 break; 02322 02323 case 141: 02324 { yyval.value.id = 0; yyval.value.fValue = yyvsp[-1].val; yyval.value.unit = CSSPrimitiveValue::CSS_EMS; } 02325 break; 02326 02327 case 142: 02328 { yyval.value.id = 0; yyval.value.fValue = yyvsp[-1].val; yyval.value.unit = Value::Q_EMS; } 02329 break; 02330 02331 case 143: 02332 { yyval.value.id = 0; yyval.value.fValue = yyvsp[-1].val; yyval.value.unit = CSSPrimitiveValue::CSS_EXS; } 02333 break; 02334 02335 case 144: 02336 { 02337 Function *f = new Function; 02338 f->name = yyvsp[-4].string; 02339 f->args = yyvsp[-2].valueList; 02340 yyval.value.id = 0; 02341 yyval.value.unit = Value::Function; 02342 yyval.value.function = f; 02343 } 02344 break; 02345 02346 case 145: 02347 { 02348 Function *f = new Function; 02349 f->name = yyvsp[-2].string; 02350 f->args = 0; 02351 yyval.value.id = 0; 02352 yyval.value.unit = Value::Function; 02353 yyval.value.function = f; 02354 } 02355 break; 02356 02357 case 146: 02358 { yyval.string = yyvsp[-1].string; } 02359 break; 02360 02361 case 147: 02362 { 02363 yyval.rule = 0; 02364 #ifdef CSS_DEBUG 02365 kdDebug( 6080 ) << "skipped invalid @-rule" << endl; 02366 #endif 02367 } 02368 break; 02369 02370 case 148: 02371 { 02372 yyval.rule = 0; 02373 #ifdef CSS_DEBUG 02374 kdDebug( 6080 ) << "skipped invalid @-rule" << endl; 02375 #endif 02376 } 02377 break; 02378 02379 case 149: 02380 { 02381 yyval.rule = 0; 02382 #ifdef CSS_DEBUG 02383 kdDebug( 6080 ) << "skipped invalid rule" << endl; 02384 #endif 02385 } 02386 break; 02387 02388 02389 } 02390 02391 /* Line 1016 of /usr/share/bison/yacc.c. */ 02392 #line 2393 "parser.tab.c" 02393 02394 yyvsp -= yylen; 02395 yyssp -= yylen; 02396 02397 02398 #if YYDEBUG 02399 if (yydebug) 02400 { 02401 short *yyssp1 = yyss - 1; 02402 YYFPRINTF (stderr, "state stack now"); 02403 while (yyssp1 != yyssp) 02404 YYFPRINTF (stderr, " %d", *++yyssp1); 02405 YYFPRINTF (stderr, "\n"); 02406 } 02407 #endif 02408 02409 *++yyvsp = yyval; 02410 02411 02412 /* Now `shift' the result of the reduction. Determine what state 02413 that goes to, based on the state we popped back to and the rule 02414 number reduced by. */ 02415 02416 yyn = yyr1[yyn]; 02417 02418 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; 02419 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) 02420 yystate = yytable[yystate]; 02421 else 02422 yystate = yydefgoto[yyn - YYNTOKENS]; 02423 02424 goto yynewstate; 02425 02426 02427 /*------------------------------------. 02428 | yyerrlab -- here on detecting error | 02429 `------------------------------------*/ 02430 yyerrlab: 02431 /* If not already recovering from an error, report this error. */ 02432 if (!yyerrstatus) 02433 { 02434 ++yynerrs; 02435 #if YYERROR_VERBOSE 02436 yyn = yypact[yystate]; 02437 02438 if (YYPACT_NINF < yyn && yyn < YYLAST) 02439 { 02440 YYSIZE_T yysize = 0; 02441 int yytype = YYTRANSLATE (yychar); 02442 char *yymsg; 02443 int yyx, yycount; 02444 02445 yycount = 0; 02446 /* Start YYX at -YYN if negative to avoid negative indexes in 02447 YYCHECK. */ 02448 for (yyx = yyn < 0 ? -yyn : 0; 02449 yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) 02450 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) 02451 yysize += yystrlen (yytname[yyx]) + 15, yycount++; 02452 yysize += yystrlen ("parse error, unexpected ") + 1; 02453 yysize += yystrlen (yytname[yytype]); 02454 yymsg = (char *) YYSTACK_ALLOC (yysize); 02455 if (yymsg != 0) 02456 { 02457 char *yyp = yystpcpy (yymsg, "parse error, unexpected "); 02458 yyp = yystpcpy (yyp, yytname[yytype]); 02459 02460 if (yycount < 5) 02461 { 02462 yycount = 0; 02463 for (yyx = yyn < 0 ? -yyn : 0; 02464 yyx < (int) (sizeof (yytname) / sizeof (char *)); 02465 yyx++) 02466 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) 02467 { 02468 const char *yyq = ! yycount ? ", expecting " : " or "; 02469 yyp = yystpcpy (yyp, yyq); 02470 yyp = yystpcpy (yyp, yytname[yyx]); 02471 yycount++; 02472 } 02473 } 02474 yyerror (yymsg); 02475 YYSTACK_FREE (yymsg); 02476 } 02477 else 02478 yyerror ("parse error; also virtual memory exhausted"); 02479 } 02480 else 02481 #endif /* YYERROR_VERBOSE */ 02482 yyerror ("parse error"); 02483 } 02484 goto yyerrlab1; 02485 02486 02487 /*----------------------------------------------------. 02488 | yyerrlab1 -- error raised explicitly by an action. | 02489 `----------------------------------------------------*/ 02490 yyerrlab1: 02491 if (yyerrstatus == 3) 02492 { 02493 /* If just tried and failed to reuse lookahead token after an 02494 error, discard it. */ 02495 02496 /* Return failure if at end of input. */ 02497 if (yychar == YYEOF) 02498 { 02499 /* Pop the error token. */ 02500 YYPOPSTACK; 02501 /* Pop the rest of the stack. */ 02502 while (yyssp > yyss) 02503 { 02504 YYDPRINTF ((stderr, "Error: popping ")); 02505 YYDSYMPRINT ((stderr, 02506 yystos[*yyssp], 02507 *yyvsp)); 02508 YYDPRINTF ((stderr, "\n")); 02509 yydestruct (yystos[*yyssp], *yyvsp); 02510 YYPOPSTACK; 02511 } 02512 YYABORT; 02513 } 02514 02515 YYDPRINTF ((stderr, "Discarding token %d (%s).\n", 02516 yychar, yytname[yychar1])); 02517 yydestruct (yychar1, yylval); 02518 yychar = YYEMPTY; 02519 } 02520 02521 /* Else will try to reuse lookahead token after shifting the error 02522 token. */ 02523 02524 yyerrstatus = 3; /* Each real token shifted decrements this. */ 02525 02526 for (;;) 02527 { 02528 yyn = yypact[yystate]; 02529 if (yyn != YYPACT_NINF) 02530 { 02531 yyn += YYTERROR; 02532 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) 02533 { 02534 yyn = yytable[yyn]; 02535 if (0 < yyn) 02536 break; 02537 } 02538 } 02539 02540 /* Pop the current state because it cannot handle the error token. */ 02541 if (yyssp == yyss) 02542 YYABORT; 02543 02544 YYDPRINTF ((stderr, "Error: popping ")); 02545 YYDSYMPRINT ((stderr, 02546 yystos[*yyssp], *yyvsp)); 02547 YYDPRINTF ((stderr, "\n")); 02548 02549 yydestruct (yystos[yystate], *yyvsp); 02550 yyvsp--; 02551 yystate = *--yyssp; 02552 02553 02554 #if YYDEBUG 02555 if (yydebug) 02556 { 02557 short *yyssp1 = yyss - 1; 02558 YYFPRINTF (stderr, "Error: state stack now"); 02559 while (yyssp1 != yyssp) 02560 YYFPRINTF (stderr, " %d", *++yyssp1); 02561 YYFPRINTF (stderr, "\n"); 02562 } 02563 #endif 02564 } 02565 02566 if (yyn == YYFINAL) 02567 YYACCEPT; 02568 02569 YYDPRINTF ((stderr, "Shifting error token, ")); 02570 02571 *++yyvsp = yylval; 02572 02573 02574 yystate = yyn; 02575 goto yynewstate; 02576 02577 02578 /*-------------------------------------. 02579 | yyacceptlab -- YYACCEPT comes here. | 02580 `-------------------------------------*/ 02581 yyacceptlab: 02582 yyresult = 0; 02583 goto yyreturn; 02584 02585 /*-----------------------------------. 02586 | yyabortlab -- YYABORT comes here. | 02587 `-----------------------------------*/ 02588 yyabortlab: 02589 yyresult = 1; 02590 goto yyreturn; 02591 02592 #ifndef yyoverflow 02593 /*----------------------------------------------. 02594 | yyoverflowlab -- parser overflow comes here. | 02595 `----------------------------------------------*/ 02596 yyoverflowlab: 02597 yyerror ("parser stack overflow"); 02598 yyresult = 2; 02599 /* Fall through. */ 02600 #endif 02601 02602 yyreturn: 02603 #ifndef yyoverflow 02604 if (yyss != yyssa) 02605 YYSTACK_FREE (yyss); 02606 #endif 02607 return yyresult; 02608 } 02609 02610 02611 02612 02613
KDE Logo
This file is part of the documentation for khtml Library Version 3.2.3.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Fri Oct 8 11:16:13 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003