https://github.com/luisfelipepoma/dot_translate
Basic translation app for DOT language.
https://github.com/luisfelipepoma/dot_translate
antlr4 compiler cpp dotlang graph
Last synced: 23 days ago
JSON representation
Basic translation app for DOT language.
- Host: GitHub
- URL: https://github.com/luisfelipepoma/dot_translate
- Owner: LuisFelipePoma
- License: mit
- Created: 2023-10-01T19:11:17.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-01T19:28:55.000Z (over 1 year ago)
- Last Synced: 2025-02-11T14:46:23.852Z (3 months ago)
- Topics: antlr4, compiler, cpp, dotlang, graph
- Language: Java
- Homepage:
- Size: 6.84 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DOT Language to Adjacency List
---
## How to use
### Install Java- Install via CLI
1. [ArchLinux](https://www.tecmint.com/install-java-on-arch-linux/)
* Now we are going to install the latest version of JRE
```bash
sudo pacman -S jre-openjdk
```* Now we are going to install the latest version of JDK
```bash
sudo pacman -S jdk-openjdk
```
2. Others
```bash
sudo apt install openjdk-XX-jdk
sudo apt install openjdk-XX-jre
```
>Install the latest available version for your distro### Install Antlr
1. Installation
* Create a virtual enviroment
```bash
python -m venv /path/to/new/virtual/environment
```
* Install Antlr using the file `requirements.txt`
```bash
pip install -r requirements.txt
```
* Verify installation
```bash
antlr
```
### Usage
* Create the script `setup.sh`.```sh
#!/usr/bin/shsetup(){
local venvpath="$HOME/path/to/env"source "${venvpath}/bin/activate"
export CLASSPATH=.:~/.m2/repository/org/antlr/antlr4/4.13.1/antlr4-4.13.1-complete.jar:$CLASSPATH
alias grun='java org.antlr.v4.gui.TestRig'
}setup
```
* Execute the script
```bash
source setup.sh
```* Now we compile boths files.
```bash
~ antlr4 -no-listener -visitor DotExpr.g4
```* With `javac` we compile the java codes generated.
```bash
javac *.java
```* If we want to see the gui, run Antlr with `grun`
```bash
grun DotExpr graph -gui
```