![RR](rr.svg)
# RR - Railroad Diagram Generator
RR is a generator of syntax diagrams, also known as railroad diagrams. It is
a self-contained tool with both a browser-based GUI and a batch mode.
Besides generating diagrams from EBNF rules, RR also can perform some grammar transformation, e.g. factorization
and elimination of direct recursion. To some extent this transforms BNF to EBNF, yielding more compact diagrams.
# Examples
Here are two examples of generated diagrams (taken from the [Python grammar][PYTHON]):
**if_stmt:**
![if_stmt](if_stmt.svg)
**try_stmt:**
![try_stmt](try_stmt.svg)
# Grammar syntax
RR accepts grammars in [W3C-style EBNF][W3C-EBNF]. Some other representations, including
some parser generator input notations, can be converted to W3C-style using
[Grammar Conversion][CONVERT].
# Distribution
RR comes as a .zip, containing a .war file. The .war file can be deployed
in servlet containers like Tomcat or Jetty for serving the GUI. This makes up the webapp
that is running on the original website, <https://bottlecaps.de/rr/ui>.
The .war file is a Java "executable war", i.e. it can also be started
standalone from command line. Two different tasks can be performed in standalone mode:
- serving the GUI, e.g.
```bash
java -jar rr.war -gui
```
- batch diagram generation, e.g.
```bash
java -jar rr.war grammar.ebnf
```
For listing the full set of available options, run
```bash
java -jar rr.war
```
without further command line arguments.
## Building RR
For building RR, JDK 8 (or higher) must be available. In the
project folder, run this command to build the distribution .zip file:
```bash
gradlew
```
## Thanks
This project makes use of
* [Saxon-HE][SAXON],
* [TagSoup][TAGSOUP],
* [Apache Batik][BATIK],
* [Gradle][GRADLE], and
* [Gradle-License-Report][GRADLE-LICENSE-REPORT].
## License
RR is released under the [Apache 2 License][ASL].
## Links
The official website for RR is <https://bottlecaps.de/rr/ui>.
[ASL]: http://www.apache.org/licenses/LICENSE-2.0
[PYTHON]: https://docs.python.org/3/reference/grammar.html
[W3C-EBNF]: http://www.w3.org/TR/2010/REC-xquery-20101214/#EBNFNotation
[CONVERT]: http://bottlecaps.de/convert/
[SAXON]: http://www.saxonica.com/products/products.xml
[TAGSOUP]: http://vrici.lojban.org/~cowan/XML/tagsoup/
[BATIK]: https://xmlgraphics.apache.org/batik/
[GRADLE]: https://gradle.org/
[GRADLE-LICENSE-REPORT]: https://github.com/jk1/Gradle-License-Report
没有合适的资源?快使用搜索试试~ 我知道了~
rr:RR-铁路图生成器
共59个文件
java:29个
xq:13个
svg:3个
5星 · 超过95%的资源 需积分: 44 5 下载量 183 浏览量
2021-05-05
22:38:55
上传
评论
收藏 226KB ZIP 举报
温馨提示
RR-铁路图生成器 RR是语法图(也称为铁路图)的生成器。 它是一个自包含的工具,具有基于浏览器的GUI和批处理模式。 除了从EBNF规则生成图表外,RR还可以执行一些语法转换,例如分解和消除直接递归。 在某种程度上,这会将BNF转换为EBNF,从而产生更紧凑的图表。 例子 这是生成的图的两个示例(取自): if_stmt: try_stmt: 语法语法 RR接受语法。 可以使用将某些其他表示形式(包括一些解析器生成器输入符号)转换为W3C样式。 分配 RR是.zip格式,其中包含.war文件。 可以将.war文件部署在Tomcat或Jetty之类的servlet容器中,以为GUI提供服务。 这构成了在原始网站上运行的webapp。 .war文件是Java的“可执行战争”,即也可以从命令行独立启动。 在独立模式下可以执行两个不同的任务: 服务GUI,例如 java -jar
资源详情
资源评论
资源推荐
收起资源包目录
rr-master.zip (59个子文件)
rr-master
.gitignore 48B
rr.svg 948B
gradle
wrapper
gradle-wrapper.jar 57KB
gradle-wrapper.properties 202B
README.md 2KB
build.gradle 4KB
.github
workflows
gradle.yml 609B
gradlew.bat 3KB
gradlew 6KB
LICENSE 11KB
src
main
resources
htdocs
favicon.ico 1KB
de
bottlecaps
railroad
xq
xhtml-to-md.xq 3KB
normalize-ast.xq 22KB
basic-interface.xq 3KB
eliminate-recursion.xq 9KB
disassemble.xq 6KB
color.xq 16KB
html-to-ebnf.xq 15KB
ast-to-ebnf.xq 21KB
ast-to-svg.xq 52KB
user-interface.xq 76KB
cst-to-ast.xq 9KB
style.xq 7KB
transform-ast.xq 14KB
java
de
bottlecaps
webapp
Request.java 575B
server
HttpMultiPart.java 2KB
HttpResponse.java 2KB
HttpRequest.java 8KB
HttpCookie.java 400B
servlet
ServletRequest.java 3KB
ServletResponse.java 1KB
ServletMultiPart.java 593B
ServletCookie.java 415B
MultiPart.java 229B
Response.java 334B
Cookie.java 101B
fatjar
Loader.java 3KB
railroad
Railroad.java 15KB
webapp
RailroadWebApp.java 8KB
RailroadServer.java 2KB
RailroadServlet.java 998B
core
BatikPngTranscoder.java 945B
XhtmlToZip.java 5KB
TextWidth.java 3KB
Bold.java 80KB
Normal.java 70KB
FontWidth.html 8KB
ResourceModuleUriResolver.java 732B
ExtensionFunctions.java 27KB
Download.java 3KB
PngTranscoder.java 207B
Parser.java 74KB
RsvgPngTranscoder.java 4KB
CrLfNormalizer.java 788B
Parser.ebnf 9KB
webapp
WEB-INF
web.xml 717B
try_stmt.svg 6KB
if_stmt.svg 4KB
settings.gradle 24B
共 59 条
- 1
马未都
- 粉丝: 21
- 资源: 4687
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论1