Skip to content

Latest commit

 

History

History
12 lines (7 loc) · 2.8 KB

synopsis.md

File metadata and controls

12 lines (7 loc) · 2.8 KB

>> Title << >> Synopsis << >> Contents << >> API Index <<


RACR Synopsis

RACR is a Scheme Library for Reference Attribute Grammar Controlled Rewriting. It supports incremental attribute evaluation in the presence of arbitrary abstract syntax tree rewrites. It provides a set of functions that can be used to specify abstract syntax tree schemes and their attribution and construct respective trees, query their attributes and node information and annotate and rewrite them. Thereby, both, reference attribute grammars and rewriting, are seamlessly integrated, such that rewrites can reuse attributes and attribute values change depending on performed rewrites -– a technique we call Reference Attribute Grammar Controlled Rewriting. To reevaluate attributes influenced by abstract syntax tree rewrites, a demand-driven, incremental evaluation strategy, which incorporates the actual execution paths selected at runtime for control-flows within attribute equations, is used. To realise this strategy, a dynamic attribute dependency graph is constructed throughout attribute evaluation –- a technique we call Dynamic Attribute Dependency Analyses.

Besides synthesised and inherited attributes, RACR supports reference, parameterised and circular attributes, attribute broadcasting and abstract syntax tree and attribute inheritance. RACR also supports graph pattern matching to ease the specification of complex rewires, whereas patterns can reuse attributes for rewrite conditions such that complex analyses that control rewriting can be specified. Similarly to attribute values, tests for pattern matches are incrementally evaluated and automatically cached. Further, linear pattern matching complexity is guaranteed if involved attributes are already evaluated. Thus, the main drawback of graph rewriting, the matching problem of polynomial complexity for bounded pattern sizes, is attenuated.

Since RACR is an ordinary Scheme library, its functions can arbitrarily interact with Scheme programs and vice versa. To implement attribute equations and rewrites, users reuse or develop ordinary Scheme functions with arbitrary control-flows, function calls, macro expansions and continuations. The required bookkeeping for incremental attribute evaluation is transparently and automatically performed by RACR and cannot be bypassed or disturbed.

This reference manual documents RACR's features, instantiation and usage. It summarises and exemplifies RACR's application programming interface. The Implementation of reference attribute grammar controlled rewriting or dynamic attribute dependency analyses is not discussed. Readers should be comfortable with Scheme; This reference manual is not a Scheme introduction!