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) |
From: | "vrotaru.md@gmail.com" <vrotaru.md@gmail.com> |
Newsgroups: | comp.compilers |
Date: | Sat, 13 Dec 2008 10:15:05 -0800 (PST) |
Organization: | Compilers Central |
References: | 08-12-040 |
Keywords: | errors |
Posted-Date: | 13 Dec 2008 18:20:11 EST |
On Dec 7, 2:38 am, John Williams <johnwilliam...@live.com> wrote:
> 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".
>
> The problem is that a wrong hexadecimal number in an assignment such as "a
:=
> 32GH;" is identified as an error by the syntax analyzer. I would like to
> produce a more meaningful message such as "invalid hexadecimal" so I think
I
> need to detect errors at lexer level. Is there any option in Coco/r or
should
> I have to modify the scanner by hand?
I've played a bit lately and I guess you can probably modify the
Scanner.frame. I did it with the purpose of switching off some
spurious warnings.
Return to the
comp.compilers page.
Search the
comp.compilers archives again.