Re: with or without keywords

"Olaf Stoyke" <os@cs.tu-berlin.de>
18 Mar 1998 23:04:45 -0500

          From comp.compilers

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)
| List of all articles for this month |

From: "Olaf Stoyke" <os@cs.tu-berlin.de>
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.