Luca Dan Șerbănați at the baccalaureate, 1961
Luca Dan Șerbănați in the early 1970s
Luca Dan Șerbănați giving his last fifth-year lecture, April 1989

Luca Dan Șerbănați

Emeritus Professor at Politehnica University of Bucharest

Research, teaching, industry and memoirs

RO | EN | IT
Luca Dan Șerbănați in Venice, 1990
Luca Dan Șerbănați in New York, 2005
Luca Dan Șerbănați

Context

This textbook (Parts III–IV) closes the series of course materials “Limbaje și compilatoare” [Programming Languages and Compilers] through two complementary directions: (1) the formalization of languages and of analysis/translation processes, and (2) the effective design of a compiler, viewed as a chain of controlled transformations of representations.

Note: for the moment I do not yet have a complete scanned copy ready for publication. The present page describes the contents on the basis of the course structure.

Cover (reconstructed)

Cover of the textbook Programming Languages and Compilers, Part III–IV (1984)

Cover reconstructed in order to keep the series visually consistent.

Description of contents

In this part of the course, the emphasis shifts from “what a language is” and “how one programs” to “how one specifies rigorously” and “how one builds systematically.” On the one hand, formalization (grammars, language classes, automata) provides the tools for definition and analysis; on the other hand, compiler design treats compilation as a stratified process: lexical analysis, syntax analysis, semantic analysis, and intermediate code generation.

The textbook is conceived as a working guide: each thematic block introduces only the concepts that are strictly necessary, then shows how they take concrete form in models and design procedures (data structures, analysis machines, translation schemes), so that the reader can move from definitions to the architecture of a compiler.

Part III: Introduction to Formal Systems

Part III establishes formal languages as the common foundation for describing syntax and for building analyzers. I begin with the Chomsky hierarchy and the relation between grammars and languages, then detail the properties of the classes of practical interest: context-free languages and regular languages. I then introduce the notion of an acceptor automaton as the operational model for recognition, distinguishing between the physical model and the mathematical model, and explicitly discussing the finite automaton and the push-down automaton as a basis for understanding syntactic analysis.

Part IV: Compiler Design

Part IV is the “engineering” part of the course: I follow step by step the design and implementation of the major components of a compiler. I begin with lexical analysis (model, design, implementation), then treat syntax analysis both top-down (recursive descent parser, LL(1), table-driven variants) and bottom-up (shift-reduce, simple/weak precedence, the LR family). After that, semantic analysis is presented as syntax-directed translation, with the corresponding specifications and algorithms for both top-down and bottom-up strategies.

Finally, intermediate code generation is discussed as the stage where representation is stabilized before object code: Polish notation, syntax trees, three-address code (quadruples/triples), and techniques for Boolean expressions and control statements. The aim is to show compilation as a sequence of transformations between representations, each transformation justified and controllable.

Reconstructed contents

II. INTRODUCTION TO COMPILATION THEORY

  • Chapter 1. Language specification
    • 1.1. Chomsky grammars and languages
    • 1.2. Properties of some classes of formal languages
    • 1.2.1. Context-free languages
    • 1.2.2. Regular languages
    • 1.3. Acceptor automata
    • 1.3.1. Physical model and mathematical model
    • 1.3.2. The finite automaton
    • 1.3.3. The push-down automaton
  • Chapter 2. Language translation
    • 2.1. Syntax-directed translation scheme
    • 2.2. Translation automata
    • 2.3. Attribute grammars

III. COMPILER DESIGN

  • Chapter 1. Lexical analysis
    • 1.1. Generalities
    • 1.2. The lexical analyzer model
    • 1.3. Designing a lexical analyzer
    • 1.4. Implementing a lexical analyzer
  • Chapter 2. Syntax analysis
    • 2.1. Top-down syntax analysis
    • 2.1.1. Recursive descent parser
    • 2.1.2. Table-driven top-down parsers
    • 2.1.3. LL(1) grammars
    • 2.1.4. An efficient top-down parser
    • 2.2. Bottom-up syntax analysis
    • 2.2.1. Shift-reduce analysis
    • 2.2.2. Simple precedence grammars
    • 2.2.3. Implementing a shift-reduce machine for a precedence grammar
    • 2.2.4. Weak precedence grammars
    • 2.2.5. LR parsers
  • Chapter 3. Semantic analysis
    • 3.1. Syntax-directed translation
    • 3.2. A translation specification for top-down analysis
    • 3.3. Implementing a predictive translation machine
    • 3.4. A recursive descent translation algorithm
    • 3.5. A translation specification for bottom-up analysis
  • Chapter 4. Intermediate code generation
    • 4.1. Polish notation
    • 4.2. Syntax trees
    • 4.2. Three-address intermediate code
    • 4.3.1. Quadruples
    • 4.3.2. Triples
    • 4.4. Intermediate code generation for Boolean expressions
    • 4.5. Intermediate code generation for control statements

Links