I need the solution before Dec. 21
you will find a directory containing a human-readable version of a
programming language grammar and a Lex/Yacc description of it. (For
those not familiar with this, Lex is a lexical analyzer generator and
Yacc is a parser generator. I actually used the mostly-compatible
Flex and Bison.) The result is a C language program (with some
minimal work this can be turned into C++, but that is not very
important at this point) that you can compile, which will parse
correct programs and try to produce meaningful errors (not too
successfully) for incorrect programs. See the Makefile for details of
compilation and README for some additional information.
The programming language is vaguely high-level, with tuples/lists and
sets as first-order objects.
The description of the language is however not complete, since several
important design choices are left unspecified (consider the grammar
and the lexical structure of the language fixed at this point).
Consider the following list of features (to be checked and updated
ASAP):
TBA TBA TBA TBA TBA TBA TBA TBA TBA TBA
pointer vs. value semantics for assignment
mutability of the objects that get constructed
TBA TBA TBA TBA TBA TBA TBA TBA TBA TBA
Pick XX of the choices from the above list and name YY other important
choices that have to be made by the language designers to fully
specify the language. For each choice:
* -- describe in words what the choice is (mention a standard term
for it, if it exists)
* -- give a code snippet IN THE LANGUAGE that would behave
differently for different design choices
* -- suppose the language is NOT typeless. Design a type
system for the language: what types are permited, what
operations are applicable to what types and what are the
types of the results etc. Describe additional syntactic
structure to specify types (e.g., via adding declarations, if
they are needed in your design). Describe (semi-formally, or
formally) the rules of type checking in your version of the
language
** -- modify the parser to do static semantic checking (or type
deduction, if you want a challenge)
*** -- implement an interpreter for most of the language (a
translator to another high level language is also a
possibility)
you can find a directory here
http ://cis.poly.edu/~aronov/cs637-fall2004/parser
at least you have to get the * and ** parts to work |