Skip to content
Snippets Groups Projects
Commit 0caa38cb authored by René Schöne's avatar René Schöne
Browse files

Updated README.

parent 2d2f7761
No related branches found
No related tags found
No related merge requests found
# RelAST Preprocessor # RelAST Preprocessor
Run preprocessor on train benchmark (output written to standard output): ![RelAST process](relast-process.png)
$ ./gradlew jar The RelAST preprocessor takes a `.relast` file as input comprising AST rules and relations. It produces files that afterwards are processed by JastAdd to generated Java code.
$ cat examples/TrainBenchmark.relast To use it in your project, build the JAR file running
$ java -jar relast-compiler.jar examples/TrainBenchmark.relast
$ java -jar build/libs/relast.jar examples/TrainBenchmark.relast
Run preprocessor and write output to files: ```
$ java -jar build/libs/relast.jar examples/TrainBenchmark.relast --file ./gradlew jar
$ cat examples/TrainBenchmarkGen.ast ```
$ cat examples/TrainBenchmarkGen.jadd
Run test cases: This will produce `build/libs/relast.jar`. Copy it to your project and extend your build config (preferably Gradle) with the following:
$ cd test ```
$ make task preprocess(type: JavaExec) {
group = 'Build'
main = "-jar"
args = [
"libs/relast.jar",
"./src/main/jastadd/main.relast",
"--listClass=RefList",
"--jastAddList=JastAddList",
"--file"
]
Supported relations: inputs.files file("./src/main/jastadd/main.relast")
outputs.files file("./src/main/jastadd/mainGen.ast"), file("./src/main/jastadd/mainGen.jadd")
}
```
Note that you may have to change
- the directory of `relast.jar`
- the `.relast` file(s) both as argument(s) and input file(s)
- the output files
- parameters of RelAST (in this case, the list classes were renamed)
## Supported relations
// Directed relations // Directed relations
A.b -> B; A.b -> B;
......
relast-process.png

15.5 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment