开始使用Helvetia
我愿意开始将我的语言嵌入Helvetia,但我真的不知道从哪里开始。 几周前,我使用 Petit Parser 编写了解析部分。 我想嵌入类似于以下的代码,例如 Helvetia 页面中的 sql 示例:
main ()
{
Put(Red)
Move(North)
}
我期待一些比 Helvetia 示例更简单的指南:P
I am willing to start embedding my language into Helvetia, but i dont really know where to start.
Some weeks ago i wrote the parsing part using Petit Parser.
I would like to embed code similar to the following, like the sql example in Helvetia page:
main ()
{
Put(Red)
Move(North)
}
I look forward some guide more simple :P than the Helvetia examples
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Helvetia 发行版中包含各种示例,它们完全符合您的要求并且您可能想要研究:
Cutie-Helvetia-Automaton
使用低级 Helvetia 基础设施进行集成CUAutomatonGrammar
中定义的一种自动机语言。Cutie-LanguageBoxes-SQL
使用高级语言框基础结构将LBSqlGrammar
中定义的 SQL 嵌入到 Smalltalk 中。There are various examples included with the distribution of Helvetia that do exactly what you are asking for and that you might want to study:
Cutie-Helvetia-Automaton
uses the low-level Helvetia infrastructure to integrate an automaton language defined inCUAutomatonGrammar
.Cutie-LanguageBoxes-SQL
uses the high-level language boxes infrastructure to embed SQL defined inLBSqlGrammar
into Smalltalk.您可以查看
http://scg.unibe.ch/research/helvetia
特别是语言框 (6) 和嵌入语言而不破坏工具 (&) 上的 SCG 链接更详细地解释了如何使用 helvetia
http://www.lukas-renggli.ch/blog/phd-defend
You could look into
http://scg.unibe.ch/research/helvetia
particularly the publications in the SCG link on Language Boxes (6) and Embedding Languages without breaking tools (&) explain how to use helvetia in more detail
http://www.lukas-renggli.ch/blog/phd-defended