Patterns for Name Analysis and Type Analysis with JastAdd

Uwe Meyer,Björn Pfarr
DOI: https://doi.org/10.48550/arXiv.2002.01842
2020-02-05
Programming Languages
Abstract:In the last two decades, tools have been implemented to more formally specify the semantic analysis phase of a compiler instead of relying on handwritten code. In this paper, we introduce patterns and a method to translate a formal definition of a language's type system into a specification for JastAdd, which is one of the aforementioned tools based on Reference Attribute Grammars. This methodological approach will help language designers and compiler engineers to more systematically use such tools for semantic analysis. As an example, we use a simple, yet complete imperative language and provide an outlook on how the method can be extended to cover further language constructs or even type inference.
What problem does this paper attempt to address?