Simplified use of the demo project.

- The needed ANTLR jar is provided now, so it's not needed to build it yourself.
- The generate.sh script has been updated to use the new jar.
- Small update of the readme too.
This commit is contained in:
Mike Lischke 2016-04-21 17:57:33 +02:00
parent e8325623d9
commit e85385785e
3 changed files with 9 additions and 11 deletions

View File

@ -26,6 +26,7 @@ Project Status
* Library linking
* Simple running (e.g. heap objects initialize properly)
* Simple testing (creating significiant objects)
* All memory allocations checked
* Simple demo application on OS X, Windows and Linux

Binary file not shown.

View File

@ -6,18 +6,15 @@ set -o errexit
# This script is used to generate source files from the test grammars in the same folder. The generated files are placed
# into a subfolder "generated" which the demo project uses to compile a demo binary.
# There are 3 ways of running the ANTLR generator here.
# There are 2 ways of running the ANTLR generator here.
# 1) Download the pre-built antlr jar, put in a folder of your choice and run the generation using the command in 2) but
# with a LOCATION set to your downloaded jar.
# 2) Run "mvn -DskipTests install" in the root of the antlr4 repo to compile a fresh (snapshot) jar (requires Maven to be installed).
# There are 2 variants to run the generation here, one with and the other w/o template debugger option.
#LOCATION=../../../tool/target/antlr4-4.5.3-SNAPSHOT.jar
#java -jar $LOCATION -Dlanguage=Cpp -listener -visitor -o generated/ -package antlrcpptest TLexer.g4 TParser.g4
# 1) Running from jar. Use the given jar (or replace it by another one you built or downloaded) for generation.
LOCATION=antlr-4.1.1-dev-complete.jar
java -jar $LOCATION -Dlanguage=Cpp -listener -visitor -o generated/ -package antlrcpptest TLexer.g4 TParser.g4
#java -jar $LOCATION -Dlanguage=Cpp -listener -visitor -o generated/ -package antlrcpptest -XdbgST TLexer.g4 TParser.g4
#java -jar $LOCATION -Dlanguage=Java -listener -visitor -o generated/ -package antlrcpptest TLexer.g4 TParser.g4
# 3) Running from class path. This requires that you have both antlr3 and antlr4 compiled. In this scenario no installation
# 2) Running from class path. This requires that you have both antlr3 and antlr4 compiled. In this scenario no installation
# is needed. You just compile the java class files (using "mvn compile" in both the antlr4 and the antlr3 root folders).
# The script then runs the generation using these class files, by specifying them on the classpath.
# Also the string template jar is needed. Adjust CLASSPATH if you have stored the jar in a different folder as this script assumes.
@ -26,7 +23,7 @@ set -o errexit
# antlr jar over and over again.
CLASSPATH=../../../tool/resources/:ST-4.0.8.jar:../../../tool/target/classes:../../../runtime/Java/target/classes:../../../../antlr3/runtime/Java/target/classes
java -cp $CLASSPATH org.antlr.v4.Tool -Dlanguage=Cpp -listener -visitor -o generated/ -package antlrcpptest TLexer.g4 TParser.g4
#java -cp $CLASSPATH org.antlr.v4.Tool -Dlanguage=Cpp -listener -visitor -o generated/ -package antlrcpptest TLexer.g4 TParser.g4
#java -cp $CLASSPATH org.antlr.v4.Tool -Dlanguage=Cpp -listener -visitor -o generated/ -package antlrcpptest -XdbgST TLexer.g4 TParser.g4
#java -cp $CLASSPATH org.antlr.v4.Tool -Dlanguage=Java -listener -visitor -o generated/ TLexer.g4 TParser.g4