Re: Lookahead vs. Scanner Feedback

Jan.Rekers@cwi.nl (Jan Rekers)
Tue, 07 Jan 92 14:20:45 +0100

          From comp.compilers

Related articles
Lookahead vs. Scanner Feedback hjelm+@cs.cmu.edu (1992-01-03)
Re: Lookahead vs. Scanner Feedback rockwell@socrates.umd.edu (Raul Deluth Miller-Rockwell) (1992-01-04)
Re: Lookahead vs. Scanner Feedback bliss@sp64.csrd.uiuc.edu (1992-01-07)
Re: Lookahead vs. Scanner Feedback sef@kithrup.COM (1992-01-07)
Re: Lookahead vs. Scanner Feedback Jan.Rekers@cwi.nl (1992-01-07)
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)
[5 later articles]
| List of all articles for this month |

Newsgroups: comp.compilers
From: Jan.Rekers@cwi.nl (Jan Rekers)
Keywords: yacc, parse
Organization: CWI, Amsterdam
References: 92-01-012
Date: Tue, 07 Jan 92 14:20:45 +0100

In article 92-01-012, hjelm+@cs.cmu.edu (Mark Hjelm) writes:
|> I have a parser, written using Yacc and Lex, for ANSI C. The grammar is
|> taken pretty much verbatim from the standard. The scanner uses the symbol
|> table to decide whether to return "identifier" or "typedef name" as the
|> token type for an identifier. [How do I reliably get it right?]


We use a different approach:
As we use the GLR parsing technique, which is an LR parser which is able
to split up in several LR parsers on a conflict, we are able to solve this
problem in a very general way. The scanner just returns all possible
interpretations of a token, the parser splits up to pursuit the different
possibilities; some of these will die in the sequel and the correct choice
survives. This leaves all information about the grammar out of the lexical
scanner and is guaranteed to work for any case without any inspection of
the grammar by a programmer.


Jan Rekers (Jan.Rekers@cwi.nl) Centrum voor Wiskunde en Informatica (CWI)
                                                P.O. Box 4079, 1009 AB Amsterdam, The Netherlands
--


Post a followup to this message

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