1/*
2 * Summary: API to build regexp automata
3 * Description: the API to build regexp automata
4 *
5 * Copy: See Copyright for the status of this software.
6 *
7 * Author: Daniel Veillard
8 */
9
10#ifndef __XML_AUTOMATA_H__
11#define __XML_AUTOMATA_H__
12
13#include <libxml/xmlversion.h>
14#include <libxml/tree.h>
15
16#ifdef LIBXML_REGEXP_ENABLED
17#ifdef LIBXML_AUTOMATA_ENABLED
18#include <libxml/xmlregexp.h>
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
24/**
25 * xmlAutomataPtr:
26 *
27 * A libxml automata description, It can be compiled into a regexp
28 */
29typedef struct _xmlAutomata xmlAutomata;
30typedef xmlAutomata *xmlAutomataPtr;
31
32/**
33 * xmlAutomataStatePtr:
34 *
35 * A state int the automata description,
36 */
37typedef struct _xmlAutomataState xmlAutomataState;
38typedef xmlAutomataState *xmlAutomataStatePtr;
39
40/*
41 * Building API
42 */
43XMLPUBFUN xmlAutomataPtr XMLCALL
44		    xmlNewAutomata		(void);
45XMLPUBFUN void XMLCALL
46		    xmlFreeAutomata		(xmlAutomataPtr am);
47
48XMLPUBFUN xmlAutomataStatePtr XMLCALL
49		    xmlAutomataGetInitState	(xmlAutomataPtr am);
50XMLPUBFUN int XMLCALL
51		    xmlAutomataSetFinalState	(xmlAutomataPtr am,
52						 xmlAutomataStatePtr state);
53XMLPUBFUN xmlAutomataStatePtr XMLCALL
54		    xmlAutomataNewState		(xmlAutomataPtr am);
55XMLPUBFUN xmlAutomataStatePtr XMLCALL
56		    xmlAutomataNewTransition	(xmlAutomataPtr am,
57						 xmlAutomataStatePtr from,
58						 xmlAutomataStatePtr to,
59						 const xmlChar *token,
60						 void *data);
61XMLPUBFUN xmlAutomataStatePtr XMLCALL
62		    xmlAutomataNewTransition2	(xmlAutomataPtr am,
63						 xmlAutomataStatePtr from,
64						 xmlAutomataStatePtr to,
65						 const xmlChar *token,
66						 const xmlChar *token2,
67						 void *data);
68XMLPUBFUN xmlAutomataStatePtr XMLCALL
69                    xmlAutomataNewNegTrans	(xmlAutomataPtr am,
70						 xmlAutomataStatePtr from,
71						 xmlAutomataStatePtr to,
72						 const xmlChar *token,
73						 const xmlChar *token2,
74						 void *data);
75
76XMLPUBFUN xmlAutomataStatePtr XMLCALL
77		    xmlAutomataNewCountTrans	(xmlAutomataPtr am,
78						 xmlAutomataStatePtr from,
79						 xmlAutomataStatePtr to,
80						 const xmlChar *token,
81						 int min,
82						 int max,
83						 void *data);
84XMLPUBFUN xmlAutomataStatePtr XMLCALL
85		    xmlAutomataNewCountTrans2	(xmlAutomataPtr am,
86						 xmlAutomataStatePtr from,
87						 xmlAutomataStatePtr to,
88						 const xmlChar *token,
89						 const xmlChar *token2,
90						 int min,
91						 int max,
92						 void *data);
93XMLPUBFUN xmlAutomataStatePtr XMLCALL
94		    xmlAutomataNewOnceTrans	(xmlAutomataPtr am,
95						 xmlAutomataStatePtr from,
96						 xmlAutomataStatePtr to,
97						 const xmlChar *token,
98						 int min,
99						 int max,
100						 void *data);
101XMLPUBFUN xmlAutomataStatePtr XMLCALL
102		    xmlAutomataNewOnceTrans2	(xmlAutomataPtr am,
103						 xmlAutomataStatePtr from,
104						 xmlAutomataStatePtr to,
105						 const xmlChar *token,
106						 const xmlChar *token2,
107						 int min,
108						 int max,
109						 void *data);
110XMLPUBFUN xmlAutomataStatePtr XMLCALL
111		    xmlAutomataNewAllTrans	(xmlAutomataPtr am,
112						 xmlAutomataStatePtr from,
113						 xmlAutomataStatePtr to,
114						 int lax);
115XMLPUBFUN xmlAutomataStatePtr XMLCALL
116		    xmlAutomataNewEpsilon	(xmlAutomataPtr am,
117						 xmlAutomataStatePtr from,
118						 xmlAutomataStatePtr to);
119XMLPUBFUN xmlAutomataStatePtr XMLCALL
120		    xmlAutomataNewCountedTrans	(xmlAutomataPtr am,
121						 xmlAutomataStatePtr from,
122						 xmlAutomataStatePtr to,
123						 int counter);
124XMLPUBFUN xmlAutomataStatePtr XMLCALL
125		    xmlAutomataNewCounterTrans	(xmlAutomataPtr am,
126						 xmlAutomataStatePtr from,
127						 xmlAutomataStatePtr to,
128						 int counter);
129XMLPUBFUN int XMLCALL
130		    xmlAutomataNewCounter	(xmlAutomataPtr am,
131						 int min,
132						 int max);
133
134XMLPUBFUN xmlRegexpPtr XMLCALL
135		    xmlAutomataCompile		(xmlAutomataPtr am);
136XMLPUBFUN int XMLCALL
137		    xmlAutomataIsDeterminist	(xmlAutomataPtr am);
138
139#ifdef __cplusplus
140}
141#endif
142
143#endif /* LIBXML_AUTOMATA_ENABLED */
144#endif /* LIBXML_REGEXP_ENABLED */
145
146#endif /* __XML_AUTOMATA_H__ */
147