SSCC: A software tool based on extended ordered attribute grammars

Wuu Yang*, Yen Tsan Liu

*Corresponding author for this work

Research output: Contribution to journalArticlepeer-review

1 Scopus citations

Abstract

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.

Original languageEnglish
Pages (from-to)85-99
Number of pages15
JournalProceedings of the National Science Council, Republic of China, Part A: Physical Science and Engineering
Volume23
Issue number1
StatePublished - Jan 1999

Fingerprint

Dive into the research topics of 'SSCC: A software tool based on extended ordered attribute grammars'. Together they form a unique fingerprint.

Cite this