Skip to main content

Declarative Name Binding and Scope Rules

  • Conference paper
Software Language Engineering (SLE 2012)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 7745))

Included in the following conference series:

Abstract

In textual software languages, names are used to reference elements like variables, methods, classes, etc. Name resolution analyses these names in order to establish references between definition and use sites of elements. In this paper, we identify recurring patterns for name bindings in programming languages and introduce a declarative metalanguage for the specification of name bindings in terms of namespaces, definition sites, use sites, and scopes. Based on such declarative name binding specifications, we provide a language-parametric algorithm for static name resolution during compile-time. We discuss the integration of the algorithm into the Spoofax Language Workbench and show how its results can be employed in semantic editor services like reference resolution, constraint checking, and content completion.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Standard ECMA-334 C# language specification, 4th edn (2006)

    Google ScholarĀ 

  2. ƅkesson, J., Ekman, T., Hedin, G.: Implementation of a Modelica compiler using JastAdd attribute grammars. Science of Computer ProgrammingĀ 75(1-2), 21ā€“38 (2010)

    ArticleĀ  MathSciNetĀ  MATHĀ  Google ScholarĀ 

  3. Bravenboer, M., van Dam, A., Olmos, K., Visser, E.: Program transformation with scoped dynamic rewrite rules. Fundamenta InformaticaeĀ 69(1-2), 123ā€“178 (2006)

    MathSciNetĀ  MATHĀ  Google ScholarĀ 

  4. BĆ¼rger, C., Karol, S., Wende, C., AƟmann, U.: Reference Attribute Grammars for Metamodel Semantics. In: Malloy, B., Staab, S., van den Brand, M. (eds.) SLE 2010. LNCS, vol.Ā 6563, pp. 22ā€“41. Springer, Heidelberg (2011)

    ChapterĀ  Google ScholarĀ 

  5. Ekman, T., Hedin, G.: The JastAdd extensible Java compiler. In: Gabriel, R.P., Bacon, D.F., Lopes, C.V. (eds.) Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA 2007, pp. 1ā€“18. ACM (2007)

    Google ScholarĀ 

  6. Eysholdt, M., Behrens, H.: Xtext: implement your language faster than the quick and dirty way. In: Int. Conference Companion on Object Oriented Programming Systems Languages and Applications Companion, pp. 307ā€“309. ACM (2010)

    Google ScholarĀ 

  7. Hedin, G.: An Introductory Tutorial on JastAdd Attribute Grammars. In: Fernandes, J.M., LƤmmel, R., Visser, J., Saraiva, J. (eds.) GTTSE 2009. LNCS, vol.Ā 6491, pp. 166ā€“200. Springer, Heidelberg (2011)

    ChapterĀ  Google ScholarĀ 

  8. Heidenreich, F., Johannes, J., Karol, S., Seifert, M., Wende, C.: Derivation and Refinement of Textual Syntax for Models. In: Paige, R.F., Hartman, A., Rensink, A. (eds.) ECMDA-FA 2009. LNCS, vol.Ā 5562, pp. 114ā€“129. Springer, Heidelberg (2009)

    ChapterĀ  Google ScholarĀ 

  9. Heidenreich, F., Johannes, J., Reimann, J., Seifert, M., Wende, C., Werner, C., Wilke, C., AĀ§mann, U.: Model-driven modernisation of java programs with jamopp. In: Joint Proceedings of MDSM 2011 and SQM 2011. CEUR Workshop Proceedings, pp. 8ā€“11 (March 2011)

    Google ScholarĀ 

  10. Hemel, Z., Groenewegen, D.M., Kats, L.C.L., Visser, E.: Static consistency checking of web applications with WebDSL. Journal of Symbolic ComputationĀ 46(2), 150ā€“182 (2011)

    ArticleĀ  MATHĀ  Google ScholarĀ 

  11. Hemel, Z., Kats, L.C.L., Groenewegen, D.M., Visser, E.: Code generation by model transformation: a case study in transformation modularity. Software and Systems ModelingĀ 9(3), 375ā€“402 (2010)

    ArticleĀ  Google ScholarĀ 

  12. Hemel, Z., Visser, E.: Declaratively programming the mobile web with mobl. In: Fisher, K., Lopes, C.V. (eds.) 2011 Int. Conference on Object Oriented Programming Systems Languages and Applications, OOPSLA 2011, pp. 695ā€“712. ACM (2011)

    Google ScholarĀ 

  13. Kastens, U., Waite, W.M.: Modularity and reusability in attribute grammars. Acta Inf.Ā 31(7), 601ā€“627 (1994)

    ArticleĀ  MATHĀ  Google ScholarĀ 

  14. Kats, L.C.L., Visser, E.: The Spoofax language workbench: rules for declarative specification of languages and IDEs. In: Cook, W.R., Clarke, S., Rinard, M.C. (eds.) Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA 2010, pp. 444ā€“463. ACM (2010)

    Google ScholarĀ 

  15. Kats, L.C.L., Visser, E., Wachsmuth, G.: Pure and declarative syntax definition: paradise lost and regained. In: Cook, W.R., Clarke, S., Rinard, M.C. (eds.) Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA 2010, pp. 918ā€“932. ACM (2010)

    Google ScholarĀ 

  16. Knuth, D.E.: Semantics of context-free languages. Theory Comput. Syst.Ā 2(2), 127ā€“145 (1968)

    MathSciNetĀ  MATHĀ  Google ScholarĀ 

  17. Meyer, J., Downing, T.: Java Virtual Machine. O Reilly (1997)

    Google ScholarĀ 

  18. Object Management Group: Human Usable Textual Notation Specification (2004)

    Google ScholarĀ 

  19. Object Management Group: Object Constraint Language, 2.3.1 edn. (2012)

    Google ScholarĀ 

  20. Odersky, M.: Defining context-dependent syntax without using contexts. Transactions on Programming Languages and SystemsĀ 15(3), 535ā€“562 (1993)

    ArticleĀ  Google ScholarĀ 

  21. Poetzsch-Heffter, A.: Logic-based specification of visibility rules. In: PLILP, pp. 63ā€“74 (1991)

    Google ScholarĀ 

  22. Poetzsch-Heffter, A.: Implementing High-Level Identification Specifications. In: Pfahler, P., Kastens, U. (eds.) CC 1992. LNCS, vol.Ā 641, pp. 59ā€“65. Springer, Heidelberg (1992)

    ChapterĀ  Google ScholarĀ 

  23. Steinberg, D., Budinsky, F., Paternostro, M., Merks, E.: Eclipse Modeling Framework, 2nd edn. Addison-Wesley (2009)

    Google ScholarĀ 

  24. Visser, E.: Syntax Definition for Language Prototyping. Ph.D. thesis, University of Amsterdam (September 1997)

    Google ScholarĀ 

  25. Visser, E.: Program Transformation with Stratego/XT. In: Lengauer, C., Batory, D., Blum, A., Odersky, M. (eds.) Domain-Specific Program Generation. LNCS, vol.Ā 3016, pp. 216ā€“238. Springer, Heidelberg (2004)

    ChapterĀ  Google ScholarĀ 

  26. Van Wyk, E., Bodin, D., Gao, J., Krishnan, L.: Silver: An extensible attribute grammar system. Science of Computer ProgrammingĀ 75(1-2), 39ā€“54 (2010)

    ArticleĀ  MathSciNetĀ  MATHĀ  Google ScholarĀ 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

Ā© 2013 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Konat, G., Kats, L., Wachsmuth, G., Visser, E. (2013). Declarative Name Binding and Scope Rules. In: Czarnecki, K., Hedin, G. (eds) Software Language Engineering. SLE 2012. Lecture Notes in Computer Science, vol 7745. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-36089-3_18

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-36089-3_18

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-36088-6

  • Online ISBN: 978-3-642-36089-3

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics