h3n4l / snowsql-parser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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:

./build.sh

Update grammar

Manually change the grammar file in this project

  1. run ./build.sh to generate the parser code.

From antlr4-grammars-plsql

  1. Clone the SnowflakeLexer.g4 and SnowflakeParser.g4 grammar files from https://github.com/antlr/grammars-v4/tree/master/sql/snowflake.
  2. run ./build.sh to generate the parser code.

Test the parser

Run TestSnowflakeSQLParser in parser_test.go to test the parser.

go test -v

References

About

License:Apache License 2.0


Languages

Language:ANTLR 95.9%Language:Python 2.9%Language:Go 1.1%Language:Shell 0.1%