Help improve program for parsing simple rules

pruebauno at latinmail.com pruebauno at latinmail.com
Fri Apr 17 15:40:15 EDT 2009


On Apr 17, 11:26 am, Paul McGuire <pt... at austin.rr.com> wrote:
> On Apr 16, 10:57 am, prueba... at latinmail.com wrote:
>
> > Another interesting task for those that are looking for some
> > interesting problem:
> > I inherited some rule system that checks for programmers program
> > outputs that to be ported: given some simple rules and the values it
> > has to determine if the program is still working correctly and give
> > the details of what the values are. If you have a better idea of how
> > to do this kind of parsing please chime in. I am using tokenize but
> > that might be more complex than it needs to be. This is what I have
> > come up so far:
>
> I've been meaning to expand on pyparsing's simpleArith.py example for
> a while, to include the evaluation of the parsed tokens.  Here is the
> online version,http://pyparsing.wikispaces.com/file/view/eval_arith.py,
> it will be included in version 1.5.2 (coming shortly).  I took the
> liberty of including your rule set as a list of embedded test cases.
>
> -- Paul

That is fine with me. I don't know how feasible it is for me to use
pyparsing for this project considering I don't have admin access on
the box that is eventually going to run this. To add insult to injury
Python is in the version 2->3 transition (I really would like to push
the admins to install 3.1 by the end of the year before the amount of
code written by us gets any bigger) meaning that any third party
library is an additional burden on the future upgrade. I can't
remember if pyparsing is pure Python. If it is I might be able to
include it alongside my code if it is not too big.



More information about the Python-list mailing list