Tool Paper: AGTix: Concise Use of Scope Graphs in Reference Attribute Grammars
Abstract
This tool paper introduces AGTix, an extension to reference attribute grammars that allows constraints, inspired by Visser et al.'s Statix system, that construct and query scope graphs to be written alongside traditional attribute equations. Previous work has shown that a restricted form of Statix specifications can be translated to an equivalent reference attribute grammar that produces the same results; however, the resulting attribute grammar is quite verbose. In AGTix specifications, the more concise constraints for specifying new scope nodes or edges are translated down to the verbose equations which propagate scope node and edge information up and down the syntax tree. The query constructs for resolving names are translated down to expressions; as in Statix, these include syntax for regular expressions over edge labels that describe the valid paths for a resolution. The scope graphs and query results described by these new constructs can be used in traditional attribute grammar equations for other language processing tasks such as collecting error and warning messages or using variable types to support a translation to another language. AGTix is implemented as an extension to Silver, a full-featured extensible attribute grammar system, and is evaluated by implementing several variations of the LM language introduced by Visser et al.