Embed presentation
Download to read offline

![Else if (X is a terminal) error Q;
Else if (M[X, a] is an error entry) error Q;
Else if (M[X, a] = X -> Y1Y2 •••Yk) {
Set X to the top stack symbol;
}
Note that the sentential forms in this derivation correspond to the input that has already
been matched (in column M A T C H E D) followed by the stack contents. The matched
input is shown only to highlight the correspondence. For the same reason, the top of the
stack is to the left; when we consider bottom-up parsing, it will be more natural to show
the top of the stack to the right. The input pointer points to the leftmost symbol of the
string in the INPUT column.](https://image.slidesharecdn.com/non-190122101857/75/Non-recusive-2-2048.jpg)

The document discusses non-recursive predictive parsing using a table-driven approach. It describes an algorithm that uses a parsing table to parse an input string according to a grammar. The algorithm initializes with the input string in a buffer and the start symbol on a stack. It then uses entries in the parsing table to pop symbols from the stack and advance through the input string, reporting errors if a valid parse cannot be found.

![Else if (X is a terminal) error Q;
Else if (M[X, a] is an error entry) error Q;
Else if (M[X, a] = X -> Y1Y2 •••Yk) {
Set X to the top stack symbol;
}
Note that the sentential forms in this derivation correspond to the input that has already
been matched (in column M A T C H E D) followed by the stack contents. The matched
input is shown only to highlight the correspondence. For the same reason, the top of the
stack is to the left; when we consider bottom-up parsing, it will be more natural to show
the top of the stack to the right. The input pointer points to the leftmost symbol of the
string in the INPUT column.](https://image.slidesharecdn.com/non-190122101857/75/Non-recusive-2-2048.jpg)
