parser.cpp

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