This project has moved and is read-only. For the latest updates, please go here.

Tsql escaping in typename

Dec 3, 2015 at 8: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

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