Class: Rlang::Parser::IVar
- Includes:
- Log
- Defined in:
- lib/rlang/parser/ivar.rb
Instance Attribute Summary collapse
-
#klass ⇒ Object
readonly
Returns the value of attribute klass.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#offset ⇒ Object
Returns the value of attribute offset.
-
#wtype ⇒ Object
Returns the value of attribute wtype.
Instance Method Summary collapse
-
#initialize(klass, name, wtype = WType::DEFAULT) ⇒ IVar
constructor
A new instance of IVar.
- #size ⇒ Object
- #wasm_name ⇒ Object
- #wasm_type ⇒ Object
Methods included from Log
included, logger, #logger, logger=
Constructor Details
#initialize(klass, name, wtype = WType::DEFAULT) ⇒ IVar
Returns a new instance of IVar.
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/rlang/parser/ivar.rb', line 17 def initialize(klass, name, wtype=WType::DEFAULT) @klass = klass @name = name @wtype = wtype # this is the offset of the instance variable # in memory in the order they are declared # It is computed at the end of a class # definition @offset = nil logger.debug "Instance variable #{name} created" end |
Instance Attribute Details
#klass ⇒ Object (readonly)
Returns the value of attribute klass.
14 15 16 |
# File 'lib/rlang/parser/ivar.rb', line 14 def klass @klass end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
14 15 16 |
# File 'lib/rlang/parser/ivar.rb', line 14 def name @name end |
#offset ⇒ Object
Returns the value of attribute offset.
15 16 17 |
# File 'lib/rlang/parser/ivar.rb', line 15 def offset @offset end |
#wtype ⇒ Object
Returns the value of attribute wtype.
15 16 17 |
# File 'lib/rlang/parser/ivar.rb', line 15 def wtype @wtype end |
Instance Method Details
#size ⇒ Object
29 30 31 |
# File 'lib/rlang/parser/ivar.rb', line 29 def size @wtype.size end |
#wasm_name ⇒ Object
33 34 35 |
# File 'lib/rlang/parser/ivar.rb', line 33 def wasm_name "$#{@name}" end |
#wasm_type ⇒ Object
37 38 39 |
# File 'lib/rlang/parser/ivar.rb', line 37 def wasm_type @wtype.wasm_type end |