wok rev 14340
webkit-r: bison 2.6 fix
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun Apr 14 02:26:18 2013 +0200 (2013-04-14) |
parents | ed5dd1053ab1 |
children | 2c8329f6a9b4 |
files | webkit-r/receipt webkit-r/stuff/bison26.u |
line diff
1.1 --- a/webkit-r/receipt Sat Apr 13 21:37:35 2013 +0200 1.2 +++ b/webkit-r/receipt Sun Apr 14 02:26:18 2013 +0200 1.3 @@ -23,7 +23,7 @@ 1.4 { 1.5 mv WebKit-r${VERSION} $PACKAGE-$VERSION 2>/dev/null 1.6 cd $src 1.7 - sed -i 's/xpathyyparse(.*)/xpathyyparse()/' Source/WebCore/xml/XPathParser.cpp 1.8 + patch -p0 < $stuff/bison26.u 1.9 ./autogen.sh \ 1.10 --prefix=/usr \ 1.11 --mandir=/usr/share/man \
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/webkit-r/stuff/bison26.u Sun Apr 14 02:26:18 2013 +0200 2.3 @@ -0,0 +1,540 @@ 2.4 +--- Source/WebCore/css/CSSGrammar.y 2.5 ++++ Source/WebCore/css/CSSGrammar.y 2.6 +@@ -53,14 +53,13 @@ 2.7 + #define YYMAXDEPTH 10000 2.8 + #define YYDEBUG 0 2.9 + 2.10 +-// FIXME: Replace with %parse-param { CSSParser* parser } once we can depend on bison 2.x 2.11 +-#define YYPARSE_PARAM parser 2.12 +-#define YYLEX_PARAM parser 2.13 +- 2.14 + %} 2.15 + 2.16 + %pure_parser 2.17 + 2.18 ++%parse-param { CSSParser* parser } 2.19 ++%lex-param { CSSParser* parser } 2.20 ++ 2.21 + %union { 2.22 + bool boolean; 2.23 + char character; 2.24 +@@ -88,7 +87,7 @@ 2.25 + 2.26 + %{ 2.27 + 2.28 +-static inline int cssyyerror(const char*) 2.29 ++static inline int cssyyerror(void*, const char*) 2.30 + { 2.31 + return 1; 2.32 + } 2.33 +--- Source/WebCore/css/CSSParser.cpp 2.34 ++++ Source/WebCore/css/CSSParser.cpp 2.35 +@@ -96,7 +96,7 @@ 2.36 + extern int cssyydebug; 2.37 + #endif 2.38 + 2.39 +-extern int cssyyparse(void* parser); 2.40 ++extern int cssyyparse(WebCore::CSSParser*); 2.41 + 2.42 + using namespace std; 2.43 + using namespace WTF; 2.44 +--- Source/WebCore/xml/XPathGrammar.y 2.45 ++++ Source/WebCore/xml/XPathGrammar.y 2.46 +@@ -34,6 +34,7 @@ 2.47 + #include "XPathParser.h" 2.48 + #include "XPathPath.h" 2.49 + #include "XPathPredicate.h" 2.50 ++#include "XPathStep.h" 2.51 + #include "XPathVariableReference.h" 2.52 + #include <wtf/FastMalloc.h> 2.53 + 2.54 +@@ -44,8 +45,6 @@ 2.55 + #define YYLTYPE_IS_TRIVIAL 1 2.56 + #define YYDEBUG 0 2.57 + #define YYMAXDEPTH 10000 2.58 +-#define YYPARSE_PARAM parserParameter 2.59 +-#define PARSER static_cast<Parser*>(parserParameter) 2.60 + 2.61 + using namespace WebCore; 2.62 + using namespace XPath; 2.63 +@@ -53,6 +52,7 @@ 2.64 + %} 2.65 + 2.66 + %pure_parser 2.67 ++%parse-param { WebCore::XPath::Parser* parser } 2.68 + 2.69 + %union 2.70 + { 2.71 +@@ -71,7 +71,7 @@ 2.72 + %{ 2.73 + 2.74 + static int xpathyylex(YYSTYPE* yylval) { return Parser::current()->lex(yylval); } 2.75 +-static void xpathyyerror(const char*) { } 2.76 ++static void xpathyyerror(void*, const char*) { } 2.77 + 2.78 + %} 2.79 + 2.80 +@@ -118,7 +118,7 @@ 2.81 + Expr: 2.82 + OrExpr 2.83 + { 2.84 +- PARSER->m_topExpr = $1; 2.85 ++ parser->m_topExpr = $1; 2.86 + } 2.87 + ; 2.88 + 2.89 +@@ -138,7 +138,7 @@ 2.90 + '/' 2.91 + { 2.92 + $$ = new LocationPath; 2.93 +- PARSER->registerParseNode($$); 2.94 ++ parser->registerParseNode($$); 2.95 + } 2.96 + | 2.97 + '/' RelativeLocationPath 2.98 +@@ -150,7 +150,7 @@ 2.99 + { 2.100 + $$ = $2; 2.101 + $$->insertFirstStep($1); 2.102 +- PARSER->unregisterParseNode($1); 2.103 ++ parser->unregisterParseNode($1); 2.104 + } 2.105 + ; 2.106 + 2.107 +@@ -159,22 +159,22 @@ 2.108 + { 2.109 + $$ = new LocationPath; 2.110 + $$->appendStep($1); 2.111 +- PARSER->unregisterParseNode($1); 2.112 +- PARSER->registerParseNode($$); 2.113 ++ parser->unregisterParseNode($1); 2.114 ++ parser->registerParseNode($$); 2.115 + } 2.116 + | 2.117 + RelativeLocationPath '/' Step 2.118 + { 2.119 + $$->appendStep($3); 2.120 +- PARSER->unregisterParseNode($3); 2.121 ++ parser->unregisterParseNode($3); 2.122 + } 2.123 + | 2.124 + RelativeLocationPath DescendantOrSelf Step 2.125 + { 2.126 + $$->appendStep($2); 2.127 + $$->appendStep($3); 2.128 +- PARSER->unregisterParseNode($2); 2.129 +- PARSER->unregisterParseNode($3); 2.130 ++ parser->unregisterParseNode($2); 2.131 ++ parser->unregisterParseNode($3); 2.132 + } 2.133 + ; 2.134 + 2.135 +@@ -183,58 +183,58 @@ 2.136 + { 2.137 + if ($2) { 2.138 + $$ = new Step(Step::ChildAxis, *$1, *$2); 2.139 +- PARSER->deletePredicateVector($2); 2.140 ++ parser->deletePredicateVector($2); 2.141 + } else 2.142 + $$ = new Step(Step::ChildAxis, *$1); 2.143 +- PARSER->deleteNodeTest($1); 2.144 +- PARSER->registerParseNode($$); 2.145 ++ parser->deleteNodeTest($1); 2.146 ++ parser->registerParseNode($$); 2.147 + } 2.148 + | 2.149 + NAMETEST OptionalPredicateList 2.150 + { 2.151 + String localName; 2.152 + String namespaceURI; 2.153 +- if (!PARSER->expandQName(*$1, localName, namespaceURI)) { 2.154 +- PARSER->m_gotNamespaceError = true; 2.155 ++ if (!parser->expandQName(*$1, localName, namespaceURI)) { 2.156 ++ parser->m_gotNamespaceError = true; 2.157 + YYABORT; 2.158 + } 2.159 + 2.160 + if ($2) { 2.161 + $$ = new Step(Step::ChildAxis, Step::NodeTest(Step::NodeTest::NameTest, localName, namespaceURI), *$2); 2.162 +- PARSER->deletePredicateVector($2); 2.163 ++ parser->deletePredicateVector($2); 2.164 + } else 2.165 + $$ = new Step(Step::ChildAxis, Step::NodeTest(Step::NodeTest::NameTest, localName, namespaceURI)); 2.166 +- PARSER->deleteString($1); 2.167 +- PARSER->registerParseNode($$); 2.168 ++ parser->deleteString($1); 2.169 ++ parser->registerParseNode($$); 2.170 + } 2.171 + | 2.172 + AxisSpecifier NodeTest OptionalPredicateList 2.173 + { 2.174 + if ($3) { 2.175 + $$ = new Step($1, *$2, *$3); 2.176 +- PARSER->deletePredicateVector($3); 2.177 ++ parser->deletePredicateVector($3); 2.178 + } else 2.179 + $$ = new Step($1, *$2); 2.180 +- PARSER->deleteNodeTest($2); 2.181 +- PARSER->registerParseNode($$); 2.182 ++ parser->deleteNodeTest($2); 2.183 ++ parser->registerParseNode($$); 2.184 + } 2.185 + | 2.186 + AxisSpecifier NAMETEST OptionalPredicateList 2.187 + { 2.188 + String localName; 2.189 + String namespaceURI; 2.190 +- if (!PARSER->expandQName(*$2, localName, namespaceURI)) { 2.191 +- PARSER->m_gotNamespaceError = true; 2.192 ++ if (!parser->expandQName(*$2, localName, namespaceURI)) { 2.193 ++ parser->m_gotNamespaceError = true; 2.194 + YYABORT; 2.195 + } 2.196 + 2.197 + if ($3) { 2.198 + $$ = new Step($1, Step::NodeTest(Step::NodeTest::NameTest, localName, namespaceURI), *$3); 2.199 +- PARSER->deletePredicateVector($3); 2.200 ++ parser->deletePredicateVector($3); 2.201 + } else 2.202 + $$ = new Step($1, Step::NodeTest(Step::NodeTest::NameTest, localName, namespaceURI)); 2.203 +- PARSER->deleteString($2); 2.204 +- PARSER->registerParseNode($$); 2.205 ++ parser->deleteString($2); 2.206 ++ parser->registerParseNode($$); 2.207 + } 2.208 + | 2.209 + AbbreviatedStep 2.210 +@@ -259,23 +259,23 @@ 2.211 + else if (*$1 == "comment") 2.212 + $$ = new Step::NodeTest(Step::NodeTest::CommentNodeTest); 2.213 + 2.214 +- PARSER->deleteString($1); 2.215 +- PARSER->registerNodeTest($$); 2.216 ++ parser->deleteString($1); 2.217 ++ parser->registerNodeTest($$); 2.218 + } 2.219 + | 2.220 + PI '(' ')' 2.221 + { 2.222 + $$ = new Step::NodeTest(Step::NodeTest::ProcessingInstructionNodeTest); 2.223 +- PARSER->deleteString($1); 2.224 +- PARSER->registerNodeTest($$); 2.225 ++ parser->deleteString($1); 2.226 ++ parser->registerNodeTest($$); 2.227 + } 2.228 + | 2.229 + PI '(' LITERAL ')' 2.230 + { 2.231 + $$ = new Step::NodeTest(Step::NodeTest::ProcessingInstructionNodeTest, $3->stripWhiteSpace()); 2.232 +- PARSER->deleteString($1); 2.233 +- PARSER->deleteString($3); 2.234 +- PARSER->registerNodeTest($$); 2.235 ++ parser->deleteString($1); 2.236 ++ parser->deleteString($3); 2.237 ++ parser->registerNodeTest($$); 2.238 + } 2.239 + ; 2.240 + 2.241 +@@ -293,14 +293,14 @@ 2.242 + { 2.243 + $$ = new Vector<Predicate*>; 2.244 + $$->append(new Predicate($1)); 2.245 +- PARSER->unregisterParseNode($1); 2.246 +- PARSER->registerPredicateVector($$); 2.247 ++ parser->unregisterParseNode($1); 2.248 ++ parser->registerPredicateVector($$); 2.249 + } 2.250 + | 2.251 + PredicateList Predicate 2.252 + { 2.253 + $$->append(new Predicate($2)); 2.254 +- PARSER->unregisterParseNode($2); 2.255 ++ parser->unregisterParseNode($2); 2.256 + } 2.257 + ; 2.258 + 2.259 +@@ -315,7 +315,7 @@ 2.260 + SLASHSLASH 2.261 + { 2.262 + $$ = new Step(Step::DescendantOrSelfAxis, Step::NodeTest(Step::NodeTest::AnyNodeTest)); 2.263 +- PARSER->registerParseNode($$); 2.264 ++ parser->registerParseNode($$); 2.265 + } 2.266 + ; 2.267 + 2.268 +@@ -323,13 +323,13 @@ 2.269 + '.' 2.270 + { 2.271 + $$ = new Step(Step::SelfAxis, Step::NodeTest(Step::NodeTest::AnyNodeTest)); 2.272 +- PARSER->registerParseNode($$); 2.273 ++ parser->registerParseNode($$); 2.274 + } 2.275 + | 2.276 + DOTDOT 2.277 + { 2.278 + $$ = new Step(Step::ParentAxis, Step::NodeTest(Step::NodeTest::AnyNodeTest)); 2.279 +- PARSER->registerParseNode($$); 2.280 ++ parser->registerParseNode($$); 2.281 + } 2.282 + ; 2.283 + 2.284 +@@ -337,8 +337,8 @@ 2.285 + VARIABLEREFERENCE 2.286 + { 2.287 + $$ = new VariableReference(*$1); 2.288 +- PARSER->deleteString($1); 2.289 +- PARSER->registerParseNode($$); 2.290 ++ parser->deleteString($1); 2.291 ++ parser->registerParseNode($$); 2.292 + } 2.293 + | 2.294 + '(' Expr ')' 2.295 +@@ -349,15 +349,15 @@ 2.296 + LITERAL 2.297 + { 2.298 + $$ = new StringExpression(*$1); 2.299 +- PARSER->deleteString($1); 2.300 +- PARSER->registerParseNode($$); 2.301 ++ parser->deleteString($1); 2.302 ++ parser->registerParseNode($$); 2.303 + } 2.304 + | 2.305 + NUMBER 2.306 + { 2.307 + $$ = new Number($1->toDouble()); 2.308 +- PARSER->deleteString($1); 2.309 +- PARSER->registerParseNode($$); 2.310 ++ parser->deleteString($1); 2.311 ++ parser->registerParseNode($$); 2.312 + } 2.313 + | 2.314 + FunctionCall 2.315 +@@ -369,8 +369,8 @@ 2.316 + $$ = createFunction(*$1); 2.317 + if (!$$) 2.318 + YYABORT; 2.319 +- PARSER->deleteString($1); 2.320 +- PARSER->registerParseNode($$); 2.321 ++ parser->deleteString($1); 2.322 ++ parser->registerParseNode($$); 2.323 + } 2.324 + | 2.325 + FUNCTIONNAME '(' ArgumentList ')' 2.326 +@@ -378,9 +378,9 @@ 2.327 + $$ = createFunction(*$1, *$3); 2.328 + if (!$$) 2.329 + YYABORT; 2.330 +- PARSER->deleteString($1); 2.331 +- PARSER->deleteExpressionVector($3); 2.332 +- PARSER->registerParseNode($$); 2.333 ++ parser->deleteString($1); 2.334 ++ parser->deleteExpressionVector($3); 2.335 ++ parser->registerParseNode($$); 2.336 + } 2.337 + ; 2.338 + 2.339 +@@ -389,14 +389,14 @@ 2.340 + { 2.341 + $$ = new Vector<Expression*>; 2.342 + $$->append($1); 2.343 +- PARSER->unregisterParseNode($1); 2.344 +- PARSER->registerExpressionVector($$); 2.345 ++ parser->unregisterParseNode($1); 2.346 ++ parser->registerExpressionVector($$); 2.347 + } 2.348 + | 2.349 + ArgumentList ',' Argument 2.350 + { 2.351 + $$->append($3); 2.352 +- PARSER->unregisterParseNode($3); 2.353 ++ parser->unregisterParseNode($3); 2.354 + } 2.355 + ; 2.356 + 2.357 +@@ -412,9 +412,9 @@ 2.358 + $$ = new Union; 2.359 + $$->addSubExpression($1); 2.360 + $$->addSubExpression($3); 2.361 +- PARSER->unregisterParseNode($1); 2.362 +- PARSER->unregisterParseNode($3); 2.363 +- PARSER->registerParseNode($$); 2.364 ++ parser->unregisterParseNode($1); 2.365 ++ parser->unregisterParseNode($3); 2.366 ++ parser->registerParseNode($$); 2.367 + } 2.368 + ; 2.369 + 2.370 +@@ -430,9 +430,9 @@ 2.371 + { 2.372 + $3->setAbsolute(true); 2.373 + $$ = new Path(static_cast<Filter*>($1), $3); 2.374 +- PARSER->unregisterParseNode($1); 2.375 +- PARSER->unregisterParseNode($3); 2.376 +- PARSER->registerParseNode($$); 2.377 ++ parser->unregisterParseNode($1); 2.378 ++ parser->unregisterParseNode($3); 2.379 ++ parser->registerParseNode($$); 2.380 + } 2.381 + | 2.382 + FilterExpr DescendantOrSelf RelativeLocationPath 2.383 +@@ -440,10 +440,10 @@ 2.384 + $3->insertFirstStep($2); 2.385 + $3->setAbsolute(true); 2.386 + $$ = new Path(static_cast<Filter*>($1), $3); 2.387 +- PARSER->unregisterParseNode($1); 2.388 +- PARSER->unregisterParseNode($2); 2.389 +- PARSER->unregisterParseNode($3); 2.390 +- PARSER->registerParseNode($$); 2.391 ++ parser->unregisterParseNode($1); 2.392 ++ parser->unregisterParseNode($2); 2.393 ++ parser->unregisterParseNode($3); 2.394 ++ parser->registerParseNode($$); 2.395 + } 2.396 + ; 2.397 + 2.398 +@@ -453,9 +453,9 @@ 2.399 + PrimaryExpr PredicateList 2.400 + { 2.401 + $$ = new Filter($1, *$2); 2.402 +- PARSER->unregisterParseNode($1); 2.403 +- PARSER->deletePredicateVector($2); 2.404 +- PARSER->registerParseNode($$); 2.405 ++ parser->unregisterParseNode($1); 2.406 ++ parser->deletePredicateVector($2); 2.407 ++ parser->registerParseNode($$); 2.408 + } 2.409 + ; 2.410 + 2.411 +@@ -465,9 +465,9 @@ 2.412 + OrExpr OR AndExpr 2.413 + { 2.414 + $$ = new LogicalOp(LogicalOp::OP_Or, $1, $3); 2.415 +- PARSER->unregisterParseNode($1); 2.416 +- PARSER->unregisterParseNode($3); 2.417 +- PARSER->registerParseNode($$); 2.418 ++ parser->unregisterParseNode($1); 2.419 ++ parser->unregisterParseNode($3); 2.420 ++ parser->registerParseNode($$); 2.421 + } 2.422 + ; 2.423 + 2.424 +@@ -477,9 +477,9 @@ 2.425 + AndExpr AND EqualityExpr 2.426 + { 2.427 + $$ = new LogicalOp(LogicalOp::OP_And, $1, $3); 2.428 +- PARSER->unregisterParseNode($1); 2.429 +- PARSER->unregisterParseNode($3); 2.430 +- PARSER->registerParseNode($$); 2.431 ++ parser->unregisterParseNode($1); 2.432 ++ parser->unregisterParseNode($3); 2.433 ++ parser->registerParseNode($$); 2.434 + } 2.435 + ; 2.436 + 2.437 +@@ -489,9 +489,9 @@ 2.438 + EqualityExpr EQOP RelationalExpr 2.439 + { 2.440 + $$ = new EqTestOp($2, $1, $3); 2.441 +- PARSER->unregisterParseNode($1); 2.442 +- PARSER->unregisterParseNode($3); 2.443 +- PARSER->registerParseNode($$); 2.444 ++ parser->unregisterParseNode($1); 2.445 ++ parser->unregisterParseNode($3); 2.446 ++ parser->registerParseNode($$); 2.447 + } 2.448 + ; 2.449 + 2.450 +@@ -501,9 +501,9 @@ 2.451 + RelationalExpr RELOP AdditiveExpr 2.452 + { 2.453 + $$ = new EqTestOp($2, $1, $3); 2.454 +- PARSER->unregisterParseNode($1); 2.455 +- PARSER->unregisterParseNode($3); 2.456 +- PARSER->registerParseNode($$); 2.457 ++ parser->unregisterParseNode($1); 2.458 ++ parser->unregisterParseNode($3); 2.459 ++ parser->registerParseNode($$); 2.460 + } 2.461 + ; 2.462 + 2.463 +@@ -513,17 +513,17 @@ 2.464 + AdditiveExpr PLUS MultiplicativeExpr 2.465 + { 2.466 + $$ = new NumericOp(NumericOp::OP_Add, $1, $3); 2.467 +- PARSER->unregisterParseNode($1); 2.468 +- PARSER->unregisterParseNode($3); 2.469 +- PARSER->registerParseNode($$); 2.470 ++ parser->unregisterParseNode($1); 2.471 ++ parser->unregisterParseNode($3); 2.472 ++ parser->registerParseNode($$); 2.473 + } 2.474 + | 2.475 + AdditiveExpr MINUS MultiplicativeExpr 2.476 + { 2.477 + $$ = new NumericOp(NumericOp::OP_Sub, $1, $3); 2.478 +- PARSER->unregisterParseNode($1); 2.479 +- PARSER->unregisterParseNode($3); 2.480 +- PARSER->registerParseNode($$); 2.481 ++ parser->unregisterParseNode($1); 2.482 ++ parser->unregisterParseNode($3); 2.483 ++ parser->registerParseNode($$); 2.484 + } 2.485 + ; 2.486 + 2.487 +@@ -533,9 +533,9 @@ 2.488 + MultiplicativeExpr MULOP UnaryExpr 2.489 + { 2.490 + $$ = new NumericOp($2, $1, $3); 2.491 +- PARSER->unregisterParseNode($1); 2.492 +- PARSER->unregisterParseNode($3); 2.493 +- PARSER->registerParseNode($$); 2.494 ++ parser->unregisterParseNode($1); 2.495 ++ parser->unregisterParseNode($3); 2.496 ++ parser->registerParseNode($$); 2.497 + } 2.498 + ; 2.499 + 2.500 +@@ -546,8 +546,8 @@ 2.501 + { 2.502 + $$ = new Negative; 2.503 + $$->addSubExpression($2); 2.504 +- PARSER->unregisterParseNode($2); 2.505 +- PARSER->registerParseNode($$); 2.506 ++ parser->unregisterParseNode($2); 2.507 ++ parser->registerParseNode($$); 2.508 + } 2.509 + ; 2.510 + 2.511 +--- Source/WebCore/xml/XPathParser.cpp 2.512 ++++ Source/WebCore/xml/XPathParser.cpp.NEW 2.513 +@@ -32,20 +32,17 @@ 2.514 + #include "XPathEvaluator.h" 2.515 + #include "XPathException.h" 2.516 + #include "XPathNSResolver.h" 2.517 ++#include "XPathPath.h" 2.518 + #include "XPathStep.h" 2.519 + #include <wtf/StdLibExtras.h> 2.520 + #include <wtf/text/StringHash.h> 2.521 + 2.522 +-int xpathyyparse(void*); 2.523 +- 2.524 ++using namespace WebCore; 2.525 + using namespace WTF; 2.526 + using namespace Unicode; 2.527 ++using namespace XPath; 2.528 + 2.529 +-namespace WebCore { 2.530 +-namespace XPath { 2.531 +- 2.532 +-class LocationPath; 2.533 +- 2.534 ++extern int xpathyyparse(WebCore::XPath::Parser*); 2.535 + #include "XPathGrammar.h" 2.536 + 2.537 + Parser* Parser::currentParser = 0; 2.538 +@@ -630,5 +627,3 @@ 2.539 + delete t; 2.540 + } 2.541 + 2.542 +-} 2.543 +-}