Home

Experience with a Production Compiler Automatically Generated from an Attribute Grammar

Rodney Farrow

Title:
Experience with a Production Compiler Automatically Generated from an Attribute Grammar
Author(s):
Farrow, Rodney
Date:
Type:
Technical reports
Department:
Computer Science
Permanent URL:
Series:
Columbia University Computer Science Technical Reports
Part Number:
CUCS-102-84
Abstract:
This paper relates our experience implementing a production compiler from an attribute grammar. The compiler is Intel Corporation's Pascal-80 compiler. It runs on a microcomputer-based development system without virtual memory. An attribute grammar was written describing semantic analysis, storage allocation, and translation to intermediate code. Attribute evaluation is done in two alternating passes and the program tree is kept in intermediate files on disk. The first version of the compiler was manually implemented from the attribute grammar. Using what was learned from this experience, an automatic attribute evaluator-generator was then written and a new version or the compiler was mechanically created from the attribute grammar. Various techniques for optimizing the evaluator were tried. Their degree or success is reported and they are compared with other ideas from the literature. Complex attribute-values, such as sets, sequences and finite functions, were carefully implemented using applicative data structure in order to conserve memory. The attribute grammar was designed using the principles or data abstraction and information-hiding. The internal organization or many types or attributes is completely hidden from the attribute grammar author and the attribute evaluator. These values are manipulated only by specific out-of-line semantic functions that can be viewed as the operators or an abstract data type for this attribute. This also contributed to an efficient use of memory.
Subject(s):
Computer science
Item views:
55
Metadata:
text | xml

In Partnership with the Center for Digital Research and Scholarship at Columbia University Libraries/Information Services | Terms of Use