~ubuntu-branches/ubuntu/utopic/kde4libs/utopic

« back to all changes in this revision

Viewing changes to khtml/css/parser.cpp

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2012-08-01 16:16:35 UTC
  • mfrom: (1.14.20)
  • Revision ID: package-import@ubuntu.com-20120801161635-qewual50h0fwfeju
Tags: 4:4.9.0a-0ubuntu1
New tar from upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* A Bison parser, made by GNU Bison 2.5.  */
 
1
/* A Bison parser, made by GNU Bison 2.5.1.  */
2
2
 
3
3
/* Bison implementation for Yacc-like parsers in C
4
4
   
5
 
      Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
 
5
      Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc.
6
6
   
7
7
   This program is free software: you can redistribute it and/or modify
8
8
   it under the terms of the GNU General Public License as published by
44
44
#define YYBISON 1
45
45
 
46
46
/* Bison version.  */
47
 
#define YYBISON_VERSION "2.5"
 
47
#define YYBISON_VERSION "2.5.1"
48
48
 
49
49
/* Skeleton name.  */
50
50
#define YYSKELETON_NAME "yacc.c"
184
184
 
185
185
 
186
186
 
 
187
# ifndef YY_NULL
 
188
#  if defined __cplusplus && 201103L <= __cplusplus
 
189
#   define YY_NULL nullptr
 
190
#  else
 
191
#   define YY_NULL 0
 
192
#  endif
 
193
# endif
 
194
 
187
195
/* Enabling traces.  */
188
196
#ifndef YYDEBUG
189
197
# define YYDEBUG 0
433
441
#    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
434
442
     || defined __cplusplus || defined _MSC_VER)
435
443
#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
 
444
      /* Use EXIT_SUCCESS as a witness for stdlib.h.  */
436
445
#     ifndef EXIT_SUCCESS
437
446
#      define EXIT_SUCCESS 0
438
447
#     endif
524
533
#endif
525
534
 
526
535
#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
527
 
/* Copy COUNT objects from FROM to TO.  The source and destination do
 
536
/* Copy COUNT objects from SRC to DST.  The source and destination do
528
537
   not overlap.  */
529
538
# ifndef YYCOPY
530
539
#  if defined __GNUC__ && 1 < __GNUC__
531
 
#   define YYCOPY(To, From, Count) \
532
 
      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
 
540
#   define YYCOPY(Dst, Src, Count) \
 
541
      __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
533
542
#  else
534
 
#   define YYCOPY(To, From, Count)              \
535
 
      do                                        \
536
 
        {                                       \
537
 
          YYSIZE_T yyi;                         \
538
 
          for (yyi = 0; yyi < (Count); yyi++)   \
539
 
            (To)[yyi] = (From)[yyi];            \
540
 
        }                                       \
 
543
#   define YYCOPY(Dst, Src, Count)              \
 
544
      do                                        \
 
545
        {                                       \
 
546
          YYSIZE_T yyi;                         \
 
547
          for (yyi = 0; yyi < (Count); yyi++)   \
 
548
            (Dst)[yyi] = (Src)[yyi];            \
 
549
        }                                       \
541
550
      while (YYID (0))
