I have this project and I have to eliminate left recursion from my grammar, the book gives psuedocode. I understand how the pseudocode works, but I can't figure out how to implement it. |
|
I have this project and I have to eliminate left recursion from my grammar, the book gives psuedocode. I understand how the pseudocode works, but I can't figure out how to implement it. |
|
Without providing a grammar of the language it is very hard for me to tell what your code is trying to do, so if you could provide one, great. |
|
The Expression part of the grammar is as follows |
|
You'll never write a sensible parser out of that. As I said, there's no operator precedence and heaps of left recursion. In short it does nothing, and it does nothing spectacularly badly. |
|
The grammar doesn't do anything, it's just an exercise. That's exactly how it's written in the book. Would you like to see the rest of the grammar? |
|
Last edited by Identity X; 02-22-2008 at 03:08 PM.
Bookmarks