|Typchecking for modern languages email@example.com (2004-06-26)|
|Re: Typchecking for modern languages firstname.lastname@example.org (2004-06-28)|
|Re: Typchecking for modern languages email@example.com (Hans Aberg) (2004-06-28)|
|Re: Typchecking for modern languages firstname.lastname@example.org (Daniel C. Wang) (2004-06-30)|
|From:||email@example.com (Tom Linden)|
|Date:||28 Jun 2004 20:03:51 -0400|
|Posted-Date:||28 Jun 2004 20:03:51 EDT|
firstname.lastname@example.org (AnthonyGetz) wrote
> I'm looking for books or papers that explain how to implement
> typechecking inside a compiler.
> Typechecking for Pascal is easy... I need to understand how to
> implement typechecking for languages that combine inheritance with
> parametric polymorphism (such as the new proposals for Generic Java
> and Generic C#).
> Any pointers or other help would be appreciated.
You will need a declaration validation phase following the parse phase
which walks the symbol table. For efficient validation techniques see
the declare phase of the Multics PL/I compiler, which uses a bit matrix
ordered both row and column by data-type. The data type in the
symbol node is a bit vector with some bit set according to the data type
of the object. Thus validation is reduced to an & operation of the bit
vector with appropriate rows of the bit matrix as determined by context.
Of course, if your generic types are not statically constrained then you have
an ad hoc language and will have to employ ad hoc techniques.
Return to the
Search the comp.compilers archives again.