grammatica-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Grammatica-users] Questions about Parsers


From: D. R. E. Moonfire
Subject: Re: [Grammatica-users] Questions about Parsers
Date: Wed, 20 Apr 2005 08:06:50 -0500
User-agent: Debian Thunderbird 1.0.2 (X11/20050331)

Per Cederberg wrote:
Well, this is actually expected... :-) Thing is, the tokenizer is completely context-insensitive. So it generates a flow of tokens from your input chars all by itself without caring about the current production. And as the CONSTRAINT token is placed above the IDENTIFIER token in the list of
token definitions, it is chosen.

The fix here, if you really mean that a constraint can be called CONSTRAINT,
is to change the production:

bob = CONSTRAINT (IDENTIFIER | CONSTRAINT) ;

Or even nicer:

Bob = CONSTRAINT String ;

String = IDENTIFIER
       | CONSTRAINT ;

Hope this helps!

Oh, that helps, I just was hoping to avoid it. :) But, that is the nature of tokenizers, so I'm not going to complain too much. Apparently Oracle allows CONSTRAINT and DEFAULT as column names (parsing a 80k line DDL right now) along with a lot of other keywords. But, I'll just break out identifier and that should fix it. Thank you.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]