Hi Folks,

here is an excerpt on a SchemeNumber grammar which is part of a Scheme
grammar that I am toying with.

grammar SchemeNumber;
tokens {
    HASH = '#' ;
}
prefix2        : RADIX2 EXACTNESS?
        | EXACTNESS? RADIX2
        ;
RADIX2        : HASH ('b'|'B');
EXACTNESS    : HASH ('i'|'I'|'e'|'E');

The problem is in rule 'prefix2' since token RADIX2 can be matched in two
different ways. Scheme requires that I am able to state the following
prefixes:

"#b", "#e#b" and "#b#e".

The radix description is mandatory whereas the exactness is optional, and
can come before ore after the radix description.

Any idea how to change the grammar above so that ANTLR no longer complains
and disables alternatives?

Thanks.
Hans-Martin

--

You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en.


List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

Reply via email to