?? biaoge.cpp
字號:
// Biaoge.cpp: implementation of the Biaoge class.
//
//////////////////////////////////////////////////////////////////////
#include <string.h>
#include "cifa.h"
#include "Biaoge.h"
#include "yufa.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CBiaoge::CBiaoge(CPlCompiler *p)
{
pl=p;
lev=0;
tx[0]=0;
table[0].name[0]=0;
}
void CBiaoge::Enter(enum object k)
{
if (pl->yufa->Level()>lev)
tx[++lev]=tx[lev-1];
else if (pl->yufa->Level()<lev)
lev--;
tx[lev]++;
if (tx[lev]>=TABLE_SIZE) return;
strcpy(table[tx[lev]].name,pl->cifa->id);
table[tx[lev]].kind=k;
switch (k)
{
case constant:
table[tx[lev]].val=pl->cifa->num;
break;
case variable:
table[tx[lev]].level=pl->yufa->Level();
table[tx[lev]].adr=pl->yufa->DataAddr();
break;
case procedure:
table[tx[lev]].level=pl->yufa->Level();
break;
}
}
int CBiaoge::Position(char *id)
{
int i=tx[lev];
while (stricmp(table[i].name,id) && i>0) i--;
return i;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -