Class: Rlang::Parser::LVar

Inherits:
Object show all
Defined in:
lib/rlang/parser/lvar.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, wtype = WType::DEFAULT) ⇒ LVar

Returns a new instance of LVar.



14
15
16
17
18
19
# File 'lib/rlang/parser/lvar.rb', line 14

def initialize(name, wtype=WType::DEFAULT)
  @name = name
  # TODO: check if local/param value wtype
  # was explicitely declared
  @wtype = wtype
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



11
12
13
# File 'lib/rlang/parser/lvar.rb', line 11

def name
  @name
end

#wtypeObject

Returns the value of attribute wtype.



12
13
14
# File 'lib/rlang/parser/lvar.rb', line 12

def wtype
  @wtype
end

Instance Method Details

#wasm_nameObject



21
22
23
# File 'lib/rlang/parser/lvar.rb', line 21

def wasm_name
  "$#{name}"
end

#wasm_typeObject



25
26
27
# File 'lib/rlang/parser/lvar.rb', line 25

def wasm_type
  @wtype.wasm_type
end