Evaluation of Semantic Actions in Predictive Non-Recursive Parsing

To implement a syntax-directed translator, compiler designers always have the option of building a compiler that first performs a syntax analysis and then transverses the parse tree to execute the semantic actions in order. Yet it is much more efficient to perform both processes simultaneously. This avoids having to first explicitly build and afterwards transverse the parse tree, which is a time- and resource-consuming and complex process. This paper introduces an algorithm for executing semantic actions (for semantic analysis and intermediate code generation) during predictive non-recursive LL(1) parsing. The proposed method is a simple, efficient and effective method for executing this type of parser and the corresponding semantic actions jointly with the aid of no more than an auxiliary stack.

[1]  Alaa A. Kharbouch,et al.  Three models for the description of language , 1956, IRE Trans. Inf. Theory.

[3]  Yoshimichi Watanabe,et al.  An Attribute Evaluation of Context-Free Languages , 1994, Inf. Process. Lett..

[4]  Borivoj Melichar,et al.  Attribute Evaluation and Parsing , 1991, Attribute Grammars, Applications and Systems.

[5]  O. G. Kakde Algorithms for Compiler Design , 2002 .

[6]  Seth D. Bergmann,et al.  Compilers , 1973, CSC '73.

[7]  Alfred V. Aho,et al.  Compilers: Principles, Techniques, and Tools , 1986, Addison-Wesley series in computer science / World student series edition.

[8]  Heiko Vogler,et al.  Top-down Parsing with Simultaneous Evaluation of Noncircular Attribute Grammars , 1994, Fundam. Informaticae.