Is this grammar left recursive?
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.
精彩评论