DrAST: An Inspection Tool for Attributed Syntax Trees (Tool Demo)
Channel: SPLASH2016
Date: 2016-11-15

When implementing a language by means of attribute grammars, it is often useful to study example programs and their attributed trees, to understand the compiler structure, or for debugging. DrAST is a tool that allows interactive inspection of attributed trees. It is interfaced to the JastAdd metacompiler, and supports all JastAdd attribution mechanisms, such as demand evaluation, reference attributes (graph edges), and nonterminal attributes. A challenge in visualizing attributed trees is that they are large, even for small programs. To allow the user to focus on the aspects of interest, DrAST supports the interactive definition of filtered versions of the tree through a domain-specific language which allows conditional filtering based on the attributes themselves. We have used DrAST on a variety of language implementations, from tiny compilers used in teaching to a complete Java compiler.