开发者

Is this grammar left recursive?

开发者 https://www.devze.com 2023-03-25 13:17 出处:网络
I know of two types of left recursion, immediate and indirect, and I don\'t think the following grammar falls into any of them, but is that the case?

I know of two types of left recursion, immediate and indirect, and I don't think the following grammar falls into any of them, but is that the case?

And is this grammar an LL grammar? Why or why not?

E :开发者_高级运维:= T+E | T  
T ::= F*T | F  
F ::= id | (E)


I assume you start with E. Both of E’s alternatives start with a T. Both of T’s alternatives start with F. Both of F’s alternatives start with a terminal symbol. Thus, the grammar is not left recursive.

0

精彩评论

暂无评论...
验证码 换一张
取 消