class BELParser::Parsers::AST::Statement

AST node representing a statement.

Public Class Methods

new(children = [], properties = {}) click to toggle source

New Statement AST node.

@see Node#initialize Node class for basic properties

Calls superclass method BELParser::Parsers::AST::Node::new
# File lib/bel_parser/parsers/ast/node.rb, line 684
def initialize(children = [], properties = {})
  super(Statement.ast_type, children, properties)
end

Public Instance Methods

comment() click to toggle source
# File lib/bel_parser/parsers/ast/node.rb, line 715
def comment
  comment? ? children[-1] : nil
end
comment?() click to toggle source
# File lib/bel_parser/parsers/ast/node.rb, line 711
def comment?
  children[-1] && children[-1].is_a?(Comment)
end
object() click to toggle source

Get the object of the nested statement.

# File lib/bel_parser/parsers/ast/node.rb, line 707
def object
  object? ? children[2] : nil
end
object?() click to toggle source
# File lib/bel_parser/parsers/ast/node.rb, line 702
def object?
  children[2] && children[2].is_a?(Object)
end
relationship() click to toggle source

Get the relationship of the nested statement.

# File lib/bel_parser/parsers/ast/node.rb, line 698
def relationship
  relationship? ? children[1] : nil
end
relationship?() click to toggle source
# File lib/bel_parser/parsers/ast/node.rb, line 693
def relationship?
  children[1] && children[1].is_a?(Relationship)
end
subject() click to toggle source

Get the subject of the statement.

# File lib/bel_parser/parsers/ast/node.rb, line 689
def subject
  children[0]
end