Class: SbuilderSexp::InfixExpression

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

Instance Method Summary collapse

Methods inherited from AbstactExpression

#expression_postfix, #expression_prefix, #expressions, #has_rhs, #lhs_node, #node_value, #rhs_node, #traverse

Methods inherited from Treetop::Runtime::SyntaxNode

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

Instance Method Details

#expression_valObject

during traverse show operator in between ‘lhs’ and ‘rhs’



166
167
168
# File 'lib/parser/parser_nodes.rb', line 166

def expression_val
  operator
end

#operatorString

Returns operator to use (nil if no rhs, else rhs.operator).

Returns:

  • (String)

    operator to use (nil if no rhs, else rhs.operator)



172
173
174
175
176
# File 'lib/parser/parser_nodes.rb', line 172

def operator 
  return nil if !has_rhs
  rhs_operators = expressions[1].recursive_select( SbuilderSexp::Operator )
  return rhs_operators && rhs_operators.any? && rhs_operators.first.node_value
end