⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dstate.h

📁 我的一个利用有限状态机的正则表达式的实现。
💻 H
字号:
#ifndef DSTATE_H
#define DSTATE_H

#include "myafx.h"
#include "myhash.h"
#include "myset.h"

REG_EXPORT typedef struct DState DSTATE;
REG_EXPORT typedef struct DTran DTRAN;

struct DState {
	SET* node_set;
	int marked;
	int end; // if the dstate contains any end node, it's true
	size_t dtrans_size;
	size_t dtrans_count;
	DTRAN** dtrans;
};

struct DTran {
	DSTATE* src;
	DSTATE* tar;
	char c;
};

DSTATE* new_dstate( SET* s );
DTRAN* new_dtran( DSTATE* src, DSTATE* tar, char c );

// dfa afx
HASH_TABLE::LLNode* insert_dstate( HASH_TABLE* hash_table, DSTATE* ds );
DSTATE* find_dstate( HASH_TABLE* hash_table, SET* s );
DTRAN* find_dtran( DSTATE* ds, char c );

void release_dstate( void* v );

void PrintDTran( DTRAN* dt );
void PrintDState( DSTATE* ds );

#endif

⌨️ 快捷键说明

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