8000 GitHub - marccane/LANSet: ANTLR4 Toy language compiler that generates JVM Bytecode
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

marccane/LANSet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LANSet

ANTLR4 Toy language compiler that generates JVM bytecode

Building

To build you'll need JDK 8 or newer. The build process is so simple that I've decided not to use any build tools.

Compiling

To generate the parser code from the LANSet.g4 file run

./generateParser.sh

To build the compiler and generate the jar file run

./build.sh

If there are no errors you should have lans 6FDC etc.jar in the current directory.

Running the tests

./runTests.sh

Compiling a sample program

Let's create a file called example.lans and paste some example code:

programa example
    escriureln("Hello world!");
fprograma

Compile it to generate example.class

java -jar lansetc.jar example.lans

and run it!

java example

You should see the familiar string printed in your terminal.

Troubleshooting

  • Exception in thread "main" java.lang.NoClassDefFoundError: org/antlr/v4/runtime/TokenSource
    • The jar needs to have access to lib/antlr-4.9.2-complete.jar in the current folder.

About

ANTLR4 Toy language compiler that generates JVM Bytecode

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  
0