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.
Algorithm for Nonrecursive Predictive Parsing: