CS 3723 Programming Languages
Goals and Objectives, Spring 2000
Course Goals and Objectives:
- Study programming languages. The course will do this
by to studying how programming languages are processed by the compiler.
This course will start with an assignment helping distinguish
a compiler from an interpreter.
(See
0. Quadruple Interpreter/Translator.)
Then programming assignments
will continue working on a compiler for a simple input language.
This course is not designed to turn you into a professional compiler
writer. (Current industry supports very few compiler people.)
Instead I want you to get a good idea of how a compiler works, so
that you can be a better programmer. Compiler techniques are useful
in many areas.
- Study finite state automata. These are also called
finite state machines (FSM).
Finite automata have many uses,
but in particular the are perfect for describing the lexical
level of a programming language.
(See FSM Homework.)
- Study the computer simulation of FSMs.
Their computer simulation allows the
implemention of a processor for the lexical level of a language.
(See I. Initial Scanner.)
- Study formal grammars. These are also called
BNF or context-free grammars. They will first be
studied as a formal (that is, precise and mathematical) way to describe the
syntax of a programming language.
(See Grammar Homework.)
- Study parsers.
These are computer simulations of a grammar that will recognize
a correct program written in a programming language.
(Here ``recognize'' means to accept a program that is correct
according to the syntax of the language and to reject an incorrect program.)
(See
II. Initial Parser.)
- Study syntax-directed translation.
Starting with a parser, one can add code to use the parser for translation
of a source program by a compiler. The assignment here also
helps study operators and their properties, including precedence
and associativity.
(See
III. Translate arithmetic expressions to Quadruples.)
- Study control structures.In this case we study them
by implementing them in the compiler.
(See
IV. Translate Control Structures.)
- Study activation records for implementing functions.
This emphasizes run-time storage management of the parameters
and local variable of a function.
(See Activation record Homework.)
- Study function implementation.
Actual implementation of functions involves special care with
compile time versus run time, and a clear understanding of
activation records.
(See
V. Translate Functions and Parameters.)
- Complete the project.
As a final step, I hope to use MIPS assembler language,
as a more realistic target language.
A secondary objective is to write a non-trival program implementing a useful
student-oriented compiler for a subset of the C language.
(See
VI. Final project: Target MIPS.)
More about syntax-directed translation:
From one point of view, the course has only one goal
and one central idea: that of syntax-directed translation.
This refers to a type of non-procedural programming, and we will
be talking at length about what the phrase means. In brief, however,
non-procedural programming does not write a sequence of functions
to be called in order to process data, but instead it arranges
things so that the proper functions will be automatically called
according to the particular input data. You may have seen
non-procedural programming in other contexts, as in artifical
intelligence applications, where the non-procedural prolog language
provides a set of rules to be applied to an application.
The language processor arranges to apply the proper rules in a
given situation.
(See
Knowledge Bases and the prolog language for
more about prolog.)
As another example, in database applications
the SQL language often states the desired result
of a query, without saying how that result should be achieved.
Revision Date: 1/11/00