给出描述C浮点数的DFA

来源:百度知道 编辑:UC知道 时间:2024/06/02 11:57:13
给出描述C语言中的浮点数的DFA
是编译原理方面的题目
我要的是DFA图,不是程序

令∑={d , ., e , + , -},则∑上的正规式 (+|-)d*(.dd*|ε)(e(+|-|ε)dd*|ε),其中d为0~9中的数字。
DFA图自己画吧.

#include <stdio.h>
#include <malloc.h>
enum boolean {false, true};
const int MaxSize = 20;
struct celltype{
int id;
celltype *next;
};
struct queue{
celltype *front, *rear;
};
struct EdgeNode{
int adjvex;
EdgeNode *next;
};
struct vexNode{
int info;
EdgeNode *next;
};
vexNode Graph[MaxSize];
int N;

void MakeNull(queue *head)
{

head->front->next = NULL;
head->rear = head->front;
}
void CreateQueue(queue *head)
{
head->front = (celltype*) malloc (sizeof(celltype)