[antlr-interest] Can someone please explain

Balvinder Singh bals1978 at hotmail.com
Fri Jun 21 06:37:38 PDT 2002


Hi..

 It might be the case in ur grammar that intersection of First(B) and
First(C) is not null.

bals

----- Original Message -----
From: "Silvain Piree" <s.piree at enneya.com>
To: <antlr-interest at yahoogroups.com>
Sent: Friday, June 21, 2002 6:39 PM
Subject: Re: [antlr-interest] Can someone please explain


> I understand the solution, but I don't understand the problem!
>
> Why is making a token optional in both subrules producing
> a conflict that can not be resolved with regular lookahead?
>
> Silvain
>
> >  Use syntactic predicate like this
> >
> >  (A(B)?)=>A(B)?
> >
> > It will remove the warnings but I'm not sure about run time
> > behaviour... and not sure if you add some new production,
> > whether i will work or not.
> >
> > > I'm getting nondeterminism warnings on my grammar but
> > > I don't understand why.
> > >
> > > Following rule does not cause a problem when using k=5:
> > >
> > > rule:    A B C D E       |     A B C D F   ;
> > >
> > > But, when I make the B optional then I get a nondeterminism
> > > warning regardless of lookahead 'k':
> > >
> > > rule:    A (B)? C D E       |     A (B)? C D F   ;
> > >
> > > Any suggestions would be much appreciated,
> > >
> > > Silvain
>
>
>
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



More information about the antlr-interest mailing list