views:

511

answers:

6

I want something simple in order to experiment/hack. I've created a lot interpreters/compilers for c and I just want something simple. A basic BASIC :D

If you don't know any (I've done my google search...), yacc/bison is the only way?

Thx

+1  A: 

None of these listed in TheFreeCountery are acceptable? None of them are in Python, but I should think that starting from XBLite might be more helpful than starting from Yacc/Bison/PLY.

Also, Vb2py might be a better starting position than PLY.

But, if you must go the PLY route, consider the MOLE Basic grammar as a starting point, rather than trying to roll your own from scratch.

S.Lott
+1  A: 

I also don't know a basic interpreter under ruby, but given enough time and interest ruby easily "supports" writing an interpreter for any language you like: Agile DSL Development in Ruby . I must admit that this approach comes with some investment of time. :( At the end of the presentation are some links to further readings regarding DSLs.

amaruk
+1  A: 

You may wish to also examine the Parrot virtual machine which, according to wikipedia today, has some BASIC support.

Aaron
+2  A: 

PLY is a great parser-creation library for Python. It has a simple BASIC interpreter as one of its example scripts. You could start there.

Eli Bendersky
A: 

a miniBasic in ruby is available here. Rockit seems WAY more fun that racc.

Jon Romero
A: 

I have a qBasic program running on DOS

Would like to run it in Python+html environment using an interpreter.

Anyone available to handle the job?