This project contains a small ANTLR showcase and and a talk introducing ANTLR.
The Java 8 grammar from https://github.com/antlr/grammars-v4/blob/master/java8/Java8.g4 is used as an example.
MethodsExtrationExample
extract method names from Java sources using the listener and visitor patterns and XPathLoCCounter
ANTLR solution to the LoC Code Kata (see http://codekata.com/kata/kata13-counting-code-lines/)
ListeningCalculator
showcases the listener patternVisitingCalculator
showcases the visitor patternTreeWalkingCalculator
showcases tree walkingNumberDumper
showcases XPath on the AST
You can find the accompanying talk (German) in the talk folder.
./gradlew clean install
This project uses the Maven wrapper from https://github.com/takari/maven-wrapper. Alternatively you can use your own Maven installation.
./mvnw io.takari:maven:wrapper -Dmaven=3.5.0
./mvnw clean install
Parts of this work are based on https://github.com/nielsutrecht/antlr-pres by Niels Dommerholt and are used under the MIT license 3rdparty-licenses/MIT-LICENSE