Grammar problems

"Michael Gerhardt" <gerhardt@schleissheimer.de>
26 Jan 2001 17:04:39 -0500

          From comp.compilers

Related articles
Grammar problems gerhardt@schleissheimer.de (Michael Gerhardt) (2001-01-26)
Re: Grammar problems smoleski@surakware.com (Sebastian Moleski \(SurakWare\)) (2001-01-28)
Re: Grammar problems mahesha@india.hp.com (mahesha) (2001-02-01)
| List of all articles for this month |

From: "Michael Gerhardt" <gerhardt@schleissheimer.de>
Newsgroups: comp.compilers
Date: 26 Jan 2001 17:04:39 -0500
Organization: Customer of UUNET Deutschland GmbH
Keywords: parse, question
Posted-Date: 26 Jan 2001 17:04:38 EST

Hi,


Before I start to explain my problem its time to say, that I am an
absolute beginner in this topic, so please be so kind and do not hit
me with a hammer, when I ask stupid questions...


I started generating a parser in a standard grammar with the compiler
generator coco. I do not not know if anybody is used to this tool, but
my main problem is in the grammar itself. I need to describe in which
it is allowed that Identifiers (variable names, etc.) CAN be called
like keywords. I do not know who made this specification, but this is
a severe problem for me. I wrote the complete grammar and after runnig
through a sample of code the error occured: Compilation error: keyword
expected...


Any help would be great, because I am going mad on this topic...


greets michael
[There's no good answer. Parser generators don't get along well with
languages that don't have reserved words. I've written Fortran parsers
in yacc, but they needed an enormous amount of kludgery to feed hints
from the parser back into the lexer. -John]







Post a followup to this message

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