Non-recursive predictive parsing (MCA 4)
Non-recursive predictive parsing
The table-driven predictive parser has an input buffer, stack, a parsing table and an output stream.
Input buffer:
It consists of strings to be parsed, followed by $ to indicate the end of the input string.
Stack:
It contains a sequence of grammar symbols preceded by $ to indicate the bottom of the stack. Initially, the stack contains the start symbol on top of $.
Parsing table:
It is a two-dimensional array M [A, a], where ‘A’ is a non-terminal and ‘a’ is a terminal.
![Table-Driven Parsing Table-Driven Parsing](https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcTzUmtSDZHhy8k5DGwkA4JSp6HutskseZP8WtxE1oyuRpBozlX-&usqp=CAU)
Algorithm for Nonrecursive Predictive Parsing:
![Syntax analysis](https://www.site.uottawa.ca/~bochmann/SEG-2106-2506/Notes/M2-3-SyntaxAnalysis/Aho-parsingAlg.jpg)