Re: with or without keywords

"Olaf Stoyke" <>
18 Mar 1998 23:04:45 -0500

          From comp.compilers

Related articles
with or without keywords (Buday Gergely) (1998-03-12)
Re: with or without keywords (Vladimir Alexiev) (1998-03-15)
Re: with or without keywords (1998-03-18)
Re: with or without keywords (Nick Roberts) (1998-03-18)
Re: with or without keywords (Olaf Stoyke) (1998-03-18)
| List of all articles for this month |

From: "Olaf Stoyke" <>
Newsgroups: comp.compilers
Date: 18 Mar 1998 23:04:45 -0500
Organization: Compilers Central
References: 98-03-110 98-03-136
Keywords: parse, SQL

> 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. ...

> [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]

    Try to build a new scanner start state (I don't know if your scanner
    generator supports this...) or emulate this feature (If it has no
    start states): The first token belonging to a SQL statement triggers
    this new start state and everything scanned from that moment on can
    be encoded separately for SQL in this state or in depending ones, i.e.
    you can choose which token patterns are shared (identifiers? numbers?)
    and which are not...

        Regards, Olaf


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.