Skip to content

Sample ANTLR 4.5 project using SBT for build

Notifications You must be signed in to change notification settings

derekpappas/antlr-test1

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ANTLR test project

Simple example project showing how to include ANTLR 4.5 into a Java application, using SBT for the build with the sbt-antlr4 plugin to automatically compile the grammar file under src/main/antlr.

This sample uses a grammar (starter/ArrayInit.g4) from the book "The Definitive ANTLR 4 Reference", the code samples used in the book are available online for free here.

Setup

# get dependencies and compile
./sbt clean update compile

# run to parse input string "{4,3,2,1,0}", should output parsed LISP-style tree
./sbt "run {4,3,2,1,0}"
# output -> (init { (value 4) , (value 3) , (value 2) , (value 1) , (value 0) })

Intellij

Configuration: alt text

Alt text

About

Sample ANTLR 4.5 project using SBT for build

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Scala 44.2%
  • Java 34.0%
  • ANTLR 21.8%