Changeset 284420 in webkit


Ignore:
Timestamp:
Oct 18, 2021 5:49:27 PM (3 years ago)
Author:
achristensen@apple.com
Message:

Remove "using namespace XPath;" from XPathGrammar.cpp
https://bugs.webkit.org/show_bug.cgi?id=231318

Reviewed by Chris Dumez.

I did this by editing XPathGrammar.y and re-running bison.
We have the output of bison checked in to our repo to not have bison as a build dependency of WebKit.

  • xml/XPathGrammar.cpp:

(xpathyylex):
(xpathyyerror):
(yysyntax_error):

  • xml/XPathGrammar.y:
  • xml/XPathResult.cpp:

(WebCore::XPathResult::XPathResult):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r284406 r284420  
     12021-10-18  Alex Christensen  <achristensen@webkit.org>
     2
     3        Remove "using namespace XPath;" from XPathGrammar.cpp
     4        https://bugs.webkit.org/show_bug.cgi?id=231318
     5
     6        Reviewed by Chris Dumez.
     7
     8        I did this by editing XPathGrammar.y and re-running bison.
     9        We have the output of bison checked in to our repo to not have bison as a build dependency of WebKit.
     10
     11        * xml/XPathGrammar.cpp:
     12        (xpathyylex):
     13        (xpathyyerror):
     14        (yysyntax_error):
     15        * xml/XPathGrammar.y:
     16        * xml/XPathResult.cpp:
     17        (WebCore::XPathResult::XPathResult):
     18
    1192021-10-18  Chris Dumez  <cdumez@apple.com>
    220
  • trunk/Source/WebCore/xml/XPathGrammar.cpp

    • Property allow-tabs set to 1
    r283635 r284420  
    11/* This file is generated using the following command:
    2    bison -d -p xpathyy XPathGrammar.y -o XPathGrammar.cpp 
     2   bison -d -p xpathyy XPathGrammar.y -o XPathGrammar.cpp
    33 */
    44
     
    127127
    128128
     129
    129130/* Copy the first part of user declarations.  */
    130 #line 28 "WebCore/xml/XPathGrammar.y"
     131#line 28 "XPathGrammar.y"
    131132
    132133
     
    139140#include "XPathVariableReference.h"
    140141
    141 
    142142#if COMPILER(MSVC)
    143143// See https://msdn.microsoft.com/en-us/library/1wea5zwe.aspx
     
    153153#define YYMAXDEPTH 10000
    154154
    155 using namespace WebCore;
    156 using namespace XPath;
    157155
    158156
     
    177175#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
    178176typedef union YYSTYPE
    179 #line 60 "WebCore/xml/XPathGrammar.y"
     177#line 57 "XPathGrammar.y"
    180178{
    181179    WebCore::XPath::NumericOp::Opcode numericOpcode;
     
    190188}
    191189/* Line 193 of yacc.c.  */
    192 #line 190 "./XPathGrammar.cpp"
    193     YYSTYPE;
     190#line 187 "XPathGrammar.cpp"
     191        YYSTYPE;
    194192# define yystype YYSTYPE /* obsolescent; will be withdrawn */
    195193# define YYSTYPE_IS_DECLARED 1
     
    200198
    201199/* Copy the second part of user declarations.  */
    202 #line 104 "WebCore/xml/XPathGrammar.y"
    203 
    204 
    205 static int xpathyylex(YYSTYPE* yylval, Parser& parser) { return parser.lex(*yylval); }
    206 static void xpathyyerror(Parser&, const char*) { }
     200#line 101 "XPathGrammar.y"
     201
     202
     203static int xpathyylex(YYSTYPE* yylval, WebCore::XPath::Parser& parser) { return parser.lex(*yylval); }
     204static void xpathyyerror(WebCore::XPath::Parser&, const char*) { }
    207205
    208206
    209207
    210208/* Line 216 of yacc.c.  */
    211 #line 209 "./XPathGrammar.cpp"
     209#line 206 "XPathGrammar.cpp"
    212210
    213211#ifdef short
     
    341339#  if (defined __cplusplus && ! defined _STDLIB_H \
    342340       && ! ((defined YYMALLOC || defined malloc) \
    343          && (defined YYFREE || defined free)))
     341             && (defined YYFREE || defined free)))
    344342#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
    345343#   ifndef _STDLIB_H
     
    367365#if (! defined yyoverflow \
    368366     && (! defined __cplusplus \
    369     || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
     367        || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
    370368
    371369/* A type that is properly aligned for any stack member.  */
     
    392390      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
    393391#  else
    394 #   define YYCOPY(To, From, Count)        \
    395       do                    \
    396     {                    \
    397       YYSIZE_T yyi;                \
    398       for (yyi = 0; yyi < (Count); yyi++)    \
    399         (To)[yyi] = (From)[yyi];        \
    400     }                    \
     392#   define YYCOPY(To, From, Count)              \
     393      do                                        \
     394        {                                       \
     395          YYSIZE_T yyi;                         \
     396          for (yyi = 0; yyi < (Count); yyi++)   \
     397            (To)[yyi] = (From)[yyi];            \
     398        }                                       \
    401399      while (YYID (0))
    402400#  endif
     
    408406   stack.  Advance YYPTR to a properly aligned location for the next
    409407   stack.  */
    410 # define YYSTACK_RELOCATE(Stack)                    \
    411     do                                    \
    412       {                                    \
    413     YYSIZE_T yynewbytes;                        \
    414     YYCOPY (&yyptr->Stack, Stack, yysize);                \
    415     Stack = &yyptr->Stack;                        \
    416     yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
    417     yyptr += yynewbytes / sizeof (*yyptr);                \
    418       }                                    \
     408# define YYSTACK_RELOCATE(Stack)                                        \
     409    do                                                                  \
     410      {                                                                 \
     411        YYSIZE_T yynewbytes;                                            \
     412        YYCOPY (&yyptr->Stack, Stack, yysize);                          \
     413        Stack = &yyptr->Stack;                                          \
     414        yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
     415        yyptr += yynewbytes / sizeof (*yyptr);                          \
     416      }                                                                 \
    419417    while (YYID (0))
    420418
     
    439437#define YYMAXUTOK   278
    440438
    441 #define YYTRANSLATE(YYX)                        \
     439#define YYTRANSLATE(YYX)                                                \
    442440  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
    443441
     
    516514static const yytype_uint16 yyrline[] =
    517515{
    518        0,   114,   114,   121,   125,   131,   135,   140,   145,   153,
    519      159,   165,   174,   184,   202,   213,   231,   235,   237,   244,
    520      249,   254,   259,   264,   273,   277,   281,   287,   295,   302,
    521      309,   314,   321,   327,   332,   338,   344,   348,   356,   367,
    522      373,   381,   385,   387,   394,   399,   401,   407,   416,   418,
    523      426,   428,   435,   437,   444,   446,   453,   455,   462,   464,
    524      469,   476,   478,   485,   487
     516       0,   111,   111,   118,   122,   128,   132,   137,   142,   150,
     517     156,   162,   171,   181,   199,   210,   228,   232,   234,   241,
     518     246,   251,   256,   261,   270,   274,   278,   284,   292,   299,
     519     306,   311,   318,   324,   329,   335,   341,   345,   353,   364,
     520     370,   378,   382,   384,   391,   396,   398,   404,   413,   415,
     521     423,   425,   432,   434,   441,   443,   450,   452,   459,   461,
     522     466,   473,   475,   482,   484
    525523};
    526524#endif
     
    534532  "PLUS", "AND", "OR", "FUNCTIONNAME", "LITERAL", "NAMETEST", "NUMBER",
    535533  "NODETYPE", "VARIABLEREFERENCE", "AXISNAME", "COMMENT", "DOTDOT", "PI",
    536   "NODE", "SLASHSLASH", "TEXT", "XPATH_ERROR", "'/'", "'@'", "'('", "')'",
     534  "NODE", "SLASHSLASH", "TEXT_", "XPATH_ERROR", "'/'", "'@'", "'('", "')'",
    537535  "'['", "']'", "'.'", "','", "'|'", "$accept", "Top", "Expr",
    538536  "LocationPath", "AbsoluteLocationPath", "RelativeLocationPath", "Step",
     
    691689};
    692690
    693 #define yyerrok        (yyerrstatus = 0)
    694 #define yyclearin    (yychar = YYEMPTY)
    695 #define YYEMPTY        (-2)
    696 #define YYEOF        0
    697 
    698 #define YYACCEPT    goto yyacceptlab
    699 #define YYABORT        goto yyabortlab
    700 #define YYERROR        goto yyerrorlab
     691#define yyerrok         (yyerrstatus = 0)
     692#define yyclearin       (yychar = YYEMPTY)
     693#define YYEMPTY         (-2)
     694#define YYEOF           0
     695
     696#define YYACCEPT        goto yyacceptlab
     697#define YYABORT         goto yyabortlab
     698#define YYERROR         goto yyerrorlab
    701699
    702700
     
    705703   Once GCC version 2 has supplanted version 1, this can go.  */
    706704
    707 #define YYFAIL        goto yyerrlab
     705#define YYFAIL          goto yyerrlab
    708706
    709707#define YYRECOVERING()  (!!yyerrstatus)
    710708
    711 #define YYBACKUP(Token, Value)                    \
    712 do                                \
    713   if (yychar == YYEMPTY && yylen == 1)                \
    714     {                                \
    715       yychar = (Token);                        \
    716       yylval = (Value);                        \
    717       yytoken = YYTRANSLATE (yychar);                \
    718       YYPOPSTACK (1);                        \
    719       goto yybackup;                        \
    720     }                                \
    721   else                                \
    722     {                                \
     709#define YYBACKUP(Token, Value)                                  \
     710do                                                              \
     711  if (yychar == YYEMPTY && yylen == 1)                          \
     712    {                                                           \
     713      yychar = (Token);                                         \
     714      yylval = (Value);                                         \
     715      yytoken = YYTRANSLATE (yychar);                           \
     716      YYPOPSTACK (1);                                           \
     717      goto yybackup;                                            \
     718    }                                                           \
     719  else                                                          \
     720    {                                                           \
    723721      yyerror (parser, YY_("syntax error: cannot back up")); \
    724       YYERROR;                            \
    725     }                                \
     722      YYERROR;                                                  \
     723    }                                                           \
    726724while (YYID (0))
    727725
    728726
    729 #define YYTERROR    1
    730 #define YYERRCODE    256
     727#define YYTERROR        1
     728#define YYERRCODE       256
    731729
    732730
     
    737735#define YYRHSLOC(Rhs, K) ((Rhs)[K])
    738736#ifndef YYLLOC_DEFAULT
    739 # define YYLLOC_DEFAULT(Current, Rhs, N)                \
    740     do                                    \
     737# define YYLLOC_DEFAULT(Current, Rhs, N)                                \
     738    do                                                                  \
    741739      if (YYID (N))                                                    \
    742     {                                \
    743       (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;    \
    744       (Current).first_column = YYRHSLOC (Rhs, 1).first_column;    \
    745       (Current).last_line    = YYRHSLOC (Rhs, N).last_line;        \
    746       (Current).last_column  = YYRHSLOC (Rhs, N).last_column;    \
    747     }                                \
    748       else                                \
    749     {                                \
    750       (Current).first_line   = (Current).last_line   =        \
    751         YYRHSLOC (Rhs, 0).last_line;                \
    752       (Current).first_column = (Current).last_column =        \
    753         YYRHSLOC (Rhs, 0).last_column;                \
    754     }                                \
     740        {                                                               \
     741          (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;        \
     742          (Current).first_column = YYRHSLOC (Rhs, 1).first_column;      \
     743          (Current).last_line    = YYRHSLOC (Rhs, N).last_line;         \
     744          (Current).last_column  = YYRHSLOC (Rhs, N).last_column;       \
     745        }                                                               \
     746      else                                                              \
     747        {                                                               \
     748          (Current).first_line   = (Current).last_line   =              \
     749            YYRHSLOC (Rhs, 0).last_line;                                \
     750          (Current).first_column = (Current).last_column =              \
     751            YYRHSLOC (Rhs, 0).last_column;                              \
     752        }                                                               \
    755753    while (YYID (0))
    756754#endif
     
    763761#ifndef YY_LOCATION_PRINT
    764762# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
    765 #  define YY_LOCATION_PRINT(File, Loc)            \
    766      fprintf (File, "%d.%d-%d.%d",            \
    767           (Loc).first_line, (Loc).first_column,    \
    768           (Loc).last_line,  (Loc).last_column)
     763#  define YY_LOCATION_PRINT(File, Loc)                  \
     764     fprintf (File, "%d.%d-%d.%d",                      \
     765              (Loc).first_line, (Loc).first_column,     \
     766              (Loc).last_line,  (Loc).last_column)
    769767# else
    770768#  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
     
    789787# endif
    790788
    791 # define YYDPRINTF(Args)            \
    792 do {                        \
    793   if (yydebug)                    \
    794     YYFPRINTF Args;                \
     789# define YYDPRINTF(Args)                        \
     790do {                                            \
     791  if (yydebug)                                  \
     792    YYFPRINTF Args;                             \
    795793} while (YYID (0))
    796794
    797 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)              \
    798 do {                                      \
    799   if (yydebug)                                  \
    800     {                                      \
    801       YYFPRINTF (stderr, "%s ", Title);                      \
    802       yy_symbol_print (stderr,                          \
    803           Type, Value, parser); \
    804       YYFPRINTF (stderr, "\n");                          \
    805     }                                      \
     795# define YY_SYMBOL_PRINT(Title, Type, Value, Location)                    \
     796do {                                                                      \
     797  if (yydebug)                                                            \
     798    {                                                                     \
     799      YYFPRINTF (stderr, "%s ", Title);                                   \
     800      yy_symbol_print (stderr,                                            \
     801                  Type, Value, parser); \
     802      YYFPRINTF (stderr, "\n");                                           \
     803    }                                                                     \
    806804} while (YYID (0))
    807805
     
    815813     || defined __cplusplus || defined _MSC_VER)
    816814static void
    817 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, Parser& parser)
     815yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, WebCore::XPath::Parser& parser)
    818816#else
    819817static void
     
    822820    int yytype;
    823821    YYSTYPE const * const yyvaluep;
    824     Parser& parser;
     822    WebCore::XPath::Parser& parser;
    825823#endif
    826824{
     
    837835    {
    838836      default:
    839     break;
     837        break;
    840838    }
    841839}
     
    849847     || defined __cplusplus || defined _MSC_VER)
    850848static void
    851 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, Parser& parser)
     849yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, WebCore::XPath::Parser& parser)
    852850#else
    853851static void
     
    856854    int yytype;
    857855    YYSTYPE const * const yyvaluep;
    858     Parser& parser;
     856    WebCore::XPath::Parser& parser;
    859857#endif
    860858{
     
    890888}
    891889
    892 # define YY_STACK_PRINT(Bottom, Top)                \
    893 do {                                \
    894   if (yydebug)                            \
    895     yy_stack_print ((Bottom), (Top));                \
     890# define YY_STACK_PRINT(Bottom, Top)                            \
     891do {                                                            \
     892  if (yydebug)                                                  \
     893    yy_stack_print ((Bottom), (Top));                           \
    896894} while (YYID (0))
    897895
     
    904902     || defined __cplusplus || defined _MSC_VER)
    905903static void
    906 yy_reduce_print (YYSTYPE *yyvsp, int yyrule, Parser& parser)
     904yy_reduce_print (YYSTYPE *yyvsp, int yyrule, WebCore::XPath::Parser& parser)
    907905#else
    908906static void
     
    910908    YYSTYPE *yyvsp;
    911909    int yyrule;
    912     Parser& parser;
     910    WebCore::XPath::Parser& parser;
    913911#endif
    914912{
     
    917915  unsigned long int yylno = yyrline[yyrule];
    918916  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
    919          yyrule - 1, yylno);
     917             yyrule - 1, yylno);
    920918  /* The symbols being reduced.  */
    921919  for (yyi = 0; yyi < yynrhs; yyi++)
     
    923921      fprintf (stderr, "   $%d = ", yyi + 1);
    924922      yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
    925                &(yyvsp[(yyi + 1) - (yynrhs)])
    926                               , parser);
     923                       &(yyvsp[(yyi + 1) - (yynrhs)])
     924                                       , parser);
    927925      fprintf (stderr, "\n");
    928926    }
    929927}
    930928
    931 # define YY_REDUCE_PRINT(Rule)        \
    932 do {                    \
    933   if (yydebug)                \
     929# define YY_REDUCE_PRINT(Rule)          \
     930do {                                    \
     931  if (yydebug)                          \
    934932    yy_reduce_print (yyvsp, Rule, parser); \
    935933} while (YYID (0))
     
    947945
    948946/* YYINITDEPTH -- initial size of the parser's stacks.  */
    949 #ifndef    YYINITDEPTH
     947#ifndef YYINITDEPTH
    950948# define YYINITDEPTH 200
    951949#endif
     
    10351033
    10361034      for (;;)
    1037     switch (*++yyp)
    1038       {
    1039       case '\'':
    1040       case ',':
    1041         goto do_not_strip_quotes;
    1042 
    1043       case '\\':
    1044         if (*++yyp != '\\')
    1045           goto do_not_strip_quotes;
    1046         /* Fall through.  */
    1047       default:
    1048         if (yyres)
    1049           yyres[yyn] = *yyp;
    1050         yyn++;
    1051         break;
    1052 
    1053       case '"':
    1054         if (yyres)
    1055           yyres[yyn] = '\0';
    1056         return yyn;
    1057       }
     1035        switch (*++yyp)
     1036          {
     1037          case '\'':
     1038          case ',':
     1039            goto do_not_strip_quotes;
     1040
     1041          case '\\':
     1042            if (*++yyp != '\\')
     1043              goto do_not_strip_quotes;
     1044            /* Fall through.  */
     1045          default:
     1046            if (yyres)
     1047              yyres[yyn] = *yyp;
     1048            yyn++;
     1049            break;
     1050
     1051          case '"':
     1052            if (yyres)
     1053              yyres[yyn] = '\0';
     1054            return yyn;
     1055          }
    10581056    do_not_strip_quotes: ;
    10591057    }
     
    10931091# if 0
    10941092      /* This is so xgettext sees the translatable formats that are
    1095     constructed on the fly.  */
     1093        constructed on the fly.  */
    10961094      YY_("syntax error, unexpected %s");
    10971095      YY_("syntax error, unexpected %s, expecting %s");
     
    11061104      static char const yyor[] = " or %s";
    11071105      char yyformat[sizeof yyunexpected
    1108             + sizeof yyexpecting - 1
    1109             + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
    1110                * (sizeof yyor - 1))];
     1106                    + sizeof yyexpecting - 1
     1107                    + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
     1108                       * (sizeof yyor - 1))];
    11111109      char const *yyprefix = yyexpecting;
    11121110
    11131111      /* Start YYX at -YYN if negative to avoid negative indexes in
    1114     YYCHECK.  */
     1112        YYCHECK.  */
    11151113      int yyxbegin = yyn < 0 ? -yyn : 0;
    11161114
     
    11241122
    11251123      for (yyx = yyxbegin; yyx < yyxend; ++yyx)
    1126     if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
    1127       {
    1128         if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
    1129           {
    1130         yycount = 1;
    1131         yysize = yysize0;
    1132         yyformat[sizeof yyunexpected - 1] = '\0';
    1133         break;
    1134           }
    1135         yyarg[yycount++] = yytname[yyx];
    1136         yysize1 = yysize + yytnamerr (0, yytname[yyx]);
    1137         yysize_overflow |= (yysize1 < yysize);
    1138         yysize = yysize1;
    1139         yyfmt = yystpcpy (yyfmt, yyprefix);
    1140         yyprefix = yyor;
    1141       }
     1124        if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
     1125          {
     1126            if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
     1127              {
     1128                yycount = 1;
     1129                yysize = yysize0;
     1130                yyformat[sizeof yyunexpected - 1] = '\0';
     1131                break;
     1132              }
     1133            yyarg[yycount++] = yytname[yyx];
     1134            yysize1 = yysize + yytnamerr (0, yytname[yyx]);
     1135            yysize_overflow |= (yysize1 < yysize);
     1136            yysize = yysize1;
     1137            yyfmt = yystpcpy (yyfmt, yyprefix);
     1138            yyprefix = yyor;
     1139          }
    11421140
    11431141      yyf = YY_(yyformat);
     
    11471145
    11481146      if (yysize_overflow)
    1149     return YYSIZE_MAXIMUM;
     1147        return YYSIZE_MAXIMUM;
    11501148
    11511149      if (yyresult)
    1152     {
    1153       /* Avoid sprintf, as that infringes on the user's name space.
    1154          Don't have undefined behavior even if the translation
    1155          produced a string with the wrong number of "%s"s.  */
    1156       char *yyp = yyresult;
    1157       int yyi = 0;
    1158       while ((*yyp = *yyf) != '\0')
    1159         {
    1160           if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
    1161         {
    1162           yyp += yytnamerr (yyp, yyarg[yyi++]);
    1163           yyf += 2;
    1164         }
    1165           else
    1166         {
    1167           yyp++;
    1168           yyf++;
    1169         }
    1170         }
    1171     }
     1150        {
     1151          /* Avoid sprintf, as that infringes on the user's name space.
     1152             Don't have undefined behavior even if the translation
     1153             produced a string with the wrong number of "%s"s.  */
     1154          char *yyp = yyresult;
     1155          int yyi = 0;
     1156          while ((*yyp = *yyf) != '\0')
     1157            {
     1158              if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
     1159                {
     1160                  yyp += yytnamerr (yyp, yyarg[yyi++]);
     1161                  yyf += 2;
     1162                }
     1163              else
     1164                {
     1165                  yyp++;
     1166                  yyf++;
     1167                }
     1168            }
     1169        }
    11721170      return yysize;
    11731171    }
     
    11851183     || defined __cplusplus || defined _MSC_VER)
    11861184static void
    1187 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, Parser& parser)
     1185yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, WebCore::XPath::Parser& parser)
    11881186#else
    11891187static void
     
    11921190    int yytype;
    11931191    YYSTYPE *yyvaluep;
    1194     Parser& parser;
     1192    WebCore::XPath::Parser& parser;
    11951193#endif
    11961194{
     
    12051203    {
    12061204      case 10: /* "FUNCTIONNAME" */
    1207 #line 80 "WebCore/xml/XPathGrammar.y"
    1208     { if ((yyvaluep->string)) (yyvaluep->string)->deref(); };
    1209 #line 1205 "./XPathGrammar.cpp"
    1210     break;
     1205#line 77 "XPathGrammar.y"
     1206        { if ((yyvaluep->string)) (yyvaluep->string)->deref(); };
     1207#line 1202 "XPathGrammar.cpp"
     1208        break;
    12111209      case 11: /* "LITERAL" */
    1212 #line 80 "WebCore/xml/XPathGrammar.y"
    1213     { if ((yyvaluep->string)) (yyvaluep->string)->deref(); };
    1214 #line 1210 "./XPathGrammar.cpp"
    1215     break;
     1210#line 77 "XPathGrammar.y"
     1211        { if ((yyvaluep->string)) (yyvaluep->string)->deref(); };
     1212#line 1207 "XPathGrammar.cpp"
     1213        break;
    12161214      case 12: /* "NAMETEST" */
    1217 #line 80 "WebCore/xml/XPathGrammar.y"
    1218     { if ((yyvaluep->string)) (yyvaluep->string)->deref(); };
    1219 #line 1215 "./XPathGrammar.cpp"
    1220     break;
     1215#line 77 "XPathGrammar.y"
     1216        { if ((yyvaluep->string)) (yyvaluep->string)->deref(); };
     1217#line 1212 "XPathGrammar.cpp"
     1218        break;
    12211219      case 13: /* "NUMBER" */
    1222 #line 80 "WebCore/xml/XPathGrammar.y"
    1223     { if ((yyvaluep->string)) (yyvaluep->string)->deref(); };
    1224 #line 1220 "./XPathGrammar.cpp"
    1225     break;
     1220#line 77 "XPathGrammar.y"
     1221        { if ((yyvaluep->string)) (yyvaluep->string)->deref(); };
     1222#line 1217 "XPathGrammar.cpp"
     1223        break;
    12261224      case 14: /* "NODETYPE" */
    1227 #line 80 "WebCore/xml/XPathGrammar.y"
    1228     { if ((yyvaluep->string)) (yyvaluep->string)->deref(); };
    1229 #line 1225 "./XPathGrammar.cpp"
    1230     break;
     1225#line 77 "XPathGrammar.y"
     1226        { if ((yyvaluep->string)) (yyvaluep->string)->deref(); };
     1227#line 1222 "XPathGrammar.cpp"
     1228        break;
    12311229      case 15: /* "VARIABLEREFERENCE" */
    1232 #line 80 "WebCore/xml/XPathGrammar.y"
    1233     { if ((yyvaluep->string)) (yyvaluep->string)->deref(); };
    1234 #line 1230 "./XPathGrammar.cpp"
    1235     break;
     1230#line 77 "XPathGrammar.y"
     1231        { if ((yyvaluep->string)) (yyvaluep->string)->deref(); };
     1232#line 1227 "XPathGrammar.cpp"
     1233        break;
    12361234      case 35: /* "Expr" */
    1237 #line 100 "WebCore/xml/XPathGrammar.y"
    1238     { delete (yyvaluep->expression); };
    1239 #line 1235 "./XPathGrammar.cpp"
    1240     break;
     1235#line 97 "XPathGrammar.y"
     1236        { delete (yyvaluep->expression); };
     1237#line 1232 "XPathGrammar.cpp"
     1238        break;
    12411239      case 36: /* "LocationPath" */
    1242 #line 88 "WebCore/xml/XPathGrammar.y"
    1243     { delete (yyvaluep->locationPath); };
    1244 #line 1240 "./XPathGrammar.cpp"
    1245     break;
     1240#line 85 "XPathGrammar.y"
     1241        { delete (yyvaluep->locationPath); };
     1242#line 1237 "XPathGrammar.cpp"
     1243        break;
    12461244      case 37: /* "AbsoluteLocationPath" */
    1247 #line 88 "WebCore/xml/XPathGrammar.y"
    1248     { delete (yyvaluep->locationPath); };
    1249 #line 1245 "./XPathGrammar.cpp"
    1250     break;
     1245#line 85 "XPathGrammar.y"
     1246        { delete (yyvaluep->locationPath); };
     1247#line 1242 "XPathGrammar.cpp"
     1248        break;
    12511249      case 38: /* "RelativeLocationPath" */
    1252 #line 88 "WebCore/xml/XPathGrammar.y"
    1253     { delete (yyvaluep->locationPath); };
    1254 #line 1250 "./XPathGrammar.cpp"
    1255     break;
     1250#line 85 "XPathGrammar.y"
     1251        { delete (yyvaluep->locationPath); };
     1252#line 1247 "XPathGrammar.cpp"
     1253        break;
    12561254      case 39: /* "Step" */
    1257 #line 97 "WebCore/xml/XPathGrammar.y"
    1258     { delete (yyvaluep->step); };
    1259 #line 1255 "./XPathGrammar.cpp"
    1260     break;
     1255#line 94 "XPathGrammar.y"
     1256        { delete (yyvaluep->step); };
     1257#line 1252 "XPathGrammar.cpp"
     1258        break;
    12611259      case 41: /* "NodeTest" */
    1262 #line 91 "WebCore/xml/XPathGrammar.y"
    1263     { delete (yyvaluep->nodeTest); };
    1264 #line 1260 "./XPathGrammar.cpp"
    1265     break;
     1260#line 88 "XPathGrammar.y"
     1261        { delete (yyvaluep->nodeTest); };
     1262#line 1257 "XPathGrammar.cpp"
     1263        break;
    12661264      case 42: /* "OptionalPredicateList" */
    1267 #line 94 "WebCore/xml/XPathGrammar.y"
    1268     { delete (yyvaluep->expressionVector); };
    1269 #line 1265 "./XPathGrammar.cpp"
    1270     break;
     1265#line 91 "XPathGrammar.y"
     1266        { delete (yyvaluep->expressionVector); };
     1267#line 1262 "XPathGrammar.cpp"
     1268        break;
    12711269      case 43: /* "PredicateList" */
    1272 #line 94 "WebCore/xml/XPathGrammar.y"
    1273     { delete (yyvaluep->expressionVector); };
    1274 #line 1270 "./XPathGrammar.cpp"
    1275     break;
     1270#line 91 "XPathGrammar.y"
     1271        { delete (yyvaluep->expressionVector); };
     1272#line 1267 "XPathGrammar.cpp"
     1273        break;
    12761274      case 44: /* "Predicate" */
    1277 #line 100 "WebCore/xml/XPathGrammar.y"
    1278     { delete (yyvaluep->expression); };
    1279 #line 1275 "./XPathGrammar.cpp"
    1280     break;
     1275#line 97 "XPathGrammar.y"
     1276        { delete (yyvaluep->expression); };
     1277#line 1272 "XPathGrammar.cpp"
     1278        break;
    12811279      case 45: /* "DescendantOrSelf" */
    1282 #line 97 "WebCore/xml/XPathGrammar.y"
    1283     { delete (yyvaluep->step); };
    1284 #line 1280 "./XPathGrammar.cpp"
    1285     break;
     1280#line 94 "XPathGrammar.y"
     1281        { delete (yyvaluep->step); };
     1282#line 1277 "XPathGrammar.cpp"
     1283        break;
    12861284      case 46: /* "AbbreviatedStep" */
    1287 #line 97 "WebCore/xml/XPathGrammar.y"
    1288     { delete (yyvaluep->step); };
    1289 #line 1285 "./XPathGrammar.cpp"
    1290     break;
     1285#line 94 "XPathGrammar.y"
     1286        { delete (yyvaluep->step); };
     1287#line 1282 "XPathGrammar.cpp"
     1288        break;
    12911289      case 47: /* "PrimaryExpr" */
    1292 #line 100 "WebCore/xml/XPathGrammar.y"
    1293     { delete (yyvaluep->expression); };
    1294 #line 1290 "./XPathGrammar.cpp"
    1295     break;
     1290#line 97 "XPathGrammar.y"
     1291        { delete (yyvaluep->expression); };
     1292#line 1287 "XPathGrammar.cpp"
     1293        break;
    12961294      case 48: /* "FunctionCall" */
    1297 #line 100 "WebCore/xml/XPathGrammar.y"
    1298     { delete (yyvaluep->expression); };
    1299 #line 1295 "./XPathGrammar.cpp"
    1300     break;
     1295#line 97 "XPathGrammar.y"
     1296        { delete (yyvaluep->expression); };
     1297#line 1292 "XPathGrammar.cpp"
     1298        break;
    13011299      case 49: /* "ArgumentList" */
    1302 #line 94 "WebCore/xml/XPathGrammar.y"
    1303     { delete (yyvaluep->expressionVector); };
    1304 #line 1300 "./XPathGrammar.cpp"
    1305     break;
     1300#line 91 "XPathGrammar.y"
     1301        { delete (yyvaluep->expressionVector); };
     1302#line 1297 "XPathGrammar.cpp"
     1303        break;
    13061304      case 50: /* "Argument" */
    1307 #line 100 "WebCore/xml/XPathGrammar.y"
    1308     { delete (yyvaluep->expression); };
    1309 #line 1305 "./XPathGrammar.cpp"
    1310     break;
     1305#line 97 "XPathGrammar.y"
     1306        { delete (yyvaluep->expression); };
     1307#line 1302 "XPathGrammar.cpp"
     1308        break;
    13111309      case 51: /* "UnionExpr" */
    1312 #line 100 "WebCore/xml/XPathGrammar.y"
    1313     { delete (yyvaluep->expression); };
    1314 #line 1310 "./XPathGrammar.cpp"
    1315     break;
     1310#line 97 "XPathGrammar.y"
     1311        { delete (yyvaluep->expression); };
     1312#line 1307 "XPathGrammar.cpp"
     1313        break;
    13161314      case 52: /* "PathExpr" */
    1317 #line 100 "WebCore/xml/XPathGrammar.y"
    1318     { delete (yyvaluep->expression); };
    1319 #line 1315 "./XPathGrammar.cpp"
    1320     break;
     1315#line 97 "XPathGrammar.y"
     1316        { delete (yyvaluep->expression); };
     1317#line 1312 "XPathGrammar.cpp"
     1318        break;
    13211319      case 53: /* "FilterExpr" */
    1322 #line 100 "WebCore/xml/XPathGrammar.y"
    1323     { delete (yyvaluep->expression); };
    1324 #line 1320 "./XPathGrammar.cpp"
    1325     break;
     1320#line 97 "XPathGrammar.y"
     1321        { delete (yyvaluep->expression); };
     1322#line 1317 "XPathGrammar.cpp"
     1323        break;
    13261324      case 54: /* "OrExpr" */
    1327 #line 100 "WebCore/xml/XPathGrammar.y"
    1328     { delete (yyvaluep->expression); };
    1329 #line 1325 "./XPathGrammar.cpp"
    1330     break;
     1325#line 97 "XPathGrammar.y"
     1326        { delete (yyvaluep->expression); };
     1327#line 1322 "XPathGrammar.cpp"
     1328        break;
    13311329      case 55: /* "AndExpr" */
    1332 #line 100 "WebCore/xml/XPathGrammar.y"
    1333     { delete (yyvaluep->expression); };
    1334 #line 1330 "./XPathGrammar.cpp"
    1335     break;
     1330#line 97 "XPathGrammar.y"
     1331        { delete (yyvaluep->expression); };
     1332#line 1327 "XPathGrammar.cpp"
     1333        break;
    13361334      case 56: /* "EqualityExpr" */
    1337 #line 100 "WebCore/xml/XPathGrammar.y"
    1338     { delete (yyvaluep->expression); };
    1339 #line 1335 "./XPathGrammar.cpp"
    1340     break;
     1335#line 97 "XPathGrammar.y"
     1336        { delete (yyvaluep->expression); };
     1337#line 1332 "XPathGrammar.cpp"
     1338        break;
    13411339      case 57: /* "RelationalExpr" */
    1342 #line 100 "WebCore/xml/XPathGrammar.y"
    1343     { delete (yyvaluep->expression); };
    1344 #line 1340 "./XPathGrammar.cpp"
    1345     break;
     1340#line 97 "XPathGrammar.y"
     1341        { delete (yyvaluep->expression); };
     1342#line 1337 "XPathGrammar.cpp"
     1343        break;
    13461344      case 58: /* "AdditiveExpr" */
    1347 #line 100 "WebCore/xml/XPathGrammar.y"
    1348     { delete (yyvaluep->expression); };
    1349 #line 1345 "./XPathGrammar.cpp"
    1350     break;
     1345#line 97 "XPathGrammar.y"
     1346        { delete (yyvaluep->expression); };
     1347#line 1342 "XPathGrammar.cpp"
     1348        break;
    13511349      case 59: /* "MultiplicativeExpr" */
    1352 #line 100 "WebCore/xml/XPathGrammar.y"
    1353     { delete (yyvaluep->expression); };
    1354 #line 1350 "./XPathGrammar.cpp"
    1355     break;
     1350#line 97 "XPathGrammar.y"
     1351        { delete (yyvaluep->expression); };
     1352#line 1347 "XPathGrammar.cpp"
     1353        break;
    13561354      case 60: /* "UnaryExpr" */
    1357 #line 100 "WebCore/xml/XPathGrammar.y"
    1358     { delete (yyvaluep->expression); };
    1359 #line 1355 "./XPathGrammar.cpp"
    1360     break;
     1355#line 97 "XPathGrammar.y"
     1356        { delete (yyvaluep->expression); };
     1357#line 1352 "XPathGrammar.cpp"
     1358        break;
    13611359
    13621360      default:
    1363     break;
     1361        break;
    13641362    }
    13651363}
     
    13771375#else /* ! YYPARSE_PARAM */
    13781376#if defined __STDC__ || defined __cplusplus
    1379 int yyparse (Parser& parser);
     1377int yyparse (WebCore::XPath::Parser& parser);
    13801378#else
    13811379int yyparse ();
     
    14061404     || defined __cplusplus || defined _MSC_VER)
    14071405int
    1408 yyparse (Parser& parser)
     1406yyparse (WebCore::XPath::Parser& parser)
    14091407#else
    14101408int
    14111409yyparse (parser)
    1412     Parser& parser;
     1410    WebCore::XPath::Parser& parser;
    14131411#endif
    14141412#endif
     
    14751473  yyerrstatus = 0;
    14761474  yynerrs = 0;
    1477   yychar = YYEMPTY;        /* Cause a token to be read.  */
     1475  yychar = YYEMPTY;             /* Cause a token to be read.  */
    14781476
    14791477  /* Initialize stack pointers.
     
    15051503#ifdef yyoverflow
    15061504      {
    1507     /* Give user a chance to reallocate the stack.  Use copies of
    1508        these so that the &'s don't force the real ones into
    1509        memory.  */
    1510     YYSTYPE *yyvs1 = yyvs;
    1511     yytype_int16 *yyss1 = yyss;
    1512 
    1513 
    1514     /* Each stack pointer address is followed by the size of the
    1515        data in use in that stack, in bytes.  This used to be a
    1516        conditional around just the two extra args, but that might
    1517        be undefined if yyoverflow is a macro.  */
    1518     yyoverflow (YY_("memory exhausted"),
    1519             &yyss1, yysize * sizeof (*yyssp),
    1520             &yyvs1, yysize * sizeof (*yyvsp),
    1521 
    1522             &yystacksize);
    1523 
    1524     yyss = yyss1;
    1525     yyvs = yyvs1;
     1505        /* Give user a chance to reallocate the stack.  Use copies of
     1506           these so that the &'s don't force the real ones into
     1507           memory.  */
     1508        YYSTYPE *yyvs1 = yyvs;
     1509        yytype_int16 *yyss1 = yyss;
     1510
     1511
     1512        /* Each stack pointer address is followed by the size of the
     1513           data in use in that stack, in bytes.  This used to be a
     1514           conditional around just the two extra args, but that might
     1515           be undefined if yyoverflow is a macro.  */
     1516        yyoverflow (YY_("memory exhausted"),
     1517                    &yyss1, yysize * sizeof (*yyssp),
     1518                    &yyvs1, yysize * sizeof (*yyvsp),
     1519
     1520                    &yystacksize);
     1521
     1522        yyss = yyss1;
     1523        yyvs = yyvs1;
    15261524      }
    15271525#else /* no yyoverflow */
     
    15311529      /* Extend the stack our own way.  */
    15321530      if (YYMAXDEPTH <= yystacksize)
    1533     goto yyexhaustedlab;
     1531        goto yyexhaustedlab;
    15341532      yystacksize *= 2;
    15351533      if (YYMAXDEPTH < yystacksize)
    1536     yystacksize = YYMAXDEPTH;
     1534        yystacksize = YYMAXDEPTH;
    15371535
    15381536      {
    1539     yytype_int16 *yyss1 = yyss;
    1540     union yyalloc *yyptr =
    1541       (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
    1542     if (! yyptr)
    1543       goto yyexhaustedlab;
    1544     YYSTACK_RELOCATE (yyss);
    1545     YYSTACK_RELOCATE (yyvs);
     1537        yytype_int16 *yyss1 = yyss;
     1538        union yyalloc *yyptr =
     1539          (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
     1540        if (! yyptr)
     1541          goto yyexhaustedlab;
     1542        YYSTACK_RELOCATE (yyss);
     1543        YYSTACK_RELOCATE (yyvs);
    15461544
    15471545#  undef YYSTACK_RELOCATE
    1548     if (yyss1 != yyssa)
    1549       YYSTACK_FREE (yyss1);
     1546        if (yyss1 != yyssa)
     1547          YYSTACK_FREE (yyss1);
    15501548      }
    15511549# endif
     
    15571555
    15581556      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
    1559           (unsigned long int) yystacksize));
     1557                  (unsigned long int) yystacksize));
    15601558
    15611559      if (yyss + yystacksize - 1 <= yyssp)
    1562     YYABORT;
     1560        YYABORT;
    15631561    }
    15641562
     
    16091607    {
    16101608      if (yyn == 0 || yyn == YYTABLE_NINF)
    1611     goto yyerrlab;
     1609        goto yyerrlab;
    16121610      yyn = -yyn;
    16131611      goto yyreduce;
     
    16671665    {
    16681666        case 2:
    1669 #line 115 "WebCore/xml/XPathGrammar.y"
    1670     {
    1671         parser.setParseResult(std::unique_ptr<Expression>((yyvsp[(1) - (1)].expression)));
     1667#line 112 "XPathGrammar.y"
     1668    {
     1669        parser.setParseResult(std::unique_ptr<WebCore::XPath::Expression>((yyvsp[(1) - (1)].expression)));
    16721670    ;}
    16731671    break;
    16741672
    16751673  case 4:
    1676 #line 126 "WebCore/xml/XPathGrammar.y"
     1674#line 123 "XPathGrammar.y"
    16771675    {
    16781676        (yyval.locationPath) = (yyvsp[(1) - (1)].locationPath);
     
    16821680
    16831681  case 6:
    1684 #line 136 "WebCore/xml/XPathGrammar.y"
    1685     {
    1686         (yyval.locationPath) = new LocationPath;
     1682#line 133 "XPathGrammar.y"
     1683    {
     1684        (yyval.locationPath) = new WebCore::XPath::LocationPath;
    16871685    ;}
    16881686    break;
    16891687
    16901688  case 7:
    1691 #line 141 "WebCore/xml/XPathGrammar.y"
     1689#line 138 "XPathGrammar.y"
    16921690    {
    16931691        (yyval.locationPath) = (yyvsp[(2) - (2)].locationPath);
     
    16961694
    16971695  case 8:
    1698 #line 146 "WebCore/xml/XPathGrammar.y"
     1696#line 143 "XPathGrammar.y"
    16991697    {
    17001698        (yyval.locationPath) = (yyvsp[(2) - (2)].locationPath);
    1701         (yyval.locationPath)->prependStep(std::unique_ptr<Step>((yyvsp[(1) - (2)].step)));
     1699        (yyval.locationPath)->prependStep(std::unique_ptr<WebCore::XPath::Step>((yyvsp[(1) - (2)].step)));
    17021700    ;}
    17031701    break;
    17041702
    17051703  case 9:
    1706 #line 154 "WebCore/xml/XPathGrammar.y"
    1707     {
    1708         (yyval.locationPath) = new LocationPath;
    1709         (yyval.locationPath)->appendStep(std::unique_ptr<Step>((yyvsp[(1) - (1)].step)));
     1704#line 151 "XPathGrammar.y"
     1705    {
     1706        (yyval.locationPath) = new WebCore::XPath::LocationPath;
     1707        (yyval.locationPath)->appendStep(std::unique_ptr<WebCore::XPath::Step>((yyvsp[(1) - (1)].step)));
    17101708    ;}
    17111709    break;
    17121710
    17131711  case 10:
    1714 #line 160 "WebCore/xml/XPathGrammar.y"
     1712#line 157 "XPathGrammar.y"
    17151713    {
    17161714        (yyval.locationPath) = (yyvsp[(1) - (3)].locationPath);
    1717         (yyval.locationPath)->appendStep(std::unique_ptr<Step>((yyvsp[(3) - (3)].step)));
     1715        (yyval.locationPath)->appendStep(std::unique_ptr<WebCore::XPath::Step>((yyvsp[(3) - (3)].step)));
    17181716    ;}
    17191717    break;
    17201718
    17211719  case 11:
    1722 #line 166 "WebCore/xml/XPathGrammar.y"
     1720#line 163 "XPathGrammar.y"
    17231721    {
    17241722        (yyval.locationPath) = (yyvsp[(1) - (3)].locationPath);
    1725         (yyval.locationPath)->appendStep(std::unique_ptr<Step>((yyvsp[(2) - (3)].step)));
    1726         (yyval.locationPath)->appendStep(std::unique_ptr<Step>((yyvsp[(3) - (3)].step)));
     1723        (yyval.locationPath)->appendStep(std::unique_ptr<WebCore::XPath::Step>((yyvsp[(2) - (3)].step)));
     1724        (yyval.locationPath)->appendStep(std::unique_ptr<WebCore::XPath::Step>((yyvsp[(3) - (3)].step)));
    17271725    ;}
    17281726    break;
    17291727
    17301728  case 12:
    1731 #line 175 "WebCore/xml/XPathGrammar.y"
    1732     {
    1733         std::unique_ptr<Step::NodeTest> nodeTest((yyvsp[(1) - (2)].nodeTest));
    1734         std::unique_ptr<Vector<std::unique_ptr<Expression>>> predicateList((yyvsp[(2) - (2)].expressionVector));
     1729#line 172 "XPathGrammar.y"
     1730    {
     1731        std::unique_ptr<WebCore::XPath::Step::NodeTest> nodeTest((yyvsp[(1) - (2)].nodeTest));
     1732        std::unique_ptr<Vector<std::unique_ptr<WebCore::XPath::Expression>>> predicateList((yyvsp[(2) - (2)].expressionVector));
    17351733        if (predicateList)
    1736             (yyval.step) = new Step(Step::ChildAxis, WTFMove(*nodeTest), WTFMove(*predicateList));
     1734            (yyval.step) = new WebCore::XPath::Step(WebCore::XPath::Step::ChildAxis, WTFMove(*nodeTest), WTFMove(*predicateList));
    17371735        else
    1738             (yyval.step) = new Step(Step::ChildAxis, WTFMove(*nodeTest));
     1736            (yyval.step) = new WebCore::XPath::Step(WebCore::XPath::Step::ChildAxis, WTFMove(*nodeTest));
    17391737    ;}
    17401738    break;
    17411739
    17421740  case 13:
    1743 #line 185 "WebCore/xml/XPathGrammar.y"
     1741#line 182 "XPathGrammar.y"
    17441742    {
    17451743        String nametest = adoptRef((yyvsp[(1) - (2)].string));
    1746         std::unique_ptr<Vector<std::unique_ptr<Expression>>> predicateList((yyvsp[(2) - (2)].expressionVector));
     1744        std::unique_ptr<Vector<std::unique_ptr<WebCore::XPath::Expression>>> predicateList((yyvsp[(2) - (2)].expressionVector));
    17471745
    17481746        String localName;
     
    17541752
    17551753        if (predicateList)
    1756             (yyval.step) = new Step(Step::ChildAxis, Step::NodeTest(Step::NodeTest::NameTest, localName, namespaceURI), WTFMove(*predicateList));
     1754            (yyval.step) = new WebCore::XPath::Step(WebCore::XPath::Step::ChildAxis, WebCore::XPath::Step::NodeTest(WebCore::XPath::Step::NodeTest::NameTest, localName, namespaceURI), WTFMove(*predicateList));
    17571755        else
    1758             (yyval.step) = new Step(Step::ChildAxis, Step::NodeTest(Step::NodeTest::NameTest, localName, namespaceURI));
     1756            (yyval.step) = new WebCore::XPath::Step(WebCore::XPath::Step::ChildAxis, WebCore::XPath::Step::NodeTest(WebCore::XPath::Step::NodeTest::NameTest, localName, namespaceURI));
    17591757    ;}
    17601758    break;
    17611759
    17621760  case 14:
    1763 #line 203 "WebCore/xml/XPathGrammar.y"
    1764     {
    1765         std::unique_ptr<Step::NodeTest> nodeTest((yyvsp[(2) - (3)].nodeTest));
    1766         std::unique_ptr<Vector<std::unique_ptr<Expression>>> predicateList((yyvsp[(3) - (3)].expressionVector));
     1761#line 200 "XPathGrammar.y"
     1762    {
     1763        std::unique_ptr<WebCore::XPath::Step::NodeTest> nodeTest((yyvsp[(2) - (3)].nodeTest));
     1764        std::unique_ptr<Vector<std::unique_ptr<WebCore::XPath::Expression>>> predicateList((yyvsp[(3) - (3)].expressionVector));
    17671765
    17681766        if (predicateList)
    1769             (yyval.step) = new Step((yyvsp[(1) - (3)].axis), WTFMove(*nodeTest), WTFMove(*predicateList));
     1767            (yyval.step) = new WebCore::XPath::Step((yyvsp[(1) - (3)].axis), WTFMove(*nodeTest), WTFMove(*predicateList));
    17701768        else
    1771             (yyval.step) = new Step((yyvsp[(1) - (3)].axis), WTFMove(*nodeTest));
     1769            (yyval.step) = new WebCore::XPath::Step((yyvsp[(1) - (3)].axis), WTFMove(*nodeTest));
    17721770    ;}
    17731771    break;
    17741772
    17751773  case 15:
    1776 #line 214 "WebCore/xml/XPathGrammar.y"
     1774#line 211 "XPathGrammar.y"
    17771775    {
    17781776        String nametest = adoptRef((yyvsp[(2) - (3)].string));
    1779         std::unique_ptr<Vector<std::unique_ptr<Expression>>> predicateList((yyvsp[(3) - (3)].expressionVector));
     1777        std::unique_ptr<Vector<std::unique_ptr<WebCore::XPath::Expression>>> predicateList((yyvsp[(3) - (3)].expressionVector));
    17801778
    17811779        String localName;
     
    17871785
    17881786        if (predicateList)
    1789             (yyval.step) = new Step((yyvsp[(1) - (3)].axis), Step::NodeTest(Step::NodeTest::NameTest, localName, namespaceURI), WTFMove(*predicateList));
     1787            (yyval.step) = new WebCore::XPath::Step((yyvsp[(1) - (3)].axis), WebCore::XPath::Step::NodeTest(WebCore::XPath::Step::NodeTest::NameTest, localName, namespaceURI), WTFMove(*predicateList));
    17901788        else
    1791             (yyval.step) = new Step((yyvsp[(1) - (3)].axis), Step::NodeTest(Step::NodeTest::NameTest, localName, namespaceURI));
     1789            (yyval.step) = new WebCore::XPath::Step((yyvsp[(1) - (3)].axis), WebCore::XPath::Step::NodeTest(WebCore::XPath::Step::NodeTest::NameTest, localName, namespaceURI));
    17921790    ;}
    17931791    break;
    17941792
    17951793  case 18:
    1796 #line 238 "WebCore/xml/XPathGrammar.y"
    1797     {
    1798         (yyval.axis) = Step::AttributeAxis;
     1794#line 235 "XPathGrammar.y"
     1795    {
     1796        (yyval.axis) = WebCore::XPath::Step::AttributeAxis;
    17991797    ;}
    18001798    break;
    18011799
    18021800  case 19:
    1803 #line 245 "WebCore/xml/XPathGrammar.y"
    1804     {
    1805         (yyval.nodeTest) = new Step::NodeTest(Step::NodeTest::AnyNodeTest);
     1801#line 242 "XPathGrammar.y"
     1802    {
     1803        (yyval.nodeTest) = new WebCore::XPath::Step::NodeTest(WebCore::XPath::Step::NodeTest::AnyNodeTest);
    18061804    ;}
    18071805    break;
    18081806
    18091807  case 20:
    1810 #line 250 "WebCore/xml/XPathGrammar.y"
    1811     {
    1812         (yyval.nodeTest) = new Step::NodeTest(Step::NodeTest::TextNodeTest);
     1808#line 247 "XPathGrammar.y"
     1809    {
     1810        (yyval.nodeTest) = new WebCore::XPath::Step::NodeTest(WebCore::XPath::Step::NodeTest::TextNodeTest);
    18131811    ;}
    18141812    break;
    18151813
    18161814  case 21:
    1817 #line 255 "WebCore/xml/XPathGrammar.y"
    1818     {
    1819         (yyval.nodeTest) = new Step::NodeTest(Step::NodeTest::CommentNodeTest);
     1815#line 252 "XPathGrammar.y"
     1816    {
     1817        (yyval.nodeTest) = new WebCore::XPath::Step::NodeTest(WebCore::XPath::Step::NodeTest::CommentNodeTest);
    18201818    ;}
    18211819    break;
    18221820
    18231821  case 22:
    1824 #line 260 "WebCore/xml/XPathGrammar.y"
    1825     {
    1826         (yyval.nodeTest) = new Step::NodeTest(Step::NodeTest::ProcessingInstructionNodeTest);
     1822#line 257 "XPathGrammar.y"
     1823    {
     1824        (yyval.nodeTest) = new WebCore::XPath::Step::NodeTest(WebCore::XPath::Step::NodeTest::ProcessingInstructionNodeTest);
    18271825    ;}
    18281826    break;
    18291827
    18301828  case 23:
    1831 #line 265 "WebCore/xml/XPathGrammar.y"
     1829#line 262 "XPathGrammar.y"
    18321830    {
    18331831        String literal = adoptRef((yyvsp[(3) - (4)].string));
    1834         (yyval.nodeTest) = new Step::NodeTest(Step::NodeTest::ProcessingInstructionNodeTest, literal.stripWhiteSpace());
     1832        (yyval.nodeTest) = new WebCore::XPath::Step::NodeTest(WebCore::XPath::Step::NodeTest::ProcessingInstructionNodeTest, literal.stripWhiteSpace());
    18351833    ;}
    18361834    break;
    18371835
    18381836  case 24:
    1839 #line 273 "WebCore/xml/XPathGrammar.y"
     1837#line 270 "XPathGrammar.y"
    18401838    {
    18411839        (yyval.expressionVector) = nullptr;
     
    18441842
    18451843  case 26:
    1846 #line 282 "WebCore/xml/XPathGrammar.y"
    1847     {
    1848         (yyval.expressionVector) = new Vector<std::unique_ptr<Expression>>;
    1849         (yyval.expressionVector)->append(std::unique_ptr<Expression>((yyvsp[(1) - (1)].expression)));
     1844#line 279 "XPathGrammar.y"
     1845    {
     1846        (yyval.expressionVector) = new Vector<std::unique_ptr<WebCore::XPath::Expression>>;
     1847        (yyval.expressionVector)->append(std::unique_ptr<WebCore::XPath::Expression>((yyvsp[(1) - (1)].expression)));
    18501848    ;}
    18511849    break;
    18521850
    18531851  case 27:
    1854 #line 288 "WebCore/xml/XPathGrammar.y"
     1852#line 285 "XPathGrammar.y"
    18551853    {
    18561854        (yyval.expressionVector) = (yyvsp[(1) - (2)].expressionVector);
    1857         (yyval.expressionVector)->append(std::unique_ptr<Expression>((yyvsp[(2) - (2)].expression)));
     1855        (yyval.expressionVector)->append(std::unique_ptr<WebCore::XPath::Expression>((yyvsp[(2) - (2)].expression)));
    18581856    ;}
    18591857    break;
    18601858
    18611859  case 28:
    1862 #line 296 "WebCore/xml/XPathGrammar.y"
     1860#line 293 "XPathGrammar.y"
    18631861    {
    18641862        (yyval.expression) = (yyvsp[(2) - (3)].expression);
     
    18671865
    18681866  case 29:
    1869 #line 303 "WebCore/xml/XPathGrammar.y"
    1870     {
    1871         (yyval.step) = new Step(Step::DescendantOrSelfAxis, Step::NodeTest(Step::NodeTest::AnyNodeTest));
     1867#line 300 "XPathGrammar.y"
     1868    {
     1869        (yyval.step) = new WebCore::XPath::Step(WebCore::XPath::Step::DescendantOrSelfAxis, WebCore::XPath::Step::NodeTest(WebCore::XPath::Step::NodeTest::AnyNodeTest));
    18721870    ;}
    18731871    break;
    18741872
    18751873  case 30:
    1876 #line 310 "WebCore/xml/XPathGrammar.y"
    1877     {
    1878         (yyval.step) = new Step(Step::SelfAxis, Step::NodeTest(Step::NodeTest::AnyNodeTest));
     1874#line 307 "XPathGrammar.y"
     1875    {
     1876        (yyval.step) = new WebCore::XPath::Step(WebCore::XPath::Step::SelfAxis, WebCore::XPath::Step::NodeTest(WebCore::XPath::Step::NodeTest::AnyNodeTest));
    18791877    ;}
    18801878    break;
    18811879
    18821880  case 31:
    1883 #line 315 "WebCore/xml/XPathGrammar.y"
    1884     {
    1885         (yyval.step) = new Step(Step::ParentAxis, Step::NodeTest(Step::NodeTest::AnyNodeTest));
     1881#line 312 "XPathGrammar.y"
     1882    {
     1883        (yyval.step) = new WebCore::XPath::Step(WebCore::XPath::Step::ParentAxis, WebCore::XPath::Step::NodeTest(WebCore::XPath::Step::NodeTest::AnyNodeTest));
    18861884    ;}
    18871885    break;
    18881886
    18891887  case 32:
    1890 #line 322 "WebCore/xml/XPathGrammar.y"
     1888#line 319 "XPathGrammar.y"
    18911889    {
    18921890        String name = adoptRef((yyvsp[(1) - (1)].string));
    1893         (yyval.expression) = new VariableReference(name);
     1891        (yyval.expression) = new WebCore::XPath::VariableReference(name);
    18941892    ;}
    18951893    break;
    18961894
    18971895  case 33:
    1898 #line 328 "WebCore/xml/XPathGrammar.y"
     1896#line 325 "XPathGrammar.y"
    18991897    {
    19001898        (yyval.expression) = (yyvsp[(2) - (3)].expression);
     
    19031901
    19041902  case 34:
    1905 #line 333 "WebCore/xml/XPathGrammar.y"
     1903#line 330 "XPathGrammar.y"
    19061904    {
    19071905        String literal = adoptRef((yyvsp[(1) - (1)].string));
    1908         (yyval.expression) = new StringExpression(WTFMove(literal));
     1906        (yyval.expression) = new WebCore::XPath::StringExpression(WTFMove(literal));
    19091907    ;}
    19101908    break;
    19111909
    19121910  case 35:
    1913 #line 339 "WebCore/xml/XPathGrammar.y"
     1911#line 336 "XPathGrammar.y"
    19141912    {
    19151913        String numeral = adoptRef((yyvsp[(1) - (1)].string));
    1916         (yyval.expression) = new Number(numeral.toDouble());
     1914        (yyval.expression) = new WebCore::XPath::Number(numeral.toDouble());
    19171915    ;}
    19181916    break;
    19191917
    19201918  case 37:
    1921 #line 349 "WebCore/xml/XPathGrammar.y"
     1919#line 346 "XPathGrammar.y"
    19221920    {
    19231921        String name = adoptRef((yyvsp[(1) - (3)].string));
    1924         (yyval.expression) = XPath::Function::create(name).release();
     1922        (yyval.expression) = WebCore::XPath::Function::create(name).release();
    19251923        if (!(yyval.expression))
    19261924            YYABORT;
     
    19291927
    19301928  case 38:
    1931 #line 357 "WebCore/xml/XPathGrammar.y"
     1929#line 354 "XPathGrammar.y"
    19321930    {
    19331931        String name = adoptRef((yyvsp[(1) - (4)].string));
    1934         std::unique_ptr<Vector<std::unique_ptr<Expression>>> argumentList((yyvsp[(3) - (4)].expressionVector));
    1935         (yyval.expression) = XPath::Function::create(name, WTFMove(*argumentList)).release();
     1932        std::unique_ptr<Vector<std::unique_ptr<WebCore::XPath::Expression>>> argumentList((yyvsp[(3) - (4)].expressionVector));
     1933        (yyval.expression) = WebCore::XPath::Function::create(name, WTFMove(*argumentList)).release();
    19361934        if (!(yyval.expression))
    19371935            YYABORT;
     
    19401938
    19411939  case 39:
    1942 #line 368 "WebCore/xml/XPathGrammar.y"
    1943     {
    1944         (yyval.expressionVector) = new Vector<std::unique_ptr<Expression>>;
    1945         (yyval.expressionVector)->append(std::unique_ptr<Expression>((yyvsp[(1) - (1)].expression)));
     1940#line 365 "XPathGrammar.y"
     1941    {
     1942        (yyval.expressionVector) = new Vector<std::unique_ptr<WebCore::XPath::Expression>>;
     1943        (yyval.expressionVector)->append(std::unique_ptr<WebCore::XPath::Expression>((yyvsp[(1) - (1)].expression)));
    19461944    ;}
    19471945    break;
    19481946
    19491947  case 40:
    1950 #line 374 "WebCore/xml/XPathGrammar.y"
     1948#line 371 "XPathGrammar.y"
    19511949    {
    19521950        (yyval.expressionVector) = (yyvsp[(1) - (3)].expressionVector);
    1953         (yyval.expressionVector)->append(std::unique_ptr<Expression>((yyvsp[(3) - (3)].expression)));
     1951        (yyval.expressionVector)->append(std::unique_ptr<WebCore::XPath::Expression>((yyvsp[(3) - (3)].expression)));
    19541952    ;}
    19551953    break;
    19561954
    19571955  case 43:
    1958 #line 388 "WebCore/xml/XPathGrammar.y"
    1959     {
    1960         (yyval.expression) = new Union(std::unique_ptr<Expression>((yyvsp[(1) - (3)].expression)), std::unique_ptr<Expression>((yyvsp[(3) - (3)].expression)));
     1956#line 385 "XPathGrammar.y"
     1957    {
     1958        (yyval.expression) = new WebCore::XPath::Union(std::unique_ptr<WebCore::XPath::Expression>((yyvsp[(1) - (3)].expression)), std::unique_ptr<WebCore::XPath::Expression>((yyvsp[(3) - (3)].expression)));
    19611959    ;}
    19621960    break;
    19631961
    19641962  case 44:
    1965 #line 395 "WebCore/xml/XPathGrammar.y"
     1963#line 392 "XPathGrammar.y"
    19661964    {
    19671965        (yyval.expression) = (yyvsp[(1) - (1)].locationPath);
     
    19701968
    19711969  case 46:
    1972 #line 402 "WebCore/xml/XPathGrammar.y"
     1970#line 399 "XPathGrammar.y"
    19731971    {
    19741972        (yyvsp[(3) - (3)].locationPath)->setAbsolute();
    1975         (yyval.expression) = new XPath::Path(std::unique_ptr<Expression>((yyvsp[(1) - (3)].expression)), std::unique_ptr<LocationPath>((yyvsp[(3) - (3)].locationPath)));
     1973        (yyval.expression) = new WebCore::XPath::Path(std::unique_ptr<WebCore::XPath::Expression>((yyvsp[(1) - (3)].expression)), std::unique_ptr<WebCore::XPath::LocationPath>((yyvsp[(3) - (3)].locationPath)));
    19761974    ;}
    19771975    break;
    19781976
    19791977  case 47:
    1980 #line 408 "WebCore/xml/XPathGrammar.y"
    1981     {
    1982         (yyvsp[(3) - (3)].locationPath)->prependStep(std::unique_ptr<Step>((yyvsp[(2) - (3)].step)));
     1978#line 405 "XPathGrammar.y"
     1979    {
     1980        (yyvsp[(3) - (3)].locationPath)->prependStep(std::unique_ptr<WebCore::XPath::Step>((yyvsp[(2) - (3)].step)));
    19831981        (yyvsp[(3) - (3)].locationPath)->setAbsolute();
    1984         (yyval.expression) = new XPath::Path(std::unique_ptr<Expression>((yyvsp[(1) - (3)].expression)), std::unique_ptr<LocationPath>((yyvsp[(3) - (3)].locationPath)));
     1982        (yyval.expression) = new WebCore::XPath::Path(std::unique_ptr<WebCore::XPath::Expression>((yyvsp[(1) - (3)].expression)), std::unique_ptr<WebCore::XPath::LocationPath>((yyvsp[(3) - (3)].locationPath)));
    19851983    ;}
    19861984    break;
    19871985
    19881986  case 49:
    1989 #line 419 "WebCore/xml/XPathGrammar.y"
    1990     {
    1991         std::unique_ptr<Vector<std::unique_ptr<Expression>>> predicateList((yyvsp[(2) - (2)].expressionVector));
    1992         (yyval.expression) = new Filter(std::unique_ptr<Expression>((yyvsp[(1) - (2)].expression)), WTFMove(*predicateList));
     1987#line 416 "XPathGrammar.y"
     1988    {
     1989        std::unique_ptr<Vector<std::unique_ptr<WebCore::XPath::Expression>>> predicateList((yyvsp[(2) - (2)].expressionVector));
     1990        (yyval.expression) = new WebCore::XPath::Filter(std::unique_ptr<WebCore::XPath::Expression>((yyvsp[(1) - (2)].expression)), WTFMove(*predicateList));
    19931991    ;}
    19941992    break;
    19951993
    19961994  case 51:
    1997 #line 429 "WebCore/xml/XPathGrammar.y"
    1998     {
    1999         (yyval.expression) = new LogicalOp(LogicalOp::OP_Or, std::unique_ptr<Expression>((yyvsp[(1) - (3)].expression)), std::unique_ptr<Expression>((yyvsp[(3) - (3)].expression)));
     1995#line 426 "XPathGrammar.y"
     1996    {
     1997        (yyval.expression) = new WebCore::XPath::LogicalOp(WebCore::XPath::LogicalOp::OP_Or, std::unique_ptr<WebCore::XPath::Expression>((yyvsp[(1) - (3)].expression)), std::unique_ptr<WebCore::XPath::Expression>((yyvsp[(3) - (3)].expression)));
    20001998    ;}
    20011999    break;
    20022000
    20032001  case 53:
    2004 #line 438 "WebCore/xml/XPathGrammar.y"
    2005     {
    2006         (yyval.expression) = new LogicalOp(LogicalOp::OP_And, std::unique_ptr<Expression>((yyvsp[(1) - (3)].expression)), std::unique_ptr<Expression>((yyvsp[(3) - (3)].expression)));
     2002#line 435 "XPathGrammar.y"
     2003    {
     2004        (yyval.expression) = new WebCore::XPath::LogicalOp(WebCore::XPath::LogicalOp::OP_And, std::unique_ptr<WebCore::XPath::Expression>((yyvsp[(1) - (3)].expression)), std::unique_ptr<WebCore::XPath::Expression>((yyvsp[(3) - (3)].expression)));
    20072005    ;}
    20082006    break;
    20092007
    20102008  case 55:
    2011 #line 447 "WebCore/xml/XPathGrammar.y"
    2012     {
    2013         (yyval.expression) = new EqTestOp((yyvsp[(2) - (3)].equalityTestOpcode), std::unique_ptr<Expression>((yyvsp[(1) - (3)].expression)), std::unique_ptr<Expression>((yyvsp[(3) - (3)].expression)));
     2009#line 444 "XPathGrammar.y"
     2010    {
     2011        (yyval.expression) = new WebCore::XPath::EqTestOp((yyvsp[(2) - (3)].equalityTestOpcode), std::unique_ptr<WebCore::XPath::Expression>((yyvsp[(1) - (3)].expression)), std::unique_ptr<WebCore::XPath::Expression>((yyvsp[(3) - (3)].expression)));
    20142012    ;}
    20152013    break;
    20162014
    20172015  case 57:
    2018 #line 456 "WebCore/xml/XPathGrammar.y"
    2019     {
    2020         (yyval.expression) = new EqTestOp((yyvsp[(2) - (3)].equalityTestOpcode), std::unique_ptr<Expression>((yyvsp[(1) - (3)].expression)), std::unique_ptr<Expression>((yyvsp[(3) - (3)].expression)));
     2016#line 453 "XPathGrammar.y"
     2017    {
     2018        (yyval.expression) = new WebCore::XPath::EqTestOp((yyvsp[(2) - (3)].equalityTestOpcode), std::unique_ptr<WebCore::XPath::Expression>((yyvsp[(1) - (3)].expression)), std::unique_ptr<WebCore::XPath::Expression>((yyvsp[(3) - (3)].expression)));
    20212019    ;}
    20222020    break;
    20232021
    20242022  case 59:
    2025 #line 465 "WebCore/xml/XPathGrammar.y"
    2026     {
    2027         (yyval.expression) = new NumericOp(NumericOp::OP_Add, std::unique_ptr<Expression>((yyvsp[(1) - (3)].expression)), std::unique_ptr<Expression>((yyvsp[(3) - (3)].expression)));
     2023#line 462 "XPathGrammar.y"
     2024    {
     2025        (yyval.expression) = new WebCore::XPath::NumericOp(WebCore::XPath::NumericOp::OP_Add, std::unique_ptr<WebCore::XPath::Expression>((yyvsp[(1) - (3)].expression)), std::unique_ptr<WebCore::XPath::Expression>((yyvsp[(3) - (3)].expression)));
    20282026    ;}
    20292027    break;
    20302028
    20312029  case 60:
    2032 #line 470 "WebCore/xml/XPathGrammar.y"
    2033     {
    2034         (yyval.expression) = new NumericOp(NumericOp::OP_Sub, std::unique_ptr<Expression>((yyvsp[(1) - (3)].expression)), std::unique_ptr<Expression>((yyvsp[(3) - (3)].expression)));
     2030#line 467 "XPathGrammar.y"
     2031    {
     2032        (yyval.expression) = new WebCore::XPath::NumericOp(WebCore::XPath::NumericOp::OP_Sub, std::unique_ptr<WebCore::XPath::Expression>((yyvsp[(1) - (3)].expression)), std::unique_ptr<WebCore::XPath::Expression>((yyvsp[(3) - (3)].expression)));
    20352033    ;}
    20362034    break;
    20372035
    20382036  case 62:
    2039 #line 479 "WebCore/xml/XPathGrammar.y"
    2040     {
    2041         (yyval.expression) = new NumericOp((yyvsp[(2) - (3)].numericOpcode), std::unique_ptr<Expression>((yyvsp[(1) - (3)].expression)), std::unique_ptr<Expression>((yyvsp[(3) - (3)].expression)));
     2037#line 476 "XPathGrammar.y"
     2038    {
     2039        (yyval.expression) = new WebCore::XPath::NumericOp((yyvsp[(2) - (3)].numericOpcode), std::unique_ptr<WebCore::XPath::Expression>((yyvsp[(1) - (3)].expression)), std::unique_ptr<WebCore::XPath::Expression>((yyvsp[(3) - (3)].expression)));
    20422040    ;}
    20432041    break;
    20442042
    20452043  case 64:
    2046 #line 488 "WebCore/xml/XPathGrammar.y"
    2047     {
    2048         (yyval.expression) = new Negative(std::unique_ptr<Expression>((yyvsp[(2) - (2)].expression)));
     2044#line 485 "XPathGrammar.y"
     2045    {
     2046        (yyval.expression) = new WebCore::XPath::Negative(std::unique_ptr<WebCore::XPath::Expression>((yyvsp[(2) - (2)].expression)));
    20492047    ;}
    20502048    break;
     
    20522050
    20532051/* Line 1267 of yacc.c.  */
    2054 #line 2049 "./XPathGrammar.cpp"
     2052#line 2046 "XPathGrammar.cpp"
    20552053      default: break;
    20562054    }
     
    20912089#else
    20922090      {
    2093     YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
    2094     if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
    2095       {
    2096         YYSIZE_T yyalloc = 2 * yysize;
    2097         if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
    2098           yyalloc = YYSTACK_ALLOC_MAXIMUM;
    2099         if (yymsg != yymsgbuf)
    2100           YYSTACK_FREE (yymsg);
    2101         yymsg = (char *) YYSTACK_ALLOC (yyalloc);
    2102         if (yymsg)
    2103           yymsg_alloc = yyalloc;
    2104         else
    2105           {
    2106         yymsg = yymsgbuf;
    2107         yymsg_alloc = sizeof yymsgbuf;
    2108           }
     2091        YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
     2092        if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
     2093          {
     2094            YYSIZE_T yyalloc = 2 * yysize;
     2095            if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
     2096              yyalloc = YYSTACK_ALLOC_MAXIMUM;
     2097            if (yymsg != yymsgbuf)
     2098              YYSTACK_FREE (yymsg);
     2099            yymsg = (char *) YYSTACK_ALLOC (yyalloc);
     2100            if (yymsg)
     2101              yymsg_alloc = yyalloc;
     2102            else
     2103              {
     2104                yymsg = yymsgbuf;
     2105                yymsg_alloc = sizeof yymsgbuf;
     2106              }
     2107          }
     2108
     2109        if (0 < yysize && yysize <= yymsg_alloc)
     2110          {
     2111            (void) yysyntax_error (yymsg, yystate, yychar);
     2112            yyerror (parser, yymsg);
     2113          }
     2114        else
     2115          {
     2116            yyerror (parser, YY_("syntax error"));
     2117            if (yysize != 0)
     2118              goto yyexhaustedlab;
     2119          }
    21092120      }
    2110 
    2111     if (0 < yysize && yysize <= yymsg_alloc)
    2112       {
    2113         (void) yysyntax_error (yymsg, yystate, yychar);
    2114         yyerror (parser, yymsg);
    2115       }
    2116     else
    2117       {
    2118         yyerror (parser, YY_("syntax error"));
    2119         if (yysize != 0)
    2120           goto yyexhaustedlab;
    2121       }
    2122       }
    21232121#endif
    21242122    }
     
    21292127    {
    21302128      /* If just tried and failed to reuse look-ahead token after an
    2131     error, discard it.  */
     2129        error, discard it.  */
    21322130
    21332131      if (yychar <= YYEOF)
    2134     {
    2135       /* Return failure if at end of input.  */
    2136       if (yychar == YYEOF)
    2137         YYABORT;
    2138     }
     2132        {
     2133          /* Return failure if at end of input.  */
     2134          if (yychar == YYEOF)
     2135            YYABORT;
     2136        }
    21392137      else
    2140     {
    2141       yydestruct ("Error: discarding",
    2142               yytoken, &yylval, parser);
    2143       yychar = YYEMPTY;
    2144     }
     2138        {
     2139          yydestruct ("Error: discarding",
     2140                      yytoken, &yylval, parser);
     2141          yychar = YYEMPTY;
     2142        }
    21452143    }
    21462144
     
    21762174`-------------------------------------------------------------*/
    21772175yyerrlab1:
    2178   yyerrstatus = 3;    /* Each real token shifted decrements this.  */
     2176  yyerrstatus = 3;      /* Each real token shifted decrements this.  */
    21792177
    21802178  for (;;)
     
    21822180      yyn = yypact[yystate];
    21832181      if (yyn != YYPACT_NINF)
    2184     {
    2185       yyn += YYTERROR;
    2186       if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
    2187         {
    2188           yyn = yytable[yyn];
    2189           if (0 < yyn)
    2190         break;
    2191         }
    2192     }
     2182        {
     2183          yyn += YYTERROR;
     2184          if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
     2185            {
     2186              yyn = yytable[yyn];
     2187              if (0 < yyn)
     2188                break;
     2189            }
     2190        }
    21932191
    21942192      /* Pop the current state because it cannot handle the error token.  */
    21952193      if (yyssp == yyss)
    2196     YYABORT;
     2194        YYABORT;
    21972195
    21982196
    21992197      yydestruct ("Error: popping",
    2200           yystos[yystate], yyvsp, parser);
     2198                  yystos[yystate], yyvsp, parser);
    22012199      YYPOPSTACK (1);
    22022200      yystate = *yyssp;
     
    22442242  if (yychar != YYEOF && yychar != YYEMPTY)
    22452243     yydestruct ("Cleanup: discarding lookahead",
    2246         yytoken, &yylval, parser);
     2244                yytoken, &yylval, parser);
    22472245  /* Do not reclaim the symbols of the rule which action triggered
    22482246     this YYABORT or YYACCEPT.  */
     
    22522250    {
    22532251      yydestruct ("Cleanup: popping",
    2254           yystos[*yyssp], yyvsp, parser);
     2252                  yystos[*yyssp], yyvsp, parser);
    22552253      YYPOPSTACK (1);
    22562254    }
     
    22682266
    22692267
    2270 #line 493 "WebCore/xml/XPathGrammar.y"
    2271 
    2272 
     2268#line 490 "XPathGrammar.y"
     2269
     2270
  • trunk/Source/WebCore/xml/XPathGrammar.y

    r283636 r284420  
    5353%pure-parser
    5454%lex-param { parser }
    55 %parse-param { Parser& parser }
     55%parse-param { WebCore::XPath::Parser& parser }
    5656
    5757%union {
     
    101101%{
    102102
    103 static int xpathyylex(YYSTYPE* yylval, Parser& parser) { return parser.lex(*yylval); }
    104 static void xpathyyerror(Parser&, const char*) { }
     103static int xpathyylex(YYSTYPE* yylval, WebCore::XPath::Parser& parser) { return parser.lex(*yylval); }
     104static void xpathyyerror(WebCore::XPath::Parser&, const char*) { }
    105105
    106106%}
     
    111111    Expr
    112112    {
    113         parser.setParseResult(std::unique_ptr<Expression>($1));
     113        parser.setParseResult(std::unique_ptr<WebCore::XPath::Expression>($1));
    114114    }
    115115    ;
     
    132132    '/'
    133133    {
    134         $$ = new LocationPath;
     134        $$ = new WebCore::XPath::LocationPath;
    135135    }
    136136    |
     
    143143    {
    144144        $$ = $2;
    145         $$->prependStep(std::unique_ptr<Step>($1));
     145        $$->prependStep(std::unique_ptr<WebCore::XPath::Step>($1));
    146146    }
    147147    ;
     
    150150    Step
    151151    {
    152         $$ = new LocationPath;
    153         $$->appendStep(std::unique_ptr<Step>($1));
     152        $$ = new WebCore::XPath::LocationPath;
     153        $$->appendStep(std::unique_ptr<WebCore::XPath::Step>($1));
    154154    }
    155155    |
     
    157157    {
    158158        $$ = $1;
    159         $$->appendStep(std::unique_ptr<Step>($3));
     159        $$->appendStep(std::unique_ptr<WebCore::XPath::Step>($3));
    160160    }
    161161    |
     
    163163    {
    164164        $$ = $1;
    165         $$->appendStep(std::unique_ptr<Step>($2));
    166         $$->appendStep(std::unique_ptr<Step>($3));
     165        $$->appendStep(std::unique_ptr<WebCore::XPath::Step>($2));
     166        $$->appendStep(std::unique_ptr<WebCore::XPath::Step>($3));
    167167    }
    168168    ;
     
    171171    NodeTest OptionalPredicateList
    172172    {
    173         std::unique_ptr<Step::NodeTest> nodeTest($1);
    174         std::unique_ptr<Vector<std::unique_ptr<Expression>>> predicateList($2);
     173        std::unique_ptr<WebCore::XPath::Step::NodeTest> nodeTest($1);
     174        std::unique_ptr<Vector<std::unique_ptr<WebCore::XPath::Expression>>> predicateList($2);
    175175        if (predicateList)
    176             $$ = new Step(Step::ChildAxis, WTFMove(*nodeTest), WTFMove(*predicateList));
     176            $$ = new WebCore::XPath::Step(WebCore::XPath::Step::ChildAxis, WTFMove(*nodeTest), WTFMove(*predicateList));
    177177        else
    178             $$ = new Step(Step::ChildAxis, WTFMove(*nodeTest));
     178            $$ = new WebCore::XPath::Step(WebCore::XPath::Step::ChildAxis, WTFMove(*nodeTest));
    179179    }
    180180    |
     
    182182    {
    183183        String nametest = adoptRef($1);
    184         std::unique_ptr<Vector<std::unique_ptr<Expression>>> predicateList($2);
     184        std::unique_ptr<Vector<std::unique_ptr<WebCore::XPath::Expression>>> predicateList($2);
    185185
    186186        String localName;
     
    192192
    193193        if (predicateList)
    194             $$ = new Step(Step::ChildAxis, Step::NodeTest(Step::NodeTest::NameTest, localName, namespaceURI), WTFMove(*predicateList));
     194            $$ = new WebCore::XPath::Step(WebCore::XPath::Step::ChildAxis, WebCore::XPath::Step::NodeTest(WebCore::XPath::Step::NodeTest::NameTest, localName, namespaceURI), WTFMove(*predicateList));
    195195        else
    196             $$ = new Step(Step::ChildAxis, Step::NodeTest(Step::NodeTest::NameTest, localName, namespaceURI));
     196            $$ = new WebCore::XPath::Step(WebCore::XPath::Step::ChildAxis, WebCore::XPath::Step::NodeTest(WebCore::XPath::Step::NodeTest::NameTest, localName, namespaceURI));
    197197    }
    198198    |
    199199    AxisSpecifier NodeTest OptionalPredicateList
    200200    {
    201         std::unique_ptr<Step::NodeTest> nodeTest($2);
    202         std::unique_ptr<Vector<std::unique_ptr<Expression>>> predicateList($3);
     201        std::unique_ptr<WebCore::XPath::Step::NodeTest> nodeTest($2);
     202        std::unique_ptr<Vector<std::unique_ptr<WebCore::XPath::Expression>>> predicateList($3);
    203203
    204204        if (predicateList)
    205             $$ = new Step($1, WTFMove(*nodeTest), WTFMove(*predicateList));
     205            $$ = new WebCore::XPath::Step($1, WTFMove(*nodeTest), WTFMove(*predicateList));
    206206        else
    207             $$ = new Step($1, WTFMove(*nodeTest));
     207            $$ = new WebCore::XPath::Step($1, WTFMove(*nodeTest));
    208208    }
    209209    |
     
    211211    {
    212212        String nametest = adoptRef($2);
    213         std::unique_ptr<Vector<std::unique_ptr<Expression>>> predicateList($3);
     213        std::unique_ptr<Vector<std::unique_ptr<WebCore::XPath::Expression>>> predicateList($3);
    214214
    215215        String localName;
     
    221221
    222222        if (predicateList)
    223             $$ = new Step($1, Step::NodeTest(Step::NodeTest::NameTest, localName, namespaceURI), WTFMove(*predicateList));
     223            $$ = new WebCore::XPath::Step($1, WebCore::XPath::Step::NodeTest(WebCore::XPath::Step::NodeTest::NameTest, localName, namespaceURI), WTFMove(*predicateList));
    224224        else
    225             $$ = new Step($1, Step::NodeTest(Step::NodeTest::NameTest, localName, namespaceURI));
     225            $$ = new WebCore::XPath::Step($1, WebCore::XPath::Step::NodeTest(WebCore::XPath::Step::NodeTest::NameTest, localName, namespaceURI));
    226226    }
    227227    |
     
    234234    '@'
    235235    {
    236         $$ = Step::AttributeAxis;
     236        $$ = WebCore::XPath::Step::AttributeAxis;
    237237    }
    238238    ;
     
    241241    NODE '(' ')'
    242242    {
    243         $$ = new Step::NodeTest(Step::NodeTest::AnyNodeTest);
     243        $$ = new WebCore::XPath::Step::NodeTest(WebCore::XPath::Step::NodeTest::AnyNodeTest);
    244244    }
    245245    |
    246246    TEXT_ '(' ')'
    247247    {
    248         $$ = new Step::NodeTest(Step::NodeTest::TextNodeTest);
     248        $$ = new WebCore::XPath::Step::NodeTest(WebCore::XPath::Step::NodeTest::TextNodeTest);
    249249    }
    250250    |
    251251    COMMENT '(' ')'
    252252    {
    253         $$ = new Step::NodeTest(Step::NodeTest::CommentNodeTest);
     253        $$ = new WebCore::XPath::Step::NodeTest(WebCore::XPath::Step::NodeTest::CommentNodeTest);
    254254    }
    255255    |
    256256    PI '(' ')'
    257257    {
    258         $$ = new Step::NodeTest(Step::NodeTest::ProcessingInstructionNodeTest);
     258        $$ = new WebCore::XPath::Step::NodeTest(WebCore::XPath::Step::NodeTest::ProcessingInstructionNodeTest);
    259259    }
    260260    |
     
    262262    {
    263263        String literal = adoptRef($3);
    264         $$ = new Step::NodeTest(Step::NodeTest::ProcessingInstructionNodeTest, literal.stripWhiteSpace());
     264        $$ = new WebCore::XPath::Step::NodeTest(WebCore::XPath::Step::NodeTest::ProcessingInstructionNodeTest, literal.stripWhiteSpace());
    265265    }
    266266    ;
     
    278278    Predicate
    279279    {
    280         $$ = new Vector<std::unique_ptr<Expression>>;
    281         $$->append(std::unique_ptr<Expression>($1));
     280        $$ = new Vector<std::unique_ptr<WebCore::XPath::Expression>>;
     281        $$->append(std::unique_ptr<WebCore::XPath::Expression>($1));
    282282    }
    283283    |
     
    285285    {
    286286        $$ = $1;
    287         $$->append(std::unique_ptr<Expression>($2));
     287        $$->append(std::unique_ptr<WebCore::XPath::Expression>($2));
    288288    }
    289289    ;
     
    299299    SLASHSLASH
    300300    {
    301         $$ = new Step(Step::DescendantOrSelfAxis, Step::NodeTest(Step::NodeTest::AnyNodeTest));
     301        $$ = new WebCore::XPath::Step(WebCore::XPath::Step::DescendantOrSelfAxis, WebCore::XPath::Step::NodeTest(WebCore::XPath::Step::NodeTest::AnyNodeTest));
    302302    }
    303303    ;
     
    306306    '.'
    307307    {
    308         $$ = new Step(Step::SelfAxis, Step::NodeTest(Step::NodeTest::AnyNodeTest));
     308        $$ = new WebCore::XPath::Step(WebCore::XPath::Step::SelfAxis, WebCore::XPath::Step::NodeTest(WebCore::XPath::Step::NodeTest::AnyNodeTest));
    309309    }
    310310    |
    311311    DOTDOT
    312312    {
    313         $$ = new Step(Step::ParentAxis, Step::NodeTest(Step::NodeTest::AnyNodeTest));
     313        $$ = new WebCore::XPath::Step(WebCore::XPath::Step::ParentAxis, WebCore::XPath::Step::NodeTest(WebCore::XPath::Step::NodeTest::AnyNodeTest));
    314314    }
    315315    ;
     
    319319    {
    320320        String name = adoptRef($1);
    321         $$ = new VariableReference(name);
     321        $$ = new WebCore::XPath::VariableReference(name);
    322322    }
    323323    |
     
    330330    {
    331331        String literal = adoptRef($1);
    332         $$ = new StringExpression(WTFMove(literal));
     332        $$ = new WebCore::XPath::StringExpression(WTFMove(literal));
    333333    }
    334334    |
     
    336336    {
    337337        String numeral = adoptRef($1);
    338         $$ = new Number(numeral.toDouble());
     338        $$ = new WebCore::XPath::Number(numeral.toDouble());
    339339    }
    340340    |
     
    346346    {
    347347        String name = adoptRef($1);
    348         $$ = XPath::Function::create(name).release();
     348        $$ = WebCore::XPath::Function::create(name).release();
    349349        if (!$$)
    350350            YYABORT;
     
    354354    {
    355355        String name = adoptRef($1);
    356         std::unique_ptr<Vector<std::unique_ptr<Expression>>> argumentList($3);
    357         $$ = XPath::Function::create(name, WTFMove(*argumentList)).release();
     356        std::unique_ptr<Vector<std::unique_ptr<WebCore::XPath::Expression>>> argumentList($3);
     357        $$ = WebCore::XPath::Function::create(name, WTFMove(*argumentList)).release();
    358358        if (!$$)
    359359            YYABORT;
     
    364364    Argument
    365365    {
    366         $$ = new Vector<std::unique_ptr<Expression>>;
    367         $$->append(std::unique_ptr<Expression>($1));
     366        $$ = new Vector<std::unique_ptr<WebCore::XPath::Expression>>;
     367        $$->append(std::unique_ptr<WebCore::XPath::Expression>($1));
    368368    }
    369369    |
     
    371371    {
    372372        $$ = $1;
    373         $$->append(std::unique_ptr<Expression>($3));
     373        $$->append(std::unique_ptr<WebCore::XPath::Expression>($3));
    374374    }
    375375    ;
     
    384384    UnionExpr '|' PathExpr
    385385    {
    386         $$ = new Union(std::unique_ptr<Expression>($1), std::unique_ptr<Expression>($3));
     386        $$ = new WebCore::XPath::Union(std::unique_ptr<WebCore::XPath::Expression>($1), std::unique_ptr<WebCore::XPath::Expression>($3));
    387387    }
    388388    ;
     
    399399    {
    400400        $3->setAbsolute();
    401         $$ = new XPath::Path(std::unique_ptr<Expression>($1), std::unique_ptr<LocationPath>($3));
     401        $$ = new WebCore::XPath::Path(std::unique_ptr<WebCore::XPath::Expression>($1), std::unique_ptr<WebCore::XPath::LocationPath>($3));
    402402    }
    403403    |
    404404    FilterExpr DescendantOrSelf RelativeLocationPath
    405405    {
    406         $3->prependStep(std::unique_ptr<Step>($2));
     406        $3->prependStep(std::unique_ptr<WebCore::XPath::Step>($2));
    407407        $3->setAbsolute();
    408         $$ = new XPath::Path(std::unique_ptr<Expression>($1), std::unique_ptr<LocationPath>($3));
     408        $$ = new WebCore::XPath::Path(std::unique_ptr<WebCore::XPath::Expression>($1), std::unique_ptr<WebCore::XPath::LocationPath>($3));
    409409    }
    410410    ;
     
    415415    PrimaryExpr PredicateList
    416416    {
    417         std::unique_ptr<Vector<std::unique_ptr<Expression>>> predicateList($2);
    418         $$ = new Filter(std::unique_ptr<Expression>($1), WTFMove(*predicateList));
     417        std::unique_ptr<Vector<std::unique_ptr<WebCore::XPath::Expression>>> predicateList($2);
     418        $$ = new WebCore::XPath::Filter(std::unique_ptr<WebCore::XPath::Expression>($1), WTFMove(*predicateList));
    419419    }
    420420    ;
     
    425425    OrExpr OR AndExpr
    426426    {
    427         $$ = new LogicalOp(LogicalOp::OP_Or, std::unique_ptr<Expression>($1), std::unique_ptr<Expression>($3));
     427        $$ = new WebCore::XPath::LogicalOp(WebCore::XPath::LogicalOp::OP_Or, std::unique_ptr<WebCore::XPath::Expression>($1), std::unique_ptr<WebCore::XPath::Expression>($3));
    428428    }
    429429    ;
     
    434434    AndExpr AND EqualityExpr
    435435    {
    436         $$ = new LogicalOp(LogicalOp::OP_And, std::unique_ptr<Expression>($1), std::unique_ptr<Expression>($3));
     436        $$ = new WebCore::XPath::LogicalOp(WebCore::XPath::LogicalOp::OP_And, std::unique_ptr<WebCore::XPath::Expression>($1), std::unique_ptr<WebCore::XPath::Expression>($3));
    437437    }
    438438    ;
     
    443443    EqualityExpr EQOP RelationalExpr
    444444    {
    445         $$ = new EqTestOp($2, std::unique_ptr<Expression>($1), std::unique_ptr<Expression>($3));
     445        $$ = new WebCore::XPath::EqTestOp($2, std::unique_ptr<WebCore::XPath::Expression>($1), std::unique_ptr<WebCore::XPath::Expression>($3));
    446446    }
    447447    ;
     
    452452    RelationalExpr RELOP AdditiveExpr
    453453    {
    454         $$ = new EqTestOp($2, std::unique_ptr<Expression>($1), std::unique_ptr<Expression>($3));
     454        $$ = new WebCore::XPath::EqTestOp($2, std::unique_ptr<WebCore::XPath::Expression>($1), std::unique_ptr<WebCore::XPath::Expression>($3));
    455455    }
    456456    ;
     
    461461    AdditiveExpr PLUS MultiplicativeExpr
    462462    {
    463         $$ = new NumericOp(NumericOp::OP_Add, std::unique_ptr<Expression>($1), std::unique_ptr<Expression>($3));
     463        $$ = new WebCore::XPath::NumericOp(WebCore::XPath::NumericOp::OP_Add, std::unique_ptr<WebCore::XPath::Expression>($1), std::unique_ptr<WebCore::XPath::Expression>($3));
    464464    }
    465465    |
    466466    AdditiveExpr MINUS MultiplicativeExpr
    467467    {
    468         $$ = new NumericOp(NumericOp::OP_Sub, std::unique_ptr<Expression>($1), std::unique_ptr<Expression>($3));
     468        $$ = new WebCore::XPath::NumericOp(WebCore::XPath::NumericOp::OP_Sub, std::unique_ptr<WebCore::XPath::Expression>($1), std::unique_ptr<WebCore::XPath::Expression>($3));
    469469    }
    470470    ;
     
    475475    MultiplicativeExpr MULOP UnaryExpr
    476476    {
    477         $$ = new NumericOp($2, std::unique_ptr<Expression>($1), std::unique_ptr<Expression>($3));
     477        $$ = new WebCore::XPath::NumericOp($2, std::unique_ptr<WebCore::XPath::Expression>($1), std::unique_ptr<WebCore::XPath::Expression>($3));
    478478    }
    479479    ;
     
    484484    MINUS UnaryExpr
    485485    {
    486         $$ = new Negative(std::unique_ptr<Expression>($2));
     486        $$ = new WebCore::XPath::Negative(std::unique_ptr<WebCore::XPath::Expression>($2));
    487487    }
    488488    ;
Note: See TracChangeset for help on using the changeset viewer.