- 作者: Wuu Yang ; Yen-Tsan Liu
- 中文摘要: Attribute grammars are a formalism for specifying computations on syntax trees. SSCC (a Sufficiently Smart Compiler Compiler) is a practical attribute-grammar system based on a polynomial-time extension to Kastens's ordered attribute grammars. The new class of attribute grammars is strictly larger than the class of ordered attribute grammars, and it retains the property that there is a polynomial-time procedure for finding an evaluation order. The SSCC system is comprised of two subsystems. The generation subsystem computes the evaluation order of attribute occurrences in production rules and translates attribute equations into low-level code for a virtual stack machine. The evaluation subsystem invokes tools to perform lexical and syntactic analyses and evaluates the attribute instances during a traversal of the syntax tree. Three features make SSCC capable of performing any desired computation (within the constraints of ordered attribute grammars): user-defined data types, user-defined functions and data structures, and the finalize function. A user may define arbitrary types and functions for use in the attribution equations. After all the attribute instances are evaluated, SSCC calls the finalize function, which may be supplied by a user, and passes it the whole decorated syntax tree. This offers a user opportunities for further processing of the tree and the attributes. The SSCC system is semi-strongly typed in the sense that type consistency within a specification is fully checked by SSCC; however, type consistency between a specification and user-supplied functions is not checked.
- 英文摘要: --
- 中文關鍵字: attribute grammars, ordered attribute grammars, compiler compiler
- 英文關鍵字: --