The tsql-parser is a parser for T-SQL. It is based on the ANTLR4 and use the grammar from antlr4-grammars-plsql.
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
- run
./build.sh
to generate the parser code.
- Clone the
TSqlLexer.g4
andTSqlParser.g4
grammar files from https://github.com/antlr/grammars-v4/tree/master/sql/snowflake. - Clone the examples[https://github.com/antlr/grammars-v4/tree/master/sql/tsql/examples], and use it for test.
- run
./build.sh
to generate the parser code.
Run TestTSQLParser
in parser_test.go
to test the parser.
go test -v
- 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
Port folder contains the ported code in another language.