Blog picture

Asst. Professor

Blog image KHUSHBOO RANI Shared publicly - Aug 10 2020 4:06PM

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

 

Algorithm for Nonrecursive Predictive Parsing:

Syntax analysis



Post a Comment

Comments (0)