christoff-buerger / racr

Metacompiler library supporting incremental transformation based on reference attribute grammar controlled rewriting.
MIT License
30 stars 9 forks source link

RACR-meta: meta instantiation #62

Open christoff-buerger opened 8 years ago

christoff-buerger commented 8 years ago

When using a RACR-based compiler to analyse, compile and apply RACR specifications, the system becomes dependent on itself. As a consequence, attribute evaluation results in non-termination or circular attribute dependencies of non-circular attributes. The runtime extension when an abstract syntax graph representing a specification is queried for information required to evaluate a respective attribute instance is infinite since its analyse queries itself.

This meta-circularity can be broken by means of attribute cache hits. The claim is, that the RACR specification representing RACR specifications (i.e., the meta-language) is correct. It can be manually set-up by imperatively instantiating the abstract syntax tree, attribute instances and their cache values of the meta-language.

This instantiation has not to be complete. It is sufficient if the abstract syntax tree parts and attribute instances required to instantiate and analyse the specification language in itself are pre-configured. If so, the specification language can be properly instantiated using the pre-configured setup, yielding a complete representation. The initial manually setup presentation can be garbage collected afterwards.