Class: BELParser::Language::Semantics::SemanticValue
Overview
AST node for Value is a semantic AST.
Instance Attribute Summary
Attributes inherited from AST::Node
#children, #hash, #type
Instance Method Summary
collapse
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
#serialize
Constructor Details
#initialize(children = [], **properties) ⇒ 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
|