New Features of Eli Version 4.5
Type analysis is complex, even for simple languages, but it is based
upon a number of language-independent concepts.
The type analysis of source text in a particular language can be described
in terms of those concepts, by identifying constructs playing specific
roles in the type system of that language.
Once that identification has been made, most of the code required to carry
out the analysis can be deduced automatically.
We have added attribution modules to Eli that are sufficient to describe
most type analysis problems in a straightforward manner
(see Overview of Type Analysis Reference Manual).
These modules support language concepts such as the following:
-
language- and user-defined types
-
name or structural equivalence of types
-
language- and user-defined operators, procedures, and methods
-
expressions with coercion, explicit type conversion, and overloaded operators
They encapsulate the necessary computations and the dependence
relationships among them, and export a nomenclature for language
constructs.
Type analyzer code for a particular compiler can be created by
instantiating the appropriate modules and then classifying the constructs
of the given source language according to that scheme.
For example, after instantiating the Expression module, all of the
code needed to analyze an infix operator with two operands can be obtained
by classifying the appropriate abstract syntax rule as a
DyadicContext .
For a tutorial on the use of the new modules,
see Overview of Tutorial on Type Analysis.
|