Class: Synvert::Core::NodeQuery::Parser
- Inherits:
-
Racc::Parser
- Object
- Racc::Parser
- Synvert::Core::NodeQuery::Parser
- Defined in:
- lib/synvert/core/node_query/parser.racc.rb
Constant Summary collapse
- Racc_arg =
[ racc_action_table, racc_action_check, racc_action_default, racc_action_pointer, racc_goto_table, racc_goto_check, racc_goto_default, racc_goto_pointer, racc_nt_base, racc_reduce_table, racc_token_table, racc_shift_n, racc_reduce_n, racc_use_result_var ]
- Racc_token_to_s_table =
[ "$end", "error", "tNODE_TYPE", "tATTRIBUTE", "tKEY", "tIDENTIFIER", "tIDENTIFIER_VALUE", "tINDEX", "tPSEUDO_CLASS", "tCHILD", "tSUBSEQUENT_SIBLING", "tNEXT_SIBLING", "tOPEN_ATTRIBUTE", "tCLOSE_ATTRIBUTE", "tOPEN_DYNAMIC_ATTRIBUTE", "tCLOSE_DYNAMIC_ATTRIBUTE", "tOPEN_ARRAY", "tCLOSE_ARRAY", "tOPEN_SELECTOR", "tCLOSE_SELECTOR", "tOPEN_GOTO_SCOPE", "tCLOSE_GOTO_SCOPE", "tEQUAL", "tNOT_EQUAL", "tMATCH", "tNOT_MATCH", "tGREATER_THAN", "tGREATER_THAN_OR_EQUAL", "tLESS_THAN", "tLESS_THAN_OR_EQUAL", "tIN", "tNOT_IN", "tINCLUDES", "tARRAY_VALUE", "tDYNAMIC_ATTRIBUTE", "tBOOLEAN", "tFLOAT", "tINTEGER", "tNIL", "tREGEXP", "tSTRING", "tSYMBOL", "$start", "expression", "selector", "attribute_list", "attribute", "value", "array_value" ]
- Racc_debug_parser =
false
Instance Method Summary collapse
-
#_reduce_1(val, _values) ⇒ Object
reduce 0 omitted.
- #_reduce_10(val, _values) ⇒ Object
- #_reduce_11(val, _values) ⇒ Object
- #_reduce_12(val, _values) ⇒ Object
- #_reduce_13(val, _values) ⇒ Object
- #_reduce_14(val, _values) ⇒ Object
- #_reduce_15(val, _values) ⇒ Object
- #_reduce_16(val, _values) ⇒ Object
- #_reduce_17(val, _values) ⇒ Object
- #_reduce_18(val, _values) ⇒ Object
- #_reduce_19(val, _values) ⇒ Object
- #_reduce_2(val, _values) ⇒ Object
- #_reduce_20(val, _values) ⇒ Object
- #_reduce_21(val, _values) ⇒ Object
- #_reduce_22(val, _values) ⇒ Object
- #_reduce_23(val, _values) ⇒ Object
- #_reduce_24(val, _values) ⇒ Object
- #_reduce_25(val, _values) ⇒ Object
- #_reduce_26(val, _values) ⇒ Object
- #_reduce_27(val, _values) ⇒ Object
- #_reduce_28(val, _values) ⇒ Object
- #_reduce_29(val, _values) ⇒ Object
- #_reduce_3(val, _values) ⇒ Object
- #_reduce_30(val, _values) ⇒ Object
- #_reduce_31(val, _values) ⇒ Object
- #_reduce_32(val, _values) ⇒ Object
- #_reduce_33(val, _values) ⇒ Object
- #_reduce_34(val, _values) ⇒ Object
-
#_reduce_36(val, _values) ⇒ Object
reduce 35 omitted.
- #_reduce_37(val, _values) ⇒ Object
- #_reduce_38(val, _values) ⇒ Object
- #_reduce_39(val, _values) ⇒ Object
- #_reduce_4(val, _values) ⇒ Object
- #_reduce_40(val, _values) ⇒ Object
- #_reduce_41(val, _values) ⇒ Object
- #_reduce_42(val, _values) ⇒ Object
- #_reduce_43(val, _values) ⇒ Object
- #_reduce_44(val, _values) ⇒ Object
- #_reduce_5(val, _values) ⇒ Object
- #_reduce_6(val, _values) ⇒ Object
- #_reduce_7(val, _values) ⇒ Object
- #_reduce_8(val, _values) ⇒ Object
- #_reduce_9(val, _values) ⇒ Object
- #_reduce_none(val, _values) ⇒ Object
-
#initialize ⇒ Parser
constructor
A new instance of Parser.
- #next_token ⇒ Object
- #parse(string) ⇒ Object
Constructor Details
Instance Method Details
#_reduce_1(val, _values) ⇒ Object
reduce 0 omitted
311 312 313 |
# File 'lib/synvert/core/node_query/parser.racc.rb', line 311 def _reduce_1(val, _values) Compiler::Expression.new(rest: val[1], relationship: :child) end |
#_reduce_10(val, _values) ⇒ Object
347 348 349 |
# File 'lib/synvert/core/node_query/parser.racc.rb', line 347 def _reduce_10(val, _values) Compiler::Selector.new(attribute_list: val[0], index: val[1]) end |
#_reduce_11(val, _values) ⇒ Object
351 352 353 |
# File 'lib/synvert/core/node_query/parser.racc.rb', line 351 def _reduce_11(val, _values) Compiler::Selector.new(node_type: val[0], attribute_list: val[1]) end |
#_reduce_12(val, _values) ⇒ Object
355 356 357 |
# File 'lib/synvert/core/node_query/parser.racc.rb', line 355 def _reduce_12(val, _values) Compiler::Selector.new(node_type: val[0]) end |
#_reduce_13(val, _values) ⇒ Object
359 360 361 |
# File 'lib/synvert/core/node_query/parser.racc.rb', line 359 def _reduce_13(val, _values) Compiler::Selector.new(attribute_list: val[0]) end |
#_reduce_14(val, _values) ⇒ Object
363 364 365 |
# File 'lib/synvert/core/node_query/parser.racc.rb', line 363 def _reduce_14(val, _values) Compiler::AttributeList.new(attribute: val[1], rest: val[3]) end |
#_reduce_15(val, _values) ⇒ Object
367 368 369 |
# File 'lib/synvert/core/node_query/parser.racc.rb', line 367 def _reduce_15(val, _values) Compiler::AttributeList.new(attribute: val[1]) end |
#_reduce_16(val, _values) ⇒ Object
371 372 373 |
# File 'lib/synvert/core/node_query/parser.racc.rb', line 371 def _reduce_16(val, _values) Compiler::Attribute.new(key: val[0], value: val[2], operator: :!=) end |
#_reduce_17(val, _values) ⇒ Object
375 376 377 |
# File 'lib/synvert/core/node_query/parser.racc.rb', line 375 def _reduce_17(val, _values) Compiler::Attribute.new(key: val[0], value: val[2], operator: :!~) end |
#_reduce_18(val, _values) ⇒ Object
379 380 381 |
# File 'lib/synvert/core/node_query/parser.racc.rb', line 379 def _reduce_18(val, _values) Compiler::Attribute.new(key: val[0], value: val[2], operator: :=~) end |
#_reduce_19(val, _values) ⇒ Object
383 384 385 |
# File 'lib/synvert/core/node_query/parser.racc.rb', line 383 def _reduce_19(val, _values) Compiler::Attribute.new(key: val[0], value: val[2], operator: :>=) end |
#_reduce_2(val, _values) ⇒ Object
315 316 317 |
# File 'lib/synvert/core/node_query/parser.racc.rb', line 315 def _reduce_2(val, _values) Compiler::Expression.new(rest: val[1], relationship: :subsequent_sibling) end |
#_reduce_20(val, _values) ⇒ Object
387 388 389 |
# File 'lib/synvert/core/node_query/parser.racc.rb', line 387 def _reduce_20(val, _values) Compiler::Attribute.new(key: val[0], value: val[2], operator: :>) end |
#_reduce_21(val, _values) ⇒ Object
391 392 393 |
# File 'lib/synvert/core/node_query/parser.racc.rb', line 391 def _reduce_21(val, _values) Compiler::Attribute.new(key: val[0], value: val[2], operator: :<=) end |
#_reduce_22(val, _values) ⇒ Object
395 396 397 |
# File 'lib/synvert/core/node_query/parser.racc.rb', line 395 def _reduce_22(val, _values) Compiler::Attribute.new(key: val[0], value: val[2], operator: :<) end |
#_reduce_23(val, _values) ⇒ Object
399 400 401 |
# File 'lib/synvert/core/node_query/parser.racc.rb', line 399 def _reduce_23(val, _values) Compiler::Attribute.new(key: val[0], value: val[2], operator: :==) end |
#_reduce_24(val, _values) ⇒ Object
403 404 405 |
# File 'lib/synvert/core/node_query/parser.racc.rb', line 403 def _reduce_24(val, _values) Compiler::Attribute.new(key: val[0], value: val[2], operator: :includes) end |
#_reduce_25(val, _values) ⇒ Object
407 408 409 |
# File 'lib/synvert/core/node_query/parser.racc.rb', line 407 def _reduce_25(val, _values) Compiler::Attribute.new(key: val[0], value: Compiler::Array.new, operator: :!=) end |
#_reduce_26(val, _values) ⇒ Object
411 412 413 |
# File 'lib/synvert/core/node_query/parser.racc.rb', line 411 def _reduce_26(val, _values) Compiler::Attribute.new(key: val[0], value: Compiler::Array.new, operator: :==) end |
#_reduce_27(val, _values) ⇒ Object
415 416 417 |
# File 'lib/synvert/core/node_query/parser.racc.rb', line 415 def _reduce_27(val, _values) Compiler::Attribute.new(key: val[0], value: Compiler::Array.new, operator: :not_in) end |
#_reduce_28(val, _values) ⇒ Object
419 420 421 |
# File 'lib/synvert/core/node_query/parser.racc.rb', line 419 def _reduce_28(val, _values) Compiler::Attribute.new(key: val[0], value: Compiler::Array.new, operator: :in) end |
#_reduce_29(val, _values) ⇒ Object
423 424 425 |
# File 'lib/synvert/core/node_query/parser.racc.rb', line 423 def _reduce_29(val, _values) Compiler::Attribute.new(key: val[0], value: val[3], operator: :!=) end |
#_reduce_3(val, _values) ⇒ Object
319 320 321 |
# File 'lib/synvert/core/node_query/parser.racc.rb', line 319 def _reduce_3(val, _values) Compiler::Expression.new(rest: val[1], relationship: :next_sibling) end |
#_reduce_30(val, _values) ⇒ Object
427 428 429 |
# File 'lib/synvert/core/node_query/parser.racc.rb', line 427 def _reduce_30(val, _values) Compiler::Attribute.new(key: val[0], value: val[3], operator: :==) end |
#_reduce_31(val, _values) ⇒ Object
431 432 433 |
# File 'lib/synvert/core/node_query/parser.racc.rb', line 431 def _reduce_31(val, _values) Compiler::Attribute.new(key: val[0], value: val[3], operator: :not_in) end |
#_reduce_32(val, _values) ⇒ Object
435 436 437 |
# File 'lib/synvert/core/node_query/parser.racc.rb', line 435 def _reduce_32(val, _values) Compiler::Attribute.new(key: val[0], value: val[3], operator: :in) end |
#_reduce_33(val, _values) ⇒ Object
439 440 441 |
# File 'lib/synvert/core/node_query/parser.racc.rb', line 439 def _reduce_33(val, _values) Compiler::Array.new(value: val[0], rest: val[1]) end |
#_reduce_34(val, _values) ⇒ Object
443 444 445 |
# File 'lib/synvert/core/node_query/parser.racc.rb', line 443 def _reduce_34(val, _values) Compiler::Array.new(value: val[0]) end |
#_reduce_36(val, _values) ⇒ Object
reduce 35 omitted
449 450 451 |
# File 'lib/synvert/core/node_query/parser.racc.rb', line 449 def _reduce_36(val, _values) Compiler::DynamicAttribute.new(value: val[1]) end |
#_reduce_37(val, _values) ⇒ Object
453 454 455 |
# File 'lib/synvert/core/node_query/parser.racc.rb', line 453 def _reduce_37(val, _values) Compiler::Boolean.new(value: val[0]) end |
#_reduce_38(val, _values) ⇒ Object
457 458 459 |
# File 'lib/synvert/core/node_query/parser.racc.rb', line 457 def _reduce_38(val, _values) Compiler::Float.new(value: val[0]) end |
#_reduce_39(val, _values) ⇒ Object
461 462 463 |
# File 'lib/synvert/core/node_query/parser.racc.rb', line 461 def _reduce_39(val, _values) Compiler::Integer.new(value: val[0]) end |
#_reduce_4(val, _values) ⇒ Object
323 324 325 |
# File 'lib/synvert/core/node_query/parser.racc.rb', line 323 def _reduce_4(val, _values) Compiler::Expression.new(goto_scope: val[1], rest: val[3]) end |
#_reduce_40(val, _values) ⇒ Object
465 466 467 |
# File 'lib/synvert/core/node_query/parser.racc.rb', line 465 def _reduce_40(val, _values) Compiler::Nil.new(value: val[0]) end |
#_reduce_41(val, _values) ⇒ Object
469 470 471 |
# File 'lib/synvert/core/node_query/parser.racc.rb', line 469 def _reduce_41(val, _values) Compiler::Regexp.new(value: val[0]) end |
#_reduce_42(val, _values) ⇒ Object
473 474 475 |
# File 'lib/synvert/core/node_query/parser.racc.rb', line 473 def _reduce_42(val, _values) Compiler::String.new(value: val[0]) end |
#_reduce_43(val, _values) ⇒ Object
477 478 479 |
# File 'lib/synvert/core/node_query/parser.racc.rb', line 477 def _reduce_43(val, _values) Compiler::Symbol.new(value: val[0]) end |
#_reduce_44(val, _values) ⇒ Object
481 482 483 |
# File 'lib/synvert/core/node_query/parser.racc.rb', line 481 def _reduce_44(val, _values) Compiler::Identifier.new(value: val[0]) end |
#_reduce_5(val, _values) ⇒ Object
327 328 329 |
# File 'lib/synvert/core/node_query/parser.racc.rb', line 327 def _reduce_5(val, _values) Compiler::Expression.new(relationship: val[0].to_sym, rest: val[2]) end |
#_reduce_6(val, _values) ⇒ Object
331 332 333 |
# File 'lib/synvert/core/node_query/parser.racc.rb', line 331 def _reduce_6(val, _values) Compiler::Expression.new(selector: val[0], rest: val[1]) end |
#_reduce_7(val, _values) ⇒ Object
335 336 337 |
# File 'lib/synvert/core/node_query/parser.racc.rb', line 335 def _reduce_7(val, _values) Compiler::Expression.new(selector: val[0]) end |
#_reduce_8(val, _values) ⇒ Object
339 340 341 |
# File 'lib/synvert/core/node_query/parser.racc.rb', line 339 def _reduce_8(val, _values) Compiler::Selector.new(node_type: val[0], attribute_list: val[1], index: val[2]) end |
#_reduce_9(val, _values) ⇒ Object
343 344 345 |
# File 'lib/synvert/core/node_query/parser.racc.rb', line 343 def _reduce_9(val, _values) Compiler::Selector.new(node_type: val[0], index: val[1]) end |
#_reduce_none(val, _values) ⇒ Object
485 486 487 |
# File 'lib/synvert/core/node_query/parser.racc.rb', line 485 def _reduce_none(val, _values) val[0] end |
#next_token ⇒ Object
22 23 24 |
# File 'lib/synvert/core/node_query/parser.racc.rb', line 22 def next_token @lexer.next_token end |
#parse(string) ⇒ Object
17 18 19 20 |
# File 'lib/synvert/core/node_query/parser.racc.rb', line 17 def parse string @lexer.parse string do_parse end |