Skip to content

LuisFelipePoma/DOT_Translate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DOT Language to Adjacency List


How to use

Install Java

  • Install via CLI

    1. ArchLinux
    • Now we are going to install the latest version of JRE

       sudo pacman -S jre-openjdk
    • Now we are going to install the latest version of JDK

       sudo pacman -S jdk-openjdk
    1. Others
       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

        python -m venv /path/to/new/virtual/environment
    • Install Antlr using the file requirements.txt

        pip install -r requirements.txt
    • Verify installation

        antlr

Usage

  • Create the script setup.sh.

      #!/usr/bin/sh
    
      setup(){
      	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

      source setup.sh
  • Now we compile boths files.

      ~ antlr4 -no-listener -visitor DotExpr.g4 
  • With javac we compile the java codes generated.

      javac *.java
  • If we want to see the gui, run Antlr with grun

      grun DotExpr graph -gui