sq/grammar/generate.sh
Neil O'Toole 62f067f633
Chore/upgrade to antlr 4.12.0 (#149)
* Antlr update

* README update

* parser: regenerated with antlr 4.12.0
2023-03-15 20:53:40 -06:00

15 lines
396 B
Bash
Executable File

#!/bin/sh
set -e
dest_dir="../libsq/ast/internal/slq"
mkdir -p $dest_dir
echo "Generating SLQ parser code from grammar..."
alias antlr4='java -Xmx500M -cp "./antlr-4.12.0-complete.jar:$CLASSPATH" org.antlr.v4.Tool'
antlr4 -Dlanguage=Go -listener -visitor -o $dest_dir -package slq SLQ.g4
echo "Verifying that generated files can build..."
go build -v $dest_dir
echo "Generated files are OK."