wok diff webkit-r/stuff/bison26.u @ rev 20305
pppd: into dialout group
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun May 06 10:39:28 2018 +0200 (2018-05-06) |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/webkit-r/stuff/bison26.u Sun May 06 10:39:28 2018 +0200 1.3 @@ -0,0 +1,540 @@ 1.4 +--- Source/WebCore/css/CSSGrammar.y 1.5 ++++ Source/WebCore/css/CSSGrammar.y 1.6 +@@ -53,14 +53,13 @@ 1.7 + #define YYMAXDEPTH 10000 1.8 + #define YYDEBUG 0 1.9 + 1.10 +-// FIXME: Replace with %parse-param { CSSParser* parser } once we can depend on bison 2.x 1.11 +-#define YYPARSE_PARAM parser 1.12 +-#define YYLEX_PARAM parser 1.13 +- 1.14 + %} 1.15 + 1.16 + %pure_parser 1.17 + 1.18 ++%parse-param { CSSParser* parser } 1.19 ++%lex-param { CSSParser* parser } 1.20 ++ 1.21 + %union { 1.22 + bool boolean; 1.23 + char character; 1.24 +@@ -88,7 +87,7 @@ 1.25 + 1.26 + %{ 1.27 + 1.28 +-static inline int cssyyerror(const char*) 1.29 ++static inline int cssyyerror(void*, const char*) 1.30 + { 1.31 + return 1; 1.32 + } 1.33 +--- Source/WebCore/css/CSSParser.cpp 1.34 ++++ Source/WebCore/css/CSSParser.cpp 1.35 +@@ -96,7 +96,7 @@ 1.36 + extern int cssyydebug; 1.37 + #endif 1.38 + 1.39 +-extern int cssyyparse(void* parser); 1.40 ++extern int cssyyparse(WebCore::CSSParser*); 1.41 + 1.42 + using namespace std; 1.43 + using namespace WTF; 1.44 +--- Source/WebCore/xml/XPathGrammar.y 1.45 ++++ Source/WebCore/xml/XPathGrammar.y 1.46 +@@ -34,6 +34,7 @@ 1.47 + #include "XPathParser.h" 1.48 + #include "XPathPath.h" 1.49 + #include "XPathPredicate.h" 1.50 ++#include "XPathStep.h" 1.51 + #include "XPathVariableReference.h" 1.52 + #include <wtf/FastMalloc.h> 1.53 + 1.54 +@@ -44,8 +45,6 @@ 1.55 + #define YYLTYPE_IS_TRIVIAL 1 1.56 + #define YYDEBUG 0 1.57 + #define YYMAXDEPTH 10000 1.58 +-#define YYPARSE_PARAM parserParameter 1.59 +-#define PARSER static_cast<Parser*>(parserParameter) 1.60 + 1.61 + using namespace WebCore; 1.62 + using namespace XPath; 1.63 +@@ -53,6 +52,7 @@ 1.64 + %} 1.65 + 1.66 + %pure_parser 1.67 ++%parse-param { WebCore::XPath::Parser* parser } 1.68 + 1.69 + %union 1.70 + { 1.71 +@@ -71,7 +71,7 @@ 1.72 + %{ 1.73 + 1.74 + static int xpathyylex(YYSTYPE* yylval) { return Parser::current()->lex(yylval); } 1.75 +-static void xpathyyerror(const char*) { } 1.76 ++static void xpathyyerror(void*, const char*) { } 1.77 + 1.78 + %} 1.79 + 1.80 +@@ -118,7 +118,7 @@ 1.81 + Expr: 1.82 + OrExpr 1.83 + { 1.84 +- PARSER->m_topExpr = $1; 1.85 ++ parser->m_topExpr = $1; 1.86 + } 1.87 + ; 1.88 + 1.89 +@@ -138,7 +138,7 @@ 1.90 + '/' 1.91 + { 1.92 + $$ = new LocationPath; 1.93 +- PARSER->registerParseNode($$); 1.94 ++ parser->registerParseNode($$); 1.95 + } 1.96 + | 1.97 + '/' RelativeLocationPath 1.98 +@@ -150,7 +150,7 @@ 1.99 + { 1.100 + $$ = $2; 1.101 + $$->insertFirstStep($1); 1.102 +- PARSER->unregisterParseNode($1); 1.103 ++ parser->unregisterParseNode($1); 1.104 + } 1.105 + ; 1.106 + 1.107 +@@ -159,22 +159,22 @@ 1.108 + { 1.109 + $$ = new LocationPath; 1.110 + $$->appendStep($1); 1.111 +- PARSER->unregisterParseNode($1); 1.112 +- PARSER->registerParseNode($$); 1.113 ++ parser->unregisterParseNode($1); 1.114 ++ parser->registerParseNode($$); 1.115 + } 1.116 + | 1.117 + RelativeLocationPath '/' Step 1.118 + { 1.119 + $$->appendStep($3); 1.120 +- PARSER->unregisterParseNode($3); 1.121 ++ parser->unregisterParseNode($3); 1.122 + } 1.123 + | 1.124 + RelativeLocationPath DescendantOrSelf Step 1.125 + { 1.126 + $$->appendStep($2); 1.127 + $$->appendStep($3); 1.128 +- PARSER->unregisterParseNode($2); 1.129 +- PARSER->unregisterParseNode($3); 1.130 ++ parser->unregisterParseNode($2); 1.131 ++ parser->unregisterParseNode($3); 1.132 + } 1.133 + ; 1.134 + 1.135 +@@ -183,58 +183,58 @@ 1.136 + { 1.137 + if ($2) { 1.138 + $$ = new Step(Step::ChildAxis, *$1, *$2); 1.139 +- PARSER->deletePredicateVector($2); 1.140 ++ parser->deletePredicateVector($2); 1.141 + } else 1.142 + $$ = new Step(Step::ChildAxis, *$1); 1.143 +- PARSER->deleteNodeTest($1); 1.144 +- PARSER->registerParseNode($$); 1.145 ++ parser->deleteNodeTest($1); 1.146 ++ parser->registerParseNode($$); 1.147 + } 1.148 + | 1.149 + NAMETEST OptionalPredicateList 1.150 + { 1.151 + String localName; 1.152 + String namespaceURI; 1.153 +- if (!PARSER->expandQName(*$1, localName, namespaceURI)) { 1.154 +- PARSER->m_gotNamespaceError = true; 1.155 ++ if (!parser->expandQName(*$1, localName, namespaceURI)) { 1.156 ++ parser->m_gotNamespaceError = true; 1.157 + YYABORT; 1.158 + } 1.159 + 1.160 + if ($2) { 1.161 + $$ = new Step(Step::ChildAxis, Step::NodeTest(Step::NodeTest::NameTest, localName, namespaceURI), *$2); 1.162 +- PARSER->deletePredicateVector($2); 1.163 ++ parser->deletePredicateVector($2); 1.164 + } else 1.165 + $$ = new Step(Step::ChildAxis, Step::NodeTest(Step::NodeTest::NameTest, localName, namespaceURI)); 1.166 +- PARSER->deleteString($1); 1.167 +- PARSER->registerParseNode($$); 1.168 ++ parser->deleteString($1); 1.169 ++ parser->registerParseNode($$); 1.170 + } 1.171 + | 1.172 + AxisSpecifier NodeTest OptionalPredicateList 1.173 + { 1.174 + if ($3) { 1.175 + $$ = new Step($1, *$2, *$3); 1.176 +- PARSER->deletePredicateVector($3); 1.177 ++ parser->deletePredicateVector($3); 1.178 + } else 1.179 + $$ = new Step($1, *$2); 1.180 +- PARSER->deleteNodeTest($2); 1.181 +- PARSER->registerParseNode($$); 1.182 ++ parser->deleteNodeTest($2); 1.183 ++ parser->registerParseNode($$); 1.184 + } 1.185 + | 1.186 + AxisSpecifier NAMETEST OptionalPredicateList 1.187 + { 1.188 + String localName; 1.189 + String namespaceURI; 1.190 +- if (!PARSER->expandQName(*$2, localName, namespaceURI)) { 1.191 +- PARSER->m_gotNamespaceError = true; 1.192 ++ if (!parser->expandQName(*$2, localName, namespaceURI)) { 1.193 ++ parser->m_gotNamespaceError = true; 1.194 + YYABORT; 1.195 + } 1.196 + 1.197 + if ($3) { 1.198 + $$ = new Step($1, Step::NodeTest(Step::NodeTest::NameTest, localName, namespaceURI), *$3); 1.199 +- PARSER->deletePredicateVector($3); 1.200 ++ parser->deletePredicateVector($3); 1.201 + } else 1.202 + $$ = new Step($1, Step::NodeTest(Step::NodeTest::NameTest, localName, namespaceURI)); 1.203 +- PARSER->deleteString($2); 1.204 +- PARSER->registerParseNode($$); 1.205 ++ parser->deleteString($2); 1.206 ++ parser->registerParseNode($$); 1.207 + } 1.208 + | 1.209 + AbbreviatedStep 1.210 +@@ -259,23 +259,23 @@ 1.211 + else if (*$1 == "comment") 1.212 + $$ = new Step::NodeTest(Step::NodeTest::CommentNodeTest); 1.213 + 1.214 +- PARSER->deleteString($1); 1.215 +- PARSER->registerNodeTest($$); 1.216 ++ parser->deleteString($1); 1.217 ++ parser->registerNodeTest($$); 1.218 + } 1.219 + | 1.220 + PI '(' ')' 1.221 + { 1.222 + $$ = new Step::NodeTest(Step::NodeTest::ProcessingInstructionNodeTest); 1.223 +- PARSER->deleteString($1); 1.224 +- PARSER->registerNodeTest($$); 1.225 ++ parser->deleteString($1); 1.226 ++ parser->registerNodeTest($$); 1.227 + } 1.228 + | 1.229 + PI '(' LITERAL ')' 1.230 + { 1.231 + $$ = new Step::NodeTest(Step::NodeTest::ProcessingInstructionNodeTest, $3->stripWhiteSpace()); 1.232 +- PARSER->deleteString($1); 1.233 +- PARSER->deleteString($3); 1.234 +- PARSER->registerNodeTest($$); 1.235 ++ parser->deleteString($1); 1.236 ++ parser->deleteString($3); 1.237 ++ parser->registerNodeTest($$); 1.238 + } 1.239 + ; 1.240 + 1.241 +@@ -293,14 +293,14 @@ 1.242 + { 1.243 + $$ = new Vector<Predicate*>; 1.244 + $$->append(new Predicate($1)); 1.245 +- PARSER->unregisterParseNode($1); 1.246 +- PARSER->registerPredicateVector($$); 1.247 ++ parser->unregisterParseNode($1); 1.248 ++ parser->registerPredicateVector($$); 1.249 + } 1.250 + | 1.251 + PredicateList Predicate 1.252 + { 1.253 + $$->append(new Predicate($2)); 1.254 +- PARSER->unregisterParseNode($2); 1.255 ++ parser->unregisterParseNode($2); 1.256 + } 1.257 + ; 1.258 + 1.259 +@@ -315,7 +315,7 @@ 1.260 + SLASHSLASH 1.261 + { 1.262 + $$ = new Step(Step::DescendantOrSelfAxis, Step::NodeTest(Step::NodeTest::AnyNodeTest)); 1.263 +- PARSER->registerParseNode($$); 1.264 ++ parser->registerParseNode($$); 1.265 + } 1.266 + ; 1.267 + 1.268 +@@ -323,13 +323,13 @@ 1.269 + '.' 1.270 + { 1.271 + $$ = new Step(Step::SelfAxis, Step::NodeTest(Step::NodeTest::AnyNodeTest)); 1.272 +- PARSER->registerParseNode($$); 1.273 ++ parser->registerParseNode($$); 1.274 + } 1.275 + | 1.276 + DOTDOT 1.277 + { 1.278 + $$ = new Step(Step::ParentAxis, Step::NodeTest(Step::NodeTest::AnyNodeTest)); 1.279 +- PARSER->registerParseNode($$); 1.280 ++ parser->registerParseNode($$); 1.281 + } 1.282 + ; 1.283 + 1.284 +@@ -337,8 +337,8 @@ 1.285 + VARIABLEREFERENCE 1.286 + { 1.287 + $$ = new VariableReference(*$1); 1.288 +- PARSER->deleteString($1); 1.289 +- PARSER->registerParseNode($$); 1.290 ++ parser->deleteString($1); 1.291 ++ parser->registerParseNode($$); 1.292 + } 1.293 + | 1.294 + '(' Expr ')' 1.295 +@@ -349,15 +349,15 @@ 1.296 + LITERAL 1.297 + { 1.298 + $$ = new StringExpression(*$1); 1.299 +- PARSER->deleteString($1); 1.300 +- PARSER->registerParseNode($$); 1.301 ++ parser->deleteString($1); 1.302 ++ parser->registerParseNode($$); 1.303 + } 1.304 + | 1.305 + NUMBER 1.306 + { 1.307 + $$ = new Number($1->toDouble()); 1.308 +- PARSER->deleteString($1); 1.309 +- PARSER->registerParseNode($$); 1.310 ++ parser->deleteString($1); 1.311 ++ parser->registerParseNode($$); 1.312 + } 1.313 + | 1.314 + FunctionCall 1.315 +@@ -369,8 +369,8 @@ 1.316 + $$ = createFunction(*$1); 1.317 + if (!$$) 1.318 + YYABORT; 1.319 +- PARSER->deleteString($1); 1.320 +- PARSER->registerParseNode($$); 1.321 ++ parser->deleteString($1); 1.322 ++ parser->registerParseNode($$); 1.323 + } 1.324 + | 1.325 + FUNCTIONNAME '(' ArgumentList ')' 1.326 +@@ -378,9 +378,9 @@ 1.327 + $$ = createFunction(*$1, *$3); 1.328 + if (!$$) 1.329 + YYABORT; 1.330 +- PARSER->deleteString($1); 1.331 +- PARSER->deleteExpressionVector($3); 1.332 +- PARSER->registerParseNode($$); 1.333 ++ parser->deleteString($1); 1.334 ++ parser->deleteExpressionVector($3); 1.335 ++ parser->registerParseNode($$); 1.336 + } 1.337 + ; 1.338 + 1.339 +@@ -389,14 +389,14 @@ 1.340 + { 1.341 + $$ = new Vector<Expression*>; 1.342 + $$->append($1); 1.343 +- PARSER->unregisterParseNode($1); 1.344 +- PARSER->registerExpressionVector($$); 1.345 ++ parser->unregisterParseNode($1); 1.346 ++ parser->registerExpressionVector($$); 1.347 + } 1.348 + | 1.349 + ArgumentList ',' Argument 1.350 + { 1.351 + $$->append($3); 1.352 +- PARSER->unregisterParseNode($3); 1.353 ++ parser->unregisterParseNode($3); 1.354 + } 1.355 + ; 1.356 + 1.357 +@@ -412,9 +412,9 @@ 1.358 + $$ = new Union; 1.359 + $$->addSubExpression($1); 1.360 + $$->addSubExpression($3); 1.361 +- PARSER->unregisterParseNode($1); 1.362 +- PARSER->unregisterParseNode($3); 1.363 +- PARSER->registerParseNode($$); 1.364 ++ parser->unregisterParseNode($1); 1.365 ++ parser->unregisterParseNode($3); 1.366 ++ parser->registerParseNode($$); 1.367 + } 1.368 + ; 1.369 + 1.370 +@@ -430,9 +430,9 @@ 1.371 + { 1.372 + $3->setAbsolute(true); 1.373 + $$ = new Path(static_cast<Filter*>($1), $3); 1.374 +- PARSER->unregisterParseNode($1); 1.375 +- PARSER->unregisterParseNode($3); 1.376 +- PARSER->registerParseNode($$); 1.377 ++ parser->unregisterParseNode($1); 1.378 ++ parser->unregisterParseNode($3); 1.379 ++ parser->registerParseNode($$); 1.380 + } 1.381 + | 1.382 + FilterExpr DescendantOrSelf RelativeLocationPath 1.383 +@@ -440,10 +440,10 @@ 1.384 + $3->insertFirstStep($2); 1.385 + $3->setAbsolute(true); 1.386 + $$ = new Path(static_cast<Filter*>($1), $3); 1.387 +- PARSER->unregisterParseNode($1); 1.388 +- PARSER->unregisterParseNode($2); 1.389 +- PARSER->unregisterParseNode($3); 1.390 +- PARSER->registerParseNode($$); 1.391 ++ parser->unregisterParseNode($1); 1.392 ++ parser->unregisterParseNode($2); 1.393 ++ parser->unregisterParseNode($3); 1.394 ++ parser->registerParseNode($$); 1.395 + } 1.396 + ; 1.397 + 1.398 +@@ -453,9 +453,9 @@ 1.399 + PrimaryExpr PredicateList 1.400 + { 1.401 + $$ = new Filter($1, *$2); 1.402 +- PARSER->unregisterParseNode($1); 1.403 +- PARSER->deletePredicateVector($2); 1.404 +- PARSER->registerParseNode($$); 1.405 ++ parser->unregisterParseNode($1); 1.406 ++ parser->deletePredicateVector($2); 1.407 ++ parser->registerParseNode($$); 1.408 + } 1.409 + ; 1.410 + 1.411 +@@ -465,9 +465,9 @@ 1.412 + OrExpr OR AndExpr 1.413 + { 1.414 + $$ = new LogicalOp(LogicalOp::OP_Or, $1, $3); 1.415 +- PARSER->unregisterParseNode($1); 1.416 +- PARSER->unregisterParseNode($3); 1.417 +- PARSER->registerParseNode($$); 1.418 ++ parser->unregisterParseNode($1); 1.419 ++ parser->unregisterParseNode($3); 1.420 ++ parser->registerParseNode($$); 1.421 + } 1.422 + ; 1.423 + 1.424 +@@ -477,9 +477,9 @@ 1.425 + AndExpr AND EqualityExpr 1.426 + { 1.427 + $$ = new LogicalOp(LogicalOp::OP_And, $1, $3); 1.428 +- PARSER->unregisterParseNode($1); 1.429 +- PARSER->unregisterParseNode($3); 1.430 +- PARSER->registerParseNode($$); 1.431 ++ parser->unregisterParseNode($1); 1.432 ++ parser->unregisterParseNode($3); 1.433 ++ parser->registerParseNode($$); 1.434 + } 1.435 + ; 1.436 + 1.437 +@@ -489,9 +489,9 @@ 1.438 + EqualityExpr EQOP RelationalExpr 1.439 + { 1.440 + $$ = new EqTestOp($2, $1, $3); 1.441 +- PARSER->unregisterParseNode($1); 1.442 +- PARSER->unregisterParseNode($3); 1.443 +- PARSER->registerParseNode($$); 1.444 ++ parser->unregisterParseNode($1); 1.445 ++ parser->unregisterParseNode($3); 1.446 ++ parser->registerParseNode($$); 1.447 + } 1.448 + ; 1.449 + 1.450 +@@ -501,9 +501,9 @@ 1.451 + RelationalExpr RELOP AdditiveExpr 1.452 + { 1.453 + $$ = new EqTestOp($2, $1, $3); 1.454 +- PARSER->unregisterParseNode($1); 1.455 +- PARSER->unregisterParseNode($3); 1.456 +- PARSER->registerParseNode($$); 1.457 ++ parser->unregisterParseNode($1); 1.458 ++ parser->unregisterParseNode($3); 1.459 ++ parser->registerParseNode($$); 1.460 + } 1.461 + ; 1.462 + 1.463 +@@ -513,17 +513,17 @@ 1.464 + AdditiveExpr PLUS MultiplicativeExpr 1.465 + { 1.466 + $$ = new NumericOp(NumericOp::OP_Add, $1, $3); 1.467 +- PARSER->unregisterParseNode($1); 1.468 +- PARSER->unregisterParseNode($3); 1.469 +- PARSER->registerParseNode($$); 1.470 ++ parser->unregisterParseNode($1); 1.471 ++ parser->unregisterParseNode($3); 1.472 ++ parser->registerParseNode($$); 1.473 + } 1.474 + | 1.475 + AdditiveExpr MINUS MultiplicativeExpr 1.476 + { 1.477 + $$ = new NumericOp(NumericOp::OP_Sub, $1, $3); 1.478 +- PARSER->unregisterParseNode($1); 1.479 +- PARSER->unregisterParseNode($3); 1.480 +- PARSER->registerParseNode($$); 1.481 ++ parser->unregisterParseNode($1); 1.482 ++ parser->unregisterParseNode($3); 1.483 ++ parser->registerParseNode($$); 1.484 + } 1.485 + ; 1.486 + 1.487 +@@ -533,9 +533,9 @@ 1.488 + MultiplicativeExpr MULOP UnaryExpr 1.489 + { 1.490 + $$ = new NumericOp($2, $1, $3); 1.491 +- PARSER->unregisterParseNode($1); 1.492 +- PARSER->unregisterParseNode($3); 1.493 +- PARSER->registerParseNode($$); 1.494 ++ parser->unregisterParseNode($1); 1.495 ++ parser->unregisterParseNode($3); 1.496 ++ parser->registerParseNode($$); 1.497 + } 1.498 + ; 1.499 + 1.500 +@@ -546,8 +546,8 @@ 1.501 + { 1.502 + $$ = new Negative; 1.503 + $$->addSubExpression($2); 1.504 +- PARSER->unregisterParseNode($2); 1.505 +- PARSER->registerParseNode($$); 1.506 ++ parser->unregisterParseNode($2); 1.507 ++ parser->registerParseNode($$); 1.508 + } 1.509 + ; 1.510 + 1.511 +--- Source/WebCore/xml/XPathParser.cpp 1.512 ++++ Source/WebCore/xml/XPathParser.cpp.NEW 1.513 +@@ -32,20 +32,17 @@ 1.514 + #include "XPathEvaluator.h" 1.515 + #include "XPathException.h" 1.516 + #include "XPathNSResolver.h" 1.517 ++#include "XPathPath.h" 1.518 + #include "XPathStep.h" 1.519 + #include <wtf/StdLibExtras.h> 1.520 + #include <wtf/text/StringHash.h> 1.521 + 1.522 +-int xpathyyparse(void*); 1.523 +- 1.524 ++using namespace WebCore; 1.525 + using namespace WTF; 1.526 + using namespace Unicode; 1.527 ++using namespace XPath; 1.528 + 1.529 +-namespace WebCore { 1.530 +-namespace XPath { 1.531 +- 1.532 +-class LocationPath; 1.533 +- 1.534 ++extern int xpathyyparse(WebCore::XPath::Parser*); 1.535 + #include "XPathGrammar.h" 1.536 + 1.537 + Parser* Parser::currentParser = 0; 1.538 +@@ -630,5 +627,3 @@ 1.539 + delete t; 1.540 + } 1.541 + 1.542 +-} 1.543 +-}