simplified Python parsing question
Steven D'Aprano
steve+comp.lang.python at pearwood.info
Sun Jul 29 23:33:32 EDT 2012
On Sun, 29 Jul 2012 19:21:49 -0400, Eric S. Johansson wrote:
> When you are sitting on or in a name, you look to the left or look to
> the right what would you see that would tell you that you have gone past
> the end of that name. For example
Have you read the docs? It gives full details of the Python syntax.
http://docs.python.org/reference/index.html
For example:
http://docs.python.org/reference/simple_stmts.html#assignment-statements
See also:
http://docs.python.org/library/language.html
http://effbot.org/zone/simple-top-down-parsing.htm
http://nedbatchelder.com/text/python-parsers.html
Here's a Python parser using the pyparsing library. It's a bit old
(written for Python 2.4) but it shouldn't be hard to update it to new
syntax:
http://pyparsing.wikispaces.com/file/view/pythonGrammarParser.py
--
Steven
More information about the Python-list
mailing list