Hello groovers !
My winding path has led me to a place where I want to tokenize a SQL declare statement. I've just stumbled on the notion of recursive descent parsers. Am I in the right place?
my string can have n DECLARE statements, starting with DECLARE, ending with a semi-colon
a DECLARE statement can have n declarations, separated by commas
a declaration contains a name, a datatype, that might itself have commas inside brackets (this is where my regex imagination runs out)
a declaration might be of type TABLE, in which case it will contain a comma separated list of names and datatypes (which might contain brackets and commas)
For example...
declare @id int;
declare @name string, @telephone string, @salary decimal(4,4);
declare @children table(id int identity(1,1), name string, salary decimal(4,4));
I need to do all this in a C# application. Is Eto the tool for the job? Do I write my own grammar? What are the key notions to get started?
Thanks
Simon Boddy