Next:
About this document ...
Up:
CS2111: Design and Implementation
Previous:
A larger example illustrating
CS2111: Design and Implementation of Programming Languages
Pete Jinks
Introduction
Syllabus etc.
Examples of Language design - declaring and using variables and strings
Interpreters and Translators
Some example programs and their languages
Strategies for Describing and Implementing Computer Languages
Exercises
Readings
Expressions: Operators
Number of Operands (per operator)
Overloading
Precedence
Associativity
Subexpression evaluation order
Lazy and eager evaluation
Assignment
C
SML
Language design and implementation
Exercises
Readings
LEX
Postfix calculator in LEX
Descriptions of expected inputs
LEX definitions
Actions, C declarations and code
How LEX is used
Using LEX to make an infix calculator
Language design and implementation
Exercises
Readings
YACC
YACC program for an infix calculator
Format of the grammar rules for YACC
YACC definitions
Actions, C declarations and code
How YACC is used
Using LEX and YACC together
How LEX and YACC are used together:
Language design and implementation
Exercises
Readings
YACC: Further usage
Grammar rules
Left and right recursion
Getting the order of actions correct
Precedence and associativity
Grammatical errors: handling incorrect inputs
Language design and implementation
Exercises
Readings
Inside LEX and YACC: State Machines
Inside LEX: Finite State Automata (FSA)
Inside YACC: Push Down Automata (PDA)
Language design and implementation
Exercises
Readings
Debugging YACC grammars
How YACC works and fails
Debugging an example grammar
Language design and implementation
Exercises
Readings
Parse Trees
Language design and implementation
Building parse trees for expressions
Exercises
Readings
Language Design
Error detection and correction
C is deformed because its parents were frightened by keywords
Puns: similar representations with different meanings
Synonyms: different representations, similar meanings
Orthogonality
Exercises
Readings
Expressions: Code Generation
Computer structures
Code Generation Algorithms
Exercises
Readings
Control structures
From GOTOs to Structured Programming
Concatenation
Selection
Repetition
Repeaters and Completers
Exceptions
Exercises
Readings
Procedures and functions
Introduction
Parameter passing
Polymorphism
First Class Subprograms
Readings
Identifiers: Static and Dynamic Semantics
Semantic Model
Static and dynamic properties
(Static) Scope and (Dynamic) Extent
Declarations
Variables
Readings
Scope and Extent
Classical Block Structure
Recursion
The Stack Model
Function Values
The Heap
Exercises
Readings
Types
Values and types
Strong typing
Type Coercion
Primitive types
Language Independant Datatypes
C
SML
Language design and implementation
Readings
Composite Types
Common Composite Types
Recursive Data Types (RDTs)
Pointers (references)
Language design and implementation
Readings
Vectors and Arrays - Language design and implementation
Vector Declarations and element access
Bound checking
Multi-dimensional arrays
Static and Dynamic arrays
Operations on vectors, including slicing
Exercises
Readings
Abstract Data-Types, Modules, Classes and Objects
Abstract Data Types (ADTs)
Modules e.g. ADA
Classes: Object-Oriented Programming Languages (OOPLs)
Readings
Language Design and Implementation - Identifiers
Dictionaries
Using a dictionary
Property entries
Keywords and predefined identifiers.
Binding
Exercises
Readings
Building a Compiler: recognising the input
Chomsky's classification of grammars
Macro pre-processing
Lexical analysis (itemisation, scanning, tokenisation)
Syntactic analysis (parsing)
Semantic analysis
Readings
Building a Compiler: generating the output
Code generation
Code optimisation
Constructing a compiler from tasks: Passes
Exercises
Readings
Syntax-directed Translation
When to use a tool or technique
How to combine tools and techniques - Passes
Phases of Compilation
A small example - Parse Tree after Semantic Annotation
Example run of lex calculator
Example run of yacc calculator
A larger example illustrating the Phases of Compilation
CS2111: Design and Implementation of Programming Languages Pete Jinks
Pete Jinks
1999-09-30