Integer Number Token - wrong detection

2 views
Skip to first unread message

maywyk

unread,
May 21, 2008, 2:07:14 AM5/21/08
to GOLD Parsing System
Hello, mighty parsers!
I 've just joined your community. I started exploring possibilities of
GOLD Builder with sample grammar:

! ------------------------------------------------- Sets
{ID Head} = {Letter} + [_]
{ID Tail} = {Alphanumeric} + [_]
{String Chars} = {Printable} + {HT} - ["]
{DigNZ} = [123456789]

! ------------------------------------------------- Terminals
Identifier = {ID Head}{ID Tail}*
!StringLiteral = '"' {String Chars}* '"'
Integer = {DigNZ}{Digit}*

And rule definitions follow...

The question is: on input "100x ....." scanner does detect
Integer 100 then
Identifier x.
And the error is raised by LALR parser, if no suitable rule found for
pair
Integer Identifier.

I would prefer scanner to raise error on "100x" - without producing
tokens.

I mean: Integer must be isolated from {String Chars} by whitespace or
'+','-',...

Can I tune up something in grammar specification ???

Many thanks in advance :)

Manfred_Nowak

unread,
May 23, 2008, 2:40:12 PM5/23/08
to GOLD Parsing System


On May 21, 8:07 am, maywyk <vm.o...@gmail.com> wrote:
> I mean: Integer must be isolated from {String Chars} by whitespace or
> '+','-',...

Please RTFM:
http://www.devincook.com/goldparser/doc/meta-language/whitespace-terminal.htm

-manfred
Reply all
Reply to author
Forward
0 new messages