542
551
#  endif
543
552
# endif
703
712
static const yytype_uint16 yyrline[] =
704
713
{
705
714
       0,   312,   312,   313,   314,   315,   316,   317,   321,   322,
706
 
     323,   327,   334,   340,   365,   375,   381,   383,   387,   388,
707
 
     391,   393,   394,   397,   399,   402,   411,   413,   417,   419,
708
 
     430,   440,   443,   449,   450,   454,   464,   472,   473,   477,
709
 
     478,   481,   483,   494,   495,   496,   497,   498,   499,   500,
710
 
     504,   505,   506,   507,   511,   512,   516,   522,   525,   531,
711
 
     537,   541,   548,   551,   557,   560,   563,   569,   572,   578,
712
 
     581,   586,   590,   595,   602,   613,   625,   626,   636,   654,
713
 
     657,   663,   670,   673,   679,   680,   681,   685,   686,   690,
714
 
     712,   725,   743,   753,   756,   759,   773,   787,   794,   795,
715
 
     796,   800,   805,   812,   819,   827,   837,   850,   855,   862,
716
 
     870,   883,   887,   893,   896,   906,   913,   927,   928,   929,
717
 
     933,   950,   957,   963,   970,   979,   992,   995,   998,  1001,
718
 
    1004,  1007,  1013,  1014,  1018,  1024,  1030,  1037,  1044,  1051,
719
 
    1058,  1067,  1070,  1073,  1076,  1081,  1087,  1091,  1094,  1099,
720
 
    1105,  1127,  1133,  1155,  1156,  1160,  1164,  1180,  1183,  1186,
721
 
    1192,  1193,  1195,  1196,  1197,  1203,  1204,  1205,  1207,  1213,
722
 
    1214,  1215,  1216,  1217,  1218,  1219,  1220,  1221,  1222,  1223,
723
 
    1224,  1225,  1226,  1227,  1228,  1229,  1230,  1231,  1232,  1233,
724
 
    1238,  1246,  1262,  1269,  1275,  1284,  1310,  1311,  1315,  1316
 
715
     323,   327,   334,   340,   365,   377,   383,   385,   389,   390,
 
716
     393,   395,   396,   399,   401,   404,   413,   415,   419,   421,
 
717
     432,   442,   445,   451,   452,   456,   466,   474,   475,   479,
 
718
     480,   483,   485,   496,   497,   498,   499,   500,   501,   502,
 
719
     506,   507,   508,   509,   513,   514,   518,   524,   527,   533,
 
720
     539,   543,   550,   553,   559,   562,   565,   571,   574,   580,
 
721
     583,   588,   592,   597,   604,   615,   627,   628,   638,   656,
 
722
     659,   665,   672,   675,   681,   682,   683,   687,   688,   692,
 
723
     714,   727,   745,   755,   758,   761,   775,   789,   796,   797,
 
724
     798,   802,   807,   814,   821,   829,   839,   852,   857,   864,
 
725
     872,   885,   889,   895,   898,   908,   915,   929,   930,   931,
 
726
     935,   952,   959,   965,   972,   981,   994,   997,  1000,  1003,
 
727
    1006,  1009,  1015,  1016,  1020,  1026,  1032,  1039,  1046,  1053,
 
728
    1060,  1069,  1072,  1075,  1078,  1083,  1089,  1093,  1096,  1101,
 
729
    1107,  1129,  1135,  1157,  1158,  1162,  1166,  1182,  1185,  1188,
 
730
    1194,  1195,  1197,  1198,  1199,  1205,  1206,  1207,  1209,  1215,
 
731
    1216,  1217,  1218,  1219,  1220,  1221,  1222,  1223,  1224,  1225,
 
732
    1226,  1227,  1228,  1229,  1230,  1231,  1232,  1233,  1234,  1235,
 
733
    1240,  1248,  1264,  1271,  1277,  1286,  1312,  1313,  1317,  1318
725
734
};
726
735
#endif
727
736
 
757
766
  "attrib", "match", "ident_or_string", "pseudo", "declaration_block",
758
767
  "declaration_list", "declaration", "property", "prio", "expr",
759
768
  "operator", "term", "unary_term", "function", "hexcolor", "invalid_at",
760
 
  "invalid_rule", "invalid_block", "invalid_block_list", 0
 
769
  "invalid_rule", "invalid_block", "invalid_block_list", YY_NULL
761
770
};
762
771
#endif
763
772
 
1154
1163
 
1155
1164
#define YYRECOVERING()  (!!yyerrstatus)
1156
1165
 
1157
 
#define YYBACKUP(Token, Value)                                  \
1158
 
