Class: BELParser::Parsers::AST::Parameter

Inherits:
Node show all
Defined in:
lib/bel_parser/parsers/ast/node.rb

Overview

AST node representing a parameter.

Instance Attribute Summary

Attributes inherited from Node

#character_range, #complete, #line_number

Attributes inherited from AST::Node

#children, #hash, #type

Instance Method Summary collapse

Methods inherited from Node

#add_syntax_error, #append, #child, #children?, #complete?, #concat, #first_child, #fourth_child, #freeze, #incomplete?, #num_children, #range_end, #range_start, #second_child, #syntax_errors, #third_child, #traverse, #updated

Methods inherited from AST::Node

#==, #append, #concat, #dup, #eql?, #inspect, #to_a, #to_ast, #to_bel, #to_s, #to_sexp, #updated

Methods included from BELParser::Parsers

#serialize

Constructor Details

#initialize(children = [], properties = {}) ⇒ Parameter

New Parameter AST node.



588
589
590
# File 'lib/bel_parser/parsers/ast/node.rb', line 588

def initialize(children = [], properties = {})
  super(Parameter.ast_type, children, properties)
end

Instance Method Details

#prefixObject

Get the prefix for the parameter.



593
594
595
# File 'lib/bel_parser/parsers/ast/node.rb', line 593

def prefix
  children[0]
end

#valueObject

Get the value for the parameter.



598
599
600
# File 'lib/bel_parser/parsers/ast/node.rb', line 598

def value
  children[1]
end