khtml Library API Documentation

parser.cpp

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