Class: BELParser::Parsers::AST::AnnotationDefinition

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

Overview

AST node representing the definition of an annotation.

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 = {}) ⇒ AnnotationDefinition

New AnnotationDefinition AST node.



256
257
258
# File 'lib/bel_parser/parsers/ast/node.rb', line 256

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

Instance Attribute Details

#uriObject

Get/Set the uri property.



271
272
273
# File 'lib/bel_parser/parsers/ast/node.rb', line 271

def uri
  @uri
end

Instance Method Details

#domainObject

Get the annotation definition’s domain.



266
267
268
# File 'lib/bel_parser/parsers/ast/node.rb', line 266

def domain
  children[1]
end

#keywordObject

Get the annotation definition’s keyword.



261
262
263
# File 'lib/bel_parser/parsers/ast/node.rb', line 261

def keyword
  children[0]
end