sq/grammar/generate.sh
Neil O'Toole f07edef14d
Add flag --src.schema (#326)
* Support for --src.schema in commands "slq", "sql", and "inspect"
2023-11-18 17:05:48 -07:00

15 lines
403 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 "../tools/antlr-4.13.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."