/* ***************************************************************************** * * $RCSfile: nfadfa.h,v $ * $Date: 1999/05/18 18:35:55 $ * $Source: /home/richard/Xml/RCS/nfadfa.h,v $ * $Revision: 1.4 $ * $Author: richard $ * ***************************************************************************** * * Copyright 1998, Brown University and Richard Goerwitz * ***************************************************************************** */ #ifndef NFADFA_H_INCLUDED #define NFADFA_H_INCLUDED /* needed in parstree.h */ typedef struct dfa_state dfa_state; #include "general.h" #include "fileutil.h" #include "parstree.h" typedef struct dfa_trans dfa_trans; typedef struct nfa_trans nfa_trans; typedef struct nfa_state nfa_state; struct dfa_trans { my_wchar_t *label; dfa_state *new_state; }; struct dfa_state { int type; size_t scount; nfa_state **nfa_states; size_t tcount; dfa_trans **transitions; int marked; }; struct nfa_trans { /* label == NULL means epsilon */ my_wchar_t *label; nfa_state *new_state; }; struct nfa_state { int type; size_t tcount; nfa_trans **transitions; }; /* state types (need to be AND/OR'd; don't use an enum */ #define NORMAL 1 #define INIT 2 #define FINAL 4 /* used to compile content models from cmnode structs */ extern dfa_state **make_dfa (xml_file *, cmnode *); /* used to free up compiled_content_models in xml_element structs */ extern void free_dfa (dfa_state **); #endif /* NFADFA_H_INCLUDED */