Class: Rlang::Parser::MArg

Inherits:
Object show all
Includes:
Log
Defined in:
lib/rlang/parser/marg.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Log

included, logger, #logger, logger=

Constructor Details

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

Returns a new instance of MArg.



16
17
18
19
20
# File 'lib/rlang/parser/marg.rb', line 16

def initialize(name, wtype=WType::DEFAULT)
  @name = name
  @wtype = wtype
  logger.debug "Method argument #{name} created"
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



13
14
15
# File 'lib/rlang/parser/marg.rb', line 13

def name
  @name
end

#wtypeObject

Returns the value of attribute wtype.



14
15
16
# File 'lib/rlang/parser/marg.rb', line 14

def wtype
  @wtype
end

Instance Method Details

#_self_?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/rlang/parser/marg.rb', line 22

def _self_?
  @name == :_self_
end

#wasm_nameObject



26
27
28
# File 'lib/rlang/parser/marg.rb', line 26

def wasm_name
  "$#{@name}"
end

#wasm_typeObject



30
31
32
# File 'lib/rlang/parser/marg.rb', line 30

def wasm_type
  @wtype.wasm_type
end