TempleOSCD_150720.ISO

This commit is contained in:
Terry A. Davis authored and minexew committed 2018-09-08 21:46:22 +02:00
1 parent 401601816c
commit f8c05f98f4
554 files changed
+26046 -24853

No files matched your search

+11 -11
View File
@@ -3,24 +3,24 @@ F64 glbl;
F64 CompileDemo(U8 *st)
{
I64 type;
U8 *ex;
CLex *lx=LexNew(st,LF_DONT_FREE_BUF);
U8 *machine_code;
CCmpCtrl *cc=CmpCtrlNew(st,CCF_DONT_FREE_BUF);
F64 result=0;
Lex(lx); //Gotta get it started
Lex(cc); //Gotta get it started
"Compile \"%s\"\n",st;
do {
if (ex=LexExpression2Bin(lx,&type)) {
if (machine_code=LexExpression2Bin(cc,&type)) {
if (type!=RT_F64)
result=ToF64(Call(ex));
result=ToF64(Call(machine_code));
else
result=Call(ex)(F64);
Free(ex);
result=Call(machine_code)(F64);
Free(machine_code);
}
"result=%9.4f\n",result;
if (lx->token==';')
Lex(lx);
} while (lx->token!=TK_EOF); //end of file?
LexDel(lx);
if (cc->token==';')
Lex(cc);
} while (cc->token!=TK_EOF); //end of file?
CmpCtrlDel(cc);
return result;
}