91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 61.01 KB
    文件類型: .rar
    金幣: 1
    下載: 0 次
    發布日期: 2024-09-21
  • 語言: 其他
  • 標簽: PL/0??

資源簡介

PL/0功能擴充break功能,自己寫的,絕對原版
作者:謝連義 山東建筑大學計算機系

資源截圖

代碼片段和文件信息

/************??PL0.c??*************/

//?pl0?compiler?source?code

#include?
#include?
#include?
#include?
#include?“set.h“
#include?“set.c“
#include?“pl0.h“

//////////////////////////////////////////////////////////////////////
//?print?error?message.
void?error(n)
{
int?i;

printf(“??????“);
for?(i?=?1;?i?<=?cc?-?1;?i++)
printf(“?“);
printf(“^\n“);
printf(“Error?%3d:?%s\n“?n?err_msg[n]);
err++;
}?//?error

//////////////////////////////////////////////////////////////////////
void?getch(void)
{
if?(cc?==?ll)//如果已經到達行尾
{
if?(feof(infile))//如果文件結束
{
printf(“\nPROGRAM?INCOMPLETE\n“);
exit(1);
}
ll?=?cc?=?0;//讀進下一行
printf(“%5d??“?cx);
while?(!feof(infile)?&&?(ch?=?getc(infile))!=‘\n‘)
{
printf(“%c“?ch);
line[++ll]?=?ch;
}?//?while
printf(“\n“);
line[++ll]?=?‘?‘;
}
ch?=?line[++cc];
}?//?getch

//////////////////////////////////////////////////////////////////////
//?gets?a?symbol?from?input?stream.
void?getsym(void)
{
int?i?k;
char?a[MAXIDLEN?+?1];

while?(ch?==?‘?‘)//如果是空格就繼續讀入到ch,直到不是空格為止
getch();

if?(isalpha(ch))
{?//?symbol?is?a?reserved?word?or?an?identifier.
//符號是關鍵字或者標示符
k?=?0;
do
{
if?(k? a[k++]?=?ch;
getch();
}
while?(isalpha(ch)?||?isdigit(ch));
a[k]?=?0;
strcpy(id?a);
word[0]?=?id;
i?=?NRW;
while?(strcmp(id?word[i--]));
if?(++i)
sym?=?wsym[i];?//?symbol?is?a?reserved?word
else
sym?=?SYM_IDENTIFIER;???//?symbol?is?an?identifier
}
else?if?(isdigit(ch))
{?//?symbol?is?a?number.
k?=?num?=?0;
sym?=?SYM_NUMBER;
do
{
num?=?num?*?10?+?ch?-?‘0‘;
k++;
getch();
}
while?(isdigit(ch));
if?(k?>?MAXNUMLEN)
error(25);?????//?The?number?is?too?great.
}
else?if?(ch?==?‘:‘)
{
getch();
if?(ch?==?‘=‘)
{
sym?=?SYM_BECOMES;?//?:=
getch();
}
else
{
sym?=?SYM_NULL;???????//?illegal?
}
}
else?if?(ch?==?‘>‘)
{
getch();
if?(ch?==?‘=‘)
{
sym?=?SYM_GEQ;?????//?>=
getch();
}
else
{
sym?=?SYM_GTR;?????//?>
}
}
else?if?(ch?==?‘<‘)
{
getch();
if?(ch?==?‘=‘)
{
sym?=?SYM_LEQ;?????//?<=
getch();
}
else?if?(ch?==?‘>‘)
{
sym?=?SYM_NEQ;?????//?<>
getch();
}
else
{
sym?=?SYM_LES;?????//?<
}
}
else
{?//?other?tokens
i?=?NSYM;
csym[0]?=?ch;
while?(csym[i--]?!=?ch);
if?(++i)
{
sym?=?ssym[i];
getch();
}
else
{
printf(“Fatal?Error:?Unknown?character.\n“);
exit(1);
}
}
}?//?getsym

//////////////////////////////////////////////////////////////////////
//?generates?(assembles)?an?instruction.
void?gen(int?x?int?y?int?z)
{
if?(cx?>?CXMAX)
{
printf(“Fatal?Error:?Program?too?long.\n“);
exit(1);
}
code[cx].f?=?x;
code[cx].l?=?y;
code[cx++].a?=?z;
}?//?gen

/////////////////////////////////////////////////////////

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件??????18447??2009-07-01?11:32??plo\pl0.c

?????文件??????18313??2009-06-30?22:04??plo\pl0.c.bak

?????文件???????4346??2009-07-01?10:03??plo\PL0.h

?????文件???????4349??2009-06-30?21:56??plo\PL0.h.bak

?????文件?????355328??2009-03-22?19:24??plo\PL0文檔.doc

?????文件???????1608??2009-03-22?19:24??plo\set.c

?????文件????????380??2009-03-22?19:24??plo\set.h

?????文件????????149??2009-07-01?11:20??plo\test.txt

?????文件????????132??2009-07-01?11:29??plo\test2.txt

?????目錄??????????0??2009-07-02?09:28??plo

-----------?---------??----------?-----??----

???????????????403052????????????????????10


評論

共有 條評論