[antlr-interest] nondeterminism warning?

Dima dimax at gmx.de
Wed Jan 25 14:26:38 PST 2006


>
> >  
> > With this part, I become this warning:
> >     nondeterminism upon k==1:LBRACK k==2:"assembly" between alt 1 and 
> > exit branch of block
> >  
>
> Please be more clear with your question, which rule causes this 
> warning(copy the entire antlr output please)?

> If the warning comes from c_unit, it is because global_attributes and 
> attribute_section can both start with LBRACK "assembly", and antlr can 
> not distinguish when k = 2.
>

Ok sorry, with k=2 it can't work, but I use k>=3.
It's true, the warning comes from c_unit.
With this rules global_attributes must be: 
	[ assembly : ...   (for k=3)
But attributes can be:
	[ assembly ] ... or
	[ assembly , ... or
	[ assembly ( ... or
	[ type :     ...
That's all not the same 

If I make attributes rule like this:
	LBRACK "type" COLON RBRACK
I get the same warning.
Antlr output:
	test1.g:39: warning:nondeterminism upon
	test1.g:39: 	k==1:LBRACK
	test1.g:39: 	k==2:"assembly"
	test1.g:39: 	k==3:COLON
	test1.g:39: 	between alt 1 and exit branch of block


Thanks!

Dima



More information about the antlr-interest mailing list