Class: BELParser::Language::Semantics::SemanticValue
- Inherits:
-
SemanticASTNode
- Object
- AST::Node
- SemanticASTNode
- BELParser::Language::Semantics::SemanticValue
- Defined in:
- lib/bel_parser/language/semantics_ast.rb
Overview
AST node for Value is a semantic AST.
Instance Attribute Summary
Attributes inherited from AST::Node
Instance Method Summary collapse
-
#initialize(children = [], **properties) ⇒ SemanticValue
constructor
A new instance of SemanticValue.
- #match(parse_node, spec, will_match_partial = false) ⇒ Object
- #terminal? ⇒ Boolean
- #value_patterns ⇒ Object
Methods inherited from AST::Node
#==, #append, #concat, #dup, #eql?, #inspect, #to_a, #to_ast, #to_bel, #to_s, #to_sexp, #updated
Methods included from Parsers
Constructor Details
#initialize(children = [], **properties) ⇒ SemanticValue
Returns a new instance of SemanticValue.
460 461 462 |
# File 'lib/bel_parser/language/semantics_ast.rb', line 460 def initialize(children = [], **properties) super(:value, children, properties) end |
Instance Method Details
#match(parse_node, spec, will_match_partial = false) ⇒ Object
472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 |
# File 'lib/bel_parser/language/semantics_ast.rb', line 472 def match(parse_node, spec, will_match_partial = false) return nil_node_warning( parse_node, spec, BELParser::Parsers::AST::Value) if parse_node.nil? if parse_node.type != BELParser::Parsers::AST::Value.ast_type return type_warning( parse_node, spec, BELParser::Parsers::AST::Value, parse_node) end value_patterns.map do |pattern| pattern.match(parse_node, spec) end end |
#terminal? ⇒ Boolean
464 465 466 |
# File 'lib/bel_parser/language/semantics_ast.rb', line 464 def terminal? true end |
#value_patterns ⇒ Object
468 469 470 |
# File 'lib/bel_parser/language/semantics_ast.rb', line 468 def value_patterns children end |