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
我想要一些简单的东西来试验/破解。我为c创建了很多解释器/编译器,我只想要一些简单的东西。一个基本的基础:D
If you don't know any (I've done my google search...), yacc/bison is the only way?
如果您不知道(我已完成谷歌搜索...),yacc / bison是唯一的方法吗?
Thx
6 个解决方案
#1
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.
TheFreeCountry中列出的这些都不可接受?它们都不是Python,但我认为从XBLite开始可能比从Yacc / Bison / PLY开始更有帮助。
Also, Vb2py might be a better starting position than PLY.
此外,Vb2py可能是比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.
但是,如果必须使用PLY路径,请将MOLE Basic语法作为起点,而不是尝试从头开始。
#2
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.
PLY是一个很棒的Python解析器创建库。它有一个简单的BASIC解释器作为其示例脚本之一。你可以从那里开始。
#3
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.
我也不知道ruby下的基本解释器,但是如果有足够的时间和兴趣,ruby很容易“支持”为你喜欢的任何语言编写解释器:Ruby中的敏捷DSL开发。我必须承认,这种方法需要一些时间投入。 :(在演示文稿的最后是一些关于DSL的进一步阅读的链接。
#4
1
You may wish to also examine the Parrot virtual machine which, according to wikipedia today, has some BASIC support.
您可能还希望检查Parrot虚拟机,根据*今天,它有一些BASIC支持。
#5
0
a miniBasic in ruby is available here. Rockit seems WAY more fun that racc.
这里有一个红宝石的miniBasic。 Rockit似乎对racc更有趣。
#6
-1
There is pybasic (python basic), rockit-minibasic (rubybasic).
有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.
为了使这些能够使用gui,那么人们必须分别使用kivy和shoes gui工具包来扩展pybasic和rockit-minibasic,并且类似于perlbasic的灵长类动物。
#1
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.
TheFreeCountry中列出的这些都不可接受?它们都不是Python,但我认为从XBLite开始可能比从Yacc / Bison / PLY开始更有帮助。
Also, Vb2py might be a better starting position than PLY.
此外,Vb2py可能是比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.
但是,如果必须使用PLY路径,请将MOLE Basic语法作为起点,而不是尝试从头开始。
#2
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.
PLY是一个很棒的Python解析器创建库。它有一个简单的BASIC解释器作为其示例脚本之一。你可以从那里开始。
#3
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.
我也不知道ruby下的基本解释器,但是如果有足够的时间和兴趣,ruby很容易“支持”为你喜欢的任何语言编写解释器:Ruby中的敏捷DSL开发。我必须承认,这种方法需要一些时间投入。 :(在演示文稿的最后是一些关于DSL的进一步阅读的链接。
#4
1
You may wish to also examine the Parrot virtual machine which, according to wikipedia today, has some BASIC support.
您可能还希望检查Parrot虚拟机,根据*今天,它有一些BASIC支持。
#5
0
a miniBasic in ruby is available here. Rockit seems WAY more fun that racc.
这里有一个红宝石的miniBasic。 Rockit似乎对racc更有趣。
#6
-1
There is pybasic (python basic), rockit-minibasic (rubybasic).
有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.
为了使这些能够使用gui,那么人们必须分别使用kivy和shoes gui工具包来扩展pybasic和rockit-minibasic,并且类似于perlbasic的灵长类动物。