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
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
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.
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.
You may wish to also examine the Parrot virtual machine which, according to wikipedia today, has some BASIC support.
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.
a miniBasic in ruby is available here. Rockit seems WAY more fun that racc.