An Attribute Grammar Evaluator in Haskell

A tool that enablesHaskell functionsto be automaticallyderivedfrom attributegrammar definitionsis presented. Basedon work in [Joh87],it is able to dealwith generalattributegrammars, providedthe datadependenciescan be resolvedunder lazy evaluation.The tool takesthe form of a pre-processor, taking attribute grammarspecificationsand producingHaskell that can be compiled through the preferred compilation route. The paper includes a brief introduction to attribute grammars,why they are useful in the implementationof certain types of problems,and how the evaluatorcan generatenative Haskell codefrom their specifications.Examplesare usedthroughout, andexecutablescriptsareprovidedasanappendix.