Chapter 5: Semantic Analysis

. Suppose semantic rule A.a = f(X.x, Y.y, Z.z) is associated with production A XYZ

. Before reducing XYZ to A, value of Z is in val(top), value of Y is in val(top-1) and value of X is in val(top-2)

. If symbol has no attribute then the entry is undefined

. After the reduction, top is decremented by 2 and state covering A is put in val(top)

An example of a parser stack while parsing of A.a := f( X.x,Y.y,Z.z). The details are included in the slide itself. Top is decremented by two because three values viz. X,Y and Z are popped and value of A has to be pushed in.