Modeling and Implementation of Visibility in Programming Languages

Phillip Edward Garrison

EECS Department
University of California, Berkeley
Technical Report No. UCB/CSD-88-400
December 1987

http://www2.eecs.berkeley.edu/Pubs/TechRpts/1988/CSD-88-400.pdf

The term visibility control refers to the use of names in programming languages. A binding of a name and an entity results from a declaration. A binding is visible where the name can be used to reference the entity. The visibility rules of a language define how names may be used in that language, how to determine which declaration is denoted by a reference anywhere in a program, and the meaning of multiple declarations of the same name.

Existing approaches to modeling visibility rules are not powerful enough to model the wide variety of visibility features present in modern programming languages. The Inheritance Graph Model, presented in this dissertation, is a natural and general model of visibility that embodies the fundamental concepts of visibility. Because the Inheritance Graph Model is based on fundamental concepts, it is easy to represent the visibility structure of a wide variety of languages and visibility features in a straightforward manner. These fundamental concepts were developed on the basis of a comprehensive survey and analysis of the visibility features used in programming languages.

The visibility structure of a program is represented by an inheritance graph. A vertex in the graph represents a uniform referencing environment (a contour). Multiple visibility classes can be used to explicitly represent different kinds of visibility in the graph. An edge in the graph represents inheritance of visibility of bindings with a specific visibility class from one vertex to another. Inheritance of visibility of bindings via an edge can be restricted depending on attributes of each binding or on the program construct represented by the edge. A general mechanism for detecting errors and specifying shadowing of bindings declared in enclosing scopes is also provided. An implementation based on data flow analysis techniques can be generated automatically from a specification of the inheritance graph for a language.

The study of visibility features and their precise meanings exposed several subtle complexities in the visibility rules of popular languages. Among these is the requirement in Pascal that a declaration precede all references to the declaration. This requirement provides few benefits, and results in visibility rules that are difficult to understand, specify, and implement correctly.

Advisor: Susan L. Graham


BibTeX citation:

@phdthesis{Garrison:CSD-88-400,
    Author = {Garrison, Phillip Edward},
    Title = {Modeling and Implementation of Visibility in Programming Languages},
    School = {EECS Department, University of California, Berkeley},
    Year = {1987},
    Month = {Dec},
    URL = {http://www2.eecs.berkeley.edu/Pubs/TechRpts/1987/5871.html},
    Number = {UCB/CSD-88-400},
    Abstract = {The term visibility control refers to the use of names in programming languages.  A binding of a name and an entity results from a declaration.  A binding is visible where the name can be used to reference the entity.  The visibility rules of a language define how names may be used in that language, how to determine which declaration is denoted by a reference anywhere in a program, and the meaning of multiple declarations of the same name. <p>Existing approaches to modeling visibility rules are not powerful enough to model the wide variety of visibility features present in modern programming languages.  The Inheritance Graph Model, presented in this dissertation, is a natural and general model of visibility that embodies the fundamental concepts of visibility.  Because the Inheritance Graph Model is based on fundamental concepts, it is easy to represent the visibility structure of a wide variety of languages and visibility features in a straightforward manner.  These fundamental concepts were developed on the basis of a comprehensive survey and analysis of the visibility features used in programming languages. <p>The visibility structure of a program is represented by an inheritance graph.  A vertex in the graph represents a uniform referencing environment (a contour).  Multiple visibility classes can be used to explicitly represent different kinds of visibility in the graph.  An edge in the graph represents inheritance of visibility of bindings with a specific visibility class from one vertex to another. Inheritance of visibility of bindings via an edge can be restricted depending on attributes of each binding or on the program construct represented by the edge.  A general mechanism for detecting errors and specifying shadowing of bindings declared in enclosing scopes is also provided.  An implementation based on data flow analysis techniques can be generated automatically from a specification of the inheritance graph for a language.  <p>The study of visibility features and their precise meanings exposed several subtle complexities in the visibility rules of popular languages.  Among these is the requirement in Pascal that a declaration precede all references to the declaration.  This requirement provides few benefits, and results in visibility rules that are difficult to understand, specify, and implement correctly.}
}

EndNote citation:

%0 Thesis
%A Garrison, Phillip Edward
%T Modeling and Implementation of Visibility in Programming Languages
%I EECS Department, University of California, Berkeley
%D 1987
%@ UCB/CSD-88-400
%U http://www2.eecs.berkeley.edu/Pubs/TechRpts/1987/5871.html
%F Garrison:CSD-88-400