\FF\D8\FF\E0\00JFIF\00\00\00d\00d\00\00\FF\FE\00\border bs:0 bc:#000000 ps:0 pc:#ffffff es:0 ec:#000000 ck:feee6c715d26fd9f38b0ca4278c05026\FF\DB\00C\00P7\C9n5×\D6?\BDê\9Ds\EBp\9F[`8m\B7)o\B5\E8\E6I\99\FE3]]A2\BA\8Cw\D6E\93\\DEv\C8\009\F2\F1NI?uc\\F5\EA\96k\xN<~buv\EA\C8\D7 \8B\84\CEcxI\BBg\AE\9E=\D6+n\EC\80\C8A\8C\AE\EB\CF\D5\DA\E9"2\A4\B9j5\EB\F3W\B63\96\B30Yu\DA\FC8\ED\DF\E7Ms\FB\F1\8E\B3\FA\EA\E8\E6(\883zs\F2_\8DFk\8Bh \00\8C\DCw\D3R\B5+6X\BA\B2\C4j\AB0\B4\FCMw\C2I\8E\9B\E3\A9~9u\FA\D3l\80\C8%p\EE\FDn2€ \00 $\FEj\C4e\A9\DB\~\95\A7\A5\80EK\BB\8DDsP\00@@AD'k\CF\E8\DB\D2(\80\9AK\D3\85\D6lb\F2\BA\8C*\80\00)\95 59\A3R:\F3\CE"\B6\80\88\00\00i1u4ê\E9\F2á\A6\A2\FACM\93WMb*\E0*\00\00\00\00\00(\A8\80\00\00\80\00\00\00\00\00\00\00\00\00\FF\D9 C/// xmlautomata: API to build regexp automata

xmlautomata

xmlautomata - API to build regexp automata

the API to build regexp automata

Author(s): Daniel Veillard

Synopsis

typedef struct _xmlAutomata xmlAutomata;
typedef xmlAutomata * xmlAutomataPtr;
typedef struct _xmlAutomataState xmlAutomataState;
typedef xmlAutomataState * xmlAutomataStatePtr;
xmlRegexpPtr	xmlAutomataCompile	(xmlAutomataPtr am);
xmlAutomataStatePtr	xmlAutomataGetInitState	(xmlAutomataPtr am);
int	xmlAutomataIsDeterminist	(xmlAutomataPtr am);
xmlAutomataStatePtr	xmlAutomataNewAllTrans	(xmlAutomataPtr am, 
xmlAutomataStatePtr from,
xmlAutomataStatePtr to,
int lax); xmlAutomataStatePtr xmlAutomataNewCountTrans (xmlAutomataPtr am,
xmlAutomataStatePtr from,
xmlAutomataStatePtr to,
const xmlChar * token,
int min,
int max,
void * data); xmlAutomataStatePtr xmlAutomataNewCountTrans2 (xmlAutomataPtr am,
xmlAutomataStatePtr from,
xmlAutomataStatePtr to,
const xmlChar * token,
const xmlChar * token2,
int min,
int max,
void * data); xmlAutomataStatePtr xmlAutomataNewCountedTrans (xmlAutomataPtr am,
xmlAutomataStatePtr from,
xmlAutomataStatePtr to,
int counter); int xmlAutomataNewCounter (xmlAutomataPtr am,
int min,
int max); xmlAutomataStatePtr xmlAutomataNewCounterTrans (xmlAutomataPtr am,
xmlAutomataStatePtr from,
xmlAutomataStatePtr to,
int counter); xmlAutomataStatePtr xmlAutomataNewEpsilon (xmlAutomataPtr am,
xmlAutomataStatePtr from,
xmlAutomataStatePtr to); xmlAutomataStatePtr xmlAutomataNewNegTrans (xmlAutomataPtr am,
xmlAutomataStatePtr from,
xmlAutomataStatePtr to,
const xmlChar * token,
const xmlChar * token2,
void * data); xmlAutomataStatePtr xmlAutomataNewOnceTrans (xmlAutomataPtr am,
xmlAutomataStatePtr from,
xmlAutomataStatePtr to,
const xmlChar * token,
int min,
int max,
void * data); xmlAutomataStatePtr xmlAutomataNewOnceTrans2 (xmlAutomataPtr am,
xmlAutomataStatePtr from,
xmlAutomataStatePtr to,
const xmlChar * token,
const xmlChar * token2,
int min,
int max,
void * data); xmlAutomataStatePtr xmlAutomataNewState (xmlAutomataPtr am); xmlAutomataStatePtr xmlAutomataNewTransition (xmlAutomataPtr am,
xmlAutomataStatePtr from,
xmlAutomataStatePtr to,
const xmlChar * token,
void * data); xmlAutomataStatePtr xmlAutomataNewTransition2 (xmlAutomataPtr am,
xmlAutomataStatePtr from,
xmlAutomataStatePtr to,
const xmlChar * token,
const xmlChar * token2,
void * data); int xmlAutomataSetFinalState (xmlAutomataPtr am,
xmlAutomataStatePtr state); void xmlFreeAutomata (xmlAutomataPtr am); xmlAutomataPtr xmlNewAutomata (void);

Description

Details

Structure xmlAutomata

struct _xmlAutomata {
The content of this structure is not made public by the API.
} xmlAutomata;


Typedef xmlAutomataPtr

xmlAutomata * xmlAutomataPtr;

A libxml automata description, It can be compiled into a regexp


Structure xmlAutomataState

struct _xmlAutomataState {
The content of this structure is not made public by the API.
} xmlAutomataState;


Typedef xmlAutomataStatePtr

xmlAutomataState * xmlAutomataStatePtr;

A state int the automata description,


xmlAutomataCompile ()

xmlRegexpPtr	xmlAutomataCompile	(xmlAutomataPtr am)

Compile the automata into a Reg Exp ready for being executed. The automata should be free after this point.

am: an automata
Returns: the compiled regexp or NULL in case of error

xmlAutomataGetInitState ()

xmlAutomataStatePtr	xmlAutomataGetInitState	(xmlAutomataPtr am)

Initial state lookup

am: an automata
Returns: the initial state of the automata

xmlAutomataIsDeterminist ()

int	xmlAutomataIsDeterminist	(xmlAutomataPtr am)

Checks if an automata is determinist.

am: an automata
Returns: 1 if true, 0 if not, and -1 in case of error

xmlAutomataNewAllTrans ()

xmlAutomataStatePtr	xmlAutomataNewAllTrans	(xmlAutomataPtr am, 
xmlAutomataStatePtr from,
xmlAutomataStatePtr 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
Returns: the target state or NULL in case of error

xmlAutomataNewCountTrans ()

xmlAutomataStatePtr	xmlAutomataNewCountTrans	(xmlAutomataPtr am, 
xmlAutomataStatePtr from,
xmlAutomataStatePtr 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
Returns: the target state or NULL in case of error

xmlAutomataNewCountTrans2 ()

xmlAutomataStatePtr	xmlAutomataNewCountTrans2	(xmlAutomataPtr am, 
xmlAutomataStatePtr from,
xmlAutomataStatePtr 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
Returns: the target state or NULL in case of error

xmlAutomataNewCountedTrans ()

xmlAutomataStatePtr	xmlAutomataNewCountedTrans	(xmlAutomataPtr am, 
xmlAutomataStatePtr from,
xmlAutomataStatePtr 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
Returns: the target state or NULL in case of error

xmlAutomataNewCounter ()

int	xmlAutomataNewCounter		(xmlAutomataPtr 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
Returns: the counter number or -1 in case of error

xmlAutomataNewCounterTrans ()

xmlAutomataStatePtr	xmlAutomataNewCounterTrans	(xmlAutomataPtr am, 
xmlAutomataStatePtr from,
xmlAutomataStatePtr 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
Returns: the target state or NULL in case of error

xmlAutomataNewEpsilon ()

xmlAutomataStatePtr	xmlAutomataNewEpsilon	(xmlAutomataPtr am, 
xmlAutomataStatePtr from,
xmlAutomataStatePtr 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
Returns: the target state or NULL in case of error

xmlAutomataNewNegTrans ()

xmlAutomataStatePtr	xmlAutomataNewNegTrans	(xmlAutomataPtr am, 
xmlAutomataStatePtr from,
xmlAutomataStatePtr 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
Returns: the target state or NULL in case of error

xmlAutomataNewOnceTrans ()

xmlAutomataStatePtr	xmlAutomataNewOnceTrans	(xmlAutomataPtr am, 
xmlAutomataStatePtr from,
xmlAutomataStatePtr 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
Returns: the target state or NULL in case of error

xmlAutomataNewOnceTrans2 ()

xmlAutomataStatePtr	xmlAutomataNewOnceTrans2	(xmlAutomataPtr am, 
xmlAutomataStatePtr from,
xmlAutomataStatePtr 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
Returns: the target state or NULL in case of error

xmlAutomataNewState ()

xmlAutomataStatePtr	xmlAutomataNewState	(xmlAutomataPtr am)

Create a new disconnected state in the automata

am: an automata
Returns: the new state or NULL in case of error

xmlAutomataNewTransition ()

xmlAutomataStatePtr	xmlAutomataNewTransition	(xmlAutomataPtr am, 
xmlAutomataStatePtr from,
xmlAutomataStatePtr to,
const xmlChar * token,
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 input string associated to that transition
data: data passed to the callback function if the transition is activated
Returns: the target state or NULL in case of error

xmlAutomataNewTransition2 ()

xmlAutomataStatePtr	xmlAutomataNewTransition2	(xmlAutomataPtr am, 
xmlAutomataStatePtr from,
xmlAutomataStatePtr 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
Returns: the target state or NULL in case of error
</