https://github.com/antlr/antlr4formatter
Formatter for ANTLR 4 grammars
https://github.com/antlr/antlr4formatter
Last synced: over 1 year ago
JSON representation
Formatter for ANTLR 4 grammars
- Host: GitHub
- URL: https://github.com/antlr/antlr4formatter
- Owner: antlr
- License: bsd-2-clause
- Created: 2017-11-20T01:06:24.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-10-28T19:42:24.000Z (over 1 year ago)
- Last Synced: 2025-01-08T23:41:46.030Z (over 1 year ago)
- Language: ANTLR
- Size: 497 KB
- Stars: 42
- Watchers: 5
- Forks: 16
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

# Antlr4Formatter
## Building
The project uses [maven wrapper](https://github.com/takari/maven-wrapper), so it's easy to build the project without worrying about having the right Maven version installed locally.
To build `antlr4-formatter` and the standalone utility `antlr4-formatter-standalone` run:
```sh
./mvnw clean package
```
## Using the standalone formatter
To format a grammar use the script `formatFile.sh` passing the grammar file as an argument to the script. You can also use it with the Spotless plugin in [gradle](https://github.com/diffplug/spotless/tree/main/plugin-gradle#antlr4formatter) or [maven](https://github.com/diffplug/spotless/tree/main/plugin-maven#antlr4formatter).
## Maven Coordinates
```xml
com.khubla.antlr4formatter
antlr4-formatter
1.2.1
jar
```
## Contributing
Contributions are welcome. To shorten the process of reviewing the pull request be sure that the code conforms to the projects code style. Before committing fix the code format by running [spotless](https://github.com/diffplug/spotless):
```sh
./mvnw spotless:apply
```