Class: SFRP::Mono::FuncCallExp

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, func_str, arg_exps, id = nil) ⇒ FuncCallExp

Returns a new instance of FuncCallExp.



57
58
59
60
61
62
# File 'lib/sfrp/mono/expression.rb', line 57

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

Instance Method Details

#compObject



64
65
66
# File 'lib/sfrp/mono/expression.rb', line 64

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

#memory(set) ⇒ Object



73
74
75
76
77
# File 'lib/sfrp/mono/expression.rb', line 73

def memory(set)
  @arg_exps.reduce(set.func(@func_str).memory(set)) do |m, e|
    m.and(e.memory(set))
  end
end

#to_low(set, env) ⇒ Object



68
69
70
71
# File 'lib/sfrp/mono/expression.rb', line 68

def to_low(set, env)
  low_arg_exps = @arg_exps.map { |e| e.to_low(set, env) }
  set.func(@func_str).low_call_exp_in_exp(set, env, low_arg_exps)
end