www.pudn.com > hsgbiyiyuanli.rar > main.cpp
#include "define.h"
#include "cifa.h"
#include "yufa.h"
#include "toasm.h"
int main()
{
for(int i = 0;i < MAXLEN ; i++)
{
FLAGTAB[i].name[0] = '\0';
}
in = fopen("source.txt","r");
out = fopen("token.txt","wa");
if ( !in || !out )
{
printf("can't open the file");
return 0;
}
cout<<"============================================================\n"
<<"================= 欢迎使用SIMPLE编译器!====================\n"
<<"============================================================\n\n\n"
<<"============================================================\n"
<<"========== 设计者:黄胜根,曾超,李世清,杨清波 ============\n"
<<"================ 2003计算机科学技术(1)班 ===================\n"
<<"============================================================\n\n\n";
otherout=fopen("other.txt","wa");
scaner();
fclose(in);
fclose(out);
in = fopen("token.txt","r");
if ( !in )
{
printf("can't read the token");
return 0;
}
synditer();
print_quad();
fclose(in);
fclose(otherout);
tran_to_asm();
return 1;
}