DrAST - An attribute debugger for JastAdd

University essay from Lunds universitet/Institutionen för datavetenskap

Abstract: Here we present a solution for debugging compilers that use abstract-syntax trees as their internal structure. The solution focuses on capturing one specific state of the compilation process, and should not be confused with the more known step-by-step debugging. The goal is to visualize the current state of the abstract-syntax tree and present its data to the user in an intuitive and interactive way. We believe that deeper understanding of an abstract-syntax tree, and bugs in its structure, can be achieved by visualization of the tree. Few such debuggers exist today however, but with this master thesis we aim to fill this gap. The main feature of the developed tool DrAST is the ability to visualize the abstract-syntax tree. It is also possible to filter the tree, so that only nodes of interest are visualized, while the rest are gathered in what we call clusters. Further, DrAST can display attributes, draw references between nodes, calculate parameterized attributes and is built for further extension. DrAST mainly debugs compilers created in the attribute-grammar-based system JastAdd. By the use of Java reflection and annotations from the JastAdd system, the debugger is able to extract the abstract-syntax tree from a compiler without knowing the specific grammar. In short, DrAST provides a new solution in compiler debugging which can be of use for both students and professionals.

  AT THIS PAGE YOU CAN DOWNLOAD THE WHOLE ESSAY. (follow the link to the next page)