bld extension for generating ANTLR4 grammars https://github.com/ethauvin/bld-antlr4.git
Find a file
2023-04-04 09:21:48 -04:00
.github/workflows GitHub setup 2023-04-04 09:21:48 -04:00
.idea Updated to RIFE2 1.5.16 2023-04-03 22:57:33 -04:00
.vscode Updated to RIFE2 1.5.16 2023-04-03 22:57:33 -04:00
lib/bld Updated to RIFE2 1.5.16 2023-04-03 22:57:33 -04:00
src GitHub setup 2023-04-04 09:21:48 -04:00
.gitignore Initial commit 2023-04-01 01:07:12 -04:00
bld Initial commit 2023-04-01 01:07:12 -04:00
bld.bat Initial commit 2023-04-01 01:07:12 -04:00
LICENSE Initial commit 2023-04-01 01:03:21 -04:00
README.md GitHub setup 2023-04-04 09:21:48 -04:00

Bld extension to generate ANTLR4 parsers

License Java Release GitHub CI

An extension for generating Java sources from ANTLR4 parsers.

private final Antlr4Operation antlr4Operation_ = new Antlr4Operation();
@BuildCommand
public void generateGrammar()
throws Exception {
    antlr4Operation_.executeOnce(o -> o
        .sourceDirectories(List.of(new File(srcMainDirectory(), "antlr")))
        .outputDirectory(new File(buildDirectory(), "generated"))
        .visitor()
        .longMessages());
}

// compileOperation_ is part of the main project
public void compile()
throws Exception {
    generateGrammar();
    compileOperation_.executeOnce(o -> o
        .fromProject(this)
        .mainSourceDirectories(List.of(antlr4Operation_.outputDirectory())));
}