Advertisement

Acta Informatica

, Volume 25, Issue 2, pp 155–178 | Cite as

Incremental evaluation for attribute grammars with unrestricted movement between tree modifications

  • Thomas Reps
Article

Summary

This paper concerns the design of editors that perform checks on a language's context-dependent constraints. Our particular concern is the design of an efficient, incremental analysis algorithm for systems based on the attribute-grammar model of editing. With previous incremental evaluation algorithms for arbitrary noncircular attribute grammars, the editing model required there to be a restriction on the operation that moves the editing cursor: moving the cursor was limited to just a single step in the tree — either to the parent node or to one of the child nodes of the current cursor location. This paper describes a new updating algorithm that can be used when an arbitrary movement of the cursor in the tree is permitted. After an operation that restructures the tree, the tree's attributes can be updated with a cost of 0 ((1+¦AFFECTED¦)·√m), where m is the size of the tree and AFFECTED is the subset of the tree's attributes that require new values, when the cost is amortized over a sequence of tree modifications. the editing cursor may be moved from its current location to any other node of the tree in a single, unit-cost operation. CR Categories and Subject Descriptors: D.2.3 [Software Engineering]: Coding — program editors; D.2.6 [Software Engineering]: Programming Environments; D.3.1 [Programming Languages]: Formal Definitions and Theory — semantics, syntax D.3.4 [Programming Languages]: Processors — translator writing systems and compiler generators F.3.2 [Logics and Meanings of Programs]: Semantics of Programming Languages — denotational semantics.

Keywords

Tree Modification Program Language Writing System Incremental Evaluation Incremental Analysis 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Demers, A., Reps, T., Teitelbaum, T.: Incremental evaluation for attribute grammars with application to syntax-directed editors. In Conference Record of the Eighth ACM Symposium on Principles of Programming Languages, Williamsburg, Va., Jan. 26–28, 1981, pp. 105–116Google Scholar
  2. 2.
    Demers, A., Rogers, A., Zadeck, F.K.: Attribute propagation by message passing. In: Conference Record of the ACM SIGPLAN 85 Symposium on Language Issues in Programming Environments, Seattle, WA, June 25–28, 1985. SIGPLAN Notices 20, 43–59 (1985)Google Scholar
  3. 3.
    Hoover, R.: Dynamically bypassing copy rule chains in attribute grammars. In: Conference Record of the Thirteenth ACM Symposium on Principles of Programming Languages, St. Petersburg, FL, Jan. 13–15, 1986, pp. 14–25Google Scholar
  4. 4.
    Johnson, G.F., Fischer, C.N.: A meta-language and system for nonlocal incremental attribute evaluation in language-based editors. In Conference Record of the Twelfth ACM Symposium on Principles of Programming Languages, New Orleans, La., Jan. 14–16, 1985, pp. 141–151Google Scholar
  5. 5.
    Kastens, U.: Ordered attribute grammars. Acta Inf. 13, 229–256 (1980)MathSciNetCrossRefGoogle Scholar
  6. 6.
    Knuth, D.E.: Semantics of context-free languages. Math. Syst. Theory 2, 127–145 (1968) (Correction, ibid. 5, 1 (Mar 1971, 95–96)MathSciNetCrossRefGoogle Scholar
  7. 7.
    Reps, T.: Optimal-time incremental semantic analysis for syntax-directed editors. In: Conference Record of the Ninth ACM Symposium on Principles of Programming Languages, Albuquerque, N.M., Jan. 25–27, 1982, pp. 169–176Google Scholar
  8. 8.
    Reps, T.: Generating language-based environments. Cambridge, MA: M.I.T. Press 1984zbMATHGoogle Scholar
  9. 9.
    Reps, T., Teitelbaum, T., Demers, A.: Incremental context-dependent analysis for language-based editors. ACM Trans. Program. Lang. Syst. 5, 449–477 (1983)CrossRefGoogle Scholar
  10. 10.
    Reps, T., Marceau, C., Teitelbaum, T.: Remote attribute updating for language-based editors. In: Conference Record of the 13th ACM Symposium on Principles of Programming Languages, St. Petersburg, Fla., Jan. 13–15, 1986, pp.1–13Google Scholar
  11. 11.
    Reps, T., Demers, A.: Sublinear-space evaluation algorithms for attribute grammars. ACM Trans. Program. Lang. Syst. 9, 408–440 (1987)CrossRefGoogle Scholar
  12. 12.
    Reps, T., Teitelbaum, T.: The Synthesizer Generator. In: Proceedings of the ACM SIGSOFT/SIGPLAN Software Engineering Symposium on Practical Software Development Environments, Pittsburgh, Penn., Apr. 23–25, 1984. Appeared as joint issue: SIGPLAN Notices (ACM) 19, 42–48 1984, and Soft. Eng. Notes (ACM) 9, 42–48 1984Google Scholar
  13. 13.
    Reps, T., Teitelbaum, T.: The Synthesizer Generator reference manual. Tech. Rep. 84-619, Dept. of Computer Science, Cornell Univ., Ithaca, NY, 1985 (Second edition), 1987zbMATHGoogle Scholar
  14. 14.
    Tarjan, R.E.: Data Structures and Network Algorithms. Society for Industrial and Applied Mathematics, Philadelphia, PA, 1983CrossRefGoogle Scholar
  15. 15.
    Tsakalidis, A.K.: Maintaining order in a generalized linked list. Acta Inf. 21, 101–112 (1984)MathSciNetCrossRefGoogle Scholar
  16. 16.
    Yeh, D.: On incremental evaluation of ordered attributed grammars. BIT 23, 308–320 (1983)MathSciNetCrossRefGoogle Scholar

Copyright information

© Springer-Verlag 1988

Authors and Affiliations

  • Thomas Reps
    • 1
  1. 1.Computer Sciences DepartmentUniversity of WisconsinMadisonUSA

Personalised recommendations