Tsql escaping in typename

Dec 3, 2015 at 7:48 PM
I need simple t-sql parser and I started with demo SqlGrammar. t-sql escaping ([, ]) works fine with identifiers (it looks that there is some "magic" inside call

var Id_simple = TerminalFactory.CreateSqlExtIdentifier(this, "id_simple");

but I need this also for typenames so for example
create table abc ([a] [int])
could work (now it's problem with [int] which is not recognised)

How should I change rule
typeName.Rule = ToTerm("BIT") | "DATE" | "TIME" | "TIMESTAMP" | "DECIMAL" | "REAL" | "FLOAT" | "SMALLINT" | "INTEGER"

that it will also support sql quotes [, ]?

Thanks for help

Matej
Coordinator
Dec 5, 2015 at 5:36 PM
Just add
... | id_simple;
to typeName rule
Dec 7, 2015 at 12:25 PM
thanks. it works.