khtml Library API Documentation

parser.cpp

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