Class: Emfrp::InputDef

Inherits:
Object
  • Object
show all
Defined in:
lib/emfrp/compile/c/syntax_codegen.rb

Instance Method Summary collapse

Instance Method Details

#init_func_gen(ct) ⇒ Object



290
291
292
293
294
# File 'lib/emfrp/compile/c/syntax_codegen.rb', line 290

def init_func_gen(ct)
  ct.define_func(ct.tref(self), init_func_name(ct), []) do |x|
    x << "return #{self[:init_exp].codegen(ct, x)};"
  end
end

#init_func_name(ct) ⇒ Object



300
301
302
# File 'lib/emfrp/compile/c/syntax_codegen.rb', line 300

def init_func_name(ct)
  "init_#{self[:name][:desc]}"
end

#node_var_gen(ct) ⇒ Object



296
297
298
# File 'lib/emfrp/compile/c/syntax_codegen.rb', line 296

def node_var_gen(ct)
  ct.define_global_var(ct.tref(self), "#{node_var_name(ct)}[2]")
end

#node_var_name(ct) ⇒ Object



304
305
306
# File 'lib/emfrp/compile/c/syntax_codegen.rb', line 304

def node_var_name(ct)
  "node_memory_#{self[:name][:desc]}"
end