Using Spoofax to Support Online Code Navigation

Author Peter D. Mosses

Thumbnail PDF


  • Filesize: 2.26 MB
  • 12 pages

Document Identifiers

Author Details

Peter D. Mosses
  • Delft University of Technology, The Netherlands
  • Swansea University, UK


Eelco Visser (1966–2022) was a visionary leader. For more than two decades, I have benefited greatly from reading his persuasive publications, listening to his animated presentations, and discussing topics of common interest with him - especially modular language specification. Since 2012, I have also been an enthusiastic user of the Spoofax language workbench, developed by Eelco and his Programming Languages group at TU Delft. This paper reports on some work that I carried out as a visitor at TU Delft since 2016. I am grateful to the reviewers of a previous version for helpful comments and suggestions.

Cite AsGet BibTex

Peter D. Mosses. Using Spoofax to Support Online Code Navigation. In Eelco Visser Commemorative Symposium (EVCS 2023). Open Access Series in Informatics (OASIcs), Volume 109, pp. 21:1-21:12, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2023)


Spoofax is a language workbench. A Spoofax language specification generally includes name resolution: the analysis of bindings between definitions and references. When browsing code in the specified language using Spoofax, the bindings appear as hyperlinks, supporting precise name-based code navigation. However, Spoofax cannot be used for browsing code in online repositories. This paper is about a toolchain that uses Spoofax to generate hyperlinked twins of code repositories. These generated artefacts support the same precise code navigation as Spoofax, and can be browsed online. The technique has been prototyped on the CBS (Component-Based Semantics) specification language developed by the PLanCompS project, but could be used on any language after specifying its name resolution in Spoofax.

Subject Classification

ACM Subject Classification
  • Information systems → Web interfaces
  • Software and its engineering → Integrated and visual development environments
  • Software and its engineering → Development frameworks and environments
  • Spoofax language workbench
  • name resolution
  • precise code navigation


  • Access Statistics
  • Total Accesses (updated on a weekly basis)
    PDF Downloads


  1. CBS-beta. A framework and meta-language for component-based specification of programming languages, accessed 2023-01-30. URL:
  2. CBS-LaTeX. A LaTeX package for CBS specifications, accessed 2023-01-30. URL:
  3. Martin Churchill, Peter D. Mosses, Neil Sculthorpe, and Paolo Torrini. Reusable components of semantic specifications. LNCS Trans. Aspect Oriented Softw. Dev., 12:132-179, 2015. URL:
  4. Douglas Creager. Introducing stack graphs. GitHub Blog, 2021. URL:
  5. Damian Frölich and L. Thomas van Binsbergen. iCoLa: A compositional meta-language with support for incremental language development. In Bernd Fischer, Lola Burgueño, and Walter Cazzola, editors, Proceedings of the 15th ACM SIGPLAN International Conference on Software Language Engineering, SLE 2022, Auckland, New Zealand, December 6-7, 2022, pages 202-215. ACM, 2022. URL:
  6. Jekyll. A static site generator, accessed 2023-01-30. URL:
  7. KaTeX. A math typesetting library for the web, accessed 2023-01-30. URL:
  8. Lennart C. L. Kats and Eelco Visser. The Spoofax language workbench. In William R. Cook, Siobhán Clarke, and Martin C. Rinard, editors, Companion to the 25th Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA 2010, October 17-21, 2010, Reno/Tahoe, Nevada, USA, pages 237-238. ACM, 2010. URL:
  9. Casey Klein, John Clements, Christos Dimoulas, Carl Eastlund, Matthias Felleisen, Matthew Flatt, Jay A. McCarthy, Jon Rafkind, Sam Tobin-Hochstadt, and Robert Bruce Findler. Run your research: on the effectiveness of lightweight mechanization. In John Field and Michael Hicks, editors, Proceedings of the 39th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2012, Philadelphia, Pennsylvania, USA, January 22-28, 2012, pages 285-296. ACM, 2012. URL:
  10. Gabriël Konat, Sebastian Erdweg, and Eelco Visser. Bootstrapping domain-specific meta-languages in language workbenches. In Bernd Fischer and Ina Schaefer, editors, Proceedings of the 2016 ACM SIGPLAN International Conference on Generative Programming: Concepts and Experiences, GPCE 2016, Amsterdam, The Netherlands, October 31 - November 1, 2016, pages 47-58. ACM, 2016. URL:
  11. Gabriël D. P. Konat, Lennart C. L. Kats, Guido Wachsmuth, and Eelco Visser. Declarative name binding and scope rules. In Krzysztof Czarnecki and Görel Hedin, editors, Software Language Engineering, 5th International Conference, SLE 2012, Dresden, Germany, September 26-28, 2012, Revised Selected Papers, volume 7745 of Lecture Notes in Computer Science, pages 311-331. Springer, 2012. URL:
  12. kramdown. A library for parsing and converting a superset of Markdown, accessed 2023-01-30. URL:
  13. MathJax. A JavaScript display engine for mathematics, accessed 2023-01-30. URL:
  14. MetaBorg. GitHub organisation, accessed 2023-01-30. URL:
  15. Peter D. Mosses. Modular structural operational semantics. J. Log. Algebraic Methods Program., 60-61:195-228, 2004. URL:
  16. Peter D. Mosses. A component-based formal language workbench. In Rosemary Monahan, Virgile Prevosto, and José Proença, editors, Proceedings Fifth Workshop on Formal Integrated Development Environment, F-IDE@FM 2019, Porto, Portugal, 7th October 2019, volume 310 of EPTCS, pages 29-34, 2019. URL:
  17. Peter D. Mosses. Software meta-language engineering and CBS. J. Comput. Lang., 50:39-48, 2019. URL:
  18. Peter D. Mosses. Fundamental constructs in programming languages. In Tiziana Margaria and Bernhard Steffen, editors, Leveraging Applications of Formal Methods, Verification and Validation - 10th International Symposium on Leveraging Applications of Formal Methods, ISoLA 2021, Rhodes, Greece, October 17-29, 2021, Proceedings, volume 13036 of Lecture Notes in Computer Science, pages 296-321. Springer, 2021. URL:
  19. Pierre Neron, Andrew P. Tolmach, Eelco Visser, and Guido Wachsmuth. A theory of name resolution. In Jan Vitek, editor, Programming Languages and Systems - 24th European Symposium on Programming, ESOP 2015, London, UK, April 11-18, 2015. Proceedings, volume 9032 of Lecture Notes in Computer Science, pages 205-231. Springer, 2015. URL:
  20. Daniël A. A. Pelsmaeker, Hendrik van Antwerpen, and Eelco Visser. Towards language-parametric semantic editor services based on declarative type system specifications. In Alastair F. Donaldson, editor, 33rd European Conference on Object-Oriented Programming, ECOOP 2019, July 15-19, 2019, London, United Kingdom, volume 134 of LIPIcs, pages 26:1-26:18. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2019. URL:
  21. PLanCompS: Programming language components and specifications. Home page, accessed 2023-01-30. URL:
  22. Arjen Rouvoet, Hendrik van Antwerpen, Casper Bach Poulsen, Robbert Krebbers, and Eelco Visser. Knowing when to ask: sound scheduling of name resolution in type checkers derived from declarative specifications. Proc. ACM Program. Lang., 4(OOPSLA):180:1-180:28, 2020. URL:
  23. SCIP Code Intelligence Protocol. Sourcegraph Blog post, accessed 2023-01-30. URL:
  24. spoofax-sunshine. An application for running Spoofax, accessed 2023-01-30. URL:
  25. Hendrik van Antwerpen, Pierre Neron, Andrew P. Tolmach, Eelco Visser, and Guido Wachsmuth. A constraint language for static semantic analysis based on scope graphs. In Martin Erwig and Tiark Rompf, editors, Proceedings of the 2016 ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation, PEPM 2016, St. Petersburg, FL, USA, January 20 - 22, 2016, pages 49-60. ACM, 2016. URL:
  26. Hendrik van Antwerpen, Casper Bach Poulsen, Arjen Rouvoet, and Eelco Visser. Scopes as types. Proc. ACM Program. Lang., 2(OOPSLA):114:1-114:30, 2018. URL:
  27. Hendrik van Antwerpen and Eelco Visser. Scope states: Guarding safety of name resolution in parallel type checkers. In Anders Møller and Manu Sridharan, editors, 35th European Conference on Object-Oriented Programming, ECOOP 2021, July 11-17, 2021, Aarhus, Denmark, volume 194 of LIPIcs, pages 1:1-1:29. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2021. URL:
  28. L. Thomas van Binsbergen, Peter D. Mosses, and Neil Sculthorpe. Executable component-based semantics. J. Log. Algebraic Methods Program., 103:184-212, 2019. URL:
  29. L. Thomas van Binsbergen, Neil Sculthorpe, and Peter D. Mosses. Tool support for component-based semantics. In Lidia Fuentes, Don S. Batory, and Krzysztof Czarnecki, editors, Companion Proceedings of the 15th International Conference on Modularity, Málaga, Spain, March 14 - 18, 2016, pages 8-11. ACM, 2016. URL:
  30. Visual Studio Code: Language server extension guide. Visual Studio Code API, accessed 2023-01-30. URL:
  31. Guido Wachsmuth, Gabriël D. P. Konat, and Eelco Visser. Language design with the Spoofax language workbench. IEEE Softw., 31(5):35-43, 2014. URL:
  32. Philip Wadler, Wen Kokke, and Jeremy G. Siek. Programming Language Foundations in Agda. Online book, August 2022. URL: