| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2005 Frerich Raabe <raabe@kde.org> | 2 * Copyright 2005 Frerich Raabe <raabe@kde.org> |
| 3 * Copyright (C) 2006 Apple Inc. All rights reserved. | 3 * Copyright (C) 2006 Apple Inc. All rights reserved. |
| 4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * | 9 * |
| 10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 %type <expr> RelationalExpr | 114 %type <expr> RelationalExpr |
| 115 %type <expr> AdditiveExpr | 115 %type <expr> AdditiveExpr |
| 116 %type <expr> MultiplicativeExpr | 116 %type <expr> MultiplicativeExpr |
| 117 %type <expr> UnaryExpr | 117 %type <expr> UnaryExpr |
| 118 | 118 |
| 119 %% | 119 %% |
| 120 | 120 |
| 121 Expr: | 121 Expr: |
| 122 OrExpr | 122 OrExpr |
| 123 { | 123 { |
| 124 parser->m_topExpr = $1; | 124 parser->top_expr_ = $1; |
| 125 } | 125 } |
| 126 ; | 126 ; |
| 127 | 127 |
| 128 LocationPath: | 128 LocationPath: |
| 129 RelativeLocationPath | 129 RelativeLocationPath |
| 130 { | 130 { |
| 131 $$->setAbsolute(false); | 131 $$->setAbsolute(false); |
| 132 } | 132 } |
| 133 | | 133 | |
| 134 AbsoluteLocationPath | 134 AbsoluteLocationPath |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 { | 171 { |
| 172 $$->appendStep($2); | 172 $$->appendStep($2); |
| 173 $$->appendStep($3); | 173 $$->appendStep($3); |
| 174 } | 174 } |
| 175 ; | 175 ; |
| 176 | 176 |
| 177 Step: | 177 Step: |
| 178 NodeTest OptionalPredicateList | 178 NodeTest OptionalPredicateList |
| 179 { | 179 { |
| 180 if ($2) | 180 if ($2) |
| 181 $$ = new Step(Step::ChildAxis, *$1, *$2); | 181 $$ = new Step(Step::kChildAxis, *$1, *$2); |
| 182 else | 182 else |
| 183 $$ = new Step(Step::ChildAxis, *$1); | 183 $$ = new Step(Step::kChildAxis, *$1); |
| 184 } | 184 } |
| 185 | | 185 | |
| 186 NAMETEST OptionalPredicateList | 186 NAMETEST OptionalPredicateList |
| 187 { | 187 { |
| 188 AtomicString localName; | 188 AtomicString localName; |
| 189 AtomicString namespaceURI; | 189 AtomicString namespaceURI; |
| 190 if (!parser->expandQName(*$1, localName, namespaceURI)) { | 190 if (!parser->expandQName(*$1, localName, namespaceURI)) { |
| 191 parser->m_gotNamespaceError = true; | 191 parser->got_namespace_error_ = true; |
| 192 YYABORT; | 192 YYABORT; |
| 193 } | 193 } |
| 194 | 194 |
| 195 if ($2) | 195 if ($2) |
| 196 $$ = new Step(Step::ChildAxis, Step::NodeTest(Step::NodeTest::NameTe
st, localName, namespaceURI), *$2); | 196 $$ = new Step(Step::kChildAxis, Step::NodeTest(Step::NodeTest::kName
Test, localName, namespaceURI), *$2); |
| 197 else | 197 else |
| 198 $$ = new Step(Step::ChildAxis, Step::NodeTest(Step::NodeTest::NameTe
st, localName, namespaceURI)); | 198 $$ = new Step(Step::kChildAxis, Step::NodeTest(Step::NodeTest::kName
Test, localName, namespaceURI)); |
| 199 parser->deleteString($1); | 199 parser->deleteString($1); |
| 200 } | 200 } |
| 201 | | 201 | |
| 202 AxisSpecifier NodeTest OptionalPredicateList | 202 AxisSpecifier NodeTest OptionalPredicateList |
| 203 { | 203 { |
| 204 if ($3) | 204 if ($3) |
| 205 $$ = new Step($1, *$2, *$3); | 205 $$ = new Step($1, *$2, *$3); |
| 206 else | 206 else |
| 207 $$ = new Step($1, *$2); | 207 $$ = new Step($1, *$2); |
| 208 } | 208 } |
| 209 | | 209 | |
| 210 AxisSpecifier NAMETEST OptionalPredicateList | 210 AxisSpecifier NAMETEST OptionalPredicateList |
| 211 { | 211 { |
| 212 AtomicString localName; | 212 AtomicString localName; |
| 213 AtomicString namespaceURI; | 213 AtomicString namespaceURI; |
| 214 if (!parser->expandQName(*$2, localName, namespaceURI)) { | 214 if (!parser->expandQName(*$2, localName, namespaceURI)) { |
| 215 parser->m_gotNamespaceError = true; | 215 parser->got_namespace_error_ = true; |
| 216 YYABORT; | 216 YYABORT; |
| 217 } | 217 } |
| 218 | 218 |
| 219 if ($3) | 219 if ($3) |
| 220 $$ = new Step($1, Step::NodeTest(Step::NodeTest::NameTest, localName
, namespaceURI), *$3); | 220 $$ = new Step($1, Step::NodeTest(Step::NodeTest::kNameTest, localNam
e, namespaceURI), *$3); |
| 221 else | 221 else |
| 222 $$ = new Step($1, Step::NodeTest(Step::NodeTest::NameTest, localName
, namespaceURI)); | 222 $$ = new Step($1, Step::NodeTest(Step::NodeTest::kNameTest, localNam
e, namespaceURI)); |
| 223 parser->deleteString($2); | 223 parser->deleteString($2); |
| 224 } | 224 } |
| 225 | | 225 | |
| 226 AbbreviatedStep | 226 AbbreviatedStep |
| 227 ; | 227 ; |
| 228 | 228 |
| 229 AxisSpecifier: | 229 AxisSpecifier: |
| 230 AXISNAME | 230 AXISNAME |
| 231 | | 231 | |
| 232 '@' | 232 '@' |
| 233 { | 233 { |
| 234 $$ = Step::AttributeAxis; | 234 $$ = Step::kAttributeAxis; |
| 235 } | 235 } |
| 236 ; | 236 ; |
| 237 | 237 |
| 238 NodeTest: | 238 NodeTest: |
| 239 NODETYPE '(' ')' | 239 NODETYPE '(' ')' |
| 240 { | 240 { |
| 241 if (*$1 == "node") | 241 if (*$1 == "node") |
| 242 $$ = new Step::NodeTest(Step::NodeTest::AnyNodeTest); | 242 $$ = new Step::NodeTest(Step::NodeTest::kAnyNodeTest); |
| 243 else if (*$1 == "text") | 243 else if (*$1 == "text") |
| 244 $$ = new Step::NodeTest(Step::NodeTest::TextNodeTest); | 244 $$ = new Step::NodeTest(Step::NodeTest::kTextNodeTest); |
| 245 else if (*$1 == "comment") | 245 else if (*$1 == "comment") |
| 246 $$ = new Step::NodeTest(Step::NodeTest::CommentNodeTest); | 246 $$ = new Step::NodeTest(Step::NodeTest::kCommentNodeTest); |
| 247 | 247 |
| 248 parser->deleteString($1); | 248 parser->deleteString($1); |
| 249 } | 249 } |
| 250 | | 250 | |
| 251 PI '(' ')' | 251 PI '(' ')' |
| 252 { | 252 { |
| 253 $$ = new Step::NodeTest(Step::NodeTest::ProcessingInstructionNodeTest); | 253 $$ = new Step::NodeTest(Step::NodeTest::kProcessingInstructionNodeTest); |
| 254 parser->deleteString($1); | 254 parser->deleteString($1); |
| 255 } | 255 } |
| 256 | | 256 | |
| 257 PI '(' LITERAL ')' | 257 PI '(' LITERAL ')' |
| 258 { | 258 { |
| 259 $$ = new Step::NodeTest(Step::NodeTest::ProcessingInstructionNodeTest, $
3->stripWhiteSpace()); | 259 $$ = new Step::NodeTest(Step::NodeTest::kProcessingInstructionNodeTest,
$3->stripWhiteSpace()); |
| 260 parser->deleteString($1); | 260 parser->deleteString($1); |
| 261 parser->deleteString($3); | 261 parser->deleteString($3); |
| 262 } | 262 } |
| 263 ; | 263 ; |
| 264 | 264 |
| 265 OptionalPredicateList: | 265 OptionalPredicateList: |
| 266 /* empty */ | 266 /* empty */ |
| 267 { | 267 { |
| 268 $$ = 0; | 268 $$ = 0; |
| 269 } | 269 } |
| (...skipping 17 matching lines...) Expand all Loading... |
| 287 Predicate: | 287 Predicate: |
| 288 '[' Expr ']' | 288 '[' Expr ']' |
| 289 { | 289 { |
| 290 $$ = $2; | 290 $$ = $2; |
| 291 } | 291 } |
| 292 ; | 292 ; |
| 293 | 293 |
| 294 DescendantOrSelf: | 294 DescendantOrSelf: |
| 295 SLASHSLASH | 295 SLASHSLASH |
| 296 { | 296 { |
| 297 $$ = new Step(Step::DescendantOrSelfAxis, Step::NodeTest(Step::NodeTest:
:AnyNodeTest)); | 297 $$ = new Step(Step::kDescendantOrSelfAxis, Step::NodeTest(Step::NodeTest
::kAnyNodeTest)); |
| 298 } | 298 } |
| 299 ; | 299 ; |
| 300 | 300 |
| 301 AbbreviatedStep: | 301 AbbreviatedStep: |
| 302 '.' | 302 '.' |
| 303 { | 303 { |
| 304 $$ = new Step(Step::SelfAxis, Step::NodeTest(Step::NodeTest::AnyNodeTest
)); | 304 $$ = new Step(Step::kSelfAxis, Step::NodeTest(Step::NodeTest::kAnyNodeTe
st)); |
| 305 } | 305 } |
| 306 | | 306 | |
| 307 DOTDOT | 307 DOTDOT |
| 308 { | 308 { |
| 309 $$ = new Step(Step::ParentAxis, Step::NodeTest(Step::NodeTest::AnyNodeTe
st)); | 309 $$ = new Step(Step::kParentAxis, Step::NodeTest(Step::NodeTest::kAnyNode
Test)); |
| 310 } | 310 } |
| 311 ; | 311 ; |
| 312 | 312 |
| 313 PrimaryExpr: | 313 PrimaryExpr: |
| 314 VARIABLEREFERENCE | 314 VARIABLEREFERENCE |
| 315 { | 315 { |
| 316 $$ = new VariableReference(*$1); | 316 $$ = new VariableReference(*$1); |
| 317 parser->deleteString($1); | 317 parser->deleteString($1); |
| 318 } | 318 } |
| 319 | | 319 | |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 { | 412 { |
| 413 $$ = new blink::XPath::Filter($1, *$2); | 413 $$ = new blink::XPath::Filter($1, *$2); |
| 414 } | 414 } |
| 415 ; | 415 ; |
| 416 | 416 |
| 417 OrExpr: | 417 OrExpr: |
| 418 AndExpr | 418 AndExpr |
| 419 | | 419 | |
| 420 OrExpr OR AndExpr | 420 OrExpr OR AndExpr |
| 421 { | 421 { |
| 422 $$ = new LogicalOp(LogicalOp::OP_Or, $1, $3); | 422 $$ = new LogicalOp(LogicalOp::kOP_Or, $1, $3); |
| 423 } | 423 } |
| 424 ; | 424 ; |
| 425 | 425 |
| 426 AndExpr: | 426 AndExpr: |
| 427 EqualityExpr | 427 EqualityExpr |
| 428 | | 428 | |
| 429 AndExpr AND EqualityExpr | 429 AndExpr AND EqualityExpr |
| 430 { | 430 { |
| 431 $$ = new LogicalOp(LogicalOp::OP_And, $1, $3); | 431 $$ = new LogicalOp(LogicalOp::kOP_And, $1, $3); |
| 432 } | 432 } |
| 433 ; | 433 ; |
| 434 | 434 |
| 435 EqualityExpr: | 435 EqualityExpr: |
| 436 RelationalExpr | 436 RelationalExpr |
| 437 | | 437 | |
| 438 EqualityExpr EQOP RelationalExpr | 438 EqualityExpr EQOP RelationalExpr |
| 439 { | 439 { |
| 440 $$ = new EqTestOp($2, $1, $3); | 440 $$ = new EqTestOp($2, $1, $3); |
| 441 } | 441 } |
| 442 ; | 442 ; |
| 443 | 443 |
| 444 RelationalExpr: | 444 RelationalExpr: |
| 445 AdditiveExpr | 445 AdditiveExpr |
| 446 | | 446 | |
| 447 RelationalExpr RELOP AdditiveExpr | 447 RelationalExpr RELOP AdditiveExpr |
| 448 { | 448 { |
| 449 $$ = new EqTestOp($2, $1, $3); | 449 $$ = new EqTestOp($2, $1, $3); |
| 450 } | 450 } |
| 451 ; | 451 ; |
| 452 | 452 |
| 453 AdditiveExpr: | 453 AdditiveExpr: |
| 454 MultiplicativeExpr | 454 MultiplicativeExpr |
| 455 | | 455 | |
| 456 AdditiveExpr PLUS MultiplicativeExpr | 456 AdditiveExpr PLUS MultiplicativeExpr |
| 457 { | 457 { |
| 458 $$ = new NumericOp(NumericOp::OP_Add, $1, $3); | 458 $$ = new NumericOp(NumericOp::kOP_Add, $1, $3); |
| 459 } | 459 } |
| 460 | | 460 | |
| 461 AdditiveExpr MINUS MultiplicativeExpr | 461 AdditiveExpr MINUS MultiplicativeExpr |
| 462 { | 462 { |
| 463 $$ = new NumericOp(NumericOp::OP_Sub, $1, $3); | 463 $$ = new NumericOp(NumericOp::kOP_Sub, $1, $3); |
| 464 } | 464 } |
| 465 ; | 465 ; |
| 466 | 466 |
| 467 MultiplicativeExpr: | 467 MultiplicativeExpr: |
| 468 UnaryExpr | 468 UnaryExpr |
| 469 | | 469 | |
| 470 MultiplicativeExpr MULOP UnaryExpr | 470 MultiplicativeExpr MULOP UnaryExpr |
| 471 { | 471 { |
| 472 $$ = new NumericOp($2, $1, $3); | 472 $$ = new NumericOp($2, $1, $3); |
| 473 } | 473 } |
| 474 ; | 474 ; |
| 475 | 475 |
| 476 UnaryExpr: | 476 UnaryExpr: |
| 477 UnionExpr | 477 UnionExpr |
| 478 | | 478 | |
| 479 MINUS UnaryExpr | 479 MINUS UnaryExpr |
| 480 { | 480 { |
| 481 $$ = new Negative; | 481 $$ = new Negative; |
| 482 $$->addSubExpression($2); | 482 $$->addSubExpression($2); |
| 483 } | 483 } |
| 484 ; | 484 ; |
| 485 | 485 |
| 486 %% | 486 %% |
| OLD | NEW |