Pyparsing: Grammar Suggestion

Khoa Nguyen khoa.coffee at gmail.com
Wed May 17 11:24:39 EDT 2006


I am trying to come up with a grammar that describes the following:

record = f1,f2,...,fn END_RECORD
All the f(i) has to be in that order.
Any f(i) can be absent (e.g. f1,,f3,f4,,f6 END_RECORD)
Number of f(i)'s can vary. For example, the followings are allowed:
f1,f2 END_RECORD
f1,f2,,f4,,f6 END_RECORD

Any suggestions?

Thanks,
Khoa



More information about the Python-list mailing list