- 博客(6)
- 收藏
- 关注
原创 c\c++编译原理实现消除直接\间接左递归,first集,follow集,预测分析表,主控程序
#include<iostream> #include<map> #include<list> #include<vector> #include<stdio.h> #include<set> #include<string> #include<stack> using namespace std; typedef struct { string left; string right[200];
2021-11-12 15:12:37
618
原创 c\c++ 编译原理实现消除(直接/间接)左递归,first集,follow集,预测分析表,主控程序
#include<iostream> #include<map> #include<list> #include<vector> #include<stdio.h> #include<set> #include<string> #include<stack> using namespace std; typedef struct { string left; string right[200];
2021-11-12 15:07:55
1562
1
原创 程序预处理与词法分析器
#include<stdio.h> #include<string.h> #define MAX_LENGTH 1024 char str[10000]; char str2[10000]; char rwtab[48][15] = { “#”,“main”,“if”,“then”,“while”,“do”,“static”,“int”,“double”, “struct”,“break”,“else”,“long”,“switch”,“case”,“typedof”,“char”,
2021-10-18 22:12:34
225
原创 c语言实现离散真值表主析取主合取
#include<stdio.h> #include<stdlib.h> #include<string.h> #define MAX 20 #define OK 1 constexpr auto ERROR = 0; typedef char Elemtype; typedef struct { Elemtype data[MAX]; int top; }Stack; typedef struct { char ch[MAX]; char vaule[MAX]; }Va
2020-10-22 08:50:56
1549
原创 c语言实现迷宫问题(栈)
#include"\header1.h" #define N 5 void makeprint(int map[][N],pos p) { map[p.x][p.y] = 3;//不能走/死胡同标记为3 } pos nexpos(pos curpos, int i) {//走的顺序:顺时针 switch (i) { { case 1:curpos.y++; break; case 2:curpos.x++; break; case 3:curpos.y–; break; case 4:curpos.x–;
2020-10-17 19:43:56
1395
原创 c语言单链表的基本操作创建删除查询遍历
#include"constants.h" typedef struct node{ ElemType elem; struct node *next; }SqLinkedList; //初始化链表 Status SqLinkedInit(SqLinkedList L) { L = (SqLinkedList)malloc(sizeof(SqLinkedList)); if (!L) { return FALSE; } L->next = NULL; return OK; } //清空链表 Statu
2020-10-15 21:46:10
265
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