Class: BELParser::Parsers::AST::NamespaceDefinition

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

Overview

AST node representing the definition of a 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 = {}) ⇒ NamespaceDefinition

New NamespaceDefinition AST node.



310
311
312
# File 'lib/bel_parser/parsers/ast/node.rb', line 310

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

Instance Attribute Details

#uriObject

Get/Set the uri property.



325
326
327
# File 'lib/bel_parser/parsers/ast/node.rb', line 325

def uri
  @uri
end

Instance Method Details

#domainObject

Get the namespace definition’s domain.



320
321
322
# File 'lib/bel_parser/parsers/ast/node.rb', line 320

def domain
  children[1]
end

#keywordObject

Get the namespace definition’s keyword.



315
316
317
# File 'lib/bel_parser/parsers/ast/node.rb', line 315

def keyword
  children[0]
end