Class: SystemRDL::Evaluator::Literal
- Inherits:
-
Object
- Object
- SystemRDL::Evaluator::Literal
show all
- Includes:
- Common
- Defined in:
- lib/systemrdl/evaluator/literal.rb
Instance Attribute Summary collapse
Attributes included from Common
#component, #parent
Instance Method Summary
collapse
Methods included from Common
#connect
Constructor Details
#initialize(node) ⇒ Literal
Returns a new instance of Literal.
8
9
10
11
12
|
# File 'lib/systemrdl/evaluator/literal.rb', line 8
def initialize(node)
super(node.token_range)
@node = node
evaluate_literal
end
|
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value.
14
15
16
|
# File 'lib/systemrdl/evaluator/literal.rb', line 14
def value
@value
end
|
Instance Method Details
#evaluate(_instance, **_optargs) ⇒ Object
16
17
18
|
# File 'lib/systemrdl/evaluator/literal.rb', line 16
def evaluate(_instance, **_optargs)
@evaluated ||= Value.new(value, type, width, token_range)
end
|
#expression_width ⇒ Object
20
21
22
|
# File 'lib/systemrdl/evaluator/literal.rb', line 20
def expression_width
width
end
|
#token_range ⇒ Object
24
25
26
|
# File 'lib/systemrdl/evaluator/literal.rb', line 24
def token_range
@node.token_range
end
|