[964] | 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 |
---|
| 21 | extern "C" { |
---|
| 22 | #endif |
---|
| 23 | |
---|
| 24 | /** |
---|
| 25 | * xmlAutomataPtr: |
---|
| 26 | * |
---|
| 27 | * A libxml automata description, It can be compiled into a regexp |
---|
| 28 | */ |
---|
| 29 | typedef struct _xmlAutomata xmlAutomata; |
---|
| 30 | typedef xmlAutomata *xmlAutomataPtr; |
---|
| 31 | |
---|
| 32 | /** |
---|
| 33 | * xmlAutomataStatePtr: |
---|
| 34 | * |
---|
| 35 | * A state int the automata description, |
---|
| 36 | */ |
---|
| 37 | typedef struct _xmlAutomataState xmlAutomataState; |
---|
| 38 | typedef xmlAutomataState *xmlAutomataStatePtr; |
---|
| 39 | |
---|
| 40 | /* |
---|
| 41 | * Building API |
---|
| 42 | */ |
---|
| 43 | XMLPUBFUN xmlAutomataPtr XMLCALL |
---|
| 44 | xmlNewAutomata (void); |
---|
| 45 | XMLPUBFUN void XMLCALL |
---|
| 46 | xmlFreeAutomata (xmlAutomataPtr am); |
---|
| 47 | |
---|
| 48 | XMLPUBFUN xmlAutomataStatePtr XMLCALL |
---|
| 49 | xmlAutomataGetInitState (xmlAutomataPtr am); |
---|
| 50 | XMLPUBFUN int XMLCALL |
---|
| 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, |
---|
| 59 | const xmlChar *token, |
---|
| 60 | void *data); |
---|
| 61 | XMLPUBFUN xmlAutomataStatePtr XMLCALL |
---|
| 62 | xmlAutomataNewTransition2 (xmlAutomataPtr am, |
---|
| 63 | xmlAutomataStatePtr from, |
---|
| 64 | xmlAutomataStatePtr to, |
---|
| 65 | const xmlChar *token, |
---|
| 66 | const xmlChar *token2, |
---|
| 67 | void *data); |
---|
| 68 | XMLPUBFUN xmlAutomataStatePtr XMLCALL |
---|
| 69 | xmlAutomataNewCountTrans (xmlAutomataPtr am, |
---|
| 70 | xmlAutomataStatePtr from, |
---|
| 71 | xmlAutomataStatePtr to, |
---|
| 72 | const xmlChar *token, |
---|
| 73 | int min, |
---|
| 74 | int max, |
---|
| 75 | void *data); |
---|
| 76 | XMLPUBFUN xmlAutomataStatePtr XMLCALL |
---|
| 77 | xmlAutomataNewCountTrans2 (xmlAutomataPtr am, |
---|
| 78 | xmlAutomataStatePtr from, |
---|
| 79 | xmlAutomataStatePtr to, |
---|
| 80 | const xmlChar *token, |
---|
| 81 | const xmlChar *token2, |
---|
| 82 | int min, |
---|
| 83 | int max, |
---|
| 84 | void *data); |
---|
| 85 | XMLPUBFUN xmlAutomataStatePtr XMLCALL |
---|
| 86 | xmlAutomataNewOnceTrans (xmlAutomataPtr am, |
---|
| 87 | xmlAutomataStatePtr from, |
---|
| 88 | xmlAutomataStatePtr to, |
---|
| 89 | const xmlChar *token, |
---|
| 90 | int min, |
---|
| 91 | int max, |
---|
| 92 | void *data); |
---|
| 93 | XMLPUBFUN xmlAutomataStatePtr XMLCALL |
---|
| 94 | xmlAutomataNewOnceTrans2 (xmlAutomataPtr am, |
---|
| 95 | xmlAutomataStatePtr from, |
---|
| 96 | xmlAutomataStatePtr to, |
---|
| 97 | const xmlChar *token, |
---|
| 98 | const xmlChar *token2, |
---|
| 99 | int min, |
---|
| 100 | int max, |
---|
| 101 | void *data); |
---|
| 102 | XMLPUBFUN xmlAutomataStatePtr XMLCALL |
---|
| 103 | xmlAutomataNewAllTrans (xmlAutomataPtr am, |
---|
| 104 | xmlAutomataStatePtr from, |
---|
| 105 | xmlAutomataStatePtr to, |
---|
| 106 | int lax); |
---|
| 107 | XMLPUBFUN xmlAutomataStatePtr XMLCALL |
---|
| 108 | xmlAutomataNewEpsilon (xmlAutomataPtr am, |
---|
| 109 | xmlAutomataStatePtr from, |
---|
| 110 | xmlAutomataStatePtr to); |
---|
| 111 | XMLPUBFUN xmlAutomataStatePtr XMLCALL |
---|
| 112 | xmlAutomataNewCountedTrans (xmlAutomataPtr am, |
---|
| 113 | xmlAutomataStatePtr from, |
---|
| 114 | xmlAutomataStatePtr to, |
---|
| 115 | int counter); |
---|
| 116 | XMLPUBFUN xmlAutomataStatePtr XMLCALL |
---|
| 117 | xmlAutomataNewCounterTrans (xmlAutomataPtr am, |
---|
| 118 | xmlAutomataStatePtr from, |
---|
| 119 | xmlAutomataStatePtr to, |
---|
| 120 | int counter); |
---|
| 121 | XMLPUBFUN int XMLCALL |
---|
| 122 | xmlAutomataNewCounter (xmlAutomataPtr am, |
---|
| 123 | int min, |
---|
| 124 | int max); |
---|
| 125 | |
---|
| 126 | XMLPUBFUN xmlRegexpPtr XMLCALL |
---|
| 127 | xmlAutomataCompile (xmlAutomataPtr am); |
---|
| 128 | XMLPUBFUN int XMLCALL |
---|
| 129 | xmlAutomataIsDeterminist (xmlAutomataPtr am); |
---|
| 130 | |
---|
| 131 | #ifdef __cplusplus |
---|
| 132 | } |
---|
| 133 | #endif |
---|
| 134 | |
---|
| 135 | #endif /* LIBXML_AUTOMATA_ENABLED */ |
---|
| 136 | #endif /* LIBXML_REGEXP_ENABLED */ |
---|
| 137 | |
---|
| 138 | #endif /* __XML_AUTOMATA_H__ */ |
---|