CSci 4607 Computer Language Processing -- Project and other
[Project and other assignments]
This page contains description of the project, project assignments and
deadlines, and other course assignments.
Written assignments can be submitted online via the course Wiki
page. Programming assignments will be submitted
Important: Each assignment must be accompanied by a brief note
describing participation of each team member in the submitted
work (if you don't feel comfortable posting such a note on Wiki, you
may submit a hand-written note or send me an e-mail, CC to all team
members). If all goes well, all team members get the same grade for
an assignment. However, if there is a definite disproportion in
participation, I reserve the right to grade the work individually.
Since written assignments include a substantial amount of
descriptive text, both the contents and the style of the submitted
document will be graded. Points may be deducted for spelling and
grammatic errors and for text which is hard to understand.
Programming assignments must include comments, authorship notes,
and dates of creation/last modification. Proper naming of variables
and functions and proper indentation is required. All changes made after
previous submissions must be documented.
Decide whom are you going to do your project with. Project groups can
have 2-3 students. Please let me know by e-mail (CC-ed to all members
of your project group) before the beginning of the class who is going
to be in your group. You can, if you'd like, choose a name for your
The focus of this assignment is to clearly define a problem you are
trying to solve. Specifically, you need to describe the following:
The goal of this project phase is to completely define the syntax of
the little language. You should focus on two interdependent issues:
the formal grammar for the language and the ease of use of the
- The purpose of the language (briefly).
- A typical user of the language (do you assume that the user is
familiar with programming? If yes, what programming
languages do you expect the user to be comfortable with? If your
language is specific to a particular branch of science, such as
chemistry, astronomy, etc., or deals with other specialized
knowledge, do you expect the user to use specific
terminology related to this field in the language you are designing?)
- The data that the language will be working with. Be as specific
as possible. Examples are a must, but they are not sufficient for a
complete description, you need to describe the general case as
well. Use BNF if it's helpful.
This and the next part of the
assignment should constitute the major part of your work.
- The format of the outcome of the language. Again, you need to
describe the general case with all the details and include examples.
- Describe the language paradigm that you think would be
appropriate for solving this problem. Explain why this is a good
choice. If you have considered other ones, please describe those and
explain why your decision. If you are still undecided about your
paradigm, please summarize your options and explain advantages and
disadvantages of each choice.
You don't need to use terminology given in the book. A well-chosen
example of a program execution would suffice.
Start by writing examples in your language. Then try to encode the
syntax as a formal grammar. Check that the grammar satisfies the
requirements below. If it doesn't (or if you find it very difficult to
prove that it does), try to come up with a different grammar for the
same language. If this fails, then you might want to change the
Your submission will consist of two parts:
Part 1: Formal grammar. Your grammar must satisfy the following
If your program allows the user to write comments, then include the
syntax of comments in the grammar and in the examples.
- It must be context-free (i.e. defined via BNF)
- It must be unambiguous (i.e. every statement must have a unique
- The sub-grammars that describe identifiers, numbers, and similar
entities must be regular grammars, since they will be used by the
- The grammar should be such that you can always choose a
production rule by looking ahead no more than one token (see p. 100
of the textbook for details). While you don't need to construct a
push-down automaton to recognize the grammar, you should make up a lot
of examples and convince yourselves that you grammar satisfies these
rules. For instance a variable assignment can be distinguished from a
function invocation by the left parenthesis after the function name:
int n = m;
int n = m(x);
If you find your grammar to be too complicated, you might try the
Part 2: Examples. You must include at least 5 examples
of the language (a few lines of code each). The examples should be
different enough to
demonstrate various features of the language. You should explain
briefly what's the result of the "program" in each of the cases.
- different syntax for different entities in the language
(for instance, logical laws might start with a capital letter whereas
propositional variables are lower case),
- special characters may be convenient to use to distinguish
different language elements.
When writing examples, make sure that the language is clear, easy to
understand, and suitable for the intended users. If it's not, then you
should change the syntax.
Things you don't need to worry about at this project stage:
- Implementation. Don't hesitate to include features that
may be difficult to implement: our focus is on language development
and processing, not on implementation. You don't need to think about
data structures and other details. This will be the focus of a
- Syntax error reporting. Don't worry (yet) about the error
messages that will be printed if the program is incorrect.