Class: BELParser::Parsers::AST::Prefix

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

Overview

AST node representing a parameter.

Special node properties - namespace: #namespace

Instance Attribute Summary collapse

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_sexp, #updated

Constructor Details

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

New Prefix AST node.



545
546
547
# File 'lib/bel_parser/parsers/ast/node.rb', line 545

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

Instance Attribute Details

#namespaceObject

Get/Set the namespace property.



555
556
557
# File 'lib/bel_parser/parsers/ast/node.rb', line 555

def namespace
  @namespace
end

Instance Method Details

#identifierObject

Get the identifier for the prefix.



550
551
552
# File 'lib/bel_parser/parsers/ast/node.rb', line 550

def identifier
  children[0]
end