Related articles |
---|
[6 earlier articles] |
Re: Oracle grammar ambiguities and conflicts drikosv@otenet.gr (Evangelos Drikos) (2006-01-12) |
Oracle grammar ambiguities and conflicts mark.thiehatten@bibit.com (Mark Thiehatten) (2006-01-12) |
Re: Oracle grammar ambiguities and conflicts cfc@shell01.TheWorld.com (Chris F Clark) (2006-01-17) |
Re: Oracle grammar ambiguities and conflicts mattblackmon@hotmail.com (Matt Blackmon) (2006-01-17) |
Re: Oracle grammar ambiguities and conflicts david@tribble.com (David R Tribble) (2006-01-17) |
Re: Oracle grammar ambiguities and conflicts parsersinc@earthlink.net (SLK Parsers) (2006-01-19) |
Re: Oracle grammar ambiguities and conflicts parsersinc@earthlink.net (SLK Parsers) (2006-01-19) |
Re: Oracle grammar ambiguities and conflicts parsersinc@earthlink.net (SLK Parsers) (2006-01-20) |
From: | "SLK Parsers" <parsersinc@earthlink.net> |
Newsgroups: | comp.compilers |
Date: | 19 Jan 2006 23:16:25 -0500 |
Organization: | Parsers Inc. |
References: | 01-07-118 06-01-029 06-01-032 |
Keywords: | parse, SQL |
Posted-Date: | 19 Jan 2006 23:16:25 EST |
>At a syntax error we check whether the current token is a keyword.
>If an identifier token would be acceptable at this location then
>we convert the keyword token into an identifier token and continue parsing.
I also use this technique to handle typedef in C. SLK facilitates this with
the following retry rules on return from the user error routine:
If the same token is returned, the algorithm proceeds as if nothing
happened. The parse stack is popped. For mismatch(), this is one way to
insert a missing token.
If a different token is returned, the algorithm does a retry using the new
token and the same nonterminal.
If zero is returned, the algorithm retries using the old token/nonterminal
pair. This is useful when the action required is to change the symbol table
information.
The SLK parser generator: http://home.earthlink.net/~slkpg/
Return to the
comp.compilers page.
Search the
comp.compilers archives again.