Incremental context-dependent analysis for language-based editors

T Reps, T Teitelbaum, A Demers - ACM Transactions on Programming …, 1983 - dl.acm.org
T Reps, T Teitelbaum, A Demers
ACM Transactions on Programming Languages and Systems (TOPLAS), 1983dl.acm.org
Knowledge of a programming language's grammar allows language-based editors to
enforce syntactic correctness at all times during development by restricting editing
operations to legitimate modifications ot~ the program's context-free derivation tree;
however, not all language constraints can be enforced in this way because not all features
can be described by the context-free formalism. Attribute grammars permit context-
dependent language features to be expressed in a modular, declarative fashion and thus …
Knowledge of a programming language's grammar allows language-based editors to enforce syntactic correctness at all times during development by restricting editing operations to legitimate modifications ot~ the program's context-free derivation tree; however, not all language constraints can be enforced in this way because not all features can be described by the context-free formalism. Attribute grammars permit context-dependent language features to be expressed in a modular, declarative fashion and thus are a good basis for specifying language-based editors. Such editors represent programs as attributed trees, Which are modified by operations such as subtree pruning and grafting. Incremental analysis is performed by updating attribute values after every modification. This paper discusses how updating can be carried out and presents several algorithms for the task, including one that is asymptotically optimal in time.
ACM Digital Library