Abstract/Details

A COMPILER GENERATOR FOR SEMANTIC GRAMMARS

PAULSON, LAWRENCE CHARLES. 
 Stanford University ProQuest Dissertations Publishing,  1982. 8214603.

Abstract (summary)

Most programming languages are defined using English, with its attendant ambiguities. This thesis introduces the semantic grammar, a formal, unambiguous notation for syntax and semantics. Appendix D is a semantic grammar for Pascal; I have also written one for Fortran. Semantic grammars evolved from denotational semantics and attribute grammars. A grammar contains domain definitions, expression definitions, and attribute grammar rules. Attributes express semantic dependencies and constraints. A semantic grammar may express static semantics, such as type-checking and symbol table management, as well as dynamic semantics. A grammar can define axiomatic or operational semantics, as well as denotational.

Developing a compiler still requires a major effort, in spite of all the design tools available. Most generate only part of a compiler, and require the user to code the rest. This thesis describes a compiler generator that translates semantic grammars into compilers. It has generated Pascal and Fortran compilers, and run numerous programs, including an LR(0) parser constructor. The compiler generator consists of a grammar analyzer, universal translator, and stack machine. The grammar analyzer converts a semantic grammar into a language description file that includes LALR(1) parse tables and attribute semantics. The universal translator reads the file and parses a program, producing a graph of attribute dependencies. It simplifies the graph into a single formula, while reporting semantic errors in the program. It compiles the formula into stack machine instructions for execution. The stack machine uses Landin's SECD architecture to execute lambda-calculus formulas.

The compiler generator was designed to be as general and complete as possible, to provide language designers with immediate implementations of their ideas. It accommodates applicative languages and novel control structures. It can perform the complex static checking that modern languages require. The compilers are not efficient enough to replace hand-written ones, but can execute test programs several pages long, to evaluate an experimental language.

Indexing (details)


Subject
Computer science
Classification
0984: Computer science
Identifier / keyword
Applied sciences
Title
A COMPILER GENERATOR FOR SEMANTIC GRAMMARS
Author
PAULSON, LAWRENCE CHARLES
Number of pages
168
Degree date
1982
School code
0212
Source
DAI-B 43/01, Dissertation Abstracts International
Place of publication
Ann Arbor
Country of publication
United States
ISBN
9798662249165
University/institution
Stanford University
University location
United States -- California
Degree
Ph.D.
Source type
Dissertation or Thesis
Language
English
Document type
Dissertation/Thesis
Dissertation/thesis number
8214603
ProQuest document ID
303229537
Copyright
Database copyright ProQuest LLC; ProQuest does not claim copyright in the individual underlying works.
Document URL
https://www.proquest.com/docview/303229537