Class: SbuilderSexp::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



997
998
999
# File 'lib/parser/parser_nodes.rb', line 997

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

#if_not_trueObject



1009
1010
1011
# File 'lib/parser/parser_nodes.rb', line 1009

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

#if_trueObject



1005
1006
1007
# File 'lib/parser/parser_nodes.rb', line 1005

def if_true
  true_or_else.first
end

#true_or_elseObject



1001
1002
1003
# File 'lib/parser/parser_nodes.rb', line 1001

def true_or_else
  recursive_select( SbuilderSexp::Statement)
end