khtml Library API Documentation

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