TY - GEN
T1 - Profile-based abstraction and analysis of attribute grammar evaluation
AU - Sloane, Anthony M.
PY - 2013
Y1 - 2013
N2 - Attribute grammars enable complex algorithms to be defined on tree and graph structures by declarative equations. An understanding of how the equations cooperate is necessary to gain a proper understanding of an algorithm defined by an attribute grammar. Existing attribute grammar tools and libraries provide little assistance with understanding the behaviour of an attribute evaluator. To do better, we need a way to summarise behaviour in terms of attributes, their values, their relationships, and the structures that are being attributed. A simple approach to program profiling is presented that models program execution as a hierarchy of domain-specific profile records. An abstract event for attribute evaluation is defined and evaluators are modified to collect event instances at run-time and assemble the model. A flexible report writer summarises the event instances along both intrinsic and derived dimensions, including ones defined by the developer. Selecting appropriate dimensions produces reports that expose complex properties of evaluator behaviour in a convenient way. The approach is illustrated and evaluated using the profiler we have built for the Kiama language processing library. We show that the method is both useful and practical.
AB - Attribute grammars enable complex algorithms to be defined on tree and graph structures by declarative equations. An understanding of how the equations cooperate is necessary to gain a proper understanding of an algorithm defined by an attribute grammar. Existing attribute grammar tools and libraries provide little assistance with understanding the behaviour of an attribute evaluator. To do better, we need a way to summarise behaviour in terms of attributes, their values, their relationships, and the structures that are being attributed. A simple approach to program profiling is presented that models program execution as a hierarchy of domain-specific profile records. An abstract event for attribute evaluation is defined and evaluators are modified to collect event instances at run-time and assemble the model. A flexible report writer summarises the event instances along both intrinsic and derived dimensions, including ones defined by the developer. Selecting appropriate dimensions produces reports that expose complex properties of evaluator behaviour in a convenient way. The approach is illustrated and evaluated using the profiler we have built for the Kiama language processing library. We show that the method is both useful and practical.
UR - http://www.scopus.com/inward/record.url?scp=84872710007&partnerID=8YFLogxK
U2 - 10.1007/978-3-642-36089-3_3
DO - 10.1007/978-3-642-36089-3_3
M3 - Conference proceeding contribution
AN - SCOPUS:84872710007
SN - 9783642360886
VL - 7745
T3 - Lecture Notes in Computer Science
SP - 24
EP - 43
BT - Software Language Engineering
A2 - Czarnecki, Krzysztof
A2 - Hedin, Görel
PB - Springer, Springer Nature
CY - Heidelberg
T2 - 5th International Conference on Software Language Engineering, SLE 2012
Y2 - 26 September 2012 through 28 September 2012
ER -