2015-11-25 04:00:38 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2015 Andrew Kelley
|
|
|
|
*
|
|
|
|
* This file is part of zig, which is MIT licensed.
|
|
|
|
* See http://opensource.org/licenses/MIT
|
|
|
|
*/
|
|
|
|
|
2015-11-24 13:47:25 +08:00
|
|
|
#ifndef ZIG_CODEGEN_HPP
|
|
|
|
#define ZIG_CODEGEN_HPP
|
|
|
|
|
|
|
|
#include "parser.hpp"
|
|
|
|
|
|
|
|
struct CodeGen;
|
|
|
|
|
|
|
|
struct ErrorMsg {
|
|
|
|
int line_start;
|
|
|
|
int column_start;
|
|
|
|
int line_end;
|
|
|
|
int column_end;
|
|
|
|
Buf *msg;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2015-11-25 10:07:33 +08:00
|
|
|
CodeGen *create_codegen(AstNode *root, bool is_static, Buf *in_file);
|
2015-11-24 13:47:25 +08:00
|
|
|
|
|
|
|
void semantic_analyze(CodeGen *g);
|
|
|
|
|
|
|
|
void code_gen(CodeGen *g);
|
|
|
|
|
2015-11-25 10:07:33 +08:00
|
|
|
void code_gen_link(CodeGen *g, const char *out_file);
|
2015-11-25 04:00:38 +08:00
|
|
|
|
2015-11-24 13:47:25 +08:00
|
|
|
ZigList<ErrorMsg> *codegen_error_messages(CodeGen *g);
|
|
|
|
|
|
|
|
#endif
|