
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

Sohail Aslam Compiler Construction Notes Set:5-
Implementing Ad-Hoc Scheme
The parser needs a mechanism to pass values of attributes from definitions in one snippet to uses in another. We will adopt notation used by YACC for snippets and passing values. Recall that the skeleton LR(1) parser stored two values on the stack
〈 symbol,state 〉. We can replace this with triples 〈 value,symbol,state 〉. On a reduction
by A → β, the parser pops 3×|β| items from the stack rather than 2×|β|. It pushes value along with the symbol.