Class: SystemRDL::Evaluator::Operation

Inherits:
Object
  • Object
show all
Includes:
Common
Defined in:
lib/systemrdl/evaluator/operation.rb

Direct Known Subclasses

BinaryOperation, UnaryOperation

Instance Attribute Summary collapse

Attributes included from Common

#component, #parent

Instance Method Summary collapse

Methods included from Common

#connect, #initialize

Instance Attribute Details

#token_rangeObject (readonly)

Returns the value of attribute token_range.



8
9
10
# File 'lib/systemrdl/evaluator/operation.rb', line 8

def token_range
  @token_range
end

Instance Method Details

#evaluate(instance, width: nil, **_optargs) ⇒ Object



10
11
12
13
# File 'lib/systemrdl/evaluator/operation.rb', line 10

def evaluate(instance, width: nil, **_optargs)
  value, type, width = eval_operation(instance, width)
  Value.new(value, type, width, token_range)
end