문제

I have the following productions

A -> Aa
A -> b

so it is clear that there is left recursion like

parseA() {
   parseA();//recursion
   parsea();
}

It is said that the left recursion can be avoided using the following rule

A -> bA'
A' -> aA'|null

How is left recursion avoided here?.There is still recursion in function A'. Can anybody explain me this.I am a beginner in this subject?

도움이 되었습니까?

해결책

How is left recursion avoided here?.There is still recursion in function A'.

Read this again. Left recursion is avoided. Non-left recursion is not.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top