I agree with you guys and would prefer a rule based solution. I am not sure what would be the differences among the various ideas that have been explored here, but obviously (in layman terminology) the preferred solution would be to have the Microsoft (SQL Server), Oracle, MySQL and all other vendors' extensions present, preferably in their own subsections (I assume that this is what you guys mean by sub-grammars).
As I've stated in this and past conversations, there are two obstacles:
1. Such grammars are not readily published/available (and perhaps are even kept quasi-secret or intentionally obfuscated), so they should either be developed or somehow extracted from obfuscated documents. And this bring me to my second, clearly stated, disadvantage, namely
2. I do not, even if I managed to extract such grammars, posses the knowledge of how to put them in correct BNF format and how to add them, sub-grammars or otherwise to the existing ones.
Again, I added it to my list to study that stuff, but the learning curve would be pretty stiff. Also, I did not yet have managed to find any place where Microsoft clearly publishes their extensions. Preliminary evaluation of Oracle publications showed me that extracting their rules and discern their extensions would be a project unto itself. And I did not even try to look at MySQL and others.
For the current project in its current state, I will certainly look at Jeffrey's code and see how to adapt it
Thank you and have a Happy New Year
ZA