mirror of
https://github.com/ethauvin/bld-antlr4.git
synced 2025-04-25 00:37:12 -07:00
Updated readme
This commit is contained in:
parent
84c4cb976f
commit
a0b1c17de5
1 changed files with 9 additions and 2 deletions
11
README.md
11
README.md
|
@ -16,20 +16,27 @@ sources into the main source directories.
|
|||
|
||||
```java
|
||||
private final Antlr4Operation antlr4Operation_ = new Antlr4Operation();
|
||||
@BuildCommand
|
||||
|
||||
@BuildCommand(summary = "Generates the grammar Java sources")
|
||||
public void generateGrammar()
|
||||
throws Exception {
|
||||
antlr4Operation_.executeOnce(o -> o
|
||||
.sourceDirectories(List.of(new File(srcMainDirectory(), "antlr")))
|
||||
.outputDirectory(new File(buildDirectory(), "generated"))
|
||||
// these options are specific to ANTLR4, please refer to the extension
|
||||
// documentation to learn more about these and other option
|
||||
.visitor()
|
||||
.longMessages());
|
||||
}
|
||||
|
||||
// compileOperation_ is part of the main project
|
||||
@BuildCommand
|
||||
public void compile()
|
||||
throws Exception {
|
||||
// always generate the latest grammar before compiling the sources
|
||||
generateGrammar();
|
||||
|
||||
// compileOperation_ is part of the main project, include the generated
|
||||
// grammar with the main sources
|
||||
compileOperation_.executeOnce(o -> o
|
||||
.fromProject(this)
|
||||
.mainSourceDirectories(List.of(antlr4Operation_.outputDirectory())));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue