Class: SystemRDL::Evaluator::BinaryOperation
- Defined in:
- lib/systemrdl/evaluator/operation.rb
Instance Attribute Summary
Attributes inherited from Operation
Attributes included from Common
#component, #parent, #token_range
Instance Method Summary collapse
- #connect(parent, component) ⇒ Object
- #expression_width ⇒ Object
-
#initialize(operator, l_operand, r_operand, token_range) ⇒ BinaryOperation
constructor
A new instance of BinaryOperation.
Methods inherited from Operation
Constructor Details
#initialize(operator, l_operand, r_operand, token_range) ⇒ BinaryOperation
Returns a new instance of BinaryOperation.
123 124 125 126 127 128 |
# File 'lib/systemrdl/evaluator/operation.rb', line 123 def initialize(operator, l_operand, r_operand, token_range) @operator = operator @l_operand = l_operand @r_operand = r_operand super(token_range) end |
Instance Method Details
#connect(parent, component) ⇒ Object
130 131 132 133 134 |
# File 'lib/systemrdl/evaluator/operation.rb', line 130 def connect(parent, component) super @l_operand.connect(self, component) @r_operand.connect(self, component) end |
#expression_width ⇒ Object
136 137 138 139 140 141 142 |
# File 'lib/systemrdl/evaluator/operation.rb', line 136 def expression_width if [:'&&', :'||', :==, :!=, :<, :>, :<=, :>=].include?(@operator) 1 else eval_expression_width end end |