do                                                              \
1159
 
  if (yychar == YYEMPTY && yylen == 1)                          \
1160
 
    {                                                           \
1161
 
      yychar = (Token);                                         \
1162
 
      yylval = (Value);                                         \
1163
 
      YYPOPSTACK (1);                                           \
1164
 
      goto yybackup;                                            \
1165
 
    }                                                           \
1166
 
  else                                                          \
1167
 
    {                                                           \
 
1166
#define YYBACKUP(Token, Value)                                  \
 
1167
do                                                              \
 
1168
  if (yychar == YYEMPTY)                                        \
 
1169
    {                                                           \
 
1170
      yychar = (Token);                                         \
 
1171
      yylval = (Value);                                         \
 
1172
      YYPOPSTACK (yylen);                                       \
 
1173
      yystate = *yyssp;                                         \
 
1174
      goto yybackup;                                            \
 
1175
    }                                                           \
 
1176
  else                                                          \
 
1177
    {                                                           \
1168
1178
      yyerror (YY_("syntax error: cannot back up")); \
1169
1179
      YYERROR;                                                  \
1170
1180
    }                                                           \
1259
1269
    YYSTYPE const * const yyvaluep;
1260
1270
#endif
1261
1271
{
 
1272
  FILE *yyo = yyoutput;
 
1273
  YYUSE (yyo);
1262
1274
  if (!yyvaluep)
1263
1275
    return;
1264
1276
# ifdef YYPRINT
1510
1522
yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1511
1523
                yytype_int16 *yyssp, int yytoken)
1512
1524
{
1513
 
  YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]);
 
1525
  YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
1514
1526
  YYSIZE_T yysize = yysize0;
1515
1527
  YYSIZE_T yysize1;
1516
1528
  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1517
1529
  /* Internationalized format string. */
1518
 
  const char *yyformat = 0;
 
1530
  const char *yyformat = YY_NULL;
1519
1531
  /* Arguments of yyformat. */
1520
1532
  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1521
1533
  /* Number of reported tokens (one for the "unexpected", one per
1575
1587
                    break;
1576
1588
                  }
1577
1589
                yyarg[yycount++] = yytname[yyx];
1578
 
                yysize1 = yysize + yytnamerr (0, yytname[yyx]);
 
1590
                yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
1579
1591
                if (! (yysize <= yysize1
1580
1592
                       && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1581
1593
                  return 2;
1811
1823
       `yyss': related to states.
1812
1824
       `yyvs': related to semantic values.
1813
1825
 
1814
 
       Refer to the stacks thru separate pointers, to allow yyoverflow
 
1826
       Refer to the stacks through separate pointers, to allow yyoverflow
1815
1827
       to reallocate them elsewhere.  */
1816
1828
 
1817
1829
    /* The state stack.  */
2087
2099
 
2088
2100
    {
2089
2101
                CSSParser *p = static_cast<CSSParser *>(parser);
2090
 
                if ((yyvsp[(4) - (5)].selectorList))
 
2102
                if ((yyvsp[(4) - (5)].selectorList)) {
2091
2103
                        p->selectors = *(yyvsp[(4) - (5)].selectorList);
2092
 
                else
 
2104
                        delete (yyvsp[(4) - (5)].selectorList);
 
2105
                        (yyvsp[(4) - (5)].selectorList) = 0;
 
2106
                } else
2093
2107
                        p->selectors.clear(); // parse error
2094
2108
        }
2095
2109
    break;
3553
3567
  yyresult = 1;
3554
3568
  goto yyreturn;
3555
3569
 
3556
 
#if !defined(yyoverflow) || YYERROR_VERBOSE
 
3570
#if !defined yyoverflow || YYERROR_VERBOSE
3557
3571
/*-------------------------------------------------.
3558
3572
| yyexhaustedlab -- memory exhaustion comes here.  |
3559
3573
`-------------------------------------------------*/