stkmach.h

来自「一个用flex、bison和vc开发的堆栈机」· C头文件 代码 · 共 28 行

H
28
字号
#include "symbol.h"
#ifndef STACKMACHINE
#define STACKMACHINE
typedef union Datum {/*interpreter stack type*/
	double val;
	symrec *sym;
}Datum;
extern Datum pop();

typedef int (*Inst)();/*machine instruction*/
#define STOP (Inst)0

typedef struct Frame {	/* proc/func call stack frame */
	symrec *sp;			/* symbol table entry */
	Inst *retpc;		/* where to resume after return */
	Datum *argn;		/* n-th argument on stack */
	int nargs;			/* number of argument */
} Frame;

extern Inst prog[];
extern eval(), add(), sub(), mul(), divi(), neg(), power();
extern assign(), bltin(), varpush(), constpush(), print();
extern prexpr(), argassign(), funcret(), procret(), call();
extern prstr(), arg(), varread(), define(), defnonly();
extern gt(), lt(), eq(), ge(), le(), ne(), and(), or(), not();
extern ifcode(), whilecode();
extern indef;
#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?