khtml Library API Documentation

parser.cpp

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