2 * Summary: API to build regexp automata
3 * Description: the API to build regexp automata
5 * Copy: See Copyright for the status of this software.
7 * Author: Daniel Veillard
10 #ifndef __XML_AUTOMATA_H__
11 #define __XML_AUTOMATA_H__
13 #include <libxml/xmlversion.h>
14 #include <libxml/tree.h>
16 #ifdef LIBXML_REGEXP_ENABLED
17 #ifdef LIBXML_AUTOMATA_ENABLED
18 #include <libxml/xmlregexp.h>
27 * A libxml automata description, It can be compiled into a regexp
29 typedef struct _xmlAutomata xmlAutomata
;
30 typedef xmlAutomata
*xmlAutomataPtr
;
33 * xmlAutomataStatePtr:
35 * A state int the automata description,
37 typedef struct _xmlAutomataState xmlAutomataState
;
38 typedef xmlAutomataState
*xmlAutomataStatePtr
;
43 XMLPUBFUN xmlAutomataPtr XMLCALL
44 xmlNewAutomata (void);
45 XMLPUBFUN
void XMLCALL
46 xmlFreeAutomata (xmlAutomataPtr am
);
48 XMLPUBFUN xmlAutomataStatePtr XMLCALL
49 xmlAutomataGetInitState (xmlAutomataPtr am
);
51 xmlAutomataSetFinalState (xmlAutomataPtr am
,
52 xmlAutomataStatePtr state
);
53 XMLPUBFUN xmlAutomataStatePtr XMLCALL
54 xmlAutomataNewState (xmlAutomataPtr am
);
55 XMLPUBFUN xmlAutomataStatePtr XMLCALL
56 xmlAutomataNewTransition (xmlAutomataPtr am
,
57 xmlAutomataStatePtr from
,
58 xmlAutomataStatePtr to
,
61 XMLPUBFUN xmlAutomataStatePtr XMLCALL
62 xmlAutomataNewTransition2 (xmlAutomataPtr am
,
63 xmlAutomataStatePtr from
,
64 xmlAutomataStatePtr to
,
66 const xmlChar
*token2
,
68 XMLPUBFUN xmlAutomataStatePtr XMLCALL
69 xmlAutomataNewNegTrans (xmlAutomataPtr am
,
70 xmlAutomataStatePtr from
,
71 xmlAutomataStatePtr to
,
73 const xmlChar
*token2
,
76 XMLPUBFUN xmlAutomataStatePtr XMLCALL
77 xmlAutomataNewCountTrans (xmlAutomataPtr am
,
78 xmlAutomataStatePtr from
,
79 xmlAutomataStatePtr to
,
84 XMLPUBFUN xmlAutomataStatePtr XMLCALL
85 xmlAutomataNewCountTrans2 (xmlAutomataPtr am
,
86 xmlAutomataStatePtr from
,
87 xmlAutomataStatePtr to
,
89 const xmlChar
*token2
,
93 XMLPUBFUN xmlAutomataStatePtr XMLCALL
94 xmlAutomataNewOnceTrans (xmlAutomataPtr am
,
95 xmlAutomataStatePtr from
,
96 xmlAutomataStatePtr to
,
101 XMLPUBFUN xmlAutomataStatePtr XMLCALL
102 xmlAutomataNewOnceTrans2 (xmlAutomataPtr am
,
103 xmlAutomataStatePtr from
,
104 xmlAutomataStatePtr to
,
105 const xmlChar
*token
,
106 const xmlChar
*token2
,
110 XMLPUBFUN xmlAutomataStatePtr XMLCALL
111 xmlAutomataNewAllTrans (xmlAutomataPtr am
,
112 xmlAutomataStatePtr from
,
113 xmlAutomataStatePtr to
,
115 XMLPUBFUN xmlAutomataStatePtr XMLCALL
116 xmlAutomataNewEpsilon (xmlAutomataPtr am
,
117 xmlAutomataStatePtr from
,
118 xmlAutomataStatePtr to
);
119 XMLPUBFUN xmlAutomataStatePtr XMLCALL
120 xmlAutomataNewCountedTrans (xmlAutomataPtr am
,
121 xmlAutomataStatePtr from
,
122 xmlAutomataStatePtr to
,
124 XMLPUBFUN xmlAutomataStatePtr XMLCALL
125 xmlAutomataNewCounterTrans (xmlAutomataPtr am
,
126 xmlAutomataStatePtr from
,
127 xmlAutomataStatePtr to
,
129 XMLPUBFUN
int XMLCALL
130 xmlAutomataNewCounter (xmlAutomataPtr am
,
134 XMLPUBFUN xmlRegexpPtr XMLCALL
135 xmlAutomataCompile (xmlAutomataPtr am
);
136 XMLPUBFUN
int XMLCALL
137 xmlAutomataIsDeterminist (xmlAutomataPtr am
);
143 #endif /* LIBXML_AUTOMATA_ENABLED */
144 #endif /* LIBXML_REGEXP_ENABLED */
146 #endif /* __XML_AUTOMATA_H__ */