Class: SFRP::Mono::VConstCallExp

Inherits:
Exp
  • Object
show all
Defined in:
lib/sfrp/mono/expression.rb

Instance Attribute Summary

Attributes inherited from Exp

#type_str

Instance Method Summary collapse

Methods inherited from Exp

#==

Constructor Details

#initialize(type_str, vconst_str, arg_exps, id = nil) ⇒ VConstCallExp

Returns a new instance of VConstCallExp.



81
82
83
84
85
86
# File 'lib/sfrp/mono/expression.rb', line 81

def initialize(type_str, vconst_str, arg_exps, id = nil)
  @type_str = type_str
  @vconst_str = vconst_str
  @arg_exps = arg_exps
  @id = id
end

Instance Method Details

#compObject



88
89
90
# File 'lib/sfrp/mono/expression.rb', line 88

def comp
  [@type_str, @vconst_strs, @arg_exps]
end

#memory(set) ⇒ Object



97
98
99
100
101
# File 'lib/sfrp/mono/expression.rb', line 97

def memory(set)
  @arg_exps.reduce(Memory.one(@type_str)) do |m, e|
    m.and(e.memory(set))
  end
end

#to_low(set, env) ⇒ Object



92
93
94
95
# File 'lib/sfrp/mono/expression.rb', line 92

def to_low(set, env)
  low_arg_exps = @arg_exps.map { |e| e.to_low(set, env) }
  set.vconst(@vconst_str).low_constructor_call_exp(low_arg_exps)
end