Error handling with Coco/r

John Williams <johnwilliams40@live.com>
Sun, 7 Dec 2008 01:38:36 +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: John Williams <johnwilliams40@live.com>
Newsgroups: comp.compilers
Date: Sun, 7 Dec 2008 01:38:36 +0100
Organization: Compilers Central
Keywords: tools, errors, question
Posted-Date: 06 Dec 2008 19:42:42 EST

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?


Thanks,


Post a followup to this message

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