Class: BELParser::Parsers::AST::Statement
- Defined in:
- lib/bel_parser/parsers/ast/node.rb
Overview
AST node representing a statement.
Instance Attribute Summary
Attributes inherited from Node
#character_range, #complete, #line_number
Attributes inherited from AST::Node
Instance Method Summary collapse
- #comment ⇒ Object
- #comment? ⇒ Boolean
-
#initialize(children = [], properties = {}) ⇒ Statement
constructor
New Statement AST node.
-
#object ⇒ Object
Get the object of the nested statement.
- #object? ⇒ Boolean
-
#relationship ⇒ Object
Get the relationship of the nested statement.
- #relationship? ⇒ Boolean
-
#subject ⇒ Object
Get the subject of the statement.
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
Constructor Details
Instance Method Details
#comment ⇒ Object
715 716 717 |
# File 'lib/bel_parser/parsers/ast/node.rb', line 715 def comment comment? ? children[-1] : nil end |
#comment? ⇒ Boolean
711 712 713 |
# File 'lib/bel_parser/parsers/ast/node.rb', line 711 def comment? children[-1] && children[-1].is_a?(Comment) end |
#object ⇒ Object
Get the object of the nested statement.
707 708 709 |
# File 'lib/bel_parser/parsers/ast/node.rb', line 707 def object object? ? children[2] : nil end |
#object? ⇒ Boolean
702 703 704 |
# File 'lib/bel_parser/parsers/ast/node.rb', line 702 def object? children[2] && children[2].is_a?(Object) end |
#relationship ⇒ Object
Get the relationship of the nested statement.
698 699 700 |
# File 'lib/bel_parser/parsers/ast/node.rb', line 698 def relationship relationship? ? children[1] : nil end |
#relationship? ⇒ Boolean
693 694 695 |
# File 'lib/bel_parser/parsers/ast/node.rb', line 693 def relationship? children[1] && children[1].is_a?(Relationship) end |
#subject ⇒ Object
Get the subject of the statement.
689 690 691 |
# File 'lib/bel_parser/parsers/ast/node.rb', line 689 def subject children[0] end |