2

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

6 Answers 6

4

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.

3

None of these listed in TheFreeCountry 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.

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

1

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.

1

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

0

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

-1

There is pybasic (python basic), rockit-minibasic (rubybasic).

To make these able to use the gui, then one has to develop extensions with kivy and shoes gui toolkits for pybasic and rockit-minibasic respectively and similarly prima gui for perlbasic if ever exists.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.