Software language design and implementation often involve specifications written in various esoteric meta-languages. Language workbenches generally include support for precise name-based navigation when browsing language specifications locally, but such support is lacking when browsing the same specifications online in code repositories. This paper presents a technique to support precise name-based navigation of language specifications in online repositories using ordinary web browsers. The idea is to generate hyperlinked twins: websites where verbatim copies of specification text are enhanced with hyperlinks between name references and declarations. By generating hyperlinks directly from the name binding analysis used internally in a language workbench, online navigation in hyperlinked twins is automatically consistent with local navigation. The presented technique has been implemented for the Spoofax language workbench, and used to generate hyperlinked twin websites from various language specifications in Spoofax meta-languages. However, the applicability of the technique is not limited to Spoofax, and developers of other language workbenches could presumably implement similar tooling, to make their language specifications more accessible to those who do not have the workbench installed.
翻译:软件语言设计与实现通常涉及以各种深奥的元语言编写的规范。语言工作台通常支持在本地浏览语言规范时进行精确的基于名称的导航,但在代码仓库中在线浏览相同规范时,这种支持却有所欠缺。本文提出了一种技术,支持通过普通网页浏览器在在线仓库中对语言规范进行精确的基于名称的导航。其核心思路是生成超链接孪生网站:在这些网站中,规范文本的逐字副本通过名称引用与声明之间的超链接得到增强。通过直接从语言工作台内部使用的名称绑定分析生成超链接,超链接孪生网站中的在线导航能够自动与本地导航保持一致。该技术已在Spoofax语言工作台中实现,并用于从Spoofax元语言编写的多种语言规范生成超链接孪生网站。然而,该技术的适用性并不局限于Spoofax,其他语言工作台的开发者同样可以开发类似的工具,使得未安装该工作台的用户也能更便捷地访问其语言规范。