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

  • 大小: 948KB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發布日期: 2021-07-15
  • 語言: 其他
  • 標簽: 課程資源??

資源簡介

河北工業大學編譯原理實驗,壓縮包內含源代碼與實驗報告

資源截圖

代碼片段和文件信息

#include?
#include?
#include?
#include?
#include?
#define?DIGIT?1
#define?POINT?2
#define?OTHER?3
#define?POWER?4
#define?PLUS?5
#define?MINUS?6
#define?UCON?7
#define?ClassOther?200
#define?EndState?-1//無符號數識別程序宏定義

#define?MI?8
#define?MU?9
#define?DI?10
#define?ID?11
#define?L?12
#define?R?13//詞法分析程序宏定義

#define?RIGHT?1
#define?ERROR?0
#define?MAXINPUT?300
#define?MAXSTACK?100
#define?STARTSYMBOL?‘E‘//語法分析程序宏定義

char?TOKEN[20];
int?wnped;
int?Class;??//Used?to?indicate?class?of?the?word
int?ICON;
double?FCON;
static?int?CurrentState;
int?row=1col=0;//詞法分析程序全局變量

int?index=0;//語法分析符號棧數組下標
int?count=0;
char?VT[8]={‘(‘‘i‘‘*‘‘/‘‘+‘‘-‘‘)‘‘#‘};
char?stack[MAXSTACK]array[MAXINPUT];
char?matrix[8][8]=
{‘<‘‘<‘‘<‘‘<‘‘<‘‘<‘‘=‘‘e‘
‘e‘‘e‘‘>‘‘>‘‘>‘‘>‘‘>‘‘>‘
‘<‘‘<‘‘>‘‘>‘‘>‘‘>‘‘>‘‘>‘
‘<‘‘<‘‘>‘‘>‘‘>‘‘>‘‘>‘‘>‘
‘<‘‘<‘‘<‘‘<‘‘>‘‘>‘‘>‘‘>‘
‘<‘‘<‘‘<‘‘<‘‘>‘‘>‘‘>‘‘>‘
‘e‘‘e‘‘>‘‘>‘‘>‘‘>‘‘>‘‘>‘
‘<‘‘<‘‘<‘‘<‘‘<‘‘<‘‘e‘‘=‘};//語法分析程序全局變量

char?var=‘1‘;
char?s[MAXSTACK];//語義分析程序全局變量

int?GetChar(FILE?*fp)
{
int?c;
c=fgetc(fp);col++;
if(isdigit(c))
{
d=c-‘0‘;
return?DIGIT;
}
if(c==‘.‘)
return?POINT;
if(c==‘E‘||c==‘e‘)
return?POWER;
if(c==‘+‘)
return?PLUS;
if(c==‘-‘)
return?MINUS;
return?OTHER;
}
int?EXCUTE(int?stateint?symbol)
{
switch(state)
{
case?0:switch(symbol)
???{
case?DIGIT:n=0;p=0;e=1;w=d;CurrentState=1;Class=UCON;break;
case?POINT:w=0;n=0;p=0;e=1;CurrentState=3;Class=UCON;break;
default:Class=ClassOther;
CurrentState=EndState;
???}
break;
case?1:switch(symbol)
???{
case?DIGIT:w=w*10+d;break;??//CurrentState=1
case?POINT:CurrentState=2;break;
case?POWER:CurrentState=4;break;
default:?ICON=w;CurrentState=EndState;
???}
break;
case?2:switch(symbol)
???{
case?DIGIT:n++;w=w*10+d;break;
case?POWER:CurrentState=4;break;
default:FCON=w*pow(10e*p-n);CurrentState=EndState;
???}
break;
case?3:switch(symbol)
???{
case?DIGIT:n++;w=w*10+d;CurrentState=2;break;
default:printf(“Error!\n“);CurrentState=EndState;
???}
break;
case?4:switch(symbol)
???{
case?DIGIT:p=p*10+d;CurrentState=6;break;
case?MINUS:e=-1;CurrentState=5;break;
case?PLUS:CurrentState=5;break;
default:printf(“Error!\n“);CurrentState=EndState;
???}
break;
case?5:switch(symbol)
???{
case?DIGIT:p=p*10+d;CurrentState=6;break;
default:printf(“Error!\n“);CurrentState=EndState;
???}
break;
case?6:switch(symbol)
???{
case?DIGIT:p=p*10+d;break;
default:FCON=w*pow(10e*p-n);CurrentState=EndState;
???}
break;
}
return?CurrentState;
}
void?LEX(FILE?*fp)
{
int?ch;
CurrentState=0;
while(CurrentState!=EndState)
{
ch=GetChar(fp);
EXCUTE(CurrentStatech);
}
}//無符號數識別程序

void?out(int?mchar?*aFILE?*fp2)
{
fprintf(fp2“(“fp2);
switch(m)
{
case?ID:fputs(“ID“fp2);ar

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

?????文件????????627??2017-01-02?15:56??編譯原理\Read?Me.txt

????..A..H.???????162??2017-12-18?15:15??編譯原理\~$報告-計152-153111-王兵.docx

?????文件?????????19??2017-12-18?16:43??編譯原理\合\file2_1.txt

?????文件????????106??2018-01-04?22:13??編譯原理\合\file2_2.txt

?????文件???????9113??2017-12-18?16:41??編譯原理\合\合.cpp

?????文件???????3355??2017-12-18?16:37??編譯原理\合\合.dsp

?????文件????????512??2017-12-18?16:46??編譯原理\合\合.dsw

?????文件??????41984??2018-01-04?23:33??編譯原理\合\合.ncb

?????文件??????48640??2018-01-04?23:33??編譯原理\合\合.opt

?????文件????????728??2017-12-18?16:42??編譯原理\合\合.plg

?????文件??????41984??2018-01-04?22:13??編譯原理\合\Debug\vc60.idb

?????文件??????53248??2017-12-18?16:41??編譯原理\合\Debug\vc60.pdb

?????文件?????229465??2017-12-18?16:42??編譯原理\合\Debug\合.exe

?????文件?????252020??2017-12-18?16:42??編譯原理\合\Debug\合.ilk

?????文件??????28219??2017-12-18?16:42??編譯原理\合\Debug\合.obj

?????文件?????239844??2017-12-18?15:13??編譯原理\合\Debug\合.pch

?????文件?????517120??2017-12-18?16:41??編譯原理\合\Debug\合.pdb

?????文件?????????29??2017-12-18?16:02??編譯原理\實驗一\file1_1.txt

?????文件????????101??2017-12-18?16:02??編譯原理\實驗一\file1_2.txt

?????文件???????6626??2017-12-18?16:10??編譯原理\實驗一\實驗一.cpp

?????文件???????3403??2017-12-18?16:02??編譯原理\實驗一\實驗一.dsp

?????文件????????520??2017-12-18?16:02??編譯原理\實驗一\實驗一.dsw

?????文件??????41984??2018-01-05?00:08??編譯原理\實驗一\實驗一.ncb

?????文件??????48640??2017-12-18?16:02??編譯原理\實驗一\實驗一.opt

?????文件????????748??2017-12-18?16:02??編譯原理\實驗一\實驗一.plg

?????文件??????33792??2017-12-18?16:02??編譯原理\實驗一\Debug\vc60.idb

?????文件??????45056??2017-12-18?15:56??編譯原理\實驗一\Debug\vc60.pdb

?????文件?????229473??2017-12-18?16:02??編譯原理\實驗一\Debug\實驗一.exe

?????文件?????231836??2017-12-18?16:02??編譯原理\實驗一\Debug\實驗一.ilk

?????文件??????21192??2017-12-18?16:02??編譯原理\實驗一\Debug\實驗一.obj

............此處省略42個文件信息

評論

共有 條評論