Generate EBNF from ANTLR

早过忘川 提交于 2019-12-12 08:11:08

问题


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).

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

but it would like to have a bare textual description, preferable text, tex, html, xml, or similar.


回答1:


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.



来源:https://stackoverflow.com/questions/9921850/generate-ebnf-from-antlr

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!