daima.h

来自「该包中包含一个pl0文法要求和根据此文法编写的编译器」· C头文件 代码 · 共 35 行

H
35
字号
#ifndef __DAIMA_H
#define __DAIMA_H

#include "YUFA.h"

#define CODE_SIZE	200
#define RUN_STACK_SIZE	500		

enum fct {lit,opr,lod,sto,cal,intint,jmp,jpc};

struct instruction{
	fct f;	                   //fuction code
	int l;	                   //level
	int a;	                   //displacement addr
};

class CDaima{
friend class CYufa;
public:
	CDaima(){cx=0;}
	void Gen(fct f,int l,int a);
	void ListCode();
	void Interpret();

private:
	instruction code[CODE_SIZE];
	int cx;

	int b;	                 
	int s[RUN_STACK_SIZE];	 
private:
	int base(int l);
};

#endif 

⌨️ 快捷键说明

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