Changeset 284420 in webkit
- Timestamp:
- Oct 18, 2021, 5:49:27 PM (3 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/Source/WebCore/ChangeLog ¶
r284406 r284420 1 2021-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 1 19 2021-10-18 Chris Dumez <cdumez@apple.com> 2 20 -
TabularUnified trunk/Source/WebCore/xml/XPathGrammar.cpp ¶
-
Property allow-tabs
set to
1
r283635 r284420 1 1 /* 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 3 3 */ 4 4 … … 127 127 128 128 129 129 130 /* Copy the first part of user declarations. */ 130 #line 28 " WebCore/xml/XPathGrammar.y"131 #line 28 "XPathGrammar.y" 131 132 132 133 … … 139 140 #include "XPathVariableReference.h" 140 141 141 142 142 #if COMPILER(MSVC) 143 143 // See https://msdn.microsoft.com/en-us/library/1wea5zwe.aspx … … 153 153 #define YYMAXDEPTH 10000 154 154 155 using namespace WebCore;156 using namespace XPath;157 155 158 156 … … 177 175 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED 178 176 typedef union YYSTYPE 179 #line 60 "WebCore/xml/XPathGrammar.y"177 #line 57 "XPathGrammar.y" 180 178 { 181 179 WebCore::XPath::NumericOp::Opcode numericOpcode; … … 190 188 } 191 189 /* Line 193 of yacc.c. */ 192 #line 1 90 "./XPathGrammar.cpp"193 190 #line 187 "XPathGrammar.cpp" 191 YYSTYPE; 194 192 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ 195 193 # define YYSTYPE_IS_DECLARED 1 … … 200 198 201 199 /* Copy the second part of user declarations. */ 202 #line 10 4 "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 203 static int xpathyylex(YYSTYPE* yylval, WebCore::XPath::Parser& parser) { return parser.lex(*yylval); } 204 static void xpathyyerror(WebCore::XPath::Parser&, const char*) { } 207 205 208 206 209 207 210 208 /* Line 216 of yacc.c. */ 211 #line 20 9 "./XPathGrammar.cpp"209 #line 206 "XPathGrammar.cpp" 212 210 213 211 #ifdef short … … 341 339 # if (defined __cplusplus && ! defined _STDLIB_H \ 342 340 && ! ((defined YYMALLOC || defined malloc) \ 343 341 && (defined YYFREE || defined free))) 344 342 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 345 343 # ifndef _STDLIB_H … … 367 365 #if (! defined yyoverflow \ 368 366 && (! defined __cplusplus \ 369 367 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) 370 368 371 369 /* A type that is properly aligned for any stack member. */ … … 392 390 __builtin_memcpy (To, From, (Count) * sizeof (*(From))) 393 391 # 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 } \ 401 399 while (YYID (0)) 402 400 # endif … … 408 406 stack. Advance YYPTR to a properly aligned location for the next 409 407 stack. */ 410 # define YYSTACK_RELOCATE(Stack) 411 do 412 { 413 YYSIZE_T yynewbytes;\414 YYCOPY (&yyptr->Stack, Stack, yysize);\415 Stack = &yyptr->Stack;\416 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 } \ 419 417 while (YYID (0)) 420 418 … … 439 437 #define YYMAXUTOK 278 440 438 441 #define YYTRANSLATE(YYX) 439 #define YYTRANSLATE(YYX) \ 442 440 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) 443 441 … … 516 514 static const yytype_uint16 yyrline[] = 517 515 { 518 0, 11 4, 114, 121, 125, 131, 135, 140, 145, 153,519 15 9, 165, 174, 184, 202, 213, 231, 235, 237, 244,520 24 9, 254, 259, 264, 273, 277, 281, 287, 295, 302,521 30 9, 314, 321, 327, 332, 338, 344, 348, 356, 367,522 37 3, 381, 385, 387, 394, 399, 401, 407, 416, 418,523 42 6, 428, 435, 437, 444, 446, 453, 455, 462, 464,524 46 9, 476, 478, 485, 487516 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 525 523 }; 526 524 #endif … … 534 532 "PLUS", "AND", "OR", "FUNCTIONNAME", "LITERAL", "NAMETEST", "NUMBER", 535 533 "NODETYPE", "VARIABLEREFERENCE", "AXISNAME", "COMMENT", "DOTDOT", "PI", 536 "NODE", "SLASHSLASH", "TEXT ", "XPATH_ERROR", "'/'", "'@'", "'('", "')'",534 "NODE", "SLASHSLASH", "TEXT_", "XPATH_ERROR", "'/'", "'@'", "'('", "')'", 537 535 "'['", "']'", "'.'", "','", "'|'", "$accept", "Top", "Expr", 538 536 "LocationPath", "AbsoluteLocationPath", "RelativeLocationPath", "Step", … … 691 689 }; 692 690 693 #define yyerrok 694 #define yyclearin 695 #define YYEMPTY 696 #define YYEOF 697 698 #define YYACCEPT 699 #define YYABORT 700 #define YYERROR 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 701 699 702 700 … … 705 703 Once GCC version 2 has supplanted version 1, this can go. */ 706 704 707 #define YYFAIL 705 #define YYFAIL goto yyerrlab 708 706 709 707 #define YYRECOVERING() (!!yyerrstatus) 710 708 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) \ 710 do \ 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 { \ 723 721 yyerror (parser, YY_("syntax error: cannot back up")); \ 724 YYERROR; 725 } 722 YYERROR; \ 723 } \ 726 724 while (YYID (0)) 727 725 728 726 729 #define YYTERROR 730 #define YYERRCODE 727 #define YYTERROR 1 728 #define YYERRCODE 256 731 729 732 730 … … 737 735 #define YYRHSLOC(Rhs, K) ((Rhs)[K]) 738 736 #ifndef YYLLOC_DEFAULT 739 # define YYLLOC_DEFAULT(Current, Rhs, N) 740 do 737 # define YYLLOC_DEFAULT(Current, Rhs, N) \ 738 do \ 741 739 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 } \ 755 753 while (YYID (0)) 756 754 #endif … … 763 761 #ifndef YY_LOCATION_PRINT 764 762 # 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 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) 769 767 # else 770 768 # define YY_LOCATION_PRINT(File, Loc) ((void) 0) … … 789 787 # endif 790 788 791 # define YYDPRINTF(Args) 792 do { 793 if (yydebug) 794 YYFPRINTF Args; 789 # define YYDPRINTF(Args) \ 790 do { \ 791 if (yydebug) \ 792 YYFPRINTF Args; \ 795 793 } while (YYID (0)) 796 794 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 804 YYFPRINTF (stderr, "\n"); 805 } 795 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ 796 do { \ 797 if (yydebug) \ 798 { \ 799 YYFPRINTF (stderr, "%s ", Title); \ 800 yy_symbol_print (stderr, \ 801 Type, Value, parser); \ 802 YYFPRINTF (stderr, "\n"); \ 803 } \ 806 804 } while (YYID (0)) 807 805 … … 815 813 || defined __cplusplus || defined _MSC_VER) 816 814 static void 817 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, Parser& parser)815 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, WebCore::XPath::Parser& parser) 818 816 #else 819 817 static void … … 822 820 int yytype; 823 821 YYSTYPE const * const yyvaluep; 824 Parser& parser;822 WebCore::XPath::Parser& parser; 825 823 #endif 826 824 { … … 837 835 { 838 836 default: 839 837 break; 840 838 } 841 839 } … … 849 847 || defined __cplusplus || defined _MSC_VER) 850 848 static void 851 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, Parser& parser)849 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, WebCore::XPath::Parser& parser) 852 850 #else 853 851 static void … … 856 854 int yytype; 857 855 YYSTYPE const * const yyvaluep; 858 Parser& parser;856 WebCore::XPath::Parser& parser; 859 857 #endif 860 858 { … … 890 888 } 891 889 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) \ 891 do { \ 892 if (yydebug) \ 893 yy_stack_print ((Bottom), (Top)); \ 896 894 } while (YYID (0)) 897 895 … … 904 902 || defined __cplusplus || defined _MSC_VER) 905 903 static void 906 yy_reduce_print (YYSTYPE *yyvsp, int yyrule, Parser& parser)904 yy_reduce_print (YYSTYPE *yyvsp, int yyrule, WebCore::XPath::Parser& parser) 907 905 #else 908 906 static void … … 910 908 YYSTYPE *yyvsp; 911 909 int yyrule; 912 Parser& parser;910 WebCore::XPath::Parser& parser; 913 911 #endif 914 912 { … … 917 915 unsigned long int yylno = yyrline[yyrule]; 918 916 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", 919 917 yyrule - 1, yylno); 920 918 /* The symbols being reduced. */ 921 919 for (yyi = 0; yyi < yynrhs; yyi++) … … 923 921 fprintf (stderr, " $%d = ", yyi + 1); 924 922 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], 925 926 923 &(yyvsp[(yyi + 1) - (yynrhs)]) 924 , parser); 927 925 fprintf (stderr, "\n"); 928 926 } 929 927 } 930 928 931 # define YY_REDUCE_PRINT(Rule) 932 do { 933 if (yydebug) 929 # define YY_REDUCE_PRINT(Rule) \ 930 do { \ 931 if (yydebug) \ 934 932 yy_reduce_print (yyvsp, Rule, parser); \ 935 933 } while (YYID (0)) … … 947 945 948 946 /* YYINITDEPTH -- initial size of the parser's stacks. */ 949 #ifndef 947 #ifndef YYINITDEPTH 950 948 # define YYINITDEPTH 200 951 949 #endif … … 1035 1033 1036 1034 for (;;) 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 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 } 1058 1056 do_not_strip_quotes: ; 1059 1057 } … … 1093 1091 # if 0 1094 1092 /* This is so xgettext sees the translatable formats that are 1095 1093 constructed on the fly. */ 1096 1094 YY_("syntax error, unexpected %s"); 1097 1095 YY_("syntax error, unexpected %s, expecting %s"); … … 1106 1104 static char const yyor[] = " or %s"; 1107 1105 char yyformat[sizeof yyunexpected 1108 1109 1110 1106 + sizeof yyexpecting - 1 1107 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) 1108 * (sizeof yyor - 1))]; 1111 1109 char const *yyprefix = yyexpecting; 1112 1110 1113 1111 /* Start YYX at -YYN if negative to avoid negative indexes in 1114 1112 YYCHECK. */ 1115 1113 int yyxbegin = yyn < 0 ? -yyn : 0; 1116 1114 … … 1124 1122 1125 1123 for (yyx = yyxbegin; yyx < yyxend; ++yyx) 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 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 } 1142 1140 1143 1141 yyf = YY_(yyformat); … … 1147 1145 1148 1146 if (yysize_overflow) 1149 1147 return YYSIZE_MAXIMUM; 1150 1148 1151 1149 if (yyresult) 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 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 } 1172 1170 return yysize; 1173 1171 } … … 1185 1183 || defined __cplusplus || defined _MSC_VER) 1186 1184 static void 1187 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, Parser& parser)1185 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, WebCore::XPath::Parser& parser) 1188 1186 #else 1189 1187 static void … … 1192 1190 int yytype; 1193 1191 YYSTYPE *yyvaluep; 1194 Parser& parser;1192 WebCore::XPath::Parser& parser; 1195 1193 #endif 1196 1194 { … … 1205 1203 { 1206 1204 case 10: /* "FUNCTIONNAME" */ 1207 #line 80 "WebCore/xml/XPathGrammar.y"1208 1209 #line 120 5 "./XPathGrammar.cpp"1210 1205 #line 77 "XPathGrammar.y" 1206 { if ((yyvaluep->string)) (yyvaluep->string)->deref(); }; 1207 #line 1202 "XPathGrammar.cpp" 1208 break; 1211 1209 case 11: /* "LITERAL" */ 1212 #line 80 "WebCore/xml/XPathGrammar.y"1213 1214 #line 12 10 "./XPathGrammar.cpp"1215 1210 #line 77 "XPathGrammar.y" 1211 { if ((yyvaluep->string)) (yyvaluep->string)->deref(); }; 1212 #line 1207 "XPathGrammar.cpp" 1213 break; 1216 1214 case 12: /* "NAMETEST" */ 1217 #line 80 "WebCore/xml/XPathGrammar.y"1218 1219 #line 121 5 "./XPathGrammar.cpp"1220 1215 #line 77 "XPathGrammar.y" 1216 { if ((yyvaluep->string)) (yyvaluep->string)->deref(); }; 1217 #line 1212 "XPathGrammar.cpp" 1218 break; 1221 1219 case 13: /* "NUMBER" */ 1222 #line 80 "WebCore/xml/XPathGrammar.y"1223 1224 #line 12 20 "./XPathGrammar.cpp"1225 1220 #line 77 "XPathGrammar.y" 1221 { if ((yyvaluep->string)) (yyvaluep->string)->deref(); }; 1222 #line 1217 "XPathGrammar.cpp" 1223 break; 1226 1224 case 14: /* "NODETYPE" */ 1227 #line 80 "WebCore/xml/XPathGrammar.y"1228 1229 #line 122 5 "./XPathGrammar.cpp"1230 1225 #line 77 "XPathGrammar.y" 1226 { if ((yyvaluep->string)) (yyvaluep->string)->deref(); }; 1227 #line 1222 "XPathGrammar.cpp" 1228 break; 1231 1229 case 15: /* "VARIABLEREFERENCE" */ 1232 #line 80 "WebCore/xml/XPathGrammar.y"1233 1234 #line 12 30 "./XPathGrammar.cpp"1235 1230 #line 77 "XPathGrammar.y" 1231 { if ((yyvaluep->string)) (yyvaluep->string)->deref(); }; 1232 #line 1227 "XPathGrammar.cpp" 1233 break; 1236 1234 case 35: /* "Expr" */ 1237 #line 100 "WebCore/xml/XPathGrammar.y"1238 1239 #line 123 5 "./XPathGrammar.cpp"1240 1235 #line 97 "XPathGrammar.y" 1236 { delete (yyvaluep->expression); }; 1237 #line 1232 "XPathGrammar.cpp" 1238 break; 1241 1239 case 36: /* "LocationPath" */ 1242 #line 8 8 "WebCore/xml/XPathGrammar.y"1243 1244 #line 12 40 "./XPathGrammar.cpp"1245 1240 #line 85 "XPathGrammar.y" 1241 { delete (yyvaluep->locationPath); }; 1242 #line 1237 "XPathGrammar.cpp" 1243 break; 1246 1244 case 37: /* "AbsoluteLocationPath" */ 1247 #line 8 8 "WebCore/xml/XPathGrammar.y"1248 1249 #line 124 5 "./XPathGrammar.cpp"1250 1245 #line 85 "XPathGrammar.y" 1246 { delete (yyvaluep->locationPath); }; 1247 #line 1242 "XPathGrammar.cpp" 1248 break; 1251 1249 case 38: /* "RelativeLocationPath" */ 1252 #line 8 8 "WebCore/xml/XPathGrammar.y"1253 1254 #line 12 50 "./XPathGrammar.cpp"1255 1250 #line 85 "XPathGrammar.y" 1251 { delete (yyvaluep->locationPath); }; 1252 #line 1247 "XPathGrammar.cpp" 1253 break; 1256 1254 case 39: /* "Step" */ 1257 #line 9 7 "WebCore/xml/XPathGrammar.y"1258 1259 #line 125 5 "./XPathGrammar.cpp"1260 1255 #line 94 "XPathGrammar.y" 1256 { delete (yyvaluep->step); }; 1257 #line 1252 "XPathGrammar.cpp" 1258 break; 1261 1259 case 41: /* "NodeTest" */ 1262 #line 91 "WebCore/xml/XPathGrammar.y"1263 1264 #line 12 60 "./XPathGrammar.cpp"1265 1260 #line 88 "XPathGrammar.y" 1261 { delete (yyvaluep->nodeTest); }; 1262 #line 1257 "XPathGrammar.cpp" 1263 break; 1266 1264 case 42: /* "OptionalPredicateList" */ 1267 #line 9 4 "WebCore/xml/XPathGrammar.y"1268 1269 #line 126 5 "./XPathGrammar.cpp"1270 1265 #line 91 "XPathGrammar.y" 1266 { delete (yyvaluep->expressionVector); }; 1267 #line 1262 "XPathGrammar.cpp" 1268 break; 1271 1269 case 43: /* "PredicateList" */ 1272 #line 9 4 "WebCore/xml/XPathGrammar.y"1273 1274 #line 12 70 "./XPathGrammar.cpp"1275 1270 #line 91 "XPathGrammar.y" 1271 { delete (yyvaluep->expressionVector); }; 1272 #line 1267 "XPathGrammar.cpp" 1273 break; 1276 1274 case 44: /* "Predicate" */ 1277 #line 100 "WebCore/xml/XPathGrammar.y"1278 1279 #line 127 5 "./XPathGrammar.cpp"1280 1275 #line 97 "XPathGrammar.y" 1276 { delete (yyvaluep->expression); }; 1277 #line 1272 "XPathGrammar.cpp" 1278 break; 1281 1279 case 45: /* "DescendantOrSelf" */ 1282 #line 9 7 "WebCore/xml/XPathGrammar.y"1283 1284 #line 12 80 "./XPathGrammar.cpp"1285 1280 #line 94 "XPathGrammar.y" 1281 { delete (yyvaluep->step); }; 1282 #line 1277 "XPathGrammar.cpp" 1283 break; 1286 1284 case 46: /* "AbbreviatedStep" */ 1287 #line 9 7 "WebCore/xml/XPathGrammar.y"1288 1289 #line 128 5 "./XPathGrammar.cpp"1290 1285 #line 94 "XPathGrammar.y" 1286 { delete (yyvaluep->step); }; 1287 #line 1282 "XPathGrammar.cpp" 1288 break; 1291 1289 case 47: /* "PrimaryExpr" */ 1292 #line 100 "WebCore/xml/XPathGrammar.y"1293 1294 #line 12 90 "./XPathGrammar.cpp"1295 1290 #line 97 "XPathGrammar.y" 1291 { delete (yyvaluep->expression); }; 1292 #line 1287 "XPathGrammar.cpp" 1293 break; 1296 1294 case 48: /* "FunctionCall" */ 1297 #line 100 "WebCore/xml/XPathGrammar.y"1298 1299 #line 129 5 "./XPathGrammar.cpp"1300 1295 #line 97 "XPathGrammar.y" 1296 { delete (yyvaluep->expression); }; 1297 #line 1292 "XPathGrammar.cpp" 1298 break; 1301 1299 case 49: /* "ArgumentList" */ 1302 #line 9 4 "WebCore/xml/XPathGrammar.y"1303 1304 #line 1 300 "./XPathGrammar.cpp"1305 1300 #line 91 "XPathGrammar.y" 1301 { delete (yyvaluep->expressionVector); }; 1302 #line 1297 "XPathGrammar.cpp" 1303 break; 1306 1304 case 50: /* "Argument" */ 1307 #line 100 "WebCore/xml/XPathGrammar.y"1308 1309 #line 130 5 "./XPathGrammar.cpp"1310 1305 #line 97 "XPathGrammar.y" 1306 { delete (yyvaluep->expression); }; 1307 #line 1302 "XPathGrammar.cpp" 1308 break; 1311 1309 case 51: /* "UnionExpr" */ 1312 #line 100 "WebCore/xml/XPathGrammar.y"1313 1314 #line 13 10 "./XPathGrammar.cpp"1315 1310 #line 97 "XPathGrammar.y" 1311 { delete (yyvaluep->expression); }; 1312 #line 1307 "XPathGrammar.cpp" 1313 break; 1316 1314 case 52: /* "PathExpr" */ 1317 #line 100 "WebCore/xml/XPathGrammar.y"1318 1319 #line 131 5 "./XPathGrammar.cpp"1320 1315 #line 97 "XPathGrammar.y" 1316 { delete (yyvaluep->expression); }; 1317 #line 1312 "XPathGrammar.cpp" 1318 break; 1321 1319 case 53: /* "FilterExpr" */ 1322 #line 100 "WebCore/xml/XPathGrammar.y"1323 1324 #line 13 20 "./XPathGrammar.cpp"1325 1320 #line 97 "XPathGrammar.y" 1321 { delete (yyvaluep->expression); }; 1322 #line 1317 "XPathGrammar.cpp" 1323 break; 1326 1324 case 54: /* "OrExpr" */ 1327 #line 100 "WebCore/xml/XPathGrammar.y"1328 1329 #line 132 5 "./XPathGrammar.cpp"1330 1325 #line 97 "XPathGrammar.y" 1326 { delete (yyvaluep->expression); }; 1327 #line 1322 "XPathGrammar.cpp" 1328 break; 1331 1329 case 55: /* "AndExpr" */ 1332 #line 100 "WebCore/xml/XPathGrammar.y"1333 1334 #line 13 30 "./XPathGrammar.cpp"1335 1330 #line 97 "XPathGrammar.y" 1331 { delete (yyvaluep->expression); }; 1332 #line 1327 "XPathGrammar.cpp" 1333 break; 1336 1334 case 56: /* "EqualityExpr" */ 1337 #line 100 "WebCore/xml/XPathGrammar.y"1338 1339 #line 133 5 "./XPathGrammar.cpp"1340 1335 #line 97 "XPathGrammar.y" 1336 { delete (yyvaluep->expression); }; 1337 #line 1332 "XPathGrammar.cpp" 1338 break; 1341 1339 case 57: /* "RelationalExpr" */ 1342 #line 100 "WebCore/xml/XPathGrammar.y"1343 1344 #line 13 40 "./XPathGrammar.cpp"1345 1340 #line 97 "XPathGrammar.y" 1341 { delete (yyvaluep->expression); }; 1342 #line 1337 "XPathGrammar.cpp" 1343 break; 1346 1344 case 58: /* "AdditiveExpr" */ 1347 #line 100 "WebCore/xml/XPathGrammar.y"1348 1349 #line 134 5 "./XPathGrammar.cpp"1350 1345 #line 97 "XPathGrammar.y" 1346 { delete (yyvaluep->expression); }; 1347 #line 1342 "XPathGrammar.cpp" 1348 break; 1351 1349 case 59: /* "MultiplicativeExpr" */ 1352 #line 100 "WebCore/xml/XPathGrammar.y"1353 1354 #line 13 50 "./XPathGrammar.cpp"1355 1350 #line 97 "XPathGrammar.y" 1351 { delete (yyvaluep->expression); }; 1352 #line 1347 "XPathGrammar.cpp" 1353 break; 1356 1354 case 60: /* "UnaryExpr" */ 1357 #line 100 "WebCore/xml/XPathGrammar.y"1358 1359 #line 135 5 "./XPathGrammar.cpp"1360 1355 #line 97 "XPathGrammar.y" 1356 { delete (yyvaluep->expression); }; 1357 #line 1352 "XPathGrammar.cpp" 1358 break; 1361 1359 1362 1360 default: 1363 1361 break; 1364 1362 } 1365 1363 } … … 1377 1375 #else /* ! YYPARSE_PARAM */ 1378 1376 #if defined __STDC__ || defined __cplusplus 1379 int yyparse ( Parser& parser);1377 int yyparse (WebCore::XPath::Parser& parser); 1380 1378 #else 1381 1379 int yyparse (); … … 1406 1404 || defined __cplusplus || defined _MSC_VER) 1407 1405 int 1408 yyparse ( Parser& parser)1406 yyparse (WebCore::XPath::Parser& parser) 1409 1407 #else 1410 1408 int 1411 1409 yyparse (parser) 1412 Parser& parser;1410 WebCore::XPath::Parser& parser; 1413 1411 #endif 1414 1412 #endif … … 1475 1473 yyerrstatus = 0; 1476 1474 yynerrs = 0; 1477 yychar = YYEMPTY; 1475 yychar = YYEMPTY; /* Cause a token to be read. */ 1478 1476 1479 1477 /* Initialize stack pointers. … … 1505 1503 #ifdef yyoverflow 1506 1504 { 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 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; 1526 1524 } 1527 1525 #else /* no yyoverflow */ … … 1531 1529 /* Extend the stack our own way. */ 1532 1530 if (YYMAXDEPTH <= yystacksize) 1533 1531 goto yyexhaustedlab; 1534 1532 yystacksize *= 2; 1535 1533 if (YYMAXDEPTH < yystacksize) 1536 1534 yystacksize = YYMAXDEPTH; 1537 1535 1538 1536 { 1539 1540 1541 1542 1543 1544 1545 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); 1546 1544 1547 1545 # undef YYSTACK_RELOCATE 1548 1549 1546 if (yyss1 != yyssa) 1547 YYSTACK_FREE (yyss1); 1550 1548 } 1551 1549 # endif … … 1557 1555 1558 1556 YYDPRINTF ((stderr, "Stack size increased to %lu\n", 1559 1557 (unsigned long int) yystacksize)); 1560 1558 1561 1559 if (yyss + yystacksize - 1 <= yyssp) 1562 1560 YYABORT; 1563 1561 } 1564 1562 … … 1609 1607 { 1610 1608 if (yyn == 0 || yyn == YYTABLE_NINF) 1611 1609 goto yyerrlab; 1612 1610 yyn = -yyn; 1613 1611 goto yyreduce; … … 1667 1665 { 1668 1666 case 2: 1669 #line 11 5 "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))); 1672 1670 ;} 1673 1671 break; 1674 1672 1675 1673 case 4: 1676 #line 12 6 "WebCore/xml/XPathGrammar.y"1674 #line 123 "XPathGrammar.y" 1677 1675 { 1678 1676 (yyval.locationPath) = (yyvsp[(1) - (1)].locationPath); … … 1682 1680 1683 1681 case 6: 1684 #line 13 6 "WebCore/xml/XPathGrammar.y"1685 { 1686 (yyval.locationPath) = new LocationPath;1682 #line 133 "XPathGrammar.y" 1683 { 1684 (yyval.locationPath) = new WebCore::XPath::LocationPath; 1687 1685 ;} 1688 1686 break; 1689 1687 1690 1688 case 7: 1691 #line 1 41 "WebCore/xml/XPathGrammar.y"1689 #line 138 "XPathGrammar.y" 1692 1690 { 1693 1691 (yyval.locationPath) = (yyvsp[(2) - (2)].locationPath); … … 1696 1694 1697 1695 case 8: 1698 #line 14 6 "WebCore/xml/XPathGrammar.y"1696 #line 143 "XPathGrammar.y" 1699 1697 { 1700 1698 (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))); 1702 1700 ;} 1703 1701 break; 1704 1702 1705 1703 case 9: 1706 #line 15 4 "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))); 1710 1708 ;} 1711 1709 break; 1712 1710 1713 1711 case 10: 1714 #line 1 60 "WebCore/xml/XPathGrammar.y"1712 #line 157 "XPathGrammar.y" 1715 1713 { 1716 1714 (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))); 1718 1716 ;} 1719 1717 break; 1720 1718 1721 1719 case 11: 1722 #line 16 6 "WebCore/xml/XPathGrammar.y"1720 #line 163 "XPathGrammar.y" 1723 1721 { 1724 1722 (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))); 1727 1725 ;} 1728 1726 break; 1729 1727 1730 1728 case 12: 1731 #line 17 5 "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)); 1735 1733 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)); 1737 1735 else 1738 (yyval.step) = new Step(Step::ChildAxis, WTFMove(*nodeTest));1736 (yyval.step) = new WebCore::XPath::Step(WebCore::XPath::Step::ChildAxis, WTFMove(*nodeTest)); 1739 1737 ;} 1740 1738 break; 1741 1739 1742 1740 case 13: 1743 #line 18 5 "WebCore/xml/XPathGrammar.y"1741 #line 182 "XPathGrammar.y" 1744 1742 { 1745 1743 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)); 1747 1745 1748 1746 String localName; … … 1754 1752 1755 1753 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)); 1757 1755 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)); 1759 1757 ;} 1760 1758 break; 1761 1759 1762 1760 case 14: 1763 #line 20 3 "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)); 1767 1765 1768 1766 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)); 1770 1768 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)); 1772 1770 ;} 1773 1771 break; 1774 1772 1775 1773 case 15: 1776 #line 21 4 "WebCore/xml/XPathGrammar.y"1774 #line 211 "XPathGrammar.y" 1777 1775 { 1778 1776 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)); 1780 1778 1781 1779 String localName; … … 1787 1785 1788 1786 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)); 1790 1788 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)); 1792 1790 ;} 1793 1791 break; 1794 1792 1795 1793 case 18: 1796 #line 23 8 "WebCore/xml/XPathGrammar.y"1797 { 1798 (yyval.axis) = Step::AttributeAxis;1794 #line 235 "XPathGrammar.y" 1795 { 1796 (yyval.axis) = WebCore::XPath::Step::AttributeAxis; 1799 1797 ;} 1800 1798 break; 1801 1799 1802 1800 case 19: 1803 #line 24 5 "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); 1806 1804 ;} 1807 1805 break; 1808 1806 1809 1807 case 20: 1810 #line 2 50 "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); 1813 1811 ;} 1814 1812 break; 1815 1813 1816 1814 case 21: 1817 #line 25 5 "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); 1820 1818 ;} 1821 1819 break; 1822 1820 1823 1821 case 22: 1824 #line 2 60 "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); 1827 1825 ;} 1828 1826 break; 1829 1827 1830 1828 case 23: 1831 #line 26 5 "WebCore/xml/XPathGrammar.y"1829 #line 262 "XPathGrammar.y" 1832 1830 { 1833 1831 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()); 1835 1833 ;} 1836 1834 break; 1837 1835 1838 1836 case 24: 1839 #line 27 3 "WebCore/xml/XPathGrammar.y"1837 #line 270 "XPathGrammar.y" 1840 1838 { 1841 1839 (yyval.expressionVector) = nullptr; … … 1844 1842 1845 1843 case 26: 1846 #line 2 82 "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))); 1850 1848 ;} 1851 1849 break; 1852 1850 1853 1851 case 27: 1854 #line 28 8 "WebCore/xml/XPathGrammar.y"1852 #line 285 "XPathGrammar.y" 1855 1853 { 1856 1854 (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))); 1858 1856 ;} 1859 1857 break; 1860 1858 1861 1859 case 28: 1862 #line 29 6 "WebCore/xml/XPathGrammar.y"1860 #line 293 "XPathGrammar.y" 1863 1861 { 1864 1862 (yyval.expression) = (yyvsp[(2) - (3)].expression); … … 1867 1865 1868 1866 case 29: 1869 #line 30 3 "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)); 1872 1870 ;} 1873 1871 break; 1874 1872 1875 1873 case 30: 1876 #line 3 10 "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)); 1879 1877 ;} 1880 1878 break; 1881 1879 1882 1880 case 31: 1883 #line 31 5 "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)); 1886 1884 ;} 1887 1885 break; 1888 1886 1889 1887 case 32: 1890 #line 3 22 "WebCore/xml/XPathGrammar.y"1888 #line 319 "XPathGrammar.y" 1891 1889 { 1892 1890 String name = adoptRef((yyvsp[(1) - (1)].string)); 1893 (yyval.expression) = new VariableReference(name);1891 (yyval.expression) = new WebCore::XPath::VariableReference(name); 1894 1892 ;} 1895 1893 break; 1896 1894 1897 1895 case 33: 1898 #line 32 8 "WebCore/xml/XPathGrammar.y"1896 #line 325 "XPathGrammar.y" 1899 1897 { 1900 1898 (yyval.expression) = (yyvsp[(2) - (3)].expression); … … 1903 1901 1904 1902 case 34: 1905 #line 33 3 "WebCore/xml/XPathGrammar.y"1903 #line 330 "XPathGrammar.y" 1906 1904 { 1907 1905 String literal = adoptRef((yyvsp[(1) - (1)].string)); 1908 (yyval.expression) = new StringExpression(WTFMove(literal));1906 (yyval.expression) = new WebCore::XPath::StringExpression(WTFMove(literal)); 1909 1907 ;} 1910 1908 break; 1911 1909 1912 1910 case 35: 1913 #line 33 9 "WebCore/xml/XPathGrammar.y"1911 #line 336 "XPathGrammar.y" 1914 1912 { 1915 1913 String numeral = adoptRef((yyvsp[(1) - (1)].string)); 1916 (yyval.expression) = new Number(numeral.toDouble());1914 (yyval.expression) = new WebCore::XPath::Number(numeral.toDouble()); 1917 1915 ;} 1918 1916 break; 1919 1917 1920 1918 case 37: 1921 #line 34 9 "WebCore/xml/XPathGrammar.y"1919 #line 346 "XPathGrammar.y" 1922 1920 { 1923 1921 String name = adoptRef((yyvsp[(1) - (3)].string)); 1924 (yyval.expression) = XPath::Function::create(name).release();1922 (yyval.expression) = WebCore::XPath::Function::create(name).release(); 1925 1923 if (!(yyval.expression)) 1926 1924 YYABORT; … … 1929 1927 1930 1928 case 38: 1931 #line 35 7 "WebCore/xml/XPathGrammar.y"1929 #line 354 "XPathGrammar.y" 1932 1930 { 1933 1931 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(); 1936 1934 if (!(yyval.expression)) 1937 1935 YYABORT; … … 1940 1938 1941 1939 case 39: 1942 #line 36 8 "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))); 1946 1944 ;} 1947 1945 break; 1948 1946 1949 1947 case 40: 1950 #line 37 4 "WebCore/xml/XPathGrammar.y"1948 #line 371 "XPathGrammar.y" 1951 1949 { 1952 1950 (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))); 1954 1952 ;} 1955 1953 break; 1956 1954 1957 1955 case 43: 1958 #line 38 8 "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))); 1961 1959 ;} 1962 1960 break; 1963 1961 1964 1962 case 44: 1965 #line 39 5 "WebCore/xml/XPathGrammar.y"1963 #line 392 "XPathGrammar.y" 1966 1964 { 1967 1965 (yyval.expression) = (yyvsp[(1) - (1)].locationPath); … … 1970 1968 1971 1969 case 46: 1972 #line 402 "WebCore/xml/XPathGrammar.y"1970 #line 399 "XPathGrammar.y" 1973 1971 { 1974 1972 (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))); 1976 1974 ;} 1977 1975 break; 1978 1976 1979 1977 case 47: 1980 #line 40 8 "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))); 1983 1981 (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))); 1985 1983 ;} 1986 1984 break; 1987 1985 1988 1986 case 49: 1989 #line 41 9 "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)); 1993 1991 ;} 1994 1992 break; 1995 1993 1996 1994 case 51: 1997 #line 42 9 "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))); 2000 1998 ;} 2001 1999 break; 2002 2000 2003 2001 case 53: 2004 #line 43 8 "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))); 2007 2005 ;} 2008 2006 break; 2009 2007 2010 2008 case 55: 2011 #line 44 7 "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))); 2014 2012 ;} 2015 2013 break; 2016 2014 2017 2015 case 57: 2018 #line 45 6 "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))); 2021 2019 ;} 2022 2020 break; 2023 2021 2024 2022 case 59: 2025 #line 46 5 "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))); 2028 2026 ;} 2029 2027 break; 2030 2028 2031 2029 case 60: 2032 #line 4 70 "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))); 2035 2033 ;} 2036 2034 break; 2037 2035 2038 2036 case 62: 2039 #line 47 9 "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))); 2042 2040 ;} 2043 2041 break; 2044 2042 2045 2043 case 64: 2046 #line 48 8 "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))); 2049 2047 ;} 2050 2048 break; … … 2052 2050 2053 2051 /* Line 1267 of yacc.c. */ 2054 #line 204 9 "./XPathGrammar.cpp"2052 #line 2046 "XPathGrammar.cpp" 2055 2053 default: break; 2056 2054 } … … 2091 2089 #else 2092 2090 { 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 } 2109 2120 } 2110 2111 if (0 < yysize && yysize <= yymsg_alloc)2112 {2113 (void) yysyntax_error (yymsg, yystate, yychar);2114 yyerror (parser, yymsg);2115 }2116 else2117 {2118 yyerror (parser, YY_("syntax error"));2119 if (yysize != 0)2120 goto yyexhaustedlab;2121 }2122 }2123 2121 #endif 2124 2122 } … … 2129 2127 { 2130 2128 /* If just tried and failed to reuse look-ahead token after an 2131 2129 error, discard it. */ 2132 2130 2133 2131 if (yychar <= YYEOF) 2134 2135 2136 2137 2138 2132 { 2133 /* Return failure if at end of input. */ 2134 if (yychar == YYEOF) 2135 YYABORT; 2136 } 2139 2137 else 2140 2141 2142 2143 2144 2138 { 2139 yydestruct ("Error: discarding", 2140 yytoken, &yylval, parser); 2141 yychar = YYEMPTY; 2142 } 2145 2143 } 2146 2144 … … 2176 2174 `-------------------------------------------------------------*/ 2177 2175 yyerrlab1: 2178 yyerrstatus = 3; 2176 yyerrstatus = 3; /* Each real token shifted decrements this. */ 2179 2177 2180 2178 for (;;) … … 2182 2180 yyn = yypact[yystate]; 2183 2181 if (yyn != YYPACT_NINF) 2184 2185 2186 2187 2188 2189 2190 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 } 2193 2191 2194 2192 /* Pop the current state because it cannot handle the error token. */ 2195 2193 if (yyssp == yyss) 2196 2194 YYABORT; 2197 2195 2198 2196 2199 2197 yydestruct ("Error: popping", 2200 2198 yystos[yystate], yyvsp, parser); 2201 2199 YYPOPSTACK (1); 2202 2200 yystate = *yyssp; … … 2244 2242 if (yychar != YYEOF && yychar != YYEMPTY) 2245 2243 yydestruct ("Cleanup: discarding lookahead", 2246 2244 yytoken, &yylval, parser); 2247 2245 /* Do not reclaim the symbols of the rule which action triggered 2248 2246 this YYABORT or YYACCEPT. */ … … 2252 2250 { 2253 2251 yydestruct ("Cleanup: popping", 2254 2252 yystos[*yyssp], yyvsp, parser); 2255 2253 YYPOPSTACK (1); 2256 2254 } … … 2268 2266 2269 2267 2270 #line 49 3 "WebCore/xml/XPathGrammar.y"2271 2272 2268 #line 490 "XPathGrammar.y" 2269 2270 -
Property allow-tabs
set to
-
TabularUnified trunk/Source/WebCore/xml/XPathGrammar.y ¶
r283636 r284420 53 53 %pure-parser 54 54 %lex-param { parser } 55 %parse-param { Parser& parser }55 %parse-param { WebCore::XPath::Parser& parser } 56 56 57 57 %union { … … 101 101 %{ 102 102 103 static int xpathyylex(YYSTYPE* yylval, Parser& parser) { return parser.lex(*yylval); }104 static void xpathyyerror( Parser&, const char*) { }103 static int xpathyylex(YYSTYPE* yylval, WebCore::XPath::Parser& parser) { return parser.lex(*yylval); } 104 static void xpathyyerror(WebCore::XPath::Parser&, const char*) { } 105 105 106 106 %} … … 111 111 Expr 112 112 { 113 parser.setParseResult(std::unique_ptr< Expression>($1));113 parser.setParseResult(std::unique_ptr<WebCore::XPath::Expression>($1)); 114 114 } 115 115 ; … … 132 132 '/' 133 133 { 134 $$ = new LocationPath;134 $$ = new WebCore::XPath::LocationPath; 135 135 } 136 136 | … … 143 143 { 144 144 $$ = $2; 145 $$->prependStep(std::unique_ptr< Step>($1));145 $$->prependStep(std::unique_ptr<WebCore::XPath::Step>($1)); 146 146 } 147 147 ; … … 150 150 Step 151 151 { 152 $$ = new LocationPath;153 $$->appendStep(std::unique_ptr< Step>($1));152 $$ = new WebCore::XPath::LocationPath; 153 $$->appendStep(std::unique_ptr<WebCore::XPath::Step>($1)); 154 154 } 155 155 | … … 157 157 { 158 158 $$ = $1; 159 $$->appendStep(std::unique_ptr< Step>($3));159 $$->appendStep(std::unique_ptr<WebCore::XPath::Step>($3)); 160 160 } 161 161 | … … 163 163 { 164 164 $$ = $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)); 167 167 } 168 168 ; … … 171 171 NodeTest OptionalPredicateList 172 172 { 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); 175 175 if (predicateList) 176 $$ = new Step(Step::ChildAxis, WTFMove(*nodeTest), WTFMove(*predicateList));176 $$ = new WebCore::XPath::Step(WebCore::XPath::Step::ChildAxis, WTFMove(*nodeTest), WTFMove(*predicateList)); 177 177 else 178 $$ = new Step(Step::ChildAxis, WTFMove(*nodeTest));178 $$ = new WebCore::XPath::Step(WebCore::XPath::Step::ChildAxis, WTFMove(*nodeTest)); 179 179 } 180 180 | … … 182 182 { 183 183 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); 185 185 186 186 String localName; … … 192 192 193 193 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)); 195 195 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)); 197 197 } 198 198 | 199 199 AxisSpecifier NodeTest OptionalPredicateList 200 200 { 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); 203 203 204 204 if (predicateList) 205 $$ = new Step($1, WTFMove(*nodeTest), WTFMove(*predicateList));205 $$ = new WebCore::XPath::Step($1, WTFMove(*nodeTest), WTFMove(*predicateList)); 206 206 else 207 $$ = new Step($1, WTFMove(*nodeTest));207 $$ = new WebCore::XPath::Step($1, WTFMove(*nodeTest)); 208 208 } 209 209 | … … 211 211 { 212 212 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); 214 214 215 215 String localName; … … 221 221 222 222 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)); 224 224 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)); 226 226 } 227 227 | … … 234 234 '@' 235 235 { 236 $$ = Step::AttributeAxis;236 $$ = WebCore::XPath::Step::AttributeAxis; 237 237 } 238 238 ; … … 241 241 NODE '(' ')' 242 242 { 243 $$ = new Step::NodeTest(Step::NodeTest::AnyNodeTest);243 $$ = new WebCore::XPath::Step::NodeTest(WebCore::XPath::Step::NodeTest::AnyNodeTest); 244 244 } 245 245 | 246 246 TEXT_ '(' ')' 247 247 { 248 $$ = new Step::NodeTest(Step::NodeTest::TextNodeTest);248 $$ = new WebCore::XPath::Step::NodeTest(WebCore::XPath::Step::NodeTest::TextNodeTest); 249 249 } 250 250 | 251 251 COMMENT '(' ')' 252 252 { 253 $$ = new Step::NodeTest(Step::NodeTest::CommentNodeTest);253 $$ = new WebCore::XPath::Step::NodeTest(WebCore::XPath::Step::NodeTest::CommentNodeTest); 254 254 } 255 255 | 256 256 PI '(' ')' 257 257 { 258 $$ = new Step::NodeTest(Step::NodeTest::ProcessingInstructionNodeTest);258 $$ = new WebCore::XPath::Step::NodeTest(WebCore::XPath::Step::NodeTest::ProcessingInstructionNodeTest); 259 259 } 260 260 | … … 262 262 { 263 263 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()); 265 265 } 266 266 ; … … 278 278 Predicate 279 279 { 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)); 282 282 } 283 283 | … … 285 285 { 286 286 $$ = $1; 287 $$->append(std::unique_ptr< Expression>($2));287 $$->append(std::unique_ptr<WebCore::XPath::Expression>($2)); 288 288 } 289 289 ; … … 299 299 SLASHSLASH 300 300 { 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)); 302 302 } 303 303 ; … … 306 306 '.' 307 307 { 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)); 309 309 } 310 310 | 311 311 DOTDOT 312 312 { 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)); 314 314 } 315 315 ; … … 319 319 { 320 320 String name = adoptRef($1); 321 $$ = new VariableReference(name);321 $$ = new WebCore::XPath::VariableReference(name); 322 322 } 323 323 | … … 330 330 { 331 331 String literal = adoptRef($1); 332 $$ = new StringExpression(WTFMove(literal));332 $$ = new WebCore::XPath::StringExpression(WTFMove(literal)); 333 333 } 334 334 | … … 336 336 { 337 337 String numeral = adoptRef($1); 338 $$ = new Number(numeral.toDouble());338 $$ = new WebCore::XPath::Number(numeral.toDouble()); 339 339 } 340 340 | … … 346 346 { 347 347 String name = adoptRef($1); 348 $$ = XPath::Function::create(name).release();348 $$ = WebCore::XPath::Function::create(name).release(); 349 349 if (!$$) 350 350 YYABORT; … … 354 354 { 355 355 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(); 358 358 if (!$$) 359 359 YYABORT; … … 364 364 Argument 365 365 { 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)); 368 368 } 369 369 | … … 371 371 { 372 372 $$ = $1; 373 $$->append(std::unique_ptr< Expression>($3));373 $$->append(std::unique_ptr<WebCore::XPath::Expression>($3)); 374 374 } 375 375 ; … … 384 384 UnionExpr '|' PathExpr 385 385 { 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)); 387 387 } 388 388 ; … … 399 399 { 400 400 $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)); 402 402 } 403 403 | 404 404 FilterExpr DescendantOrSelf RelativeLocationPath 405 405 { 406 $3->prependStep(std::unique_ptr< Step>($2));406 $3->prependStep(std::unique_ptr<WebCore::XPath::Step>($2)); 407 407 $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)); 409 409 } 410 410 ; … … 415 415 PrimaryExpr PredicateList 416 416 { 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)); 419 419 } 420 420 ; … … 425 425 OrExpr OR AndExpr 426 426 { 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)); 428 428 } 429 429 ; … … 434 434 AndExpr AND EqualityExpr 435 435 { 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)); 437 437 } 438 438 ; … … 443 443 EqualityExpr EQOP RelationalExpr 444 444 { 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)); 446 446 } 447 447 ; … … 452 452 RelationalExpr RELOP AdditiveExpr 453 453 { 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)); 455 455 } 456 456 ; … … 461 461 AdditiveExpr PLUS MultiplicativeExpr 462 462 { 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)); 464 464 } 465 465 | 466 466 AdditiveExpr MINUS MultiplicativeExpr 467 467 { 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)); 469 469 } 470 470 ; … … 475 475 MultiplicativeExpr MULOP UnaryExpr 476 476 { 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)); 478 478 } 479 479 ; … … 484 484 MINUS UnaryExpr 485 485 { 486 $$ = new Negative(std::unique_ptr<Expression>($2));486 $$ = new WebCore::XPath::Negative(std::unique_ptr<WebCore::XPath::Expression>($2)); 487 487 } 488 488 ;
Note:
See TracChangeset
for help on using the changeset viewer.