Class: SbuilderSexp::InfixExpression
- Inherits:
-
AbstactExpression
- Object
- Treetop::Runtime::SyntaxNode
- Root
- AbstactExpression
- SbuilderSexp::InfixExpression
- Defined in:
- lib/parser/parser_nodes.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#expression_val ⇒ Object
during traverse show operator in between ‘lhs’ and ‘rhs’.
-
#operator ⇒ String
Operator to use (nil if no rhs, else rhs.operator).
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_val ⇒ Object
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 |
#operator ⇒ String
Returns 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 |