Regex: Parsing Lisp with Python
zopestoller at thomas-guettler.de
Thu Aug 8 10:22:38 EDT 2002
Yigal Duppen wrote:
>>I need to parse lisp with python. Has anyone
>>experience with this?
> Yes I do :)
> Actually, I have a program that parses Scheme, but as far as the syntax is
> concerned, that's probably OK.
> I used Plex for it -- much better than regular expressions for non-trivial
Thank you for your quick reply.
I tried it like this, but this gives me all tokens
serialized. It is hard to get the second symbol without
counting all open and close tokens. Is there a way to get
the tokens in nested lists?
((a b) c) --> [[a b] c]
I tried it like this:
if not line:
More information about the Python-list