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