Is it possible to create a LL(1) table-driven (non-recursive) compiler with ANTLR or ANTLR3 ?

有帮助吗?

解决方案

No.

However since ANTLR is open source you could modify a fork of ANTLR to do it.

ANTLR builds lexers and parsers as recursive descent source code. This is why ANTLR is easy to use and popular because people can look at the source code and understand how the lexer and parser work versus looking at table entries. Because it is source code, one can also use tools to debug the source code. If ANTLR used tables instead of source code output it would lose its ease of understanding and usefulness for those learning lexing and parsing on their own.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top