Class: Jaina::Parser::Expression::Operator::Or Private

Inherits:
NonTerminal show all
Defined in:
lib/jaina/parser/expression/operator/or.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0

Constant Summary

Constants inherited from Abstract

Abstract::Error, Abstract::InompatibleDirectionComparisonError

Constants included from Abstract::DSL

Abstract::DSL::Error, Abstract::DSL::IncorrectAssociativityDirectionError, Abstract::DSL::IncorrectPrecedenceLevelError, Abstract::DSL::IncorrectTokenError, Abstract::DSL::LEFT_ASSOC, Abstract::DSL::RIGHT_ASSOC

Instance Attribute Summary

Attributes inherited from Abstract

#arguments, #expressions

Instance Method Summary collapse

Methods inherited from NonTerminal

non_terminal?, terminal?

Methods inherited from Abstract

#initialize, #lower, lower?

Methods included from Abstract::DSL

included

Constructor Details

This class inherits a constructor from Jaina::Parser::Expression::Operator::Abstract

Instance Method Details

#evaluate(context) ⇒ Any

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parameters:

Returns:

  • (Any)

Since:

  • 0.2.0



17
18
19
# File 'lib/jaina/parser/expression/operator/or.rb', line 17

def evaluate(context)
  left_expression.evaluate(context) || right_expression.evaluate(context)
end

#left_expressionJaina::Parser::Expression::Operator::Abstract

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



25
26
27
# File 'lib/jaina/parser/expression/operator/or.rb', line 25

def left_expression
  expressions[0]
end

#right_expressionJaina::Parser::Expression::Operator::Abstract

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



33
34
35
# File 'lib/jaina/parser/expression/operator/or.rb', line 33

def right_expression
  expressions[1]
end