Class: Dentaku::AST::Operation
- Inherits:
-
Node
- Object
- Node
- Dentaku::AST::Operation
show all
- Defined in:
- lib/dentaku/ast/operation.rb
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Node
arity, #name, precedence, resolve_class, #type
Constructor Details
#initialize(left, right) ⇒ Operation
Returns a new instance of Operation.
16
17
18
19
|
# File 'lib/dentaku/ast/operation.rb', line 16
def initialize(left, right)
@left = left
@right = right
end
|
Instance Attribute Details
#left ⇒ Object
Returns the value of attribute left.
6
7
8
|
# File 'lib/dentaku/ast/operation.rb', line 6
def left
@left
end
|
#right ⇒ Object
Returns the value of attribute right.
6
7
8
|
# File 'lib/dentaku/ast/operation.rb', line 6
def right
@right
end
|
Class Method Details
.max_param_count ⇒ Object
12
13
14
|
# File 'lib/dentaku/ast/operation.rb', line 12
def self.max_param_count
arity
end
|
.min_param_count ⇒ Object
8
9
10
|
# File 'lib/dentaku/ast/operation.rb', line 8
def self.min_param_count
arity
end
|
.right_associative? ⇒ Boolean
25
26
27
|
# File 'lib/dentaku/ast/operation.rb', line 25
def self.right_associative?
false
end
|
Instance Method Details
#accept(visitor) ⇒ Object
29
30
31
|
# File 'lib/dentaku/ast/operation.rb', line 29
def accept(visitor)
visitor.visit_operation(self)
end
|
#dependencies(context = {}) ⇒ Object
21
22
23
|
# File 'lib/dentaku/ast/operation.rb', line 21
def dependencies(context = {})
(left.dependencies(context) + right.dependencies(context)).uniq
end
|
#display_operator ⇒ Object
Also known as:
to_s
33
34
35
|
# File 'lib/dentaku/ast/operation.rb', line 33
def display_operator
operator.to_s
end
|