40 lines
1.2 KiB
Markdown
40 lines
1.2 KiB
Markdown
# Let's build a compiler !
|
|
|
|
Minimal c-like language built using java, ANTLR4, and jasmin
|
|
|
|
Summary of tools used :
|
|
|
|
- [Jasmin](http://jasmin.sourceforge.net/) : an assembler for the Java Virtual Machine.
|
|
- [ANTLR (ANother Tool for Language Recognition)](http://www.antlr.org/) is a powerful parser generator for reading, processing, executing, or translating structured text or binary files.
|
|
- [TestNG](http://testng.org/doc/index.html) a java unit-testing framework
|
|
|
|
Test cases are available [here](compiler/src/test/resources/examples)
|
|
|
|
From [this playlist](https://www.youtube.com/watch?v=2uvKTmfPNzE&list=PLOfFbVTfT2vbJ9qiw_6fWwBAmJAYV4iUm).
|
|
|
|
## [Installing third-party jars in maven](https://stackoverflow.com/a/36602256)
|
|
|
|
Define a local maven repository in folder `lib/` in pom.xml :
|
|
|
|
```xml
|
|
<repositories>
|
|
<repository>
|
|
<id>local-maven-repo</id>
|
|
<url>file:./lib</url>
|
|
</repository>
|
|
</repositories>
|
|
```
|
|
|
|
For each external jar you want to install run :
|
|
|
|
```bash
|
|
mvn deploy:deploy-file \
|
|
-DgroupId=com.example \
|
|
-DartifactId=example \
|
|
-Dversion=1.0 \
|
|
-Durl=file:./lib/ \
|
|
-DrepositoryId=local-maven-repo \
|
|
-DupdateReleaseInfo=true \
|
|
-Dfile=/path/to/file.jar
|
|
```
|