예제 #1
0
파일: cpp.c 프로젝트: zhuzhaoyuan/8cc
void cpp_eval(char *buf) {
    FILE *fp = fmemopen(buf, strlen(buf), "r");
    set_input_file("(eval)", NULL, fp);
    List *toplevels = read_toplevels();
    for (Iter *i = list_iter(toplevels); !iter_end(i);)
        emit_toplevel(iter_next(i));
}
예제 #2
0
파일: cpp.c 프로젝트: ctx2002/8cc
void cpp_eval(char *buf) {
    stream_stash(make_file_string(buf));
    Vector *toplevels = read_toplevels();
    for (int i = 0; i < vec_len(toplevels); i++)
        emit_toplevel(vec_get(toplevels, i));
    stream_unstash();
}
예제 #3
0
파일: splay.c 프로젝트: pombreda/splay
static void compile(module_t m, struct symbol_list *list)
{
	struct symbol *sym;

	FOR_EACH_PTR(list, sym) {
		struct entrypoint *ep;

		expand_symbol(sym);
		ep = linearize_symbol(sym);
		if (ep)
			emit_function(m, ep);
		else
			emit_toplevel(m, sym);
	} END_FOR_EACH_PTR(sym);
}