Forum Discussion
OleksiiKovalov
May 31, 2021Copper Contributor
Looking for Microsoft.SqlServer.TransactSql.ScriptDom grammar
Hi! I'm looking for any info/contact for antlr grammar used by Microsoft.SqlServer.TransactSql.ScriptDom assembly Looks like https://github.com/microsoft/ doesn't contains any useful info
olafhelper
Bronze Contributor
ANTLR = ANother Tool for Language Recognition? Don't understand that.
ScriptDom is a "simple" parser for Transact-SQL, with the MS SQL Server specific SQL dialect.
No need to "recognite" anything, it's for T-SQL.
OleksiiKovalov
May 31, 2021Copper Contributor
yes, ANother Tool for Language Recognition
Scriptdom is built using ANTLR (version/implementation is unknown to me) grammar.
And generated parser is very fast.
Now I'm working on a set of similar SQL parsers and I have some performance problems.
Some of the issues I've resolved by simplification, removing ambiguities, and extra LA in grammar/parser, but my implementation of SQL grammar still way too slow as compared to ScriptDOM parser.
I'm sure that I missed some simple, but important things when developing SQL grammar. I think it would be very useful to take a look/receive a consultation from developers of original ScriptDOM grammar.
Scriptdom is built using ANTLR (version/implementation is unknown to me) grammar.
And generated parser is very fast.
Now I'm working on a set of similar SQL parsers and I have some performance problems.
Some of the issues I've resolved by simplification, removing ambiguities, and extra LA in grammar/parser, but my implementation of SQL grammar still way too slow as compared to ScriptDOM parser.
I'm sure that I missed some simple, but important things when developing SQL grammar. I think it would be very useful to take a look/receive a consultation from developers of original ScriptDOM grammar.
- olafhelperJun 01, 2021Bronze Contributor
Now I'm working on a set of similar SQL parsers
Why re-inventing the wheel, use the existing MS SqlScriptDom.
- OleksiiKovalovJun 01, 2021Copper Contributor
Now I'm working on pl/sql and pl/pgsql grammars, with MySQL in future plans.
For t-sql related tasks i'm using ScriptDOM, of course