package
0.0.0-20241125012152-0eb8d61e1382
Repository: https://github.com/khulnasoft/go-parser.git
Documentation: pkg.go.dev
# README
The plsql-parser is a parser for Snowflake. It is based on the ANTLR4 and use the grammar from antlr4-grammars-plsql.
Build
Before build, you need to install the ANTLR4.
requirements:
- https://github.com/antlr/antlr4/blob/master/doc/getting-started.md
- https://github.com/antlr/antlr4/blob/master/doc/go-target.md
./build.sh
Update grammar
Manually change the grammar file in this project
- run
./build.sh
to generate the parser code.
From antlr4-grammars-plsql
- Clone the
SnowflakeLexer.g4
andSnowflakeParser.g4
grammar files from https://github.com/antlr/grammars-v4/tree/master/sql/snowflake. - run
./build.sh
to generate the parser code.
Test the parser
Run TestSnowflakeSQLParser
in tests.go
to test the parser.
go test -v
References
- ANTLR4 Getting Started https://github.com/antlr/antlr4/blob/master/doc/getting-started.md
- ANTLR4 Go Garget https://github.com/antlr/antlr4/blob/master/doc/go-target.md