A Theory of Name Resolution

  • Pierre Neron
  • Andrew Tolmach
  • Eelco Visser
  • Guido Wachsmuth
Conference paper

DOI: 10.1007/978-3-662-46669-8_9

Volume 9032 of the book series Lecture Notes in Computer Science (LNCS)
Cite this paper as:
Neron P., Tolmach A., Visser E., Wachsmuth G. (2015) A Theory of Name Resolution. In: Vitek J. (eds) Programming Languages and Systems. ESOP 2015. Lecture Notes in Computer Science, vol 9032. Springer, Berlin, Heidelberg

Abstract

We describe a language-independent theory for name binding and resolution, suitable for programming languages with complex scoping rules including both lexical scoping and modules. We formulate name resolution as a two-stage problem. First a language-independent scope graph is constructed using language-specific rules from an abstract syntax tree. Then references in the scope graph are resolved to corresponding declarations using a language-independent resolution process. We introduce a resolution calculus as a concise, declarative, and languageindependent specification of name resolution. We develop a resolution algorithm that is sound and complete with respect to the calculus. Based on the resolution calculus we develop language-independent definitions of α-equivalence and rename refactoring. We illustrate the approach using a small example language with modules. In addition, we show how our approach provides a model for a range of name binding patterns in existing languages.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Copyright information

© Springer-Verlag Berlin Heidelberg 2015

Authors and Affiliations

  • Pierre Neron
    • 1
  • Andrew Tolmach
    • 2
  • Eelco Visser
    • 1
  • Guido Wachsmuth
    • 1
  1. 1.Delft University of TechnologyDelftThe Netherlands
  2. 2.Portland State UniversityPortlandUSA