O'Reilly logo

Compilers: Principles and Practice by Himanshu B. Dave, Parag H. Dave

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

5.2 Synchronized Semantic Stacks

For context-free grammars, being more general than the restricted grammar with which can be handled by an RDP, we have to use a separate stack to store the semantic information generated during the semantic analysis process. RDP used the return stack of the implementation platform to store this information in local variables created automatically on the return stack. Generally, LL(k), LR(1) or LALR(1) parsers do not have this one-to-one relationship between the Activation Record on the return stack and detection of a particular syntactic construct.

The separate stacks, more than one of which may be used by a parser, must be kept in synchronization with the detection of a particular syntactic construct. Such stacks ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required