Need algorithm for parser for Context-Free Grammar
I am doing a project for my B.Sc(Honns). The project is to make a simulator for a programmable robot. Sounds easy, right? Right.
Anyway, my biggest problem right now is that I need to write a parser for the simulator's language. The language is a small subset of C - nothing complicated, just three pages of context-free grammar... :confused:
This has had me stumped for a week now - I tried using up to about four nested loops to do the job - it clearly doesn't work. Loops are not the way to go. So instead of wasting another week on trying to use recursion in five different ways, I decided to ask if anyone here has an algorithm for parsing context-free grammars?