Some nondeterminism between rules question.
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Vladislav_Shikhov
Posted On:   Saturday, June 8, 2002 01:59 PM

for instance, there is a grammar (k=3): protected DOT : '.' ; protected DIGIT : '0'..'9' ; DBLODIGIT : DIGIT (DIGIT)? ; INT : (DIGIT)+ ; DOTINT : DBLODIGIT DOT ; Why i have worning "nondeterminism between rules DOTINT & INT"?    More>>

for instance, there is a grammar (k=3):




protected



DOT

: '.'

;



protected



DIGIT

: '0'..'9'

;



DBLODIGIT

: DIGIT (DIGIT)?

;



INT

: (DIGIT)+

;



DOTINT

: DBLODIGIT DOT

;



Why i have worning "nondeterminism between rules DOTINT & INT"?

   <<Less

Re[2]: Some nondeterminism between rules question.

Posted By:   Vladislav_Shikhov  
Posted On:   Tuesday, June 11, 2002 08:40 PM

But it works fine if i comment out
INT : DIGIT+

so why ANT can't distinguish finite rule from unfinite rile?

Re: Some nondeterminism between rules question.

Posted By:   Peggy_Wong  
Posted On:   Sunday, June 9, 2002 08:34 PM

if '00.'

ANTLR cannot recognize if it is a DOTINT or first an INT then a DOT.

'00.' can be '0', '0', '.',

or it can be '0', '0', , '.',

here.
About | Sitemap | Contact