Reputation: 1634
I need some advice about writing a parser (using C and Lex) that accepts a CFG and removes left recursion. Since the parser, needs to accept any string and a grammer, I am clueless about how to start. Although I am familiar with the algorithm to remove left recursoin (as mentioned here, I am clueless about how to start, and what will be the data structures involved. What is the best way to store the grammar, and the string. And how can I efficiently apply the algorithm. Please suggest. (Since this is homework, please do not provide me the code, instead any other help/pseudocode shall do) :)
Upvotes: 1
Views: 341
Reputation: 95324
Upvotes: 1