Related articles |
---|
with or without keywords gergoe@math.bme.hu (Buday Gergely) (1998-03-12) |
Re: with or without keywords vladimir@cs.ualberta.ca (Vladimir Alexiev) (1998-03-15) |
Re: with or without keywords scott@basis.com (1998-03-18) |
Re: with or without keywords Nick.Roberts@dial.pipex.com (Nick Roberts) (1998-03-18) |
Re: with or without keywords os@cs.tu-berlin.de (Olaf Stoyke) (1998-03-18) |
From: | Buday Gergely <gergoe@math.bme.hu> |
Newsgroups: | comp.compilers |
Date: | 12 Mar 1998 23:22:02 -0500 |
Organization: | Compilers Central |
Keywords: | parse, question |
I'd like to parse a language that allows embedded sql querys. The
problem is that tokens that are keywords in an sql statement are
allowed as an identifier outside it. I've tried to circumvence this
by introducing an SQLKEYWORD nonterminal, with the rule:
SQLKEYWORD: ORDER | ...
and
IDENT : ID | SQLKEYWORD
but I had no success, some conflicts were arisen, and at all, it does
not seem to be elegant. Is there any possibility to use a rule what
invesigates the next ID's content, and, depending on it, chooses on
shift/reduce? Or is it a completely stupid idea? Just to remark, I'm
using ML-Yacc. What can I do?
- Gergely
[When I did that, I did the extra work in the lexer so the SQL parser only
started up with a lexical flag said that there was embedded SQL. I used
double square brackets or something like that. -John]
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.