Re: Error handling with Coco/r

Hans-Peter Diettrich <DrDiettrich1@aol.com>
Sun, 07 Dec 2008 05:32:14 +0100

          From comp.compilers

Related articles
Error handling with Coco/r johnwilliams40@live.com (John Williams) (2008-12-07)
Re: Error handling with Coco/r gah@ugcs.caltech.edu (Glen Herrmannsfeldt) (2008-12-06)
Re: Error handling with Coco/r DrDiettrich1@aol.com (Hans-Peter Diettrich) (2008-12-07)
Re: Error handling with Coco/r gah@ugcs.caltech.edu (Glen Herrmannsfeldt) (2008-12-07)
Re: Error handling with Coco/r vrotaru.md@gmail.com (vrotaru.md@gmail.com) (2008-12-13)
| List of all articles for this month |
From: Hans-Peter Diettrich <DrDiettrich1@aol.com>
Newsgroups: comp.compilers
Date: Sun, 07 Dec 2008 05:32:14 +0100
Organization: Compilers Central
References: 08-12-040
Keywords: parse, tools, errors
Posted-Date: 07 Dec 2008 08:34:37 EST

John Williams schrieb:
> I'm using the tool Coco/r to build a grammar for a programming language. My
> token section is something like this:
>
> id = letter { letter | digit }.
> integer = digit { digit }
> | digit { hexDigit } "H".


Make your token syntax LL, as supported by CoCo/R.


The selection amongst decimal and hexadecimal numbers should occur
*before* the digits are scanned, e.g. by "$"{hexDigit}, not afterwards.
When the lexer has to switch from decimal to hex mode when a hex digit
is encountered, a trailing "H" is quite superfluous.


DoDi



Post a followup to this message

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