|keywords not reserved, any guidelines ?? email@example.com (Ann Roddy) (1993-11-11)|
|keywords not reserved, any guidelines ?? firstname.lastname@example.org (James Kanze) (1993-11-12)|
|From:||James Kanze <email@example.com>|
|Date:||Fri, 12 Nov 1993 12:05:25 GMT|
|> I am looking for any guidelines, papers, or books that cover the lexical
|> problems associated with languages such as Fortran, PLEX, and PL/I, ie.
|> languages which do not have keywords as reserved words, thus the lookahead
|> of such parsers is large.
|> I have studied a few methods for specific Fortran parsers, but I would
|> like to know if anything significant has been written on this area ?? Most
|> books I've read seem to gloss over the topic .
I wrote a paper on this about four or five years ago, which appeared in
SIGPLAN Notices. I'm afraid I don't have the references handy at work.
Basically, the idea was to have the scanner return the keyword, and modify
the error handling (in my case, in yacc) to ask for a different token when
it couldn't shift. The parse only went into its error states when it
couldn't get a different token.
Of course, this is worthless for Fortran, but it does handle most of the
cases where the user is allowed to have a user symbol with the same
spelling as a keyword. I've used the technique extensively where the
language has had to cope with externally defined names (such as file
names, or symbols in a program being debugged).
James Kanze email: firstname.lastname@example.org
GABI Software, Sarl., 8 rue du Faisan, F-67000 Strasbourg, France
Return to the
Search the comp.compilers archives again.