1.将以下文法消除左递归,并分析符号串 i*i+i
E -> E+T | T
T -> T*F | F
F -> (E) | i
E->TE'
E'->+TE'|ε
T->FT'
T'->*FT'|ε
F->(E)|i
2.P101练习7(2)(3)
(2)
A->aABe|a
B->Bb|d
(3)
S->Aa|b
A->SB
B->ab
每个候选式的FIrst集为:
S->Ap
First(Ap)={a,c,p}
A->a|ε
First(a)={a}
A->cA
First(cA)={c}
A->aA
First(aA)={a}