Class: Sexp::Conditional

Inherits:
UnlabeledStatement show all
Defined in:
lib/parser/parser_nodes.rb

Instance Method Summary collapse

Methods inherited from UnlabeledStatement

#statement_label

Methods inherited from Statement

#find_labelnode, #get_statement, #node_value, #statement_label, #statement_val, #statements, #traverse

Methods inherited from Treetop::Runtime::SyntaxNode

#node_type, #node_value, #recursive_inject, #recursive_inject_parent, #recursive_select, #value

Instance Method Details

#conditionObject



895
896
897
# File 'lib/parser/parser_nodes.rb', line 895

def condition
  recursive_select( Sexp::Expression).first
end

#if_not_trueObject



907
908
909
# File 'lib/parser/parser_nodes.rb', line 907

def if_not_true
  return true_or_else[1] if true_or_else.length == 2
end

#if_trueObject



903
904
905
# File 'lib/parser/parser_nodes.rb', line 903

def if_true
  true_or_else.first
end

#true_or_elseObject



899
900
901
# File 'lib/parser/parser_nodes.rb', line 899

def true_or_else
  recursive_select( Sexp::Statement)
end