[antlr-interest] I don't understand.....

Silvain Piree s.piree at enneya.com
Wed Apr 3 04:20:06 PST 2002


> why this (stupid) grammar has problem ?
>    file: (name | number) +;
>    name: (CHAR) + ;
>    number: (DIGIT) + ;

Given input "AB C" this could parse as:

    name (A)  name (B)  name (C)
 
or 

    name (ABC)

So there's a conflict. 

If you want to do it like this, then you probably want to return
space as token to separate names (and numbers).

Silvain



 

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



More information about the antlr-interest mailing list