Writing an interpreter for language similar to python!!

luvsat luv.urs at gmail.com
Wed Feb 28 12:38:01 EST 2007


Hello all,

I am new to python and working on a project that involves designing a
new language. The grammar of the language is very much inspired from
python as in is supports nearly all the statements and expressions
that are supported by python. Since my project is in initial stage, so
I think it would be appropriate if I clarify the following questions:

1. Would it make sense if I parse the whole program from scratch and
then construct the valid python strings back so that they can be
executed using ''exec'' and ''eval'' commands?
2. Recently, I came across PLY (Python-Lex-Yacc) module that can be
used to implement interpreters. It seems quite friendly to work with.
Is there any implementation of python interpreter using ply? Any such
reference would be extermely helpful for me to continue.

Any kind of suggestions/ comments would be highly appreciated.

Thanks,
Luvish Satija




More information about the Python-list mailing list