Class: Jaina::Parser::Expression::Operator::Abstract Private
- Inherits:
-
Object
- Object
- Jaina::Parser::Expression::Operator::Abstract
- Includes:
- DSL
- Defined in:
- lib/jaina/parser/expression/operator/abstract.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.
Direct Known Subclasses
Defined Under Namespace
Modules: DSL
Constant Summary collapse
- Error =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Class.new(StandardError)
- InompatibleDirectionComparisonError =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Class.new(Error)
Constants included from DSL
DSL::IncorrectAssociativityDirectionError, DSL::IncorrectPrecedenceLevelError, DSL::IncorrectTokenError, DSL::LEFT_ASSOC, DSL::RIGHT_ASSOC
Instance Attribute Summary collapse
- #arguments ⇒ Array<Any> readonly private
- #expressions ⇒ Array<Jaina::Parser::Expressions::Operator::Abstract> readonly private
Class Method Summary collapse
Instance Method Summary collapse
- #evaluate(context) ⇒ Any private
- #initialize(arguments: [], expressions: []) ⇒ void constructor private
- #lower(another_operator) ⇒ Boolean private
Methods included from DSL
Constructor Details
#initialize(arguments: [], expressions: []) ⇒ void
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.
55 56 57 58 |
# File 'lib/jaina/parser/expression/operator/abstract.rb', line 55 def initialize(arguments: [], expressions: []) @arguments = arguments @expressions = expressions end |
Instance Attribute Details
#arguments ⇒ Array<Any> (readonly)
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.
41 42 43 |
# File 'lib/jaina/parser/expression/operator/abstract.rb', line 41 def arguments @arguments end |
#expressions ⇒ Array<Jaina::Parser::Expressions::Operator::Abstract> (readonly)
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.
47 48 49 |
# File 'lib/jaina/parser/expression/operator/abstract.rb', line 47 def expressions @expressions end |
Class Method Details
.lower?(another_operator) ⇒ Boolean
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.
23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/jaina/parser/expression/operator/abstract.rb', line 23 def lower?(another_operator) raise( InompatibleDirectionComparisonError, "Trying to compare non-comparable terms `#{token}` and `#{another_operator.token}`" ) if associativity_direction.nil? || another_operator.associativity_direction.nil? if associativity_direction == Jaina::Parser::Expression::Operator::Abstract::DSL::LEFT_ASSOC associativity_direction <= another_operator.associativity_direction else associativity_direction < another_operator.associativity_direction end end |
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.
65 |
# File 'lib/jaina/parser/expression/operator/abstract.rb', line 65 def evaluate(context); end |
#lower(another_operator) ⇒ Boolean
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.
72 73 74 |
# File 'lib/jaina/parser/expression/operator/abstract.rb', line 72 def lower(another_operator) self.class.lower(another_operator) end |