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., 51 Franklin Street, Fifth Floor,
00019    Boston, MA 02110-1301, USA.  */
00020 
00021 /* As a special exception, when this file is copied by Bison into a
00022    Bison output file, you may use that output file without restriction.
00023    This special exception was added by the Free Software Foundation
00024    in version 1.24 of Bison.  */
00025 
00026 /* Written by Richard Stallman by simplifying the original so called
00027    ``semantic'' parser.  */
00028 
00029 /* All symbols defined below should begin with yy or YY, to avoid
00030    infringing on user name space.  This should be done even for local
00031    variables, as they might otherwise be expanded by user macros.
00032    There are some unavoidable exceptions within include files to
00033    define necessary library symbols; they are noted "INFRINGES ON
00034    USER NAME SPACE" below.  */
00035 
00036 /* Identify Bison output.  */
00037 #define YYBISON 1
00038 
00039 /* Skeleton name.  */
00040 #define YYSKELETON_NAME "yacc.c"
00041 
00042 /* Pure parsers.  */
00043 #define YYPURE 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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  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   447
00413 
00414 /* YYNTOKENS -- Number of terminals. */
00415 #define YYNTOKENS  66
00416 /* YYNNTS -- Number of nonterminals. */
00417 #define YYNNTS  54
00418 /* YYNRULES -- Number of rules. */
00419 #define YYNRULES  161
00420 /* YYNRULES -- Number of states. */
00421 #define YYNSTATES  304
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,    95,    99,   100,
00474      103,   104,   108,   110,   112,   114,   116,   118,   120,   123,
00475      125,   127,   128,   130,   132,   137,   140,   148,   149,   153,
00476      156,   160,   164,   168,   172,   175,   178,   181,   182,   184,
00477      186,   189,   191,   196,   199,   201,   205,   208,   210,   213,
00478      216,   219,   223,   226,   230,   235,   239,   241,   243,   245,
00479      248,   251,   253,   255,   257,   259,   262,   265,   270,   279,
00480      286,   297,   299,   301,   303,   305,   307,   309,   311,   313,
00481      316,   320,   325,   330,   335,   340,   346,   351,   356,   361,
00482      367,   373,   377,   381,   386,   391,   397,   400,   403,   406,
00483      407,   409,   413,   416,   419,   420,   422,   425,   428,   431,
00484      434,   437,   440,   442,   444,   447,   450,   453,   456,   459,
00485      462,   465,   468,   471,   474,   477,   480,   483,   486,   489,
00486      492,   495,   498,   504,   508,   511,   515,   519,   522,   528,
00487      532,   534
00488 };
00489 
00490 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
00491 static const yysigned_char yyrhs[] =
00492 {
00493       67,     0,    -1,    73,    72,    74,    76,    79,    -1,    68,
00494       71,    -1,    69,    71,    -1,    70,    71,    -1,    26,    53,
00495       71,    91,    71,    54,    -1,    27,   105,    -1,    28,    53,
00496       71,   110,    54,    -1,    -1,    71,     4,    -1,    -1,    72,
00497        5,    -1,    72,     4,    -1,    -1,    24,    71,    11,    71,
00498       55,    -1,    24,     1,   118,    -1,    24,     1,    55,    -1,
00499       -1,    74,    75,    72,    -1,    20,    71,    81,    71,    82,
00500       55,    -1,    20,     1,   118,    -1,    20,     1,    55,    -1,
00501       -1,    77,    72,    -1,    25,    71,    78,    81,    71,    55,
00502       -1,    25,     1,   118,    -1,    25,     1,    55,    -1,    -1,
00503       12,     4,    -1,    -1,    79,    80,    72,    -1,    91,    -1,
00504       84,    -1,    87,    -1,    88,    -1,   117,    -1,   116,    -1,
00505       75,     1,    -1,    11,    -1,    49,    -1,    -1,    83,    -1,
00506       86,    -1,    83,    56,    71,    86,    -1,    83,     1,    -1,
00507       22,    71,    83,    53,    71,    85,    54,    -1,    -1,    85,
00508       91,    71,    -1,    12,    71,    -1,    21,     1,   118,    -1,
00509       21,     1,    55,    -1,    23,     1,   118,    -1,    23,     1,
00510       55,    -1,    57,    71,    -1,    58,    71,    -1,    59,    71,
00511       -1,    -1,    60,    -1,    57,    -1,    92,   105,    -1,    93,
00512       -1,    92,    56,    71,    93,    -1,    92,     1,    -1,    95,
00513       -1,    93,    89,    95,    -1,    93,     1,    -1,    19,    -1,
00514       18,    19,    -1,    12,    19,    -1,    96,    71,    -1,    96,
00515       97,    71,    -1,    97,    71,    -1,    94,    96,    71,    -1,
00516       94,    96,    97,    71,    -1,    94,    97,    71,    -1,    12,
00517       -1,    18,    -1,    98,    -1,    97,    98,    -1,    97,     1,
00518       -1,    14,    -1,    99,    -1,   101,    -1,   104,    -1,    16,
00519       12,    -1,    12,    71,    -1,    17,    71,   100,    61,    -1,
00520       17,    71,   100,   102,    71,   103,    71,    61,    -1,    17,
00521       71,    94,    19,   100,    61,    -1,    17,    71,    94,    19,
00522      100,   102,    71,   103,    71,    61,    -1,    62,    -1,     6,
00523       -1,     7,    -1,     8,    -1,     9,    -1,    10,    -1,    12,
00524       -1,    11,    -1,    15,    12,    -1,    15,    15,    12,    -1,
00525       15,    50,    13,    63,    -1,    15,    50,    48,    63,    -1,
00526       15,    50,    12,    63,    -1,    15,    50,    11,    63,    -1,
00527       15,    51,    71,    95,    63,    -1,    53,    71,   107,    54,
00528       -1,    53,    71,     1,    54,    -1,    53,    71,   106,    54,
00529       -1,    53,    71,   106,   107,    54,    -1,    53,    71,   106,
00530        1,    54,    -1,   107,    55,    71,    -1,     1,    55,    71,
00531       -1,   106,   107,    55,    71,    -1,   106,     1,    55,    71,
00532       -1,   108,    15,    71,   110,   109,    -1,     1,   118,    -1,
00533       12,    71,    -1,    29,    71,    -1,    -1,   112,    -1,   110,
00534      111,   112,    -1,    64,    71,    -1,    56,    71,    -1,    -1,
00535      113,    -1,    90,   113,    -1,    46,    71,    -1,    11,    71,
00536       -1,    12,    71,    -1,    49,    71,    -1,    52,    71,    -1,
00537      115,    -1,   114,    -1,    48,    71,    -1,    47,    71,    -1,
00538       33,    71,    -1,    34,    71,    -1,    35,    71,    -1,    36,
00539       71,    -1,    37,    71,    -1,    38,    71,    -1,    39,    71,
00540       -1,    40,    71,    -1,    41,    71,    -1,    42,    71,    -1,
00541       43,    71,    -1,    44,    71,    -1,    45,    71,    -1,    31,
00542       71,    -1,    30,    71,    -1,    32,    71,    -1,    50,    71,
00543      110,    63,    71,    -1,    50,    71,     1,    -1,    14,    71,
00544       -1,    65,     1,   118,    -1,    65,     1,    55,    -1,     1,
00545      118,    -1,    53,     1,   119,     1,    54,    -1,    53,     1,
00546       54,    -1,   118,    -1,   119,     1,   118,    -1
00547 };
00548 
00549 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
00550 static const unsigned short yyrline[] =
00551 {
00552        0,   255,   255,   256,   257,   258,   262,   269,   275,   300,
00553      301,   304,   306,   307,   310,   312,   317,   318,   321,   323,
00554      334,   344,   347,   353,   354,   358,   366,   367,   371,   372,
00555      375,   377,   388,   389,   390,   391,   392,   393,   394,   398,
00556      399,   403,   406,   411,   415,   420,   427,   441,   442,   452,
00557      474,   477,   483,   486,   492,   493,   494,   495,   499,   500,
00558      504,   524,   537,   551,   558,   561,   582,   589,   590,   591,
00559      595,   599,   604,   609,   616,   625,   637,   653,   659,   663,
00560      673,   680,   686,   687,   688,   692,   701,   725,   730,   736,
00561      744,   756,   759,   762,   765,   768,   771,   777,   778,   782,
00562      788,   794,   801,   808,   815,   822,   831,   834,   837,   840,
00563      845,   851,   855,   858,   863,   869,   891,   897,   904,   905,
00564      909,   913,   929,   932,   935,   941,   942,   944,   945,   946,
00565      952,   953,   954,   956,   962,   963,   964,   965,   966,   967,
00566      968,   969,   970,   971,   972,   973,   974,   975,   976,   977,
00567      978,   979,   984,   992,  1008,  1015,  1021,  1030,  1056,  1057,
00568     1061,  1062
00569 };
00570 #endif
00571 
00572 #if YYDEBUG || YYERROR_VERBOSE
00573 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
00574    First, the terminals, then, starting at YYNTOKENS, nonterminals. */
00575 static const char *const yytname[] =
00576 {
00577   "$end", "error", "$undefined", "UNIMPORTANT_TOK", "S", "SGML_CD", 
00578   "INCLUDES", "DASHMATCH", "BEGINSWITH", "ENDSWITH", "CONTAINS", "STRING", 
00579   "IDENT", "NTH", "HASH", "':'", "'.'", "'['", "'*'", "'|'", "IMPORT_SYM", 
00580   "PAGE_SYM", "MEDIA_SYM", "FONT_FACE_SYM", "CHARSET_SYM", 
00581   "NAMESPACE_SYM", "KHTML_RULE_SYM", "KHTML_DECLS_SYM", "KHTML_VALUE_SYM", 
00582   "IMPORTANT_SYM", "QEMS", "EMS", "EXS", "PXS", "CMS", "MMS", "INS", 
00583   "PTS", "PCS", "DEGS", "RADS", "GRADS", "MSECS", "SECS", "HERZ", "KHERZ", 
00584   "DIMEN", "PERCENTAGE", "NUMBER", "URI", "FUNCTION", "NOTFUNCTION", 
00585   "UNICODERANGE", "'{'", "'}'", "';'", "','", "'+'", "'~'", "'>'", "'-'", 
00586   "']'", "'='", "')'", "'/'", "'@'", "$accept", "stylesheet", 
00587   "khtml_rule", "khtml_decls", "khtml_value", "maybe_space", "maybe_sgml", 
00588   "maybe_charset", "import_list", "import", "maybe_namespace", 
00589   "namespace", "maybe_ns_prefix", "rule_list", "rule", "string_or_uri", 
00590   "maybe_media_list", "media_list", "media", "ruleset_list", "medium", 
00591   "page", "font_face", "combinator", "unary_operator", "ruleset", 
00592   "selector_list", "selector", "namespace_selector", "simple_selector", 
00593   "element_name", "specifier_list", "specifier", "class", "attrib_id", 
00594   "attrib", "match", "ident_or_string", "pseudo", "declaration_block", 
00595   "declaration_list", "declaration", "property", "prio", "expr", 
00596   "operator", "term", "unary_term", "function", "hexcolor", "invalid_at", 
00597   "invalid_rule", "invalid_block", "invalid_block_list", 0
00598 };
00599 #endif
00600 
00601 # ifdef YYPRINT
00602 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
00603    token YYLEX-NUM.  */
00604 static const unsigned short yytoknum[] =
00605 {
00606        0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
00607      265,   266,   267,   268,   269,    58,    46,    91,    42,   124,
00608      270,   271,   272,   273,   274,   275,   276,   277,   278,   279,
00609      280,   281,   282,   283,   284,   285,   286,   287,   288,   289,
00610      290,   291,   292,   293,   294,   295,   296,   297,   298,   299,
00611      300,   301,   302,   123,   125,    59,    44,    43,   126,    62,
00612       45,    93,    61,    41,    47,    64
00613 };
00614 # endif
00615 
00616 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
00617 static const unsigned char yyr1[] =
00618 {
00619        0,    66,    67,    67,    67,    67,    68,    69,    70,    71,
00620       71,    72,    72,    72,    73,    73,    73,    73,    74,    74,
00621       75,    75,    75,    76,    76,    77,    77,    77,    78,    78,
00622       79,    79,    80,    80,    80,    80,    80,    80,    80,    81,
00623       81,    82,    82,    83,    83,    83,    84,    85,    85,    86,
00624       87,    87,    88,    88,    89,    89,    89,    89,    90,    90,
00625       91,    92,    92,    92,    93,    93,    93,    94,    94,    94,
00626       95,    95,    95,    95,    95,    95,    96,    96,    97,    97,
00627       97,    98,    98,    98,    98,    99,   100,   101,   101,   101,
00628      101,   102,   102,   102,   102,   102,   102,   103,   103,   104,
00629      104,   104,   104,   104,   104,   104,   105,   105,   105,   105,
00630      105,   106,   106,   106,   106,   107,   107,   108,   109,   109,
00631      110,   110,   111,   111,   111,   112,   112,   112,   112,   112,
00632      112,   112,   112,   112,   113,   113,   113,   113,   113,   113,
00633      113,   113,   113,   113,   113,   113,   113,   113,   113,   113,
00634      113,   113,   114,   114,   115,   116,   116,   117,   118,   118,
00635      119,   119
00636 };
00637 
00638 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
00639 static const unsigned char yyr2[] =
00640 {
00641        0,     2,     5,     2,     2,     2,     6,     2,     5,     0,
00642        2,     0,     2,     2,     0,     5,     3,     3,     0,     3,
00643        6,     3,     3,     0,     2,     6,     3,     3,     0,     2,
00644        0,     3,     1,     1,     1,     1,     1,     1,     2,     1,
00645        1,     0,     1,     1,     4,     2,     7,     0,     3,     2,
00646        3,     3,     3,     3,     2,     2,     2,     0,     1,     1,
00647        2,     1,     4,     2,     1,     3,     2,     1,     2,     2,
00648        2,     3,     2,     3,     4,     3,     1,     1,     1,     2,
00649        2,     1,     1,     1,     1,     2,     2,     4,     8,     6,
00650       10,     1,     1,     1,     1,     1,     1,     1,     1,     2,
00651        3,     4,     4,     4,     4,     5,     4,     4,     4,     5,
00652        5,     3,     3,     4,     4,     5,     2,     2,     2,     0,
00653        1,     3,     2,     2,     0,     1,     2,     2,     2,     2,
00654        2,     2,     1,     1,     2,     2,     2,     2,     2,     2,
00655        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00656        2,     2,     5,     3,     2,     3,     3,     2,     5,     3,
00657        1,     3
00658 };
00659 
00660 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
00661    STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
00662    means the default is an error.  */
00663 static const unsigned char yydefact[] =
00664 {
00665       14,     0,     0,     0,     0,     0,     9,     9,     9,    11,
00666        0,     0,     9,     9,     7,     9,     1,     3,     4,     5,
00667       18,     0,    17,    16,    10,     9,     0,     0,     0,    13,
00668       12,    23,     0,     0,    76,    81,     0,     0,     9,    77,
00669       67,     9,     0,     0,     0,    64,     9,     0,    78,    82,
00670       83,    84,     0,     9,     0,     0,     0,     9,     9,     9,
00671        9,     9,     9,     9,     9,     9,     9,     9,     9,     9,
00672        9,     9,     9,     9,     9,     9,     9,     9,     9,     9,
00673        9,     9,    59,    58,     0,   124,   120,   125,   133,   132,
00674        0,     0,    11,    30,    11,   159,   160,     0,    15,    69,
00675       99,     0,     0,     9,    85,     0,    68,     0,    63,     9,
00676       60,    66,     9,     9,     9,     0,    76,    77,     9,     0,
00677       70,     0,    80,    72,    79,   107,     9,   116,   117,     0,
00678      108,     0,   106,     9,     9,   128,   129,   154,   150,   149,
00679      151,   136,   137,   138,   139,   140,   141,   142,   143,   144,
00680      145,   146,   147,   148,   127,   135,   134,   130,     0,   131,
00681      126,     8,     9,     9,     0,     0,     0,     0,    28,    19,
00682        0,    24,     0,   100,     0,     0,     0,     0,     0,     9,
00683        0,     0,     0,     6,     0,    54,    55,    56,    65,    73,
00684        0,    75,    71,   112,   110,     9,   109,     9,   111,     0,
00685      153,   124,   123,   122,   121,    22,    21,    39,    40,     9,
00686       27,    26,     0,     0,     0,     0,     9,     0,     0,     0,
00687       11,    33,    34,    35,    32,    37,    36,   158,   161,   104,
00688      103,   101,   102,     0,    86,     0,    92,    93,    94,    95,
00689       96,    87,    91,     9,     0,    74,   114,   113,   124,     9,
00690       41,    29,     9,   157,     0,     0,     0,     0,    38,    31,
00691      105,     9,     0,     0,     9,   115,   152,     9,     0,     0,
00692       43,     0,    51,    50,     0,    53,    52,   156,   155,    89,
00693        9,    98,    97,     9,   118,    49,    20,    45,     9,    25,
00694        9,     0,     0,     0,    47,     9,    88,    44,     0,     0,
00695       46,     9,    90,    48
00696 };
00697 
00698 /* YYDEFGOTO[NTERM-NUM]. */
00699 static const short yydefgoto[] =
00700 {
00701       -1,     5,     6,     7,     8,   234,    20,     9,    31,    92,
00702       93,    94,   213,   170,   220,   209,   268,   269,   221,   298,
00703      270,   222,   223,   115,    84,    41,    42,    43,    44,    45,
00704       46,    47,    48,    49,   182,    50,   243,   283,    51,    14,
00705       54,    55,    56,   265,    85,   164,    86,    87,    88,    89,
00706      225,   226,   127,    97
00707 };
00708 
00709 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
00710    STATE-NUM.  */
00711 #define YYPACT_NINF -170
00712 static const short yypact[] =
00713 {
00714      186,   226,   -27,   -11,    57,   114,  -170,  -170,  -170,  -170,
00715       -2,   124,  -170,  -170,  -170,  -170,  -170,   151,   151,   151,
00716      213,   158,  -170,  -170,  -170,  -170,   322,    37,   319,  -170,
00717     -170,     2,   211,    46,   173,  -170,   178,   185,  -170,   176,
00718     -170,  -170,    43,   187,   330,  -170,   372,   163,  -170,  -170,
00719     -170,  -170,   117,  -170,   103,   236,   194,  -170,  -170,  -170,
00720     -170,  -170,  -170,  -170,  -170,  -170,  -170,  -170,  -170,  -170,
00721     -170,  -170,  -170,  -170,  -170,  -170,  -170,  -170,  -170,  -170,
00722     -170,  -170,  -170,  -170,   392,   206,  -170,  -170,  -170,  -170,
00723      120,   162,  -170,  -170,  -170,  -170,  -170,   199,  -170,  -170,
00724     -170,   223,   138,  -170,  -170,   249,  -170,   102,  -170,  -170,
00725     -170,  -170,  -170,  -170,  -170,   366,  -170,  -170,   372,   163,
00726      151,   163,  -170,   151,  -170,  -170,  -170,  -170,   151,   130,
00727     -170,   273,  -170,  -170,  -170,   151,   151,   151,   151,   151,
00728      151,   151,   151,   151,   151,   151,   151,   151,   151,   151,
00729      151,   151,   151,   151,   151,   151,   151,   151,   272,   151,
00730     -170,  -170,  -170,  -170,   361,   179,   105,   183,    35,   213,
00731      122,   213,   227,  -170,   168,   215,   225,   229,   322,   173,
00732      176,   220,    26,  -170,   322,   151,   151,   151,  -170,   151,
00733      163,   151,   151,   151,  -170,  -170,  -170,  -170,   151,   319,
00734     -170,   -33,   151,   151,  -170,  -170,  -170,  -170,  -170,  -170,
00735     -170,  -170,   281,   142,   242,   300,  -170,   324,   334,   342,
00736     -170,  -170,  -170,  -170,  -170,  -170,  -170,  -170,  -170,  -170,
00737     -170,  -170,  -170,   307,   151,   362,  -170,  -170,  -170,  -170,
00738     -170,  -170,  -170,  -170,   240,   151,   151,   151,   169,  -170,
00739      164,  -170,  -170,  -170,   216,   164,   219,   222,  -170,   213,
00740     -170,  -170,    85,   115,  -170,  -170,   151,  -170,   335,    42,
00741     -170,    50,  -170,  -170,    47,  -170,  -170,  -170,  -170,  -170,
00742     -170,  -170,  -170,  -170,   151,   151,  -170,  -170,  -170,  -170,
00743     -170,   115,    24,   164,   151,  -170,  -170,  -170,     1,    25,
00744     -170,  -170,  -170,   151
00745 };
00746 
00747 /* YYPGOTO[NTERM-NUM].  */
00748 static const short yypgoto[] =
00749 {
00750     -170,  -170,  -170,  -170,  -170,    -1,   -90,  -170,  -170,   207,
00751     -170,  -170,  -170,  -170,  -170,   201,  -170,   157,  -170,  -170,
00752      123,  -170,  -170,  -170,  -170,  -169,  -170,   231,   312,   -94,
00753      375,   -36,   -38,  -170,   203,  -170,   180,   129,  -170,   399,
00754     -170,   389,  -170,  -170,   -51,  -170,   280,   363,  -170,  -170,
00755     -170,  -170,    -7,  -170
00756 };
00757 
00758 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
00759    positive, shift that token.  If negative, reduce the rule which
00760    number is the opposite.  If zero, do what YYDEFACT says.
00761    If YYTABLE_NINF, syntax error.  */
00762 #define YYTABLE_NINF -120
00763 static const short yytable[] =
00764 {
00765       11,   224,   169,    23,   171,    17,    18,    19,   119,   124,
00766      121,    26,    27,    34,    28,    35,    36,    37,    38,    39,
00767       40,   188,    90,   162,    33,    96,    12,    91,    24,    24,
00768      249,   163,   236,   237,   238,   239,   240,   105,    52,    24,
00769      107,    24,    13,   287,   108,   120,   123,   212,   287,    53,
00770       24,    21,   128,    22,    24,   300,   135,   136,   137,   138,
00771      139,   140,   141,   142,   143,   144,   145,   146,   147,   148,
00772      149,   150,   151,   152,   153,   154,   155,   156,   157,   158,
00773      159,   124,   190,   124,   233,   296,   302,   241,   242,   166,
00774      168,   236,   237,   238,   239,   240,    13,   -42,   288,   109,
00775      290,    98,   178,   288,   129,   289,    24,   201,   184,    24,
00776       15,   185,   186,   187,    16,    53,   207,   189,   191,    24,
00777      192,   165,    -2,   214,    -9,   193,   281,   282,    24,   301,
00778      259,    -9,   198,   199,    34,    25,    35,    36,    37,    38,
00779       39,    40,    90,   215,   216,   217,   279,   242,   248,   174,
00780      175,   176,   124,   207,   208,    24,   183,   130,   206,    32,
00781      211,   202,   203,   167,   122,   228,    -9,    -9,    24,    -9,
00782       21,   125,   126,    -9,    -9,    -9,   267,    35,    36,    37,
00783       38,    -9,    -9,    21,   194,   195,   177,   218,   111,   245,
00784      100,   208,    99,   101,   246,   106,   247,   104,   264,   -57,
00785      172,   -57,   -57,   -57,   -57,   -57,   -57,   253,   250,   134,
00786        1,    -9,     2,     3,     4,   255,    -9,    29,    30,    -9,
00787       -9,    -9,    -9,  -119,  -119,   162,    -9,    10,   102,   103,
00788       -9,   229,    21,   163,   205,   173,    21,    -9,   210,   235,
00789      -61,   111,   263,   -61,   112,   113,   114,   273,   266,   276,
00790      278,   271,   -57,    24,   -57,   -57,   -57,   -57,   -57,   -57,
00791      161,   179,   162,   284,    21,    95,   285,   180,    40,    21,
00792      163,   272,    21,   200,   275,    21,    24,   277,   230,   291,
00793       21,   227,   292,    57,    58,   251,    59,   293,   231,   294,
00794      132,   133,   232,   -62,   299,    21,   -62,   112,   113,   114,
00795      303,   254,    60,    61,    62,    63,    64,    65,    66,    67,
00796       68,    69,    70,    71,    72,    73,    74,    75,    76,    77,
00797       78,    79,    80,    24,    81,   256,    24,   196,   197,    82,
00798       57,    58,    83,    59,    34,   257,    35,    36,    37,    38,
00799       39,    40,   116,   258,    35,    36,    37,    38,   117,    60,
00800       61,    62,    63,    64,    65,    66,    67,    68,    69,    70,
00801       71,    72,    73,    74,    75,    76,    77,    78,    79,    80,
00802      260,    81,    57,    58,   261,    59,    82,   219,    34,    83,
00803       35,    36,    37,    38,    39,    40,    35,    36,    37,    38,
00804      286,    60,    61,    62,    63,    64,    65,    66,    67,    68,
00805       69,    70,    71,    72,    73,    74,    75,    76,    77,    78,
00806       79,    80,   274,    81,   252,   244,   297,   181,    82,   118,
00807      295,    83,    60,    61,    62,    63,    64,    65,    66,    67,
00808       68,    69,    70,    71,    72,    73,    74,    75,   262,    77,
00809       78,   110,   280,   131,   204,     0,     0,   160
00810 };
00811 
00812 static const short yycheck[] =
00813 {
00814        1,   170,    92,    10,    94,     6,     7,     8,    44,    47,
00815       46,    12,    13,    12,    15,    14,    15,    16,    17,    18,
00816       19,   115,    20,    56,    25,    32,    53,    25,     4,     4,
00817       63,    64,     6,     7,     8,     9,    10,    38,     1,     4,
00818       41,     4,    53,     1,     1,    46,    47,    12,     1,    12,
00819        4,    53,    53,    55,     4,    54,    57,    58,    59,    60,
00820       61,    62,    63,    64,    65,    66,    67,    68,    69,    70,
00821       71,    72,    73,    74,    75,    76,    77,    78,    79,    80,
00822       81,   119,   118,   121,   178,    61,    61,    61,    62,    90,
00823       91,     6,     7,     8,     9,    10,    53,    55,    56,    56,
00824       53,    55,   103,    56,     1,    55,     4,   158,   109,     4,
00825       53,   112,   113,   114,     0,    12,    11,   118,   119,     4,
00826      121,     1,     0,     1,     4,   126,    11,    12,     4,   298,
00827      220,    11,   133,   134,    12,    11,    14,    15,    16,    17,
00828       18,    19,    20,    21,    22,    23,    61,    62,   199,    11,
00829       12,    13,   190,    11,    49,     4,    54,    54,   165,     1,
00830      167,   162,   163,     1,     1,   172,     4,     4,     4,    49,
00831       53,    54,    55,    11,    12,    12,    12,    14,    15,    16,
00832       17,    18,    19,    53,    54,    55,    48,    65,     1,   190,
00833       12,    49,    19,    15,   195,    19,   197,    12,    29,    12,
00834        1,    14,    15,    16,    17,    18,    19,   214,   209,    15,
00835       24,    49,    26,    27,    28,   216,    53,     4,     5,    56,
00836       57,    58,    59,    54,    55,    56,    63,     1,    50,    51,
00837        4,    63,    53,    64,    55,    12,    53,    11,    55,    19,
00838       53,     1,   243,    56,    57,    58,    59,   254,   249,   256,
00839      257,   252,    12,     4,    14,    15,    16,    17,    18,    19,
00840       54,    12,    56,   264,    53,    54,   267,    18,    19,    53,
00841       64,    55,    53,     1,    55,    53,     4,    55,    63,   280,
00842       53,    54,   283,    11,    12,     4,    14,   288,    63,   290,
00843       54,    55,    63,    53,   295,    53,    56,    57,    58,    59,
00844      301,     1,    30,    31,    32,    33,    34,    35,    36,    37,
00845       38,    39,    40,    41,    42,    43,    44,    45,    46,    47,
00846       48,    49,    50,     4,    52,     1,     4,    54,    55,    57,
00847       11,    12,    60,    14,    12,     1,    14,    15,    16,    17,
00848       18,    19,    12,     1,    14,    15,    16,    17,    18,    30,
00849       31,    32,    33,    34,    35,    36,    37,    38,    39,    40,
00850       41,    42,    43,    44,    45,    46,    47,    48,    49,    50,
00851       63,    52,    11,    12,    12,    14,    57,   170,    12,    60,
00852       14,    15,    16,    17,    18,    19,    14,    15,    16,    17,
00853       55,    30,    31,    32,    33,    34,    35,    36,    37,    38,
00854       39,    40,    41,    42,    43,    44,    45,    46,    47,    48,
00855       49,    50,   255,    52,   213,   184,   293,   105,    57,    44,
00856      291,    60,    30,    31,    32,    33,    34,    35,    36,    37,
00857       38,    39,    40,    41,    42,    43,    44,    45,   235,    47,
00858       48,    42,   262,    54,   164,    -1,    -1,    84
00859 };
00860 
00861 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
00862    symbol of state STATE-NUM.  */
00863 static const unsigned char yystos[] =
00864 {
00865        0,    24,    26,    27,    28,    67,    68,    69,    70,    73,
00866        1,    71,    53,    53,   105,    53,     0,    71,    71,    71,
00867       72,    53,    55,   118,     4,    11,    71,    71,    71,     4,
00868        5,    74,     1,    71,    12,    14,    15,    16,    17,    18,
00869       19,    91,    92,    93,    94,    95,    96,    97,    98,    99,
00870      101,   104,     1,    12,   106,   107,   108,    11,    12,    14,
00871       30,    31,    32,    33,    34,    35,    36,    37,    38,    39,
00872       40,    41,    42,    43,    44,    45,    46,    47,    48,    49,
00873       50,    52,    57,    60,    90,   110,   112,   113,   114,   115,
00874       20,    25,    75,    76,    77,    54,   118,   119,    55,    19,
00875       12,    15,    50,    51,    12,    71,    19,    71,     1,    56,
00876      105,     1,    57,    58,    59,    89,    12,    18,    96,    97,
00877       71,    97,     1,    71,    98,    54,    55,   118,    71,     1,
00878       54,   107,    54,    55,    15,    71,    71,    71,    71,    71,
00879       71,    71,    71,    71,    71,    71,    71,    71,    71,    71,
00880       71,    71,    71,    71,    71,    71,    71,    71,    71,    71,
00881      113,    54,    56,    64,   111,     1,    71,     1,    71,    72,
00882       79,    72,     1,    12,    11,    12,    13,    48,    71,    12,
00883       18,    94,   100,    54,    71,    71,    71,    71,    95,    71,
00884       97,    71,    71,    71,    54,    55,    54,    55,    71,    71,
00885        1,   110,    71,    71,   112,    55,   118,    11,    49,    81,
00886       55,   118,    12,    78,     1,    21,    22,    23,    65,    75,
00887       80,    84,    87,    88,    91,   116,   117,    54,   118,    63,
00888       63,    63,    63,    95,    71,    19,     6,     7,     8,     9,
00889       10,    61,    62,   102,    93,    71,    71,    71,   110,    63,
00890       71,     4,    81,   118,     1,    71,     1,     1,     1,    72,
00891       63,    12,   100,    71,    29,   109,    71,    12,    82,    83,
00892       86,    71,    55,   118,    83,    55,   118,    55,   118,    61,
00893      102,    11,    12,   103,    71,    71,    55,     1,    56,    55,
00894       53,    71,    71,    71,    71,   103,    61,    86,    85,    71,
00895       54,    91,    61,    71
00896 };
00897 
00898 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
00899 # define YYSIZE_T __SIZE_TYPE__
00900 #endif
00901 #if ! defined (YYSIZE_T) && defined (size_t)
00902 # define YYSIZE_T size_t
00903 #endif
00904 #if ! defined (YYSIZE_T)
00905 # if defined (__STDC__) || defined (__cplusplus)
00906 #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
00907 #  define YYSIZE_T size_t
00908 # endif
00909 #endif
00910 #if ! defined (YYSIZE_T)
00911 # define YYSIZE_T unsigned int
00912 #endif
00913 
00914 #define yyerrok     (yyerrstatus = 0)
00915 #define yyclearin   (yychar = YYEMPTY)
00916 #define YYEMPTY     (-2)
00917 #define YYEOF       0
00918 
00919 #define YYACCEPT    goto yyacceptlab
00920 #define YYABORT     goto yyabortlab
00921 #define YYERROR     goto yyerrlab1
00922 
00923 
00924 /* Like YYERROR except do call yyerror.  This remains here temporarily
00925    to ease the transition to the new meaning of YYERROR, for GCC.
00926    Once GCC version 2 has supplanted version 1, this can go.  */
00927 
00928 #define YYFAIL      goto yyerrlab
00929 
00930 #define YYRECOVERING()  (!!yyerrstatus)
00931 
00932 #define YYBACKUP(Token, Value)                  \
00933 do                              \
00934   if (yychar == YYEMPTY && yylen == 1)              \
00935     {                               \
00936       yychar = (Token);                     \
00937       yylval = (Value);                     \
00938       yytoken = YYTRANSLATE (yychar);               \
00939       YYPOPSTACK;                       \
00940       goto yybackup;                        \
00941     }                               \
00942   else                              \
00943     {                               \
00944       yyerror ("syntax error: cannot back up");\
00945       YYERROR;                          \
00946     }                               \
00947 while (0)
00948 
00949 #define YYTERROR    1
00950 #define YYERRCODE   256
00951 
00952 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
00953    are run).  */
00954 
00955 #ifndef YYLLOC_DEFAULT
00956 # define YYLLOC_DEFAULT(Current, Rhs, N)         \
00957   Current.first_line   = Rhs[1].first_line;      \
00958   Current.first_column = Rhs[1].first_column;    \
00959   Current.last_line    = Rhs[N].last_line;       \
00960   Current.last_column  = Rhs[N].last_column;
00961 #endif
00962 
00963 /* YYLEX -- calling `yylex' with the right arguments.  */
00964 
00965 #ifdef YYLEX_PARAM
00966 # define YYLEX yylex (&yylval, YYLEX_PARAM)
00967 #else
00968 # define YYLEX yylex (&yylval)
00969 #endif
00970 
00971 /* Enable debugging if requested.  */
00972 #if YYDEBUG
00973 
00974 # ifndef YYFPRINTF
00975 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
00976 #  define YYFPRINTF fprintf
00977 # endif
00978 
00979 # define YYDPRINTF(Args)            \
00980 do {                        \
00981   if (yydebug)                  \
00982     YYFPRINTF Args;             \
00983 } while (0)
00984 
00985 # define YYDSYMPRINT(Args)          \
00986 do {                        \
00987   if (yydebug)                  \
00988     yysymprint Args;                \
00989 } while (0)
00990 
00991 # define YYDSYMPRINTF(Title, Token, Value, Location)        \
00992 do {                                \
00993   if (yydebug)                          \
00994     {                               \
00995       YYFPRINTF (stderr, "%s ", Title);             \
00996       yysymprint (stderr,                   \
00997                   Token, Value);    \
00998       YYFPRINTF (stderr, "\n");                 \
00999     }                               \
01000 } while (0)
01001 
01002 /*------------------------------------------------------------------.
01003 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
01004 | TOP (cinluded).                                                   |
01005 `------------------------------------------------------------------*/
01006 
01007 #if defined (__STDC__) || defined (__cplusplus)
01008 static void
01009 yy_stack_print (short *bottom, short *top)
01010 #else
01011 static void
01012 yy_stack_print (bottom, top)
01013     short *bottom;
01014     short *top;
01015 #endif
01016 {
01017   YYFPRINTF (stderr, "Stack now");
01018   for (/* Nothing. */; bottom <= top; ++bottom)
01019     YYFPRINTF (stderr, " %d", *bottom);
01020   YYFPRINTF (stderr, "\n");
01021 }
01022 
01023 # define YY_STACK_PRINT(Bottom, Top)                \
01024 do {                                \
01025   if (yydebug)                          \
01026     yy_stack_print ((Bottom), (Top));               \
01027 } while (0)
01028 
01029 
01030 /*------------------------------------------------.
01031 | Report that the YYRULE is going to be reduced.  |
01032 `------------------------------------------------*/
01033 
01034 #if defined (__STDC__) || defined (__cplusplus)
01035 static void
01036 yy_reduce_print (int yyrule)
01037 #else
01038 static void
01039 yy_reduce_print (yyrule)
01040     int yyrule;
01041 #endif
01042 {
01043   int yyi;
01044   unsigned int yylineno = yyrline[yyrule];
01045   YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
01046              yyrule - 1, yylineno);
01047   /* Print the symbols being reduced, and their result.  */
01048   for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
01049     YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
01050   YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
01051 }
01052 
01053 # define YY_REDUCE_PRINT(Rule)      \
01054 do {                    \
01055   if (yydebug)              \
01056     yy_reduce_print (Rule);     \
01057 } while (0)
01058 
01059 /* Nonzero means print parse trace.  It is left uninitialized so that
01060    multiple parsers can coexist.  */
01061 int yydebug;
01062 #else /* !YYDEBUG */
01063 # define YYDPRINTF(Args)
01064 # define YYDSYMPRINT(Args)
01065 # define YYDSYMPRINTF(Title, Token, Value, Location)
01066 # define YY_STACK_PRINT(Bottom, Top)
01067 # define YY_REDUCE_PRINT(Rule)
01068 #endif /* !YYDEBUG */
01069 
01070 
01071 /* YYINITDEPTH -- initial size of the parser's stacks.  */
01072 #ifndef YYINITDEPTH
01073 # define YYINITDEPTH 200
01074 #endif
01075 
01076 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
01077    if the built-in stack extension method is used).
01078 
01079    Do not make this value too large; the results are undefined if
01080    SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
01081    evaluated with infinite-precision integer arithmetic.  */
01082 
01083 #if YYMAXDEPTH == 0
01084 # undef YYMAXDEPTH
01085 #endif
01086 
01087 #ifndef YYMAXDEPTH
01088 # define YYMAXDEPTH 10000
01089 #endif
01090 
01091 
01092 
01093 #if YYERROR_VERBOSE
01094 
01095 # ifndef yystrlen
01096 #  if defined (__GLIBC__) && defined (_STRING_H)
01097 #   define yystrlen strlen
01098 #  else
01099 /* Return the length of YYSTR.  */
01100 static YYSIZE_T
01101 #   if defined (__STDC__) || defined (__cplusplus)
01102 yystrlen (const char *yystr)
01103 #   else
01104 yystrlen (yystr)
01105      const char *yystr;
01106 #   endif
01107 {
01108   register const char *yys = yystr;
01109 
01110   while (*yys++ != '\0')
01111     continue;
01112 
01113   return yys - yystr - 1;
01114 }
01115 #  endif
01116 # endif
01117 
01118 # ifndef yystpcpy
01119 #  if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
01120 #   define yystpcpy stpcpy
01121 #  else
01122 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
01123    YYDEST.  */
01124 static char *
01125 #   if defined (__STDC__) || defined (__cplusplus)
01126 yystpcpy (char *yydest, const char *yysrc)
01127 #   else
01128 yystpcpy (yydest, yysrc)
01129      char *yydest;
01130      const char *yysrc;
01131 #   endif
01132 {
01133   register char *yyd = yydest;
01134   register const char *yys = yysrc;
01135 
01136   while ((*yyd++ = *yys++) != '\0')
01137     continue;
01138 
01139   return yyd - 1;
01140 }
01141 #  endif
01142 # endif
01143 
01144 #endif /* !YYERROR_VERBOSE */
01145 
01146 
01147 
01148 #if YYDEBUG
01149 /*--------------------------------.
01150 | Print this symbol on YYOUTPUT.  |
01151 `--------------------------------*/
01152 
01153 #if defined (__STDC__) || defined (__cplusplus)
01154 static void
01155 yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
01156 #else
01157 static void
01158 yysymprint (yyoutput, yytype, yyvaluep)
01159     FILE *yyoutput;
01160     int yytype;
01161     YYSTYPE *yyvaluep;
01162 #endif
01163 {
01164   /* Pacify ``unused variable'' warnings.  */
01165   (void) yyvaluep;
01166 
01167   if (yytype < YYNTOKENS)
01168     {
01169       YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
01170 # ifdef YYPRINT
01171       YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
01172 # endif
01173     }
01174   else
01175     YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
01176 
01177   switch (yytype)
01178     {
01179       default:
01180         break;
01181     }
01182   YYFPRINTF (yyoutput, ")");
01183 }
01184 
01185 #endif /* ! YYDEBUG */
01186 /*-----------------------------------------------.
01187 | Release the memory associated to this symbol.  |
01188 `-----------------------------------------------*/
01189 
01190 #if defined (__STDC__) || defined (__cplusplus)
01191 static void
01192 yydestruct (int yytype, YYSTYPE *yyvaluep)
01193 #else
01194 static void
01195 yydestruct (yytype, yyvaluep)
01196     int yytype;
01197     YYSTYPE *yyvaluep;
01198 #endif
01199 {
01200   /* Pacify ``unused variable'' warnings.  */
01201   (void) yyvaluep;
01202 
01203   switch (yytype)
01204     {
01205       case 82: /* maybe_media_list */
01206 
01207         { delete yyvaluep->mediaList; yyvaluep->mediaList = 0; };
01208 
01209         break;
01210       case 83: /* media_list */
01211 
01212         { delete yyvaluep->mediaList; yyvaluep->mediaList = 0; };
01213 
01214         break;
01215       case 85: /* ruleset_list */
01216 
01217         { delete yyvaluep->ruleList; yyvaluep->ruleList = 0; };
01218 
01219         break;
01220       case 92: /* selector_list */
01221 
01222         { delete yyvaluep->selectorList; yyvaluep->selectorList = 0; };
01223 
01224         break;
01225       case 93: /* selector */
01226 
01227         { delete yyvaluep->selector; yyvaluep->selector = 0; };
01228 
01229         break;
01230       case 95: /* simple_selector */
01231 
01232         { delete yyvaluep->selector; yyvaluep->selector = 0; };
01233 
01234         break;
01235       case 97: /* specifier_list */
01236 
01237         { delete yyvaluep->selector; yyvaluep->selector = 0; };
01238 
01239         break;
01240       case 98: /* specifier */
01241 
01242         { delete yyvaluep->selector; yyvaluep->selector = 0; };
01243 
01244         break;
01245       case 99: /* class */
01246 
01247         { delete yyvaluep->selector; yyvaluep->selector = 0; };
01248 
01249         break;
01250       case 101: /* attrib */
01251 
01252         { delete yyvaluep->selector; yyvaluep->selector = 0; };
01253 
01254         break;
01255       case 104: /* pseudo */
01256 
01257         { delete yyvaluep->selector; yyvaluep->selector = 0; };
01258 
01259         break;
01260       case 110: /* expr */
01261 
01262         { delete yyvaluep->valueList; yyvaluep->valueList = 0; };
01263 
01264         break;
01265 
01266       default:
01267         break;
01268     }
01269 }
01270 
01271 
01272 /* Prevent warnings from -Wmissing-prototypes.  */
01273 
01274 #ifdef YYPARSE_PARAM
01275 # if defined (__STDC__) || defined (__cplusplus)
01276 int yyparse (void *YYPARSE_PARAM);
01277 # else
01278 int yyparse ();
01279 # endif
01280 #else /* ! YYPARSE_PARAM */
01281 #if defined (__STDC__) || defined (__cplusplus)
01282 int yyparse (void);
01283 #else
01284 int yyparse ();
01285 #endif
01286 #endif /* ! YYPARSE_PARAM */
01287 
01288 
01289 
01290 
01291 
01292 
01293 /*----------.
01294 | yyparse.  |
01295 `----------*/
01296 
01297 #ifdef YYPARSE_PARAM
01298 # if defined (__STDC__) || defined (__cplusplus)
01299 int yyparse (void *YYPARSE_PARAM)
01300 # else
01301 int yyparse (YYPARSE_PARAM)
01302   void *YYPARSE_PARAM;
01303 # endif
01304 #else /* ! YYPARSE_PARAM */
01305 #if defined (__STDC__) || defined (__cplusplus)
01306 int
01307 yyparse (void)
01308 #else
01309 int
01310 yyparse ()
01311 
01312 #endif
01313 #endif
01314 {
01315   /* The lookahead symbol.  */
01316 int yychar;
01317 
01318 /* The semantic value of the lookahead symbol.  */
01319 YYSTYPE yylval;
01320 
01321 /* Number of syntax errors so far.  */
01322 int yynerrs;
01323 
01324   register int yystate;
01325   register int yyn;
01326   int yyresult;
01327   /* Number of tokens to shift before error messages enabled.  */
01328   int yyerrstatus;
01329   /* Lookahead token as an internal (translated) token number.  */
01330   int yytoken = 0;
01331 
01332   /* Three stacks and their tools:
01333      `yyss': related to states,
01334      `yyvs': related to semantic values,
01335      `yyls': related to locations.
01336 
01337      Refer to the stacks thru separate pointers, to allow yyoverflow
01338      to reallocate them elsewhere.  */
01339 
01340   /* The state stack.  */
01341   short yyssa[YYINITDEPTH];
01342   short *yyss = yyssa;
01343   register short *yyssp;
01344 
01345   /* The semantic value stack.  */
01346   YYSTYPE yyvsa[YYINITDEPTH];
01347   YYSTYPE *yyvs = yyvsa;
01348   register YYSTYPE *yyvsp;
01349 
01350 
01351 
01352 #define YYPOPSTACK   (yyvsp--, yyssp--)
01353 
01354   YYSIZE_T yystacksize = YYINITDEPTH;
01355 
01356   /* The variables used to return semantic value and location from the
01357      action routines.  */
01358   YYSTYPE yyval;
01359 
01360 
01361   /* When reducing, the number of symbols on the RHS of the reduced
01362      rule.  */
01363   int yylen;
01364 
01365   YYDPRINTF ((stderr, "Starting parse\n"));
01366 
01367   yystate = 0;
01368   yyerrstatus = 0;
01369   yynerrs = 0;
01370   yychar = YYEMPTY;     /* Cause a token to be read.  */
01371 
01372   /* Initialize stack pointers.
01373      Waste one element of value and location stack
01374      so that they stay on the same level as the state stack.
01375      The wasted elements are never initialized.  */
01376 
01377   yyssp = yyss;
01378   yyvsp = yyvs;
01379 
01380   goto yysetstate;
01381 
01382 /*------------------------------------------------------------.
01383 | yynewstate -- Push a new state, which is found in yystate.  |
01384 `------------------------------------------------------------*/
01385  yynewstate:
01386   /* In all cases, when you get here, the value and location stacks
01387      have just been pushed. so pushing a state here evens the stacks.
01388      */
01389   yyssp++;
01390 
01391  yysetstate:
01392   *yyssp = yystate;
01393 
01394   if (yyss + yystacksize - 1 <= yyssp)
01395     {
01396       /* Get the current used size of the three stacks, in elements.  */
01397       YYSIZE_T yysize = yyssp - yyss + 1;
01398 
01399 #ifdef yyoverflow
01400       {
01401     /* Give user a chance to reallocate the stack. Use copies of
01402        these so that the &'s don't force the real ones into
01403        memory.  */
01404     YYSTYPE *yyvs1 = yyvs;
01405     short *yyss1 = yyss;
01406 
01407 
01408     /* Each stack pointer address is followed by the size of the
01409        data in use in that stack, in bytes.  This used to be a
01410        conditional around just the two extra args, but that might
01411        be undefined if yyoverflow is a macro.  */
01412     yyoverflow ("parser stack overflow",
01413             &yyss1, yysize * sizeof (*yyssp),
01414             &yyvs1, yysize * sizeof (*yyvsp),
01415 
01416             &yystacksize);
01417 
01418     yyss = yyss1;
01419     yyvs = yyvs1;
01420       }
01421 #else /* no yyoverflow */
01422 # ifndef YYSTACK_RELOCATE
01423       goto yyoverflowlab;
01424 # else
01425       /* Extend the stack our own way.  */
01426       if (YYMAXDEPTH <= yystacksize)
01427     goto yyoverflowlab;
01428       yystacksize *= 2;
01429       if (YYMAXDEPTH < yystacksize)
01430     yystacksize = YYMAXDEPTH;
01431 
01432       {
01433     short *yyss1 = yyss;
01434     union yyalloc *yyptr =
01435       (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
01436     if (! yyptr)
01437       goto yyoverflowlab;
01438     YYSTACK_RELOCATE (yyss);
01439     YYSTACK_RELOCATE (yyvs);
01440 
01441 #  undef YYSTACK_RELOCATE
01442     if (yyss1 != yyssa)
01443       YYSTACK_FREE (yyss1);
01444       }
01445 # endif
01446 #endif /* no yyoverflow */
01447 
01448       yyssp = yyss + yysize - 1;
01449       yyvsp = yyvs + yysize - 1;
01450 
01451 
01452       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
01453           (unsigned long int) yystacksize));
01454 
01455       if (yyss + yystacksize - 1 <= yyssp)
01456     YYABORT;
01457     }
01458 
01459   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
01460 
01461   goto yybackup;
01462 
01463 /*-----------.
01464 | yybackup.  |
01465 `-----------*/
01466 yybackup:
01467 
01468 /* Do appropriate processing given the current state.  */
01469 /* Read a lookahead token if we need one and don't already have one.  */
01470 /* yyresume: */
01471 
01472   /* First try to decide what to do without reference to lookahead token.  */
01473 
01474   yyn = yypact[yystate];
01475   if (yyn == YYPACT_NINF)
01476     goto yydefault;
01477 
01478   /* Not known => get a lookahead token if don't already have one.  */
01479 
01480   /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
01481   if (yychar == YYEMPTY)
01482     {
01483       YYDPRINTF ((stderr, "Reading a token: "));
01484       yychar = YYLEX;
01485     }
01486 
01487   if (yychar <= YYEOF)
01488     {
01489       yychar = yytoken = YYEOF;
01490       YYDPRINTF ((stderr, "Now at end of input.\n"));
01491     }
01492   else
01493     {
01494       yytoken = YYTRANSLATE (yychar);
01495       YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
01496     }
01497 
01498   /* If the proper action on seeing token YYTOKEN is to reduce or to
01499      detect an error, take that action.  */
01500   yyn += yytoken;
01501   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
01502     goto yydefault;
01503   yyn = yytable[yyn];
01504   if (yyn <= 0)
01505     {
01506       if (yyn == 0 || yyn == YYTABLE_NINF)
01507     goto yyerrlab;
01508       yyn = -yyn;
01509       goto yyreduce;
01510     }
01511 
01512   if (yyn == YYFINAL)
01513     YYACCEPT;
01514 
01515   /* Shift the lookahead token.  */
01516   YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
01517 
01518   /* Discard the token being shifted unless it is eof.  */
01519   if (yychar != YYEOF)
01520     yychar = YYEMPTY;
01521 
01522   *++yyvsp = yylval;
01523 
01524 
01525   /* Count tokens shifted since error; after three, turn off error
01526      status.  */
01527   if (yyerrstatus)
01528     yyerrstatus--;
01529 
01530   yystate = yyn;
01531   goto yynewstate;
01532 
01533 
01534 /*-----------------------------------------------------------.
01535 | yydefault -- do the default action for the current state.  |
01536 `-----------------------------------------------------------*/
01537 yydefault:
01538   yyn = yydefact[yystate];
01539   if (yyn == 0)
01540     goto yyerrlab;
01541   goto yyreduce;
01542 
01543 
01544 /*-----------------------------.
01545 | yyreduce -- Do a reduction.  |
01546 `-----------------------------*/
01547 yyreduce:
01548   /* yyn is the number of a rule to reduce with.  */
01549   yylen = yyr2[yyn];
01550 
01551   /* If YYLEN is nonzero, implement the default value of the action:
01552      `$$ = $1'.
01553 
01554      Otherwise, the following line sets YYVAL to garbage.
01555      This behavior is undocumented and Bison
01556      users should not rely upon it.  Assigning to YYVAL
01557      unconditionally makes the parser a bit smaller, and it avoids a
01558      GCC warning that YYVAL may be used uninitialized.  */
01559   yyval = yyvsp[1-yylen];
01560 
01561 
01562   YY_REDUCE_PRINT (yyn);
01563   switch (yyn)
01564     {
01565         case 6:
01566 
01567     {
01568         CSSParser *p = static_cast<CSSParser *>(parser);
01569     p->rule = yyvsp[-2].rule;
01570     ;}
01571     break;
01572 
01573   case 7:
01574 
01575     {
01576     /* can be empty */
01577     ;}
01578     break;
01579 
01580   case 8:
01581 
01582     {
01583     CSSParser *p = static_cast<CSSParser *>(parser);
01584     if ( yyvsp[-1].valueList ) {
01585         p->valueList = yyvsp[-1].valueList;
01586 #ifdef CSS_DEBUG
01587         kdDebug( 6080 ) << "   got property for " << p->id <<
01588         (p->important?" important":"")<< endl;
01589         bool ok =
01590 #endif
01591         p->parseValue( p->id, p->important );
01592 #ifdef CSS_DEBUG
01593         if ( !ok )
01594         kdDebug( 6080 ) << "     couldn't parse value!" << endl;
01595 #endif
01596     }
01597 #ifdef CSS_DEBUG
01598     else
01599         kdDebug( 6080 ) << "     no value found!" << endl;
01600 #endif
01601     delete p->valueList;
01602     p->valueList = 0;
01603     ;}
01604     break;
01605 
01606   case 15:
01607 
01608     {
01609 #ifdef CSS_DEBUG
01610      kdDebug( 6080 ) << "charset rule: " << qString(yyvsp[-2].string) << endl;
01611 #endif
01612  ;}
01613     break;
01614 
01615   case 19:
01616 
01617     {
01618      CSSParser *p = static_cast<CSSParser *>(parser);
01619      if ( yyvsp[-1].rule && p->styleElement && p->styleElement->isCSSStyleSheet() ) {
01620      p->styleElement->append( yyvsp[-1].rule );
01621      } else {
01622      delete yyvsp[-1].rule;
01623      }
01624  ;}
01625     break;
01626 
01627   case 20:
01628 
01629     {
01630 #ifdef CSS_DEBUG
01631     kdDebug( 6080 ) << "@import: " << qString(yyvsp[-3].string) << endl;
01632 #endif
01633     CSSParser *p = static_cast<CSSParser *>(parser);
01634     if ( yyvsp[-1].mediaList && p->styleElement && p->styleElement->isCSSStyleSheet() )
01635         yyval.rule = new CSSImportRuleImpl( p->styleElement, domString(yyvsp[-3].string), yyvsp[-1].mediaList );
01636     else
01637         yyval.rule = 0;
01638     ;}
01639     break;
01640 
01641   case 21:
01642 
01643     {
01644         yyval.rule = 0;
01645     ;}
01646     break;
01647 
01648   case 22:
01649 
01650     {
01651         yyval.rule = 0;
01652     ;}
01653     break;
01654 
01655   case 25:
01656 
01657     {
01658 #ifdef CSS_DEBUG
01659     kdDebug( 6080 ) << "@namespace: " << qString(yyvsp[-2].string) << endl;
01660 #endif
01661       CSSParser *p = static_cast<CSSParser *>(parser);
01662     if (p->styleElement && p->styleElement->isCSSStyleSheet())
01663         static_cast<CSSStyleSheetImpl*>(p->styleElement)->addNamespace(p, domString(yyvsp[-3].string), domString(yyvsp[-2].string));
01664  ;}
01665     break;
01666 
01667   case 28:
01668 
01669     { yyval.string.string = 0; ;}
01670     break;
01671 
01672   case 29:
01673 
01674     { yyval.string = yyvsp[-1].string; ;}
01675     break;
01676 
01677   case 31:
01678 
01679     {
01680      CSSParser *p = static_cast<CSSParser *>(parser);
01681      if ( yyvsp[-1].rule && p->styleElement && p->styleElement->isCSSStyleSheet() ) {
01682      p->styleElement->append( yyvsp[-1].rule );
01683      } else {
01684      delete yyvsp[-1].rule;
01685      }
01686  ;}
01687     break;
01688 
01689   case 38:
01690 
01691     { delete yyvsp[-1].rule; yyval.rule = 0; ;}
01692     break;
01693 
01694   case 41:
01695 
01696     {
01697     yyval.mediaList = new MediaListImpl();
01698     ;}
01699     break;
01700 
01701   case 43:
01702 
01703     {
01704     yyval.mediaList = new MediaListImpl();
01705     yyval.mediaList->appendMedium( domString(yyvsp[0].string).lower() );
01706     ;}
01707     break;
01708 
01709   case 44:
01710 
01711     {
01712     yyval.mediaList = yyvsp[-3].mediaList;
01713     if (yyval.mediaList)
01714         yyval.mediaList->appendMedium( domString(yyvsp[0].string).lower() );
01715     ;}
01716     break;
01717 
01718   case 45:
01719 
01720     {
01721        delete yyvsp[-1].mediaList;
01722        yyval.mediaList = 0;
01723     ;}
01724     break;
01725 
01726   case 46:
01727 
01728     {
01729     CSSParser *p = static_cast<CSSParser *>(parser);
01730     if ( yyvsp[-4].mediaList && yyvsp[-1].ruleList &&
01731          p->styleElement && p->styleElement->isCSSStyleSheet() ) {
01732         yyval.rule = new CSSMediaRuleImpl( static_cast<CSSStyleSheetImpl*>(p->styleElement), yyvsp[-4].mediaList, yyvsp[-1].ruleList );
01733     } else {
01734         yyval.rule = 0;
01735         delete yyvsp[-4].mediaList;
01736         delete yyvsp[-1].ruleList;
01737     }
01738     ;}
01739     break;
01740 
01741   case 47:
01742 
01743     { yyval.ruleList = 0; ;}
01744     break;
01745 
01746   case 48:
01747 
01748     {
01749       yyval.ruleList = yyvsp[-2].ruleList;
01750       if ( yyvsp[-1].rule ) {
01751       if ( !yyval.ruleList ) yyval.ruleList = new CSSRuleListImpl();
01752       yyval.ruleList->append( yyvsp[-1].rule );
01753       }
01754   ;}
01755     break;
01756 
01757   case 49:
01758 
01759     {
01760       yyval.string = yyvsp[-1].string;
01761   ;}
01762     break;
01763 
01764   case 50:
01765 
01766     {
01767       yyval.rule = 0;
01768     ;}
01769     break;
01770 
01771   case 51:
01772 
01773     {
01774       yyval.rule = 0;
01775     ;}
01776     break;
01777 
01778   case 52:
01779 
01780     {
01781       yyval.rule = 0;
01782     ;}
01783     break;
01784 
01785   case 53:
01786 
01787     {
01788       yyval.rule = 0;
01789     ;}
01790     break;
01791 
01792   case 54:
01793 
01794     { yyval.relation = CSSSelector::DirectAdjacent; ;}
01795     break;
01796 
01797   case 55:
01798 
01799     { yyval.relation = CSSSelector::IndirectAdjacent; ;}
01800     break;
01801 
01802   case 56:
01803 
01804     { yyval.relation = CSSSelector::Child; ;}
01805     break;
01806 
01807   case 57:
01808 
01809     { yyval.relation = CSSSelector::Descendant; ;}
01810     break;
01811 
01812   case 58:
01813 
01814     { yyval.val = -1; ;}
01815     break;
01816 
01817   case 59:
01818 
01819     { yyval.val = 1; ;}
01820     break;
01821 
01822   case 60:
01823 
01824     {
01825 #ifdef CSS_DEBUG
01826     kdDebug( 6080 ) << "got ruleset" << endl << "  selector:" << endl;
01827 #endif
01828     CSSParser *p = static_cast<CSSParser *>(parser);
01829     if ( yyvsp[-1].selectorList && yyvsp[0].ok && p->numParsedProperties ) {
01830         CSSStyleRuleImpl *rule = new CSSStyleRuleImpl( p->styleElement );
01831         CSSStyleDeclarationImpl *decl = p->createStyleDeclaration( rule );
01832         rule->setSelector( yyvsp[-1].selectorList );
01833         rule->setDeclaration(decl);
01834         yyval.rule = rule;
01835     } else {
01836         yyval.rule = 0;
01837         delete yyvsp[-1].selectorList;
01838         p->clearProperties();
01839     }
01840     ;}
01841     break;
01842 
01843   case 61:
01844 
01845     {
01846     if ( yyvsp[0].selector ) {
01847         yyval.selectorList = new QPtrList<CSSSelector>;
01848             yyval.selectorList->setAutoDelete( true );
01849 #ifdef CSS_DEBUG
01850         kdDebug( 6080 ) << "   got simple selector:" << endl;
01851         yyvsp[0].selector->print();
01852 #endif
01853         yyval.selectorList->append( yyvsp[0].selector );
01854     } else {
01855         yyval.selectorList = 0;
01856     }
01857     ;}
01858     break;
01859 
01860   case 62:
01861 
01862     {
01863     if ( yyvsp[-3].selectorList && yyvsp[0].selector ) {
01864         yyval.selectorList = yyvsp[-3].selectorList;
01865         yyval.selectorList->append( yyvsp[0].selector );
01866 #ifdef CSS_DEBUG
01867         kdDebug( 6080 ) << "   got simple selector:" << endl;
01868         yyvsp[0].selector->print();
01869 #endif
01870     } else {
01871         delete yyvsp[-3].selectorList;
01872         delete yyvsp[0].selector;
01873         yyval.selectorList = 0;
01874     }
01875     ;}
01876     break;
01877 
01878   case 63:
01879 
01880     {
01881     delete yyvsp[-1].selectorList;
01882     yyval.selectorList = 0;
01883     ;}
01884     break;
01885 
01886   case 64:
01887 
01888     {
01889     yyval.selector = yyvsp[0].selector;
01890     ;}
01891     break;
01892 
01893   case 65:
01894 
01895     {
01896     if ( !yyvsp[-2].selector || !yyvsp[0].selector ) {
01897         delete yyvsp[-2].selector;
01898         delete yyvsp[0].selector;
01899         yyval.selector = 0;
01900     } else {
01901         yyval.selector = yyvsp[0].selector;
01902         CSSSelector *end = yyvsp[0].selector;
01903         while( end->tagHistory )
01904         end = end->tagHistory;
01905         end->relation = yyvsp[-1].relation;
01906         end->tagHistory = yyvsp[-2].selector;
01907         if ( yyvsp[-1].relation == CSSSelector::Descendant ||
01908          yyvsp[-1].relation == CSSSelector::Child ) {
01909         CSSParser *p = static_cast<CSSParser *>(parser);
01910         DOM::DocumentImpl *doc = p->document();
01911         if ( doc )
01912             doc->setUsesDescendantRules(true);
01913         }
01914     }
01915     ;}
01916     break;
01917 
01918   case 66:
01919 
01920     {
01921     delete yyvsp[-1].selector;
01922     yyval.selector = 0;
01923     ;}
01924     break;
01925 
01926   case 67:
01927 
01928     { yyval.string.string = 0; yyval.string.length = 0; ;}
01929     break;
01930 
01931   case 68:
01932 
01933     { static unsigned short star = '*'; yyval.string.string = &star; yyval.string.length = 1; ;}
01934     break;
01935 
01936   case 69:
01937 
01938     { yyval.string = yyvsp[-1].string; ;}
01939     break;
01940 
01941   case 70:
01942 
01943     {
01944     yyval.selector = new CSSSelector();
01945     yyval.selector->tag = yyvsp[-1].element;
01946     ;}
01947     break;
01948 
01949   case 71:
01950 
01951     {
01952     yyval.selector = yyvsp[-1].selector;
01953         if ( yyval.selector )
01954         yyval.selector->tag = yyvsp[-2].element;
01955     ;}
01956     break;
01957 
01958   case 72:
01959 
01960     {
01961     yyval.selector = yyvsp[-1].selector;
01962         if ( yyval.selector )
01963             yyval.selector->tag = makeId(static_cast<CSSParser*>(parser)->defaultNamespace, anyLocalName);;
01964     ;}
01965     break;
01966 
01967   case 73:
01968 
01969     {
01970         yyval.selector = new CSSSelector();
01971         yyval.selector->tag = yyvsp[-1].element;
01972     CSSParser *p = static_cast<CSSParser *>(parser);
01973         if (p->styleElement && p->styleElement->isCSSStyleSheet())
01974             static_cast<CSSStyleSheetImpl*>(p->styleElement)->determineNamespace(yyval.selector->tag, domString(yyvsp[-2].string));
01975     ;}
01976     break;
01977 
01978   case 74:
01979 
01980     {
01981         yyval.selector = yyvsp[-1].selector;
01982         if (yyval.selector) {
01983             yyval.selector->tag = yyvsp[-2].element;
01984             CSSParser *p = static_cast<CSSParser *>(parser);
01985             if (p->styleElement && p->styleElement->isCSSStyleSheet())
01986                 static_cast<CSSStyleSheetImpl*>(p->styleElement)->determineNamespace(yyval.selector->tag, domString(yyvsp[-3].string));
01987         }
01988     ;}
01989     break;
01990 
01991   case 75:
01992 
01993     {
01994         yyval.selector = yyvsp[-1].selector;
01995         if (yyval.selector) {
01996             yyval.selector->tag = makeId(anyNamespace, anyLocalName);
01997             CSSParser *p = static_cast<CSSParser *>(parser);
01998             if (p->styleElement && p->styleElement->isCSSStyleSheet())
01999                 static_cast<CSSStyleSheetImpl*>(p->styleElement)->determineNamespace(yyval.selector->tag, domString(yyvsp[-2].string));
02000         }
02001     ;}
02002     break;
02003 
02004   case 76:
02005 
02006     {
02007     CSSParser *p = static_cast<CSSParser *>(parser);
02008     DOM::DocumentImpl *doc = p->document();
02009     QString tag = qString(yyvsp[0].string);
02010     if ( doc ) {
02011         if (doc->isHTMLDocument())
02012         tag = tag.lower();
02013         const DOMString dtag(tag);
02014             yyval.element = makeId(p->defaultNamespace, doc->getId(NodeImpl::ElementId, dtag.implementation(), false, true));
02015     } else {
02016         yyval.element = makeId(p->defaultNamespace, 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 77:
02025 
02026     {
02027     yyval.element = makeId(static_cast<CSSParser*>(parser)->defaultNamespace, anyLocalName);
02028     ;}
02029     break;
02030 
02031   case 78:
02032 
02033     {
02034     yyval.selector = yyvsp[0].selector;
02035     yyval.selector->nonCSSHint = static_cast<CSSParser *>(parser)->nonCSSHint;
02036     ;}
02037     break;
02038 
02039   case 79:
02040 
02041     {
02042     yyval.selector = yyvsp[-1].selector;
02043     if ( yyval.selector ) {
02044             CSSSelector *end = yyvsp[-1].selector;
02045             while( end->tagHistory )
02046                 end = end->tagHistory;
02047             end->relation = CSSSelector::SubSelector;
02048             end->tagHistory = yyvsp[0].selector;
02049     }
02050     ;}
02051     break;
02052 
02053   case 80:
02054 
02055     {
02056     delete yyvsp[-1].selector;
02057     yyval.selector = 0;
02058     ;}
02059     break;
02060 
02061   case 81:
02062 
02063     {
02064     yyval.selector = new CSSSelector();
02065     yyval.selector->match = CSSSelector::Id;
02066     yyval.selector->attr = ATTR_ID;
02067     yyval.selector->value = domString(yyvsp[0].string);
02068     ;}
02069     break;
02070 
02071   case 85:
02072 
02073     {
02074     yyval.selector = new CSSSelector();
02075     yyval.selector->match = CSSSelector::List;
02076     yyval.selector->attr = ATTR_CLASS;
02077     yyval.selector->value = domString(yyvsp[0].string);
02078     ;}
02079     break;
02080 
02081   case 86:
02082 
02083     {
02084     CSSParser *p = static_cast<CSSParser *>(parser);
02085     DOM::DocumentImpl *doc = p->document();
02086 
02087     QString attr = qString(yyvsp[-1].string);
02088     if ( doc ) {
02089         if (doc->isHTMLDocument())
02090         attr = attr.lower();
02091         const DOMString dattr(attr);
02092 #ifdef APPLE_CHANGES
02093             yyval.attribute = doc->attrId(0, dattr.implementation(), false);
02094 #else
02095         yyval.attribute = doc->getId(NodeImpl::AttributeId, dattr.implementation(), false, true);
02096 #endif
02097     } else {
02098         yyval.attribute = khtml::getAttrID(attr.lower().ascii(), attr.length());
02099         // this case should never happen - only when loading
02100         // the default stylesheet - which must not contain unknown attributes
02101         assert(yyval.attribute != 0);
02102         }
02103     ;}
02104     break;
02105 
02106   case 87:
02107 
02108     {
02109     yyval.selector = new CSSSelector();
02110     yyval.selector->attr = yyvsp[-1].attribute;
02111     yyval.selector->match = CSSSelector::Set;
02112     ;}
02113     break;
02114 
02115   case 88:
02116 
02117     {
02118     yyval.selector = new CSSSelector();
02119     yyval.selector->attr = yyvsp[-5].attribute;
02120     yyval.selector->match = yyvsp[-4].match;
02121     yyval.selector->value = domString(yyvsp[-2].string);
02122     ;}
02123     break;
02124 
02125   case 89:
02126 
02127     {
02128         yyval.selector = new CSSSelector();
02129         yyval.selector->attr = yyvsp[-1].attribute;
02130         yyval.selector->match = CSSSelector::Set;
02131         CSSParser *p = static_cast<CSSParser *>(parser);
02132         if (p->styleElement && p->styleElement->isCSSStyleSheet())
02133             static_cast<CSSStyleSheetImpl*>(p->styleElement)->determineNamespace(yyval.selector->attr, domString(yyvsp[-3].string));
02134     ;}
02135     break;
02136 
02137   case 90:
02138 
02139     {
02140         yyval.selector = new CSSSelector();
02141         yyval.selector->attr = yyvsp[-5].attribute;
02142         yyval.selector->match = (CSSSelector::Match)yyvsp[-4].match;
02143         yyval.selector->value = domString(yyvsp[-2].string);
02144         CSSParser *p = static_cast<CSSParser *>(parser);
02145         if (p->styleElement && p->styleElement->isCSSStyleSheet())
02146             static_cast<CSSStyleSheetImpl*>(p->styleElement)->determineNamespace(yyval.selector->attr, domString(yyvsp[-7].string));
02147    ;}
02148     break;
02149 
02150   case 91:
02151 
02152     {
02153     yyval.match = CSSSelector::Exact;
02154     ;}
02155     break;
02156 
02157   case 92:
02158 
02159     {
02160     yyval.match = CSSSelector::List;
02161     ;}
02162     break;
02163 
02164   case 93:
02165 
02166     {
02167     yyval.match = CSSSelector::Hyphen;
02168     ;}
02169     break;
02170 
02171   case 94:
02172 
02173     {
02174     yyval.match = CSSSelector::Begin;
02175     ;}
02176     break;
02177 
02178   case 95:
02179 
02180     {
02181     yyval.match = CSSSelector::End;
02182     ;}
02183     break;
02184 
02185   case 96:
02186 
02187     {
02188     yyval.match = CSSSelector::Contain;
02189     ;}
02190     break;
02191 
02192   case 99:
02193 
02194     {
02195     yyval.selector = new CSSSelector();
02196     yyval.selector->match = CSSSelector::PseudoClass;
02197     yyval.selector->value = domString(yyvsp[0].string);
02198     ;}
02199     break;
02200 
02201   case 100:
02202 
02203     {
02204     yyval.selector = new CSSSelector();
02205     yyval.selector->match = CSSSelector::PseudoElement;
02206         yyval.selector->value = domString(yyvsp[0].string);
02207     ;}
02208     break;
02209 
02210   case 101:
02211 
02212     {
02213         yyval.selector = new CSSSelector();
02214         yyval.selector->match = CSSSelector::PseudoClass;
02215         yyval.selector->string_arg = domString(yyvsp[-1].string);
02216         yyval.selector->value = domString(yyvsp[-2].string);
02217     ;}
02218     break;
02219 
02220   case 102:
02221 
02222     {
02223         yyval.selector = new CSSSelector();
02224         yyval.selector->match = CSSSelector::PseudoClass;
02225         yyval.selector->string_arg = QString::number(yyvsp[-1].val);
02226         yyval.selector->value = domString(yyvsp[-2].string);
02227     ;}
02228     break;
02229 
02230   case 103:
02231 
02232     {
02233         yyval.selector = new CSSSelector();
02234         yyval.selector->match = CSSSelector::PseudoClass;
02235         yyval.selector->string_arg = domString(yyvsp[-1].string);
02236         yyval.selector->value = domString(yyvsp[-2].string);
02237     ;}
02238     break;
02239 
02240   case 104:
02241 
02242     {
02243         yyval.selector = new CSSSelector();
02244         yyval.selector->match = CSSSelector::PseudoClass;
02245         yyval.selector->string_arg = domString(yyvsp[-1].string);
02246         yyval.selector->value = domString(yyvsp[-2].string);
02247     ;}
02248     break;
02249 
02250   case 105:
02251 
02252     {
02253         yyval.selector = new CSSSelector();
02254         yyval.selector->match = CSSSelector::PseudoClass;
02255         yyval.selector->simpleSelector = yyvsp[-1].selector;
02256         yyval.selector->value = domString(yyvsp[-3].string);
02257     ;}
02258     break;
02259 
02260   case 106:
02261 
02262     {
02263     yyval.ok = yyvsp[-1].ok;
02264     ;}
02265     break;
02266 
02267   case 107:
02268 
02269     {
02270     yyval.ok = false;
02271     ;}
02272     break;
02273 
02274   case 108:
02275 
02276     {
02277     yyval.ok = yyvsp[-1].ok;
02278     ;}
02279     break;
02280 
02281   case 109:
02282 
02283     {
02284     yyval.ok = yyvsp[-2].ok;
02285     if ( yyvsp[-1].ok )
02286         yyval.ok = yyvsp[-1].ok;
02287     ;}
02288     break;
02289 
02290   case 110:
02291 
02292     {
02293     yyval.ok = yyvsp[-2].ok;
02294     ;}
02295     break;
02296 
02297   case 111:
02298 
02299     {
02300     yyval.ok = yyvsp[-2].ok;
02301     ;}
02302     break;
02303 
02304   case 112:
02305 
02306     {
02307         yyval.ok = false;
02308     ;}
02309     break;
02310 
02311   case 113:
02312 
02313     {
02314     yyval.ok = yyvsp[-3].ok;
02315     if ( yyvsp[-2].ok )
02316         yyval.ok = yyvsp[-2].ok;
02317     ;}
02318     break;
02319 
02320   case 114:
02321 
02322     {
02323         yyval.ok = yyvsp[-3].ok;
02324     ;}
02325     break;
02326 
02327   case 115:
02328 
02329     {
02330     yyval.ok = false;
02331     CSSParser *p = static_cast<CSSParser *>(parser);
02332     if ( yyvsp[-4].prop_id && yyvsp[-1].valueList ) {
02333         p->valueList = yyvsp[-1].valueList;
02334 #ifdef CSS_DEBUG
02335         kdDebug( 6080 ) << "   got property: " << yyvsp[-4].prop_id <<
02336         (yyvsp[0].b?" important":"")<< endl;
02337 #endif
02338             bool ok = p->parseValue( yyvsp[-4].prop_id, yyvsp[0].b );
02339                 if ( ok )
02340             yyval.ok = ok;
02341 #ifdef CSS_DEBUG
02342             else
02343             kdDebug( 6080 ) << "     couldn't parse value!" << endl;
02344 #endif
02345     } else {
02346             delete yyvsp[-1].valueList;
02347         }
02348     delete p->valueList;
02349     p->valueList = 0;
02350     ;}
02351     break;
02352 
02353   case 116:
02354 
02355     {
02356         yyval.ok = false;
02357     ;}
02358     break;
02359 
02360   case 117:
02361 
02362     {
02363     QString str = qString(yyvsp[-1].string);
02364     yyval.prop_id = getPropertyID( str.lower().latin1(), str.length() );
02365     ;}
02366     break;
02367 
02368   case 118:
02369 
02370     { yyval.b = true; ;}
02371     break;
02372 
02373   case 119:
02374 
02375     { yyval.b = false; ;}
02376     break;
02377 
02378   case 120:
02379 
02380     {
02381     yyval.valueList = new ValueList;
02382     yyval.valueList->addValue( yyvsp[0].value );
02383     ;}
02384     break;
02385 
02386   case 121:
02387 
02388     {
02389     yyval.valueList = yyvsp[-2].valueList;
02390     if ( yyval.valueList ) {
02391         if ( yyvsp[-1].tok ) {
02392         Value v;
02393         v.id = 0;
02394         v.unit = Value::Operator;
02395         v.iValue = yyvsp[-1].tok;
02396         yyval.valueList->addValue( v );
02397         }
02398         yyval.valueList->addValue( yyvsp[0].value );
02399     }
02400     ;}
02401     break;
02402 
02403   case 122:
02404 
02405     {
02406     yyval.tok = '/';
02407     ;}
02408     break;
02409 
02410   case 123:
02411 
02412     {
02413     yyval.tok = ',';
02414     ;}
02415     break;
02416 
02417   case 124:
02418 
02419     {
02420         yyval.tok = 0;
02421   ;}
02422     break;
02423 
02424   case 125:
02425 
02426     { yyval.value = yyvsp[0].value; ;}
02427     break;
02428 
02429   case 126:
02430 
02431     { yyval.value = yyvsp[0].value; yyval.value.fValue *= yyvsp[-1].val; ;}
02432     break;
02433 
02434   case 127:
02435 
02436     { yyval.value.id = 0; yyval.value.string = yyvsp[-1].string; yyval.value.unit = CSSPrimitiveValue::CSS_DIMENSION; ;}
02437     break;
02438 
02439   case 128:
02440 
02441     { yyval.value.id = 0; yyval.value.string = yyvsp[-1].string; yyval.value.unit = CSSPrimitiveValue::CSS_STRING; ;}
02442     break;
02443 
02444   case 129:
02445 
02446     {
02447       QString str = qString( yyvsp[-1].string );
02448       yyval.value.id = getValueID( str.lower().latin1(), str.length() );
02449       yyval.value.unit = CSSPrimitiveValue::CSS_IDENT;
02450       yyval.value.string = yyvsp[-1].string;
02451   ;}
02452     break;
02453 
02454   case 130:
02455 
02456     { yyval.value.id = 0; yyval.value.string = yyvsp[-1].string; yyval.value.unit = CSSPrimitiveValue::CSS_URI; ;}
02457     break;
02458 
02459   case 131:
02460 
02461     { yyval.value.id = 0; yyval.value.iValue = 0; yyval.value.unit = CSSPrimitiveValue::CSS_UNKNOWN;/* ### */ ;}
02462     break;
02463 
02464   case 132:
02465 
02466     { yyval.value.id = 0; yyval.value.string = yyvsp[0].string; yyval.value.unit = CSSPrimitiveValue::CSS_RGBCOLOR; ;}
02467     break;
02468 
02469   case 133:
02470 
02471     {
02472       yyval.value = yyvsp[0].value;
02473   ;}
02474     break;
02475 
02476   case 134:
02477 
02478     { yyval.value.id = 0; yyval.value.fValue = yyvsp[-1].val; yyval.value.unit = CSSPrimitiveValue::CSS_NUMBER; ;}
02479     break;
02480 
02481   case 135:
02482 
02483     { yyval.value.id = 0; yyval.value.fValue = yyvsp[-1].val; yyval.value.unit = CSSPrimitiveValue::CSS_PERCENTAGE; ;}
02484     break;
02485 
02486   case 136:
02487 
02488     { yyval.value.id = 0; yyval.value.fValue = yyvsp[-1].val; yyval.value.unit = CSSPrimitiveValue::CSS_PX; ;}
02489     break;
02490 
02491   case 137:
02492 
02493     { yyval.value.id = 0; yyval.value.fValue = yyvsp[-1].val; yyval.value.unit = CSSPrimitiveValue::CSS_CM; ;}
02494     break;
02495 
02496   case 138:
02497 
02498     { yyval.value.id = 0; yyval.value.fValue = yyvsp[-1].val; yyval.value.unit = CSSPrimitiveValue::CSS_MM; ;}
02499     break;
02500 
02501   case 139:
02502 
02503     { yyval.value.id = 0; yyval.value.fValue = yyvsp[-1].val; yyval.value.unit = CSSPrimitiveValue::CSS_IN; ;}
02504     break;
02505 
02506   case 140:
02507 
02508     { yyval.value.id = 0; yyval.value.fValue = yyvsp[-1].val; yyval.value.unit = CSSPrimitiveValue::CSS_PT; ;}
02509     break;
02510 
02511   case 141:
02512 
02513     { yyval.value.id = 0; yyval.value.fValue = yyvsp[-1].val; yyval.value.unit = CSSPrimitiveValue::CSS_PC; ;}
02514     break;
02515 
02516   case 142:
02517 
02518     { yyval.value.id = 0; yyval.value.fValue = yyvsp[-1].val; yyval.value.unit = CSSPrimitiveValue::CSS_DEG; ;}
02519     break;
02520 
02521   case 143:
02522 
02523     { yyval.value.id = 0; yyval.value.fValue = yyvsp[-1].val; yyval.value.unit = CSSPrimitiveValue::CSS_RAD; ;}
02524     break;
02525 
02526   case 144:
02527 
02528     { yyval.value.id = 0; yyval.value.fValue = yyvsp[-1].val; yyval.value.unit = CSSPrimitiveValue::CSS_GRAD; ;}
02529     break;
02530 
02531   case 145:
02532 
02533     { yyval.value.id = 0; yyval.value.fValue = yyvsp[-1].val; yyval.value.unit = CSSPrimitiveValue::CSS_MS; ;}
02534     break;
02535 
02536   case 146:
02537 
02538     { yyval.value.id = 0; yyval.value.fValue = yyvsp[-1].val; yyval.value.unit = CSSPrimitiveValue::CSS_S; ;}
02539     break;
02540 
02541   case 147:
02542 
02543     { yyval.value.id = 0; yyval.value.fValue = yyvsp[-1].val; yyval.value.unit = CSSPrimitiveValue::CSS_HZ; ;}
02544     break;
02545 
02546   case 148:
02547 
02548     { yyval.value.id = 0; yyval.value.fValue = yyvsp[-1].val; yyval.value.unit = CSSPrimitiveValue::CSS_KHZ; ;}
02549     break;
02550 
02551   case 149:
02552 
02553     { yyval.value.id = 0; yyval.value.fValue = yyvsp[-1].val; yyval.value.unit = CSSPrimitiveValue::CSS_EMS; ;}
02554     break;
02555 
02556   case 150:
02557 
02558     { yyval.value.id = 0; yyval.value.fValue = yyvsp[-1].val; yyval.value.unit = Value::Q_EMS; ;}
02559     break;
02560 
02561   case 151:
02562 
02563     { yyval.value.id = 0; yyval.value.fValue = yyvsp[-1].val; yyval.value.unit = CSSPrimitiveValue::CSS_EXS; ;}
02564     break;
02565 
02566   case 152:
02567 
02568     {
02569       Function *f = new Function;
02570       f->name = yyvsp[-4].string;
02571       f->args = yyvsp[-2].valueList;
02572       yyval.value.id = 0;
02573       yyval.value.unit = Value::Function;
02574       yyval.value.function = f;
02575   ;}
02576     break;
02577 
02578   case 153:
02579 
02580     {
02581       Function *f = new Function;
02582       f->name = yyvsp[-2].string;
02583       f->args = 0;
02584       yyval.value.id = 0;
02585       yyval.value.unit = Value::Function;
02586       yyval.value.function = f;
02587   ;}
02588     break;
02589 
02590   case 154:
02591 
02592     { yyval.string = yyvsp[-1].string; ;}
02593     break;
02594 
02595   case 155:
02596 
02597     {
02598     yyval.rule = 0;
02599 #ifdef CSS_DEBUG
02600     kdDebug( 6080 ) << "skipped invalid @-rule" << endl;
02601 #endif
02602     ;}
02603     break;
02604 
02605   case 156:
02606 
02607     {
02608     yyval.rule = 0;
02609 #ifdef CSS_DEBUG
02610     kdDebug( 6080 ) << "skipped invalid @-rule" << endl;
02611 #endif
02612     ;}
02613     break;
02614 
02615   case 157:
02616 
02617     {
02618     yyval.rule = 0;
02619 #ifdef CSS_DEBUG
02620     kdDebug( 6080 ) << "skipped invalid rule" << endl;
02621 #endif
02622     ;}
02623     break;
02624 
02625 
02626     }
02627 
02628 /* Line 999 of yacc.c.  */
02629 
02630 
02631   yyvsp -= yylen;
02632   yyssp -= yylen;
02633 
02634 
02635   YY_STACK_PRINT (yyss, yyssp);
02636 
02637   *++yyvsp = yyval;
02638 
02639 
02640   /* Now `shift' the result of the reduction.  Determine what state
02641      that goes to, based on the state we popped back to and the rule
02642      number reduced by.  */
02643 
02644   yyn = yyr1[yyn];
02645 
02646   yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
02647   if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
02648     yystate = yytable[yystate];
02649   else
02650     yystate = yydefgoto[yyn - YYNTOKENS];
02651 
02652   goto yynewstate;
02653 
02654 
02655 /*------------------------------------.
02656 | yyerrlab -- here on detecting error |
02657 `------------------------------------*/
02658 yyerrlab:
02659   /* If not already recovering from an error, report this error.  */
02660   if (!yyerrstatus)
02661     {
02662       ++yynerrs;
02663 #if YYERROR_VERBOSE
02664       yyn = yypact[yystate];
02665 
02666       if (YYPACT_NINF < yyn && yyn < YYLAST)
02667     {
02668       YYSIZE_T yysize = 0;
02669       int yytype = YYTRANSLATE (yychar);
02670       char *yymsg;
02671       int yyx, yycount;
02672 
02673       yycount = 0;
02674       /* Start YYX at -YYN if negative to avoid negative indexes in
02675          YYCHECK.  */
02676       for (yyx = yyn < 0 ? -yyn : 0;
02677            yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
02678         if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
02679           yysize += yystrlen (yytname[yyx]) + 15, yycount++;
02680       yysize += yystrlen ("syntax error, unexpected ") + 1;
02681       yysize += yystrlen (yytname[yytype]);
02682       yymsg = (char *) YYSTACK_ALLOC (yysize);
02683       if (yymsg != 0)
02684         {
02685           char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
02686           yyp = yystpcpy (yyp, yytname[yytype]);
02687 
02688           if (yycount < 5)
02689         {
02690           yycount = 0;
02691           for (yyx = yyn < 0 ? -yyn : 0;
02692                yyx < (int) (sizeof (yytname) / sizeof (char *));
02693                yyx++)
02694             if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
02695               {
02696             const char *yyq = ! yycount ? ", expecting " : " or ";
02697             yyp = yystpcpy (yyp, yyq);
02698             yyp = yystpcpy (yyp, yytname[yyx]);
02699             yycount++;
02700               }
02701         }
02702           yyerror (yymsg);
02703           YYSTACK_FREE (yymsg);
02704         }
02705       else
02706         yyerror ("syntax error; also virtual memory exhausted");
02707     }
02708       else
02709 #endif /* YYERROR_VERBOSE */
02710     yyerror ("syntax error");
02711     }
02712 
02713 
02714 
02715   if (yyerrstatus == 3)
02716     {
02717       /* If just tried and failed to reuse lookahead token after an
02718      error, discard it.  */
02719 
02720       /* Return failure if at end of input.  */
02721       if (yychar == YYEOF)
02722         {
02723       /* Pop the error token.  */
02724           YYPOPSTACK;
02725       /* Pop the rest of the stack.  */
02726       while (yyss < yyssp)
02727         {
02728           YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
02729           yydestruct (yystos[*yyssp], yyvsp);
02730           YYPOPSTACK;
02731         }
02732       YYABORT;
02733         }
02734 
02735       YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
02736       yydestruct (yytoken, &yylval);
02737       yychar = YYEMPTY;
02738 
02739     }
02740 
02741   /* Else will try to reuse lookahead token after shifting the error
02742      token.  */
02743   goto yyerrlab1;
02744 
02745 
02746 /*----------------------------------------------------.
02747 | yyerrlab1 -- error raised explicitly by an action.  |
02748 `----------------------------------------------------*/
02749 yyerrlab1:
02750   yyerrstatus = 3;  /* Each real token shifted decrements this.  */
02751 
02752   for (;;)
02753     {
02754       yyn = yypact[yystate];
02755       if (yyn != YYPACT_NINF)
02756     {
02757       yyn += YYTERROR;
02758       if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
02759         {
02760           yyn = yytable[yyn];
02761           if (0 < yyn)
02762         break;
02763         }
02764     }
02765 
02766       /* Pop the current state because it cannot handle the error token.  */
02767       if (yyssp == yyss)
02768     YYABORT;
02769 
02770       YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
02771       yydestruct (yystos[yystate], yyvsp);
02772       yyvsp--;
02773       yystate = *--yyssp;
02774 
02775       YY_STACK_PRINT (yyss, yyssp);
02776     }
02777 
02778   if (yyn == YYFINAL)
02779     YYACCEPT;
02780 
02781   YYDPRINTF ((stderr, "Shifting error token, "));
02782 
02783   *++yyvsp = yylval;
02784 
02785 
02786   yystate = yyn;
02787   goto yynewstate;
02788 
02789 
02790 /*-------------------------------------.
02791 | yyacceptlab -- YYACCEPT comes here.  |
02792 `-------------------------------------*/
02793 yyacceptlab:
02794   yyresult = 0;
02795   goto yyreturn;
02796 
02797 /*-----------------------------------.
02798 | yyabortlab -- YYABORT comes here.  |
02799 `-----------------------------------*/
02800 yyabortlab:
02801   yyresult = 1;
02802   goto yyreturn;
02803 
02804 #ifndef yyoverflow
02805 /*----------------------------------------------.
02806 | yyoverflowlab -- parser overflow comes here.  |
02807 `----------------------------------------------*/
02808 yyoverflowlab:
02809   yyerror ("parser stack overflow");
02810   yyresult = 2;
02811   /* Fall through.  */
02812 #endif
02813 
02814 yyreturn:
02815 #ifndef yyoverflow
02816   if (yyss != yyssa)
02817     YYSTACK_FREE (yyss);
02818 #endif
02819   return yyresult;
02820 }
02821 
02822 
02823 
02824 
02825 
02826 
KDE Home | KDE Accessibility Home | Description of Access Keys