Class: Rlang::Parser::CVar
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods included from Log
included, logger, #logger, logger=
Constructor Details
#initialize(klass, name, value = 0, wtype = WType::DEFAULT) ⇒ CVar
18
19
20
21
22
23
24
25
26
|
# File 'lib/rlang/parser/cvar.rb', line 18
def initialize(klass, name, value=0, wtype=WType::DEFAULT)
@klass = klass
@name = name
@wtype = wtype
raise "Error: #{self.class} #{self.wasm_name} already created!" if DAta.exist? self.wasm_name.to_sym
@data = DAta.new(self.wasm_name.to_sym, value, wtype) unless wtype.name == :Class
logger.debug "creating #{self.class} #{self.class_name}::#{name} @ #{@address} with value #{value} / wtype #{wtype}"
end
|
Instance Attribute Details
Returns the value of attribute klass.
15
16
17
|
# File 'lib/rlang/parser/cvar.rb', line 15
def klass
@klass
end
|
Returns the value of attribute name.
15
16
17
|
# File 'lib/rlang/parser/cvar.rb', line 15
def name
@name
end
|
Returns the value of attribute wtype.
16
17
18
|
# File 'lib/rlang/parser/cvar.rb', line 16
def wtype
@wtype
end
|
Instance Method Details
32
33
34
|
# File 'lib/rlang/parser/cvar.rb', line 32
def address
@data.address
end
|
#class_name ⇒ Object
28
29
30
|
# File 'lib/rlang/parser/cvar.rb', line 28
def class_name
@klass.path_name
end
|
36
37
38
|
# File 'lib/rlang/parser/cvar.rb', line 36
def value
@data.value
end
|
#wasm_name ⇒ Object
40
41
42
|
# File 'lib/rlang/parser/cvar.rb', line 40
def wasm_name
"$#{self.class_name}::#{@name}"
end
|
#wasm_type ⇒ Object
44
45
46
|
# File 'lib/rlang/parser/cvar.rb', line 44
def wasm_type
@wtype.wasm_type
end
|