https://github.com/alvarofpp/docker-antlr4
A docker image for ANTLR4.
https://github.com/alvarofpp/docker-antlr4
antlr4 docker docker-image
Last synced: 3 months ago
JSON representation
A docker image for ANTLR4.
- Host: GitHub
- URL: https://github.com/alvarofpp/docker-antlr4
- Owner: alvarofpp
- License: bsd-3-clause
- Created: 2021-12-11T17:37:46.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-02-06T23:00:25.000Z (over 2 years ago)
- Last Synced: 2025-08-24T01:37:30.032Z (10 months ago)
- Topics: antlr4, docker, docker-image
- Language: Makefile
- Homepage: https://hub.docker.com/r/alvarofpp/antlr4
- Size: 21.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Docker image for ANTLR4
[][docker-hub]
A docker image based in Alpine for [ANTLR4][antlr4], inspired by the [official image][antlr4-docker].
```shell
docker pull alvarofpp/antlr4
```
> If you want to start a project using ANTLR4, I recommend using the following boilerplate:
[alvarofpp/boilerplate-antlr4][boilerplate-antlr4].
## How to use
Generate files from your grammar:
```shell
docker run --rm -u $(id -u) -v $(pwd):/work alvarofpp/antlr4 antlr -Dlanguage=Java Expr.g4
```
Compile:
```shell
docker run --rm -u $(id -u) -v $(pwd):/work alvarofpp/antlr4 javac src/Expr*.java
```
View using the GUI (tested on Ubuntu 20.04.3 LTS):
```shell
docker run --rm -u $(id -u) -it \
-e DISPLAY=$(hostname -I | cut -f1 -d' '):0 \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-v $(pwd)/src:/work alvarofpp/antlr4 grun Expr prog -gui
```
[antlr4]: https://github.com/antlr/antlr4
[antlr4-docker]: https://github.com/antlr/antlr4/tree/master/docker
[boilerplate-antlr4]: https://github.com/alvarofpp/boilerplate-antlr4
[docker-hub]: https://hub.docker.com/r/alvarofpp/antlr4