Circular attribute grammars with remote attribute references and their evaluators

Akira Sasaki, Masataka Sassa
2004 New generation computing  
Attribute grammars (AGs) are a suitable formalism for development of language processing systems. However, for languages including unrestricted labeled jumps, like "goto" in C, optimizers in compilers are hard to write in AGs. This is due to two problems which few previous researches could deal with simultaneously, i.e., references of attribute values on distant nodes and circularity in attribute dependency. This paper proposes circular remote attribute grammars (CRAGs), an extension of AGs
more » ... h allows (1) direct relations between two distant attribute instances through pointers referring to other nodes in the derivation tree, and (2) circular dependencies under certain conditions including those which arise from remote references. This extension gives AG programmers a natural way to describe language processors and programming environments for languages including any type of jump structures. We will also show a way to construct an efficient evaluator for CRAGs called a mostly static evaluator. Performance of the proposed evaluator has been measured and compared with dynamic and static evaluators.
doi:10.1007/bf03037280 fatcat:nfznbfklmzhtxh2shqdacbqynm