CS712/CS812
Project Phase 1
Spring 2005
Due Sunday February 13
In this phase the class will cooperate in the design of a simple
object-oriented language.
Our design will support the following functionality:
- An integer type.
- Integer operations: assignment, addition, subtraction, multiplication,
division, and negation.
- Reference types.
- Object definition, including integer fields, reference fields,
methods (with parameters and return values), and single inheritance.
Method overriding and overloading.
Field hiding.
Integer and reference parameters.
Integer and reference return values.
- Object creation and object deletion, with corresponding constructors and
destructors.
- Arrays, including arrays of integers, arrays of references, and
arrays of arrays. Array creation and destruction. Declaration of array
variables. Array indexing. Array length accessor.
- Assignment of reference type, including
the assignment of superclass references to and from subclass references.
- Comparison operators for integer types: equality, less than and greater
than.
These operators will produce an integer value.
- A comparison operator for reference types: equality.
- A logical negation operator defined on the integer type.
- A method call operator, with parameter evaluation and return value
generation.
- A mechanism for outputing an integer to stdout.
- An if-then-else construct.
- A while-loop construct.
- A "main" function construct, including a namespace for storing reference
and integer variables.
- A field reference operator.
- Decimal integer constants.
- Names that can denote "main" function variables or method parameters.
- A null reference constant.
- A "this" reference.
- A "super" reference.
- Parenthesized expressions.
- A comment construct.
The language will require that programs be completely specified
in a single file.
The key criteria for evaluating our design is its completeness.
We need to specify both the syntax and the semantics.
We need to be sure to consider error situations when we describe the semantics.
(For example, what should the compiler do if the user assigns a reference
to an integer?)
We will base our language specification on
The Java Language Specification.
In fact we will try to extract our language directly out of Java, and
then patch the resulting rough spots (e.g. there are no destructors
in Java; our language does not have exceptions so what do we do when
we encounter a divide by zero?).
Students will be assigned a section of the Java specification and
your assignment will be to adapt it for our language.
Each feature of our language will be discussed in class, but
the default syntax and semantics of our language will be based upon the
Java syntax and semantics.
So, when in doubt, mimic Java!
In fact, shameless copying from the Java specification is allowed
and even encouraged, but be careful to pull in only what we need.
Our language specification will be published as webpages.
David Noblet will serve as the editor of the webpages.
HTML for your section of the specification should be e-mailed
to David within 48 hours following when your section is discussed
in class.
If you are not going to be able to meet this deadline, then you
should contact me at the time your section is discussed in class.
You will be responsible for your section of the specification
over the course of the whole semester.
As weaknesses are detected in the specification, the responsible
students will need to edit their section of the specification
and e-mail the updated HTML to David.
I anticipate that all students will get full credit for this
phase, if you fulfill your responsibilities over the whole
semester, including preparing your initial draft, reading and
critiquing other students' drafts, and editing your section as needed.
Class attendance and participation is critical in the
two-week period allocated for this phase.
If you do not carry your assigned load at some point in the semester, then
I will be forced to make deductions in your grade.
We will also share test files over the course of the semester.
You will be responsible for generating test files for your
section of the specification.
The details of how and when we will share test files will be
discussed at a later date.
Here are the work assignments, with the corresponding section
in the Java specification:
- Devkota - Chapter 3 - Lexical Structure
- Olson - Chapter 4 - Types, Values, and Variables
- Prenderghast - Chapter 5 - Conversions and Promotions
- Augros - Chapter 6 - Names
- Filoti - Chapter 8 - Classes (methods and fields)
- Garbuzov - Chapter 8 - Classes (constructors and destructors)
- Kulkarni - Chapter 10 - Arrays
- Li - Chapter 14 - Blocks and Statements (if-then-else and while)
- Mehlman - Chapter 14 - Blocks and Statements (main, blocks, empty statement, expression statements, return)
- Mitchell - Chapter 15 - Expressions (variables, types, run-time checks, evaluation order, names)
- Mocny - Chapter 15 - Expressions (primary expressions, class instance creation and destruction, array creation and destruction)
- Sayles - Chapter 15 - Expressions (array access, field access, assignment)
- Tolstenko - Chapter 15 - Expressions (method invocation)
- Winters - Chapter 15 - Expressions (unary and binary operators)
- Noblet - Chapter 19 - LALR(1) Grammar
Our specification will have the following chapters in this order:
- Lexical Structure
- Types, Values, and Variables
- Conversions and Promotions
- Names
- Classes
- Arrays
- Blocks and Statement
- Expressions
- LALR(1) Grammar
For chapters that are to be written by multiple students, here are
the section numbers:
- Classes:
- Class declarations (Filoti)
- Class members (Filoti)
- Field declarations (Filoti)
- Method declarations (Filoti)
- Constructor and destructor declarations (Garbuzov)
- Blocks and Statements:
- Blocks (Mehlman)
- The main block (Mehlman)
- The empty statement (Mehlman)
- Expression statements (Mehlman)
- The if statement (Li)
- The while statement (Li)
-
- Expressions
- Evaluation, denotation and result (Mitchell)
- Variables as values (Mitchell)
- Type of an expression (Mitchell)
- Expressions and run-time checks (Mitchell)
- Evaluation order (Mitchell)
- Primary expression (Mocny)
- Class instance creation and destruction expressions (Mocny)
- Array creation and destruction expressions (Mocny)
- Field access expressions (Sayles)
- Method invocation expressions (Tolstenko)
- Array access expressions (Sayles)
- Names (Mitchell)
- Unary operators (Winters)
- Arithmetic, relational, equality operators (Winters)
- Assignment operator (Sayles)
Last modified on January 28, 2005.
Comments and questions should be directed to
hatcher@unh.edu