Blame doc/devhelp/libxml2-xmlautomata.html

Packit 423ecb
Packit 423ecb
<html>
Packit 423ecb
  <head>
Packit 423ecb
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
Packit 423ecb
    <title>xmlautomata: API to build regexp automata</title>
Packit 423ecb
    <meta name="generator" content="Libxml2 devhelp stylesheet"/>
Packit 423ecb
    <link rel="start" href="index.html" title="libxml2 Reference Manual"/>
Packit 423ecb
    <link rel="up" href="general.html" title="API"/>
Packit 423ecb
    <link rel="stylesheet" href="style.css" type="text/css"/>
Packit 423ecb
    <link rel="chapter" href="general.html" title="API"/>
Packit 423ecb
  </head>
Packit 423ecb
  <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
Packit 423ecb
    
Packit 423ecb
      
Packit 423ecb
        
Packit 423ecb
          
Packit 423ecb
            Prev
Packit 423ecb
          
Packit 423ecb
        
Packit 423ecb
        
Packit 423ecb
          
Packit 423ecb
            Up
Packit 423ecb
          
Packit 423ecb
        
Packit 423ecb
        
Packit 423ecb
          
Packit 423ecb
            Home
Packit 423ecb
          
Packit 423ecb
        
Packit 423ecb
        
Packit 423ecb
          
Packit 423ecb
            Next
Packit 423ecb
          
Packit 423ecb
        
Packit 423ecb
        libxml2 Reference Manual
Packit 423ecb
      
Packit 423ecb
    
Packit 423ecb
    

Packit 423ecb
      xmlautomata
Packit 423ecb
    
Packit 423ecb
    

xmlautomata - API to build regexp automata

Packit 423ecb
    

the API to build regexp automata

Packit 423ecb
    

Author(s): Daniel Veillard

Packit 423ecb
    
Packit 423ecb
      

Synopsis

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

Description

Packit 423ecb
    
Packit 423ecb
    
Packit 423ecb
      

Details

Packit 423ecb
      
Packit 423ecb
        

Structure xmlAutomata

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

Packit 423ecb
Packit 423ecb
        
Packit 423ecb
        

Typedef xmlAutomataPtr

xmlAutomata * xmlAutomataPtr;
Packit 423ecb

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

Packit 423ecb
Packit 423ecb
        
Packit 423ecb
        

Structure xmlAutomataState

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

Packit 423ecb
Packit 423ecb
        
Packit 423ecb
        

Typedef xmlAutomataStatePtr

xmlAutomataState * xmlAutomataStatePtr;
Packit 423ecb

A state int the automata description,

Packit 423ecb
Packit 423ecb
        
Packit 423ecb
        
Packit 423ecb

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

Packit 423ecb
<tt>am</tt>:an automata
<tt>Returns</tt>:the compiled regexp or NULL in case of error
Packit 423ecb
        
Packit 423ecb
        
Packit 423ecb

Initial state lookup

Packit 423ecb
<tt>am</tt>:an automata
<tt>Returns</tt>:the initial state of the automata
Packit 423ecb
        
Packit 423ecb
        
Packit 423ecb

Checks if an automata is determinist.

Packit 423ecb
<tt>am</tt>:an automata
<tt>Returns</tt>:1 if true, 0 if not, and -1 in case of error
Packit 423ecb
        
Packit 423ecb
        
Packit 423ecb

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.

Packit 423ecb
<tt>am</tt>:an automata
<tt>from</tt>:the starting point of the transition
<tt>to</tt>:the target point of the transition or NULL
<tt>lax</tt>:allow to transition if not all all transitions have been activated
<tt>Returns</tt>:the target state or NULL in case of error
Packit 423ecb
        
Packit 423ecb
        

xmlAutomataNewCountTrans ()

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

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

Packit 423ecb
<tt>am</tt>:an automata
<tt>from</tt>:the starting point of the transition
<tt>to</tt>:the target point of the transition or NULL
<tt>token</tt>:the input string associated to that transition
<tt>min</tt>:the minimum successive occurences of token
<tt>max</tt>:the maximum successive occurences of token
<tt>data</tt>:data associated to the transition
<tt>Returns</tt>:the target state or NULL in case of error
Packit 423ecb
        
Packit 423ecb
        

xmlAutomataNewCountTrans2 ()

xmlAutomataStatePtr	xmlAutomataNewCountTrans2	(xmlAutomataPtr am, 
xmlAutomataStatePtr from,
xmlAutomataStatePtr to,
const xmlChar * token,
const xmlChar * token2,
int min,
int max,
void * data)
Packit 423ecb

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

Packit 423ecb
<tt>am</tt>:an automata
<tt>from</tt>:the starting point of the transition
<tt>to</tt>:the target point of the transition or NULL
<tt>token</tt>:the input string associated to that transition
<tt>token2</tt>:the second input string associated to that transition
<tt>min</tt>:the minimum successive occurences of token
<tt>max</tt>:the maximum successive occurences of token
<tt>data</tt>:data associated to the transition
<tt>Returns</tt>:the target state or NULL in case of error
Packit 423ecb
        
Packit 423ecb
        
Packit 423ecb

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

Packit 423ecb
<tt>am</tt>:an automata
<tt>from</tt>:the starting point of the transition
<tt>to</tt>:the target point of the transition or NULL
<tt>counter</tt>:the counter associated to that transition
<tt>Returns</tt>:the target state or NULL in case of error
Packit 423ecb
        
Packit 423ecb
        
Packit 423ecb

Create a new counter

Packit 423ecb
<tt>am</tt>:an automata
<tt>min</tt>:the minimal value on the counter
<tt>max</tt>:the maximal value on the counter
<tt>Returns</tt>:the counter number or -1 in case of error
Packit 423ecb
        
Packit 423ecb
        
Packit 423ecb

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.

Packit 423ecb
<tt>am</tt>:an automata
<tt>from</tt>:the starting point of the transition
<tt>to</tt>:the target point of the transition or NULL
<tt>counter</tt>:the counter associated to that transition
<tt>Returns</tt>:the target state or NULL in case of error
Packit 423ecb
        
Packit 423ecb
        
Packit 423ecb

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

Packit 423ecb
<tt>am</tt>:an automata
<tt>from</tt>:the starting point of the transition
<tt>to</tt>:the target point of the transition or NULL
<tt>Returns</tt>:the target state or NULL in case of error
Packit 423ecb
        
Packit 423ecb
        

xmlAutomataNewNegTrans ()

xmlAutomataStatePtr	xmlAutomataNewNegTrans	(xmlAutomataPtr am, 
xmlAutomataStatePtr from,
xmlAutomataStatePtr to,
const xmlChar * token,
const xmlChar * token2,
void * data)
Packit 423ecb

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

Packit 423ecb
<tt>am</tt>:an automata
<tt>from</tt>:the starting point of the transition
<tt>to</tt>:the target point of the transition or NULL
<tt>token</tt>:the first input string associated to that transition
<tt>token2</tt>:the second input string associated to that transition
<tt>data</tt>:data passed to the callback function if the transition is activated
<tt>Returns</tt>:the target state or NULL in case of error
Packit 423ecb
        
Packit 423ecb
        

xmlAutomataNewOnceTrans ()

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

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.

Packit 423ecb
<tt>am</tt>:an automata
<tt>from</tt>:the starting point of the transition
<tt>to</tt>:the target point of the transition or NULL
<tt>token</tt>:the input string associated to that transition
<tt>min</tt>:the minimum successive occurences of token
<tt>max</tt>:the maximum successive occurences of token
<tt>data</tt>:data associated to the transition
<tt>Returns</tt>:the target state or NULL in case of error
Packit 423ecb
        
Packit 423ecb
        

xmlAutomataNewOnceTrans2 ()

xmlAutomataStatePtr	xmlAutomataNewOnceTrans2	(xmlAutomataPtr am, 
xmlAutomataStatePtr from,
xmlAutomataStatePtr to,
const xmlChar * token,
const xmlChar * token2,
int min,
int max,
void * data)
Packit 423ecb

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.

Packit 423ecb
<tt>am</tt>:an automata
<tt>from</tt>:the starting point of the transition
<tt>to</tt>:the target point of the transition or NULL
<tt>token</tt>:the input string associated to that transition
<tt>token2</tt>:the second input string associated to that transition
<tt>min</tt>:the minimum successive occurences of token
<tt>max</tt>:the maximum successive occurences of token
<tt>data</tt>:data associated to the transition
<tt>Returns</tt>:the target state or NULL in case of error
Packit 423ecb
        
Packit 423ecb
        
Packit 423ecb

Create a new disconnected state in the automata

Packit 423ecb
<tt>am</tt>:an automata
<tt>Returns</tt>:the new state or NULL in case of error
Packit 423ecb
        
Packit 423ecb
        

xmlAutomataNewTransition ()

xmlAutomataStatePtr	xmlAutomataNewTransition	(xmlAutomataPtr am, 
xmlAutomataStatePtr from,
xmlAutomataStatePtr to,
const xmlChar * token,
void * data)
Packit 423ecb

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

Packit 423ecb
<tt>am</tt>:an automata
<tt>from</tt>:the starting point of the transition
<tt>to</tt>:the target point of the transition or NULL
<tt>token</tt>:the input string associated to that transition
<tt>data</tt>:data passed to the callback function if the transition is activated
<tt>Returns</tt>:the target state or NULL in case of error
Packit 423ecb
        
Packit 423ecb
        

xmlAutomataNewTransition2 ()

xmlAutomataStatePtr	xmlAutomataNewTransition2	(xmlAutomataPtr am, 
xmlAutomataStatePtr from,
xmlAutomataStatePtr to,
const xmlChar * token,
const xmlChar * token2,
void * data)
Packit 423ecb

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

Packit 423ecb
<tt>am</tt>:an automata
<tt>from</tt>:the starting point of the transition
<tt>to</tt>:the target point of the transition or NULL
<tt>token</tt>:the first input string associated to that transition
<tt>token2</tt>:the second input string associated to that transition
<tt>data</tt>:data passed to the callback function if the transition is activated
<tt>Returns</tt>:the target state or NULL in case of error
Packit 423ecb
        
Packit 423ecb
        
Packit 423ecb

Makes that state a final state

Packit 423ecb
<tt>am</tt>:an automata
<tt>state</tt>:a state in this automata
<tt>Returns</tt>:0 or -1 in case of error
Packit 423ecb
        
Packit 423ecb
        
Packit 423ecb

Free an automata

Packit 423ecb
<tt>am</tt>:an automata
Packit 423ecb
        
Packit 423ecb
        

xmlNewAutomata ()

xmlAutomataPtr	xmlNewAutomata		(void)
Packit 423ecb

Create a new automata

Packit 423ecb
<tt>Returns</tt>:the new object or NULL in case of failure
Packit 423ecb
        
Packit 423ecb
      
Packit 423ecb
    
Packit 423ecb
  </body>
Packit 423ecb
</html>