Last active
June 21, 2022 13:34
-
-
Save mattak/ef029fac196a53d833074cca153927ca to your computer and use it in GitHub Desktop.
Simple script for using antlr4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -eu | |
VERSION="4.10.1" | |
JAR_DIR="/tmp/antlr4" | |
if [ ! -d "$JAR_DIR" ]; then | |
mkdir -p "$JAR_DIR" | |
fi | |
JAR_FILE="${JAR_DIR}/antlr-${VERSION}-complete.jar" | |
if [ ! -f "$JAR_FILE" ]; then | |
curl -L "https://www.antlr.org/download/antlr-${VERSION}-complete.jar" -o "${JAR_FILE}" | |
fi | |
CLASSPATH=".:${JAR_FILE}" | |
java -Xmx500M -cp "${JAR_FILE}:$CLASSPATH" org.antlr.v4.Tool $@ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -eu | |
VERSION="4.10.1" | |
JAR_DIR="/tmp/antlr4" | |
if [ ! -d "$JAR_DIR" ]; then | |
mkdir -p "$JAR_DIR" | |
fi | |
JAR_FILE="${JAR_DIR}/antlr-${VERSION}-complete.jar" | |
if [ ! -f "$JAR_FILE" ]; then | |
curl -L "https://www.antlr.org/download/antlr-${VERSION}-complete.jar" -o "${JAR_FILE}" | |
fi | |
CLASSPATH=".:${JAR_FILE}" | |
javac -cp "$CLASSPATH" $@ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -eux | |
VERSION="4.10.1" | |
JAR_DIR="/tmp/antlr4" | |
if [ ! -d "$JAR_DIR" ]; then | |
mkdir -p "$JAR_DIR" | |
fi | |
JAR_FILE="${JAR_DIR}/antlr-${VERSION}-complete.jar" | |
if [ ! -f "$JAR_FILE" ]; then | |
curl -L "https://www.antlr.org/download/antlr-${VERSION}-complete.jar" -o "${JAR_FILE}" | |
fi | |
CLASSPATH=".:${JAR_FILE}" | |
java -Xmx500M -cp "$CLASSPATH" org.antlr.v4.gui.TestRig $@ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Download g4 files
compile
download test file
show tree cui
show graph gui