table.h
来自「c语言做的pl0编译器」· C头文件 代码 · 共 41 行
H
41 行
// table.h: interface for the table class.
//////////////////////////////////////////////////////////////////////
#ifndef __TABLE_H
#define __TABLE_H
#include "pl0.h"
#include "errors.h"
#include "yufa.h"
#define TABLE_SIZE 100
enum object {constant,variable,procedure};
struct table_type
{
char name[IDENT_LENGTH+1];
object kind;
union{
int val;
struct{
int level,adr,size;
};
};
};
class Ctable
{
public:
Ctable(CPlCompiler*);
void Enter(enum object k);
int Position(char *id);
int TableIndex(){return tx[lev];}
public:
table_type table[TABLE_SIZE];
private:
int tx[MAX_LEVEL+1];
int lev;
CPlCompiler *pl;
};
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?