
Syntax Analyzer 89
We shall start by discussing a general approach to what is known as Shift/Reduce parsing and
Operator Precedence parsing. Then we define the context-free grammars, which are suitable for
Bottom-up parsing methods. Such grammars are called LR(k) grammars. The nomenclature LR(k)
has the following significance:
Parsers built based on LR(k) grammars use the productions in reverse, as they parse by reducing
the sentential forms.
4.3.1 Shift/Reduce Parsing
A general approach to Bottom-up parsing is called Shift/Reduce parsing. Referring to the grammar:
G = <{I,D,L}, {a-z, 0-9}, I, P>, with productions
P = { 1. I -> L
2. I -> IL ...