An introductory tutorial on JastAdd attribute grammars

  • Authors:
  • Görel Hedin

  • Affiliations:
  • Lund University, Sweden

  • Venue:
  • GTTSE'09 Proceedings of the 3rd international summer school conference on Generative and transformational techniques in software engineering III
  • Year:
  • 2009

Quantified Score

Hi-index 0.00

Visualization

Abstract

JastAdd is an open-source system for generating compilers and other language-based tools. Its declarative specification language is based on reference attribute grammars and object-orientation. This allows tools to be implemented as composable extensible modules, as exemplified by JastAddJ, a complete extensible Java compiler. This tutorial gives an introduction to JastAdd and its core attribute grammar mechanisms, and how to use them when solving key problems in building language-based tools. A simple state machine language is used as a running example, showing the essence of name analysis, adding graphs to the abstract syntax tree, and computing circular properties like reachability. Exercises are included, and code for the examples is available online.