msvcr71.dll
msvcr71.dll下载,有效解决程序运行时出现缺少dll文件的问题
主要程序代码: #include <iostream> #include <fstream> #include <string> #include <math.h> #include <ctype.h> #include <cstdlib> using namespace std; #define Max 655 //最大代码长度 #define WordMaxNum 256 //变量最大个数 #define DigitNum 256 //常量最大个数 #define MaxKeyWord 33 //关键字数量 #define MaxOptANum 8 //运算符最大个数 #define MaxOptBNum 4 //运算符最大个数 #define MaxEndNum 11 //界符最大个数 typedef struct DisplayTable { int Index; //标识符所在表的下标 int type; //标识符的类型 int line; //标识符所在表的行数 char symbol[20]; //标识符所在表的名称 }Table; int TableNum = 0; //display表的表项总数 char Word[WordMaxNum][20]; //标识符表 char Digit[WordMaxNum][20]; //数字表 int WordNum = 0; //变量表的下标 int DigNum = 0; //常量表的下标 bool errorFlag = 0; //错误标志 int TableIndex = -1; //display 表的下标索引 int beginCount = 0;//遇到begin加1,遇到end减1 int ifCount = 0; //遇到if加1 Table *table = new Table[Max];
编译原理实验词法生成器 C语言编写 代码部分程序: #include<stdio.h> #include <string.h> #include <math.h> #include <ctype.h> char prog[80],token[8],ch; int syn,p,m,n,sum; char *rwtab[6]={"begin","if","then","while","do","end"}; scaner(); main() {p=0; printf("\n please input a string(end with '#'):/n"); do{ scanf("%c",&ch); prog[p++]=ch; }while(ch!='#'); p=0; do{ scaner(); switch(syn) {case 11:printf("( %-10d%5d )\n",sum,syn); break; case -1:printf("you have input a wrong string\n"); getch(); exit(0); default: printf("( %-10s%5d )\n",token,syn); break; } }while(syn!=0); getch(); }