Class: SbuilderSexp::IfExpression
- Inherits:
-
SimpleExpression
- Object
- Treetop::Runtime::SyntaxNode
- Root
- AbstactExpression
- SimpleExpression
- SbuilderSexp::IfExpression
- Defined in:
- lib/parser/parser_nodes.rb
Instance Method Summary collapse
-
#condition_node ⇒ Expression
Node for condition.
-
#else_expression_node ⇒ Expression
For ELSE expression.
- #name ⇒ Object
-
#then_expression_node ⇒ Expression
For THEN expression.
Methods inherited from SimpleExpression
Methods inherited from AbstactExpression
#expression_postfix, #expression_prefix, #expression_val, #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
#condition_node ⇒ Expression
Node for condition
336 337 338 |
# File 'lib/parser/parser_nodes.rb', line 336 def condition_node recursive_select( SbuilderSexp::IfExpressionCondition ).first.recursive_select(SbuilderSexp::Expression).first end |
#else_expression_node ⇒ Expression
Returns for ELSE expression.
345 346 347 348 349 |
# File 'lib/parser/parser_nodes.rb', line 345 def else_expression_node tree_node = recursive_select( SbuilderSexp::IfExpressionElse ).first return tree_node unless tree_node tree_node.recursive_select(SbuilderSexp::Expression).first end |
#name ⇒ Object
351 352 353 |
# File 'lib/parser/parser_nodes.rb', line 351 def name 'IF' end |
#then_expression_node ⇒ Expression
Returns for THEN expression.
341 342 |
# File 'lib/parser/parser_nodes.rb', line 341 def then_expression_node recursive_select( SbuilderSexp::IfExpressionThen ).first.recursive_select(SbuilderSexp::Expression).first end |