Package mekano :: Module io :: Class StateMachineFileParser
[hide private]
[frames] | no frames]

Class StateMachineFileParser

source code

Known Subclasses:

A state machine based line-oriented parser.

You should subclass this and implement 'state' functions that begin with '_on', e.g., _onStart(self, line)

Each such function:

Additionally, two special functions must be defined with no parameters:

  1. _onInit(self)
  2. _onFinish(self)

to handle initialization (local state) and end of file (useful for formats that use no ending tag).

Instance Methods [hide private]
 
__init__(self) source code
 
_introspect(self)
Find all functions that begin with 'on' and create a map from the rest of their name to the function object.
source code
 
parse(self, line) source code
 
parseFile(self, fin) source code
 
parseFileName(self, fileName) source code
 
close(self) source code
 
_onFinish(self) source code