[antlr-interest] grammar conversion

Loring Craymer lgcraymer at yahoo.com
Wed Nov 1 15:04:24 PST 2006


The second works--you can prove that by mathematical
induction.  That is
recursion level            result
0                          X
1                          XYX
2                          XYXYX
...
n                          X (YX)+n
n+1                        XYN[n] = X (YX)+n+1

where N[n] is N from recursion level n and (YX)+n is n
copies of YX.

--Loring

--- "Jigang (Robert) Sun" <sunjigang1965 at yahoo.com.cn>
wrote:

> I know N = X | N Y could be converted to N = X (Y)*
> Now a grammar is N = X | N Y N, should it be
> converted to N = X (Y N)* or N = X (Y X)* ?
> 
> Thanks.
> Jigang
> 
> 
> 		
>
___________________________________________________________
> 
> ÇÀ×¢ÑÅ»¢Ãâ·ÑÓÊÏä-3.5GÈÝÁ¿£¬20M¸½¼þ£¡ 
> http://cn.mail.yahoo.com
> 



 
____________________________________________________________________________________
Want to start your own business? Learn how on Yahoo! Small Business 
(http://smallbusiness.yahoo.com) 



More information about the antlr-interest mailing list