100 likes | 226 Vues
This document dives into type checking, conversion, coercion, and method overloading in various programming languages. It highlights how overloaded identifiers can link to multiple semantic entities within the same scope, using examples from Pascal, Fortran, PL/I, and Ada. The challenges of implementing overloaded identifiers are discussed, including the need for unique meanings through context and operator handling. Additionally, the concepts of polymorphism and overriding in Java are explored, culminating with a summary of key issues necessary for implementing a type checker.
E N D
Conversion and Coercion Int C; A = 1.5 + C;
Overloading An id binds to >1 semantic entity in same scope Pascal: f = f + 1 Fortran/PL1: + int or real addition Ada: A(i) Many languages: function decls with different parameter numbers/types Why? What are the challenges in implementing overloaded id’s?
Resolving overloaded symbols • Determine unique meaning – use context • Operators (non-ids) • Ids
Type Checking Summary Exercise: With a partner, Outline the main issues you need to know to implement a type checker.