Method: Yadriggy::C::CodeGen#initialize

Defined in:
lib/yadriggy/c/codegen.rb

#initialize(printer, typechecker, public_methods) ⇒ CodeGen

printer is a Printer object. Only main_method is converted into an extern function. Other methods are converted into static functions.

Parameters:

  • public_methods (Array<ASTree>)

    publicly exported methods.



20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/yadriggy/c/codegen.rb', line 20

def initialize(printer, typechecker, public_methods)
  super()
  @printer = printer
  @typechecker = typechecker
  @func_counter = 0
  @func_names = {}
  @nerrors = 0
  @messages = []
  @public_methods = {}
  public_methods.each {|m| @public_methods[m.tree] = m.tree }
  @gvariables = {}
end