从 ANTLR 生成 EBNF [英] Generate EBNF from ANTLR

查看:32
本文介绍了从 ANTLR 生成 EBNF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道从 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