Package pyxb :: Package binding :: Module nfa :: Class Thompson
[hide private]
[frames] | no frames]

Class Thompson

source code

Create a NFA from a content model. Reminiscent of Thompson's algorithm for creating an NFA from a regular expression. See http://portal.acm.org/citation.cfm?doid=363387

Instance Methods [hide private]
 
nfa(self) source code
 
__init__(self, term=None) source code
 
addTransition(self, term, start, end)
Interpret the term and update the NFA to support a path from start to end that is consistent with the term.
source code
 
__fromParticle(self, particle, start, end)
Add transitions to interpret the particle.
source code
 
__fromMGSequence(self, particles, start, end) source code
 
__fromMGChoice(self, particles, start, end) source code
 
__fromMGAll(self, particles, start, end) source code
 
__fromModelGroup(self, group, start, end) source code
Class Variables [hide private]
  __nfa = None
Method Details [hide private]

addTransition(self, term, start, end)

source code 

Interpret the term and update the NFA to support a path from start to end that is consistent with the term.

Particles express looping operations with minimum and maximum iteration counts.

Model groups express control structures: ordered and unordered sequences, and alternatives.

Anything else is assumed to be a character in the automaton alphabet.