using regular express to analyze lisp code

Kelie kf9150 at gmail.com
Thu Oct 4 14:34:41 EDT 2007


On Oct 4, 7:28 am, Dan <thermos... at gmail.com> wrote:
> So, paren matching is a canonical context-sensitive algorithm. Now,
> many regex libraries have *some* not-purely-regular features, but I
> doubt your going to find anything to match parens in a single regex.
> If you want to go all out you can use a parser generator (for python
> parser generators, seehttp://python.fyxm.net/topics/parsing.html).
> Otherwise, you can go about it the quick-and-dirty way you describe:
> scan for matching open and close parens, and ignore things in quotes
> and comments.
>
> -Dan

Dan, thanks for suggesting parser generators.




More information about the Python-list mailing list