fn gen(files []ast.File, table &ast.Table, out_name string, pref &pref.Preferences) (int, int)
struct Gen {
out_name string
pref &pref.Preferences
mut:
table &ast.Table
buf []byte
sect_header_name_pos int
offset i64
str_pos []i64
strings []string
file_size_pos i64
main_fn_addr i64
code_start_pos i64
fn_addr map[string]i64
var_offset map[string]int
stack_var_pos int
debug_pos int
errors []errors.Error
warnings []errors.Warning
syms []Symbol
relocs []Reloc
nlines int
}
fn (mut g Gen) add(reg Register, val int)
fn (mut g Gen) add8(reg Register, val int)
fn (mut g Gen) call_fn(node ast.CallExpr)
fn (mut g Gen) error_with_pos(s string, pos token.Position)
fn (mut g Gen) gen_exit()
fn (mut g Gen) gen_loop_end(to int, label int)
fn (mut g Gen) gen_loop_start(from int) int
returns label's relative address
fn (mut g Gen) gen_print(s string)
fn (mut g Gen) gen_print_from_expr(expr ast.Expr, newline bool)
fn (mut g Gen) generate_elf_header()
fn (mut g Gen) generate_macho_header()
fn (mut g Gen) pop(reg Register)
fn (g &Gen) pos() i64
fn (mut g Gen) push(reg Register)
fn (mut g Gen) register_function_address(name string)
fn (mut g Gen) ret()
fn (mut g Gen) save_main_fn_addr()
fn (mut g Gen) stmts(stmts []ast.Stmt)
fn (mut g Gen) sub32(reg Register, val int)
fn (mut g Gen) sub8(reg Register, val int)
fn (mut g Gen) zeroes(n int)