Class: SystemRDL::Evaluator::UnaryOperation
- 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, operand, token_range) ⇒ UnaryOperation
constructor
A new instance of UnaryOperation.
Methods inherited from Operation
Constructor Details
#initialize(operator, operand, token_range) ⇒ UnaryOperation
Returns a new instance of UnaryOperation.
60 61 62 63 64 |
# File 'lib/systemrdl/evaluator/operation.rb', line 60 def initialize(operator, operand, token_range) @operator = operator @operand = operand super(token_range) end |
Instance Method Details
#connect(parent, component) ⇒ Object
66 67 68 69 |
# File 'lib/systemrdl/evaluator/operation.rb', line 66 def connect(parent, component) super @operand.connect(self, component) end |
#expression_width ⇒ Object
71 72 73 74 75 76 77 |
# File 'lib/systemrdl/evaluator/operation.rb', line 71 def expression_width if [:~, :+, :-].include?(@operator) @operand.expression_width else 1 end end |