Class: Rlang::Parser::CVar
- Includes:
- Log
- Defined in:
- lib/rlang/parser/cvar.rb
Instance Attribute Summary collapse
-
#klass ⇒ Object
readonly
Returns the value of attribute klass.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#wtype ⇒ Object
Returns the value of attribute wtype.
Instance Method Summary collapse
- #address ⇒ Object
- #class_name ⇒ Object
-
#initialize(klass, name, value = 0, wtype = WType::DEFAULT) ⇒ CVar
constructor
A new instance of CVar.
- #value ⇒ Object
- #wasm_name ⇒ Object
- #wasm_type ⇒ Object
Methods included from Log
included, logger, #logger, logger=
Constructor Details
#initialize(klass, name, value = 0, wtype = WType::DEFAULT) ⇒ CVar
Returns a new instance of 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 # Allocate and initialize the new cvar 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
#klass ⇒ Object (readonly)
Returns the value of attribute klass.
15 16 17 |
# File 'lib/rlang/parser/cvar.rb', line 15 def klass @klass end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
15 16 17 |
# File 'lib/rlang/parser/cvar.rb', line 15 def name @name end |
#wtype ⇒ Object
Returns the value of attribute wtype.
16 17 18 |
# File 'lib/rlang/parser/cvar.rb', line 16 def wtype @wtype end |
Instance Method Details
#address ⇒ Object
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 |
#value ⇒ Object
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 |