|
libxml2
|
API to build regexp automata. More...
Typedefs | |
| typedef struct _xmlAutomata | xmlAutomata |
| A libxml automata description. | |
| typedef struct _xmlAutomataState | xmlAutomataState |
| A state in the automata description. | |
Functions | |
| xmlAutomata * | xmlNewAutomata (void) |
| Create a new automata. | |
| void | xmlFreeAutomata (xmlAutomata *am) |
| Free an automata. | |
| xmlAutomataState * | xmlAutomataGetInitState (xmlAutomata *am) |
| Initial state lookup. | |
| int | xmlAutomataSetFinalState (xmlAutomata *am, xmlAutomataState *state) |
| Makes that state a final state. | |
| xmlAutomataState * | xmlAutomataNewState (xmlAutomata *am) |
| Create a new disconnected state in the automata. | |
| xmlAutomataState * | xmlAutomataNewTransition (xmlAutomata *am, xmlAutomataState *from, xmlAutomataState *to, const xmlChar *token, void *data) |
| Add a transition. | |
| xmlAutomataState * | xmlAutomataNewTransition2 (xmlAutomata *am, xmlAutomataState *from, xmlAutomataState *to, const xmlChar *token, const xmlChar *token2, void *data) |
| If to is NULL, this creates first a new target state in the automata and then adds a transition from the from state to the target state activated by the value of token | |
| xmlAutomataState * | xmlAutomataNewNegTrans (xmlAutomata *am, xmlAutomataState *from, xmlAutomataState *to, const xmlChar *token, const xmlChar *token2, void *data) |
| If to is NULL, this creates first a new target state in the automata and then adds a transition from the from state to the target state activated by any value except (token,token2) Note that if token2 is not NULL, then (X, NULL) won't match to follow the semantic of XSD ##other. | |
| xmlAutomataState * | xmlAutomataNewCountTrans (xmlAutomata *am, xmlAutomataState *from, xmlAutomataState *to, const xmlChar *token, int min, int max, void *data) |
| If to is NULL, this creates first a new target state in the automata and then adds a transition from the from state to the target state activated by a succession of input of value token and whose number is between min and max | |
| xmlAutomataState * | xmlAutomataNewCountTrans2 (xmlAutomata *am, xmlAutomataState *from, xmlAutomataState *to, const xmlChar *token, const xmlChar *token2, int min, int max, void *data) |
| If to is NULL, this creates first a new target state in the automata and then adds a transition from the from state to the target state activated by a succession of input of value token and token2 and whose number is between min and max | |
| xmlAutomataState * | xmlAutomataNewOnceTrans (xmlAutomata *am, xmlAutomataState *from, xmlAutomataState *to, const xmlChar *token, int min, int max, void *data) |
| If to is NULL, this creates first a new target state in the automata and then adds a transition from the from state to the target state activated by a succession of input of value token and whose number is between min and max, moreover that transition can only be crossed once. | |
| xmlAutomataState * | xmlAutomataNewOnceTrans2 (xmlAutomata *am, xmlAutomataState *from, xmlAutomataState *to, const xmlChar *token, const xmlChar *token2, int min, int max, void *data) |
| If to is NULL, this creates first a new target state in the automata and then adds a transition from the from state to the target state activated by a succession of input of value token and token2 and whose number is between min and max, moreover that transition can only be crossed once. | |
| xmlAutomataState * | xmlAutomataNewAllTrans (xmlAutomata *am, xmlAutomataState *from, xmlAutomataState *to, int lax) |
| If to is NULL, this creates first a new target state in the automata and then adds a an ALL transition from the from state to the target state. | |
| xmlAutomataState * | xmlAutomataNewEpsilon (xmlAutomata *am, xmlAutomataState *from, xmlAutomataState *to) |
| If to is NULL, this creates first a new target state in the automata and then adds an epsilon transition from the from state to the target state. | |
| xmlAutomataState * | xmlAutomataNewCountedTrans (xmlAutomata *am, xmlAutomataState *from, xmlAutomataState *to, int counter) |
| If to is NULL, this creates first a new target state in the automata and then adds an epsilon transition from the from state to the target state which will increment the counter provided. | |
| xmlAutomataState * | xmlAutomataNewCounterTrans (xmlAutomata *am, xmlAutomataState *from, xmlAutomataState *to, int counter) |
| If to is NULL, this creates first a new target state in the automata and then adds an epsilon transition from the from state to the target state which will be allowed only if the counter is within the right range. | |
| int | xmlAutomataNewCounter (xmlAutomata *am, int min, int max) |
| Create a new counter. | |
| struct _xmlRegexp * | xmlAutomataCompile (xmlAutomata *am) |
| Compile the automata into a Reg Exp ready for being executed. | |
| int | xmlAutomataIsDeterminist (xmlAutomata *am) |
| Checks if an automata is determinist. | |
API to build regexp automata.
These are internal functions and shouldn't be used.
| typedef struct _xmlAutomata xmlAutomata |
A libxml automata description.
It can be compiled into a regexp
| struct _xmlRegexp * xmlAutomataCompile | ( | xmlAutomata * | am | ) |
Compile the automata into a Reg Exp ready for being executed.
The automata should be free after this point.
| am | an automata |
| xmlAutomataState * xmlAutomataGetInitState | ( | xmlAutomata * | am | ) |
Initial state lookup.
| am | an automata |
| int xmlAutomataIsDeterminist | ( | xmlAutomata * | am | ) |
Checks if an automata is determinist.
| am | an automata |
| xmlAutomataState * xmlAutomataNewAllTrans | ( | xmlAutomata * | am, |
| xmlAutomataState * | from, | ||
| xmlAutomataState * | to, | ||
| int | lax ) |
If to is NULL, this creates first a new target state in the automata and then adds a an ALL transition from the from state to the target state.
That transition is an epsilon transition allowed only when all transitions from the from node have been activated.
| am | an automata |
| from | the starting point of the transition |
| to | the target point of the transition or NULL |
| lax | allow to transition if not all all transitions have been activated |
| xmlAutomataState * xmlAutomataNewCountedTrans | ( | xmlAutomata * | am, |
| xmlAutomataState * | from, | ||
| xmlAutomataState * | to, | ||
| int | counter ) |
If to is NULL, this creates first a new target state in the automata and then adds an epsilon transition from the from state to the target state which will increment the counter provided.
| am | an automata |
| from | the starting point of the transition |
| to | the target point of the transition or NULL |
| counter | the counter associated to that transition |
| int xmlAutomataNewCounter | ( | xmlAutomata * | am, |
| int | min, | ||
| int | max ) |
Create a new counter.
| am | an automata |
| min | the minimal value on the counter |
| max | the maximal value on the counter |
| xmlAutomataState * xmlAutomataNewCounterTrans | ( | xmlAutomata * | am, |
| xmlAutomataState * | from, | ||
| xmlAutomataState * | to, | ||
| int | counter ) |
If to is NULL, this creates first a new target state in the automata and then adds an epsilon transition from the from state to the target state which will be allowed only if the counter is within the right range.
| am | an automata |
| from | the starting point of the transition |
| to | the target point of the transition or NULL |
| counter | the counter associated to that transition |
| xmlAutomataState * xmlAutomataNewCountTrans | ( | xmlAutomata * | am, |
| xmlAutomataState * | from, | ||
| xmlAutomataState * | to, | ||
| const xmlChar * | token, | ||
| int | min, | ||
| int | max, | ||
| void * | data ) |
If to is NULL, this creates first a new target state in the automata and then adds a transition from the from state to the target state activated by a succession of input of value token and whose number is between min and max
| am | an automata |
| from | the starting point of the transition |
| to | the target point of the transition or NULL |
| token | the input string associated to that transition |
| min | the minimum successive occurrences of token |
| max | the maximum successive occurrences of token |
| data | data associated to the transition |
| xmlAutomataState * xmlAutomataNewCountTrans2 | ( | xmlAutomata * | am, |
| xmlAutomataState * | from, | ||
| xmlAutomataState * | to, | ||
| const xmlChar * | token, | ||
| const xmlChar * | token2, | ||
| int | min, | ||
| int | max, | ||
| void * | data ) |
If to is NULL, this creates first a new target state in the automata and then adds a transition from the from state to the target state activated by a succession of input of value token and token2 and whose number is between min and max
| am | an automata |
| from | the starting point of the transition |
| to | the target point of the transition or NULL |
| token | the input string associated to that transition |
| token2 | the second input string associated to that transition |
| min | the minimum successive occurrences of token |
| max | the maximum successive occurrences of token |
| data | data associated to the transition |
| xmlAutomataState * xmlAutomataNewEpsilon | ( | xmlAutomata * | am, |
| xmlAutomataState * | from, | ||
| xmlAutomataState * | to ) |
If to is NULL, this creates first a new target state in the automata and then adds an epsilon transition from the from state to the target state.
| am | an automata |
| from | the starting point of the transition |
| to | the target point of the transition or NULL |
| xmlAutomataState * xmlAutomataNewNegTrans | ( | xmlAutomata * | am, |
| xmlAutomataState * | from, | ||
| xmlAutomataState * | to, | ||
| const xmlChar * | token, | ||
| const xmlChar * | token2, | ||
| void * | data ) |
If to is NULL, this creates first a new target state in the automata and then adds a transition from the from state to the target state activated by any value except (token,token2) Note that if token2 is not NULL, then (X, NULL) won't match to follow the semantic of XSD ##other.
| am | an automata |
| from | the starting point of the transition |
| to | the target point of the transition or NULL |
| token | the first input string associated to that transition |
| token2 | the second input string associated to that transition |
| data | data passed to the callback function if the transition is activated |
| xmlAutomataState * xmlAutomataNewOnceTrans | ( | xmlAutomata * | am, |
| xmlAutomataState * | from, | ||
| xmlAutomataState * | to, | ||
| const xmlChar * | token, | ||
| int | min, | ||
| int | max, | ||
| void * | data ) |
If to is NULL, this creates first a new target state in the automata and then adds a transition from the from state to the target state activated by a succession of input of value token and whose number is between min and max, moreover that transition can only be crossed once.
| am | an automata |
| from | the starting point of the transition |
| to | the target point of the transition or NULL |
| token | the input string associated to that transition |
| min | the minimum successive occurrences of token |
| max | the maximum successive occurrences of token |
| data | data associated to the transition |
| xmlAutomataState * xmlAutomataNewOnceTrans2 | ( | xmlAutomata * | am, |
| xmlAutomataState * | from, | ||
| xmlAutomataState * | to, | ||
| const xmlChar * | token, | ||
| const xmlChar * | token2, | ||
| int | min, | ||
| int | max, | ||
| void * | data ) |
If to is NULL, this creates first a new target state in the automata and then adds a transition from the from state to the target state activated by a succession of input of value token and token2 and whose number is between min and max, moreover that transition can only be crossed once.
| am | an automata |
| from | the starting point of the transition |
| to | the target point of the transition or NULL |
| token | the input string associated to that transition |
| token2 | the second input string associated to that transition |
| min | the minimum successive occurrences of token |
| max | the maximum successive occurrences of token |
| data | data associated to the transition |
| xmlAutomataState * xmlAutomataNewState | ( | xmlAutomata * | am | ) |
Create a new disconnected state in the automata.
| am | an automata |
| xmlAutomataState * xmlAutomataNewTransition | ( | xmlAutomata * | am, |
| xmlAutomataState * | from, | ||
| xmlAutomataState * | to, | ||
| const xmlChar * | token, | ||
| void * | data ) |
Add a transition.
If to is NULL, this creates first a new target state in the automata and then adds a transition from the from state to the target state activated by the value of token
| am | an automata |
| from | the starting point of the transition |
| to | the target point of the transition or NULL |
| token | the input string associated to that transition |
| data | data passed to the callback function if the transition is activated |
| xmlAutomataState * xmlAutomataNewTransition2 | ( | xmlAutomata * | am, |
| xmlAutomataState * | from, | ||
| xmlAutomataState * | to, | ||
| const xmlChar * | token, | ||
| const xmlChar * | token2, | ||
| void * | data ) |
If to is NULL, this creates first a new target state in the automata and then adds a transition from the from state to the target state activated by the value of token
| am | an automata |
| from | the starting point of the transition |
| to | the target point of the transition or NULL |
| token | the first input string associated to that transition |
| token2 | the second input string associated to that transition |
| data | data passed to the callback function if the transition is activated |
| int xmlAutomataSetFinalState | ( | xmlAutomata * | am, |
| xmlAutomataState * | state ) |
Makes that state a final state.
| am | an automata |
| state | a state in this automata |
| void xmlFreeAutomata | ( | xmlAutomata * | am | ) |
| xmlAutomata * xmlNewAutomata | ( | void | ) |
Create a new automata.