xmlautomata

Name

xmlautomata -- 

Synopsis



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

Description

Details

struct xmlAutomata

struct xmlAutomata;


xmlAutomataPtr

typedef xmlAutomata *xmlAutomataPtr;

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


struct xmlAutomataState

struct xmlAutomataState;


xmlAutomataStatePtr

typedef xmlAutomataState *xmlAutomataStatePtr;

A state int the automata description,


xmlNewAutomata ()

xmlAutomataPtr xmlNewAutomata               (void);

Create a new automata


xmlFreeAutomata ()

void        xmlFreeAutomata                 (xmlAutomataPtr am);

Free an automata


xmlAutomataGetInitState ()

xmlAutomataStatePtr xmlAutomataGetInitState (xmlAutomataPtr am);


xmlAutomataSetFinalState ()

int         xmlAutomataSetFinalState        (xmlAutomataPtr am,
                                             xmlAutomataStatePtr state);

Makes that state a final state


xmlAutomataNewState ()

xmlAutomataStatePtr xmlAutomataNewState     (xmlAutomataPtr am);

Create a new disconnected state in the automata


xmlAutomataNewTransition ()

xmlAutomataStatePtr xmlAutomataNewTransition
                                            (xmlAutomataPtr am,
                                             xmlAutomataStatePtr from,
                                             xmlAutomataStatePtr to,
                                             const xmlChar *token,
                                             void *data);

If to is NULL, this create first a new target state in the automata and then adds a an epsilon transition from the from state to the target state


xmlAutomataNewCountTrans ()

xmlAutomataStatePtr xmlAutomataNewCountTrans
                                            (xmlAutomataPtr am,
                                             xmlAutomataStatePtr from,
                                             xmlAutomataStatePtr to,
                                             const xmlChar *token,
                                             int min,
                                             int max,
                                             void *data);

If to is NULL, this create 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


xmlAutomataNewOnceTrans ()

xmlAutomataStatePtr xmlAutomataNewOnceTrans (xmlAutomataPtr am,
                                             xmlAutomataStatePtr from,
                                             xmlAutomataStatePtr to,
                                             const xmlChar *token,
                                             int min,
                                             int max,
                                             void *data);

If to is NULL, this create 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 transistion can only be crossed once.


xmlAutomataNewAllTrans ()

xmlAutomataStatePtr xmlAutomataNewAllTrans  (xmlAutomataPtr am,
                                             xmlAutomataStatePtr from,
                                             xmlAutomataStatePtr to,
                                             int lax);

If to is NULL, this create 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.


xmlAutomataNewEpsilon ()

xmlAutomataStatePtr xmlAutomataNewEpsilon   (xmlAutomataPtr am,
                                             xmlAutomataStatePtr from,
                                             xmlAutomataStatePtr to);


xmlAutomataNewCountedTrans ()

xmlAutomataStatePtr xmlAutomataNewCountedTrans
                                            (xmlAutomataPtr am,
                                             xmlAutomataStatePtr from,
                                             xmlAutomataStatePtr to,
                                             int counter);

If to is NULL, this create 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


xmlAutomataNewCounterTrans ()

xmlAutomataStatePtr xmlAutomataNewCounterTrans
                                            (xmlAutomataPtr am,
                                             xmlAutomataStatePtr from,
                                             xmlAutomataStatePtr to,
                                             int counter);

If to is NULL, this create 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.


xmlAutomataNewCounter ()

int         xmlAutomataNewCounter           (xmlAutomataPtr am,
                                             int min,
                                             int max);

Create a new counter


xmlAutomataCompile ()

xmlRegexpPtr xmlAutomataCompile             (xmlAutomataPtr am);

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


xmlAutomataIsDeterminist ()

int         xmlAutomataIsDeterminist        (xmlAutomataPtr am);

Checks if an automata is determinist.