SSCC: A Sufficiently Smart Compiler-Compiler

Wuu Yang, Yen-Tsan Lin · 2006

. Attribute grammars are a formalism for specifying computations on syntax trees. SSCC is a practical attribute-grammar system based on a polynomial-time extension of Kastens's ordered attribute grammars. The system comprises 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 analysis 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 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 pa...

Read the paper · More papers on PaperTik