Class: BELParser::Language::Semantics::SemanticParameter

Inherits:
SemanticASTNode show all
Defined in:
lib/bel_parser/language/semantics_ast.rb

Overview

AST node for Parameter is a semantic AST.

Instance Attribute Summary

Attributes inherited from AST::Node

#children, #hash, #type

Instance Method Summary collapse

Methods inherited from SemanticASTNode

#terminal?

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) ⇒ SemanticParameter

Returns a new instance of SemanticParameter.



330
331
332
# File 'lib/bel_parser/language/semantics_ast.rb', line 330

def initialize(children = [], **properties)
  super(:parameter, children, properties)
end

Instance Method Details

#match(parse_node, spec, will_match_partial = false) ⇒ Object



334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
# File 'lib/bel_parser/language/semantics_ast.rb', line 334

def match(parse_node, spec, will_match_partial = false)
  return nil_node_warning(
    parse_node,
    spec,
    BELParser::Parsers::AST::Parameter) if parse_node.nil?

  if parse_node.type == type
    success(parse_node, spec)
  else
    type_warning(
      parse_node,
      spec,
      BELParser::Parsers::AST::Parameter,
      parse_node)
  end
end