
Syntax-directed Translation 143
better. We shall discuss Implicit Stacking in an RDP, Synchronized Semantic Stacks and Action
Symbols.
5.1 Implicit Stacking in RDP
If the language can be parsed by an RDP, then a simple method is available to implement many of
the semantic analysis operations. The method illustrated here is further used extensively in Chapter 8
on Intermediate Code, for generating the Intermediate representation of the program. Several further
examples of implicit stacking in RDP are given.
We shall use the following sub-grammar of an IF-THEN-ELSE construct:
if-stmt : IF logic-expr THEN stmt-list FI
| IF logic-expr THEN stmt-list1 ...