问题描述
我正在尝试构建一种用于学习目的的简单解释性语言.我已经阅读了无数关于 ANTLR 和 JavaCC 的理论和教程,但我不知道如何真正让它做一些有用的事情.
I'm trying to build a simple interpreted language for learning purposes. I've read countless theory and tutorials on ANTLR and JavaCC, but I can't figure out how to actually make it do something useful.
我最好通过将某些东西拆开再重新组装起来"来学习,那么,是否有在 ANTLR 或类似工具的帮助下实现的简单语言的工作示例?
I learn best by "taking something apart and putting it back together again", so, are there any working examples of simple languages implemented with the help of tools such as ANTLR, or similar?
类似以下的内容可能不错:
Something like the following might be nice:
x = 1
if x == 1
print "true"
推荐答案
[无耻插件] 为什么不买我的 语言实现模式 书?我有你需要的所有东西来组合一种语言,包括多个口译员等......
[shameless plug] Why not buy my Language Implementation Patterns book? I have all the pieces you need to put together a language including multiple interpreters etc...
这篇关于是否有使用 ANTLR 或类似语言实现的简单语言?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!