如何在语法上执行左保理,使其成为LL(1)

时间:2014-03-22 14:05:50

标签: compiler-construction computer-science left-recursion

这是我没有留下递归的语法。我必须把它变成LL(1)。我该怎么做呢?

S -> Exp eof
Exp -> Term Exp2
Exp2 -> + Term Exp2 | - Term Exp2| e 
Term -> Factor Term2
Term2 ->  * Factor Term2 | / Factor Term2 | e 
Factor -> id | num | Fncall | Aref | (Exp)
Fncall -> id (Arguments)
Aref -> id [Indices]
Arguments -> Exp | Exp, Arguments
Incides -> Exp | Exp, Indices

0 个答案:

没有答案