4 ms·
I would recommend pyparsing for this. There was an excellent article on it in Python Magazine a few months ago. Some links: 1. O'Reilly mini-book on pyparsing
by ramanujan 17y ago
I would recommend pyparsing for this. There was an excellent article on it in Python Magazine a few months ago.
Some links:
1. O'Reilly mini-book on pyparsing (probably best single ref)
http://oreilly.com/catalog/9780596514235/ http://oreilly.com/catalog/9780596514235/
2. Quick example of pyparsing
http://eikke.com/pyparsing-introduction-bnf-to-code/ http://eikke.com/pyparsing-introduction-bnf-to-code/
3. Main pyparsing page (i know it's not very aesthetically pleasing. The code is much better, I promise)
http://pyparsing.wikispaces.com/ http://pyparsing.wikispaces.com/
4. Links to more on pyparsing here
http://pyparsing.wikispaces.com/Publications http://pyparsing.wikispaces.com/Publications
Python Magazine is excellent, by the way. Definitely worth the purchase price as they include a zip file with code. (Mandatory disclaimer: I have no stake in it at all. Just found it very useful, that's all).