regulartonfa.h

来自「编译原理---正则表达式到DFA的演示程序」· C头文件 代码 · 共 50 行

H
50
字号
#ifndef _REGULAR_TO_NFA_H_
#define _REGULAR_TO_NFA_H_

#include "node.h"    //Node的结点定义
#include <string.h>  //从正则到NFA用


	/*
	 * 本程序要用的外部接口
	 */
	extern char *string;  //"10|(01|1)*0|1*#";  //接口来自正则输入表达式对话框

	/*
	 * 本程序对外提供的接口
	 */
	Node* FirstTable[100]={0,}; 
	int FirstNodeQuantity=0;   //结点数量
	char AllChar[20];		   //接收到哪些字符 
	int CharQuantity=1;        //接收字符个数,e除外 */
	void RegularToNFA();

	//---------------------------------------------------------------
	
	//下面是本程序的私有变量及函数
	static int linepos=0;

struct stArc
{
	int ST0;
    int ST1;
	int q;
};

class ListNode{
public:
        stArc arc;
		ListNode *next;
};

class Stack{
public:
	ListNode *top;
public:
	Stack(void){top=NULL;}

	void Push(stArc x);
	stArc Pop(void);
};

#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?