问题描述
有人知道可以从ANTLR生成EBNF的工具吗?ANTLR已经接近EBNF,但是出于文档目的,我想要一个简洁的EBNF描述(在两者之间没有代码).
Anybody know of a tool, that generates EBNF from ANTLR?ANTLR is already close to EBNF, but for documentation purpose I would like to have a clean EBNF description (without the Code in between).
使用antlrworks并获得语法图已经很不错了:
With antlrworks and this its already nice to get the syntax diagrams:
java -cp antlrworks-1.1.4.jar org.antlr.works.Console -f yql.g -o output/ -sd eps
,但它希望有一个简短的文字描述,更可取的文字,tex,html,xml或类似文字.
but it would like to have a bare textual description, preferable text, tex, html, xml, or similar.
推荐答案
我有一个在线工具可以进行转换外部语法转换为W3C语法符号.它具有ANTLR3语法解析器,因此也许它接近您想要的内容. W3C表示法对于生成语法图也很有用.
I have an online tool that converts foreign grammars to W3C grammar notation. It has an ANTLR3 grammar parser, so maybe this gets close to what you were looking for. W3C notation is also useful for generating syntax diagrams.
这篇关于从ANTLR生成EBNF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!