Skip to content

alejandrolozanoz/Low-Lang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Low-Compiler (by Alejandro Lozano)

Requirements

  • Python 3.7
  • ANTLR 4.8

Installation

To install ANTLR4 use the following command:

$ cd /usr/local/lib
$ sudo curl -O https://www.antlr.org/download/antlr-4.8-complete.jar
$ export CLASSPATH=".:/usr/local/lib/antlr-4.8-complete.jar:$CLASSPATH"
$ alias antlr4='java -jar /usr/local/lib/antlr-4.8-complete.jar'
$ alias grun='java org.antlr.v4.gui.TestRig'

You should also install ANTLR4 python runtime in PIP:

$ pip install antlr4-python3-runtime

Development

After installing ANTLR you can recompile the grammar by running:

$ antlr4 -Dlanguage=Python3 grammar/low.g4

To test a program's grammar run:

$ python3 main.py test1.txt

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published