资源简介
类C语法脚本解释器。类C语法脚本解释器。类C语法脚本解释器。
代码片段和文件信息
#include “vm.h“
#include “object.h“
#include “cstyle.yacc.h“
#include “cstyleio.h“
double print();
void initCfunctions();
void main(int argc char **argv)
{
//yydebug = 1;
initCfunctions();
seterrio(stderr);
yyparse();
}
void initCfunctions()
{
insertCfuntion(“print“ print);
insertCfuntion(“halt“ halt);
}
double print()
{
struct object *obj;
int i = 1;
printf(“> “);
while (obj = getparam(i++))
{
if (isnumber(obj))
{
printf(“%lf\n“ getnumber(obj));
}
else if (isstring(obj)) printf(“%s\n“ getstring(obj));
else if (isCfunction(obj)) printf(“%s\n“ getsymname(obj));
else if (isfunction(obj)) printf(“%s\n“ getsymname(obj));
else if (isstring(obj)) printf(“%s\n“ getstring(obj));
}
return 0;
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
.CA.... 245760 2013-09-28 17:04 bin\client.exe
.CA.... 1521804 2013-09-28 17:04 bin\client.ilk
.CA.... 1485824 2013-09-28 17:04 bin\client.pdb
.CA.... 883 2013-09-28 11:45 clients\client.c
.CA.... 431 2013-09-21 17:38 clients\makefile
.CA.... 93430 2013-09-21 20:27 doc\cst
.CA.... 3511 2013-09-28 17:04 include\cst
.CA.... 938 2013-09-19 18:33 include\cst
.CA.... 1816 2013-09-27 22:30 include\errorcode.h
.CA.... 101 2013-09-19 13:38 include\hash.h
.CA.... 289 2013-09-28 10:31 include\localvar.h
.CA.... 1159 2013-09-28 10:31 include\ob
.CA.... 1606 2013-09-28 16:17 include\opcode.h
.CA.... 404 2013-09-20 16:16 include\stack.h
.CA.... 1203 2013-09-28 10:32 include\symtable.h
.CA.... 439 2013-09-28 10:34 include\vm.h
.CA.... 857 2013-09-28 17:03 io\cst
.CA.... 310 2013-09-21 17:20 io\makefile
.CA.... 5966 2013-09-28 17:04 lib\client.obj
.CA.... 47111 2013-09-28 17:04 lib\cst
.CA.... 61234 2013-09-28 17:04 lib\cst
.CA.... 4689 2013-09-28 17:04 lib\cst
.CA.... 1917 2013-09-28 17:04 lib\hash.obj
.CA.... 8368 2013-09-28 17:04 lib\localvar.obj
.CA.... 8647 2013-09-28 17:04 lib\ob
.CA.... 11775 2013-09-28 17:04 lib\opcode.obj
.CA.... 7552 2013-09-28 17:04 lib\stack.obj
.CA.... 13019 2013-09-28 17:04 lib\symtable.obj
.CA.... 76800 2013-09-28 17:04 lib\vc80.idb
.CA.... 94208 2013-09-28 17:04 lib\vc80.pdb
............此处省略48个文件信息
评论
共有 条评论