資源簡介
編譯原理課程設計 源代碼+課程設計報告
for循環語句翻譯程序 使用LR分析法 輸出四元式
c++編程
代碼片段和文件信息
#include“詞法分析.cpp“
#include?
#include?
#include??
#include
//#include
using?namespace?std;
#define?stack_size?50
#define?stackincrement?50
int?p=0q=0zhshx;?????????????????????????//全局變量
char?Vn[7]={‘S‘‘E‘‘F‘‘G‘‘X‘‘Y‘‘H‘};???//非終結符
char?Vt[14]={‘f‘‘(‘‘;‘‘)‘‘{‘‘}‘‘i‘‘=‘‘c‘‘<‘‘+‘‘>‘‘-‘‘#‘};??//終結符
typedef?struct?{
????char?*bottom;
????char?*top;
????int?size;
//?char?data[stack_size];
}stack;
int?Initstack(stack?&s)????????//初始化棧
{
???s.bottom=(char?*)malloc(stack_size*sizeof(char));
???if(!s.bottom)?exit(-1);
???s.top=s.bottom;
???s.size=stack_size;
???return(1);
}
int?push(stack?&schar?e)??????//入棧
{
?//int?i;
???if(s.top-s.bottom>=s.size){
??????s.bottom=(char?*)realloc(s.bottom(sta
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????12087??2009-06-22?09:07??編譯原理課程設計\源代碼\for循環翻譯.cpp
?????文件???????3400??2009-06-18?17:24??編譯原理課程設計\源代碼\詞法分析.cpp
?????文件?????680448??2009-06-22?10:32??編譯原理課程設計\編譯課程設計報告.doc
?????目錄??????????0??2009-06-23?09:54??編譯原理課程設計\源代碼
?????目錄??????????0??2009-06-23?09:54??編譯原理課程設計
-----------?---------??----------?-----??----
???????????????695935????????????????????5
- 上一篇:中國地質大學C++課件7
- 下一篇:經典的吃豆游戲及源代碼
評論
共有 條評論