Project (Frontend)
Reading: The Eli System (Guide For New Eli Users,
Lexical Analysis, Syntactic Analysis, debugging
tools), tutorials within the
local installation of Eli, The TassKaf subset of Java,
and Diehl's Software and Experience article. Diehl's article
describes how the German project to translate TassKaf into Jasmine
was achieved using Flex, Bison, and C code. Our goal is to
translate their solution into one using the Eli tool. In particular,
a major goal will be to translate semantic analysis (e.g. type inference)
and code generation into Eli's attribute grammar tool. Take a look
at the web page for
a Description of the intermediate representation of the Front End. This
describes the fields and structure of the syntax tree. The fields for
jvm type, info, access, and offset are filled in by the backend, and
should not be your concern right now. The type field (e.g., PTvarname, etc.)
should be filled in by the frontend; so should the kids fields (see
the union type).
Examples of abstract syntax trees may be found as follows. Login to
sleepy, and cd to ~biermann/COMP/project1/source. Sample TassKaf programs
are *.tkaf files. Run the frontend and portions of the backend on one
of these examples, for example,
tasskaf < Counter.tkaf
This will produce internal C data and a file tkaf.gdl used for visualization.
To visualize the fully decorated syntax tree (which goes beyond the
frontend, and contains all information needed for backend code
generations), run vcg
xvcg tkaf.gdl
Homework