https://github.com/atp-mipt/jsyntrax
Reimplement syntrax in Java
https://github.com/atp-mipt/jsyntrax
diagram documentation railroad railroad-diagrams
Last synced: 8 months ago
JSON representation
Reimplement syntrax in Java
- Host: GitHub
- URL: https://github.com/atp-mipt/jsyntrax
- Owner: atp-mipt
- License: mit
- Created: 2020-10-25T19:10:07.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2025-09-02T16:46:58.000Z (10 months ago)
- Last Synced: 2025-09-09T14:48:34.436Z (10 months ago)
- Topics: diagram, documentation, railroad, railroad-diagrams
- Language: Java
- Homepage: https://atp-mipt.github.io/jsyntrax/
- Size: 5.42 MB
- Stars: 34
- Watchers: 1
- Forks: 4
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

# jsyntrax
[](https://github.com/atp-mipt/jsyntrax/actions?query=workflow%3A"build")
[](https://maven-badges.herokuapp.com/maven-central/org.atp-fivt/jsyntrax)
JSyntrax is a railroad diagrams generator.
It creates a visual illustration of the grammar used for programming languages. A specification file describes the syntax as a hierarchy of basic elements.
This is processed into an image representing the same syntax with interconnected bubbles.
The specification is a set of nested Groovy function calls:
```groovy
indentstack(10,
line(opt('-'), choice('0', line('1-9', loop(None, '0-9'))),
opt('.', loop('0-9', None))),
line(opt(choice('e', 'E'), choice(None, '+', '-'), loop('0-9', None)))
)
```
This is processed by JSyntrax to generate an SVG image:

JSyntrax can render to SVG vector images or PNG bitmap images. The SVG output can have [hyperlinked text](https://atp-mipt.github.io/jsyntrax/#_hyperlinked_svg) allowing users to quickly navigate to documentation of different syntax elements.
JSyntrax is a Java reimplementation of [syntrax](https://github.com/kevinpt/syntrax/) project, originally written in Python. We use [Apache Batik](https://xmlgraphics.apache.org/batik/) for SVG rasterization.
The aim of this project is to make `syntrax` tool easy to install on any operating system. No software and libraries are required for `jsyntrax` besides Java 11.
## Requirements, download and installation
JSyntrax requires [JDK 11 or later](https://adoptopenjdk.net/releases.html).
Download the latest release from [GitHub Releases](https://github.com/atp-mipt/jsyntrax/releases) page.
Unzip the archive anywhere, `/bin` directory will contain the executable `syntrax` file.
## Documentation
The full documentation is available online at the [main JSyntrax site](https://atp-mipt.github.io/jsyntrax/).