Related articles |
---|
[5 earlier articles] |
Re: Lookahead vs. Scanner Feedback burley@geech.gnu.ai.mit.edu (1992-01-07) |
Re: Lookahead vs. Scanner Feedback drw@lagrange.mit.edu (1992-01-07) |
Re: Lookahead vs. Scanner Feedback smk@dcs.edinburgh.ac.uk (1992-01-07) |
Re: Lookahead vs. Scanner Feedback bill@twwells.com (1992-01-08) |
Re: Lookahead vs. Scanner Feedback bliss@sp64.csrd.uiuc.edu (1992-01-08) |
Re: Lookahead vs. Scanner Feedback nigelh@sol.UVic.CA (1992-01-08) |
Re: Lookahead vs. Scanner Feedback dww@inf.fu-berlin.de (1992-01-08) |
Re: Lookahead vs. Scanner Feedback jwoods@convex.com (1992-01-09) |
Re: Lookahead vs. Scanner Feedback jwoods@convex.com (1992-01-10) |
Re: Lookahead vs. Scanner Feedback bliss@sp64.csrd.uiuc.edu (1992-01-13) |
Re: Lookahead vs. Scanner Feedback megatest!djones@decwrl.dec.com (1992-01-13) |
Newsgroups: | comp.compilers |
From: | dww@inf.fu-berlin.de (Debora Weber-Wulff) |
Keywords: | yacc, parse |
Organization: | Free University of Berlin |
References: | 92-01-012 |
Date: | Wed, 8 Jan 1992 15:41:57 GMT |
hjelm+@cs.cmu.edu (Mark Hjelm) writes:
>How do I KNOW that there are no situations
>which, due to parser lookahead, would cause the scanner to return an
>incorrect token type for an identifier (i.e. return "identifier", even
>though the identifier was just/will be made into a "typedef name")?
The way to KNOW would be to prove that the scanner and parser conform to
specifications (not easy, since we have neither an exact spec or a
semantics of C :-), and to prove properties of one's microsyntax or
grammar.
Another way to handle the identifier/keyword problem is to introduce a
token class <name> = <letter> {<letter> | <digit>} or whatever, and then
either insert a "filtering pass" that checks each name against a list of
reserved words and replaces the token with <identifier> or the appropriate
keyword token (I feel the "but-that's-grossly-inefficient" flames already,
but I'd rather be right than fast :-), or else to insert a blub of code at
the point that the name token has been recognized to differentiate between
the two.
--
Debora Weber-Wulff dww@inf.fu-berlin.de
Institut fuer Informatik +49 30 89691 124
Nestorstr. 8-9
D-W-1000 Berlin 31
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.