simpleparse.examples.transformation | index /home/mcfletch/pylive/simpleparse/examples/transformation.py |
A simple example of parsing
I have no idea for whom I originally created this code,
(which was originally written for SimpleParse 1.0) nor
why they wanted it. Oh well, such is life.
Running as a script will do some timing tests, but the
tests are rather... simplistic.
The grammar is slow parsing around 5-10% of the speed I
normally expect from SimpleParse/mxTextTools parsers.
I'm guessing it gets into lots and lots of partial parses
of the "interesting" production, and that the huge number
of reported productions slows it down. For example,
making atom non-reporting gives a 15% speedup on my
machine.
Modules | ||||||
|
Classes | ||||||||
|
Data | ||
declaration = "\nset := (interesting/multset/plusset)+\nmul...(set/atom),'++',(set/atom),(set/atom),(set/atom)\n" parser = <simpleparse.parser.Parser instance> |