Nothing Special   »   [go: up one dir, main page]

skip to main content
article
Open access

Optimal incremental parsing

Published: 01 January 1995 Publication History

Abstract

This communication sets the problem of incremental parsing in the context of a complete incremental compiling system. It turns out that, according to the incrementally paradigm of the attribute evaluator and data-flow analyzer to be used, two definitions of optimal incrementality in a parser are possible. Algorithms for achieving both forms of optimality are given, both of them based on ordinary LALR(1) parse tables. Optimality and correctness proofs, which are merely outlined in this communication, are made intuitive thanks to the concept of a well-formed list of threaded trees, a natural extension of the concept of threaded tree found in earlier works on incremental parsing.

References

[1]
AHo, A., SETHI, R., AND ULLMAN, J. 1986. Compilers: Principles, Techniques and Tools. Addison-Wesley, Reading, Mass.
[2]
ATKINSON, M. AND BUNEMAN, O. 1987. Types and persistence in database programming languages. ACM Comput. Surv. 19, 2 (June), 105-190.
[3]
ATKINSON, M., BANCILHON, F., DEWITT, D., DITTRICH, K., MAIER, D., AND ZDONIK, S. 1989. The object-oriented database system manifesto. In Internatwnal Conference on Deductive and Object-Oriented Databases (Kyoto, Japan).
[4]
BOULLIER, P. 1984. Contribution ~ la Construction Automatique d'Analyseurs Lexicographiques et Syntaxiques. Ph.D. thesis, Univ. d'Orl6ans, France.
[5]
CARROLL, M. D. AND RYDER, B. G. 1988. Incremental data flow analysis via dominator and attribute updates. In Proceedings of the 15th Annual ACM SIGACT-SIGPLAN Symposium on Principles of Programming Languages (San Diego, Calif.). ACM, New York, 274-284.
[6]
CELENTANO, A. 1978. incremental LR parsers. Acta Informatica 10, 4 (Oct.), 307-321.
[7]
COLLINS, B. 1986. The design of a syntax-directed text editor. In EEUG Spr~ng Conference (Florence, Italy). European UNIX Systems User Group, U.K., 52-57.
[8]
DEGANO, P., MANNUCCI, S., AND MOJANA, B. 1988. Efficient incremental LR parsing for syntaxdirected editors. ACM Trans. Program. Lang. Syst. 10, 3 (July), 345-373.
[9]
GHEZZI, C. AND MANDRIOLI, D. 1980. Augmenting parsers to support incrementality. J. ACM 27, 4 (July), 564-579.
[10]
GHEZZI, C. AND MANDRIOLI, D. 1979. Incremental parsing. ACM Trans. Program. Lang. Syst. 1, 1 (July), 58-70.
[11]
HASCOi~T, L. 1987. Transformations Automatiques de specifications s6mantiques. Applications' un v~rificateur de types in incremental. Ph.D. thesis, Univ. de Nice, France.
[12]
JALILI, F. AND GALLIER, J. 1982. Building friendly parsers. In Proceedings of the 9th Annual ACM Symposium on Principles of Programming Languages (Albuquerque, N.M.). ACM, New York, 196-206.
[13]
JOHNSON, G. N. AND FISCHER, C. 1982. Non-syntactic attribute flow in language based editors. In Conference Record of the 9th Annual Symposium on Principles of Programming Languages (Albuquerque, N.M.). ACM, New York, 185-195.
[14]
LARCHEV~QUE, J.-M. 1992a. Compilation techniques for incremental development in a persis-tent object-oriented environment. Ph.D. thesis, LRI, Univ. de Paris-Sud, France.
[15]
LARCHEVI~QUE, J.-M. 1992b. Incremental compilation in 02. In Building an Object-Oriented Database System, the Story of 02. F. Bancilhon, C. Delobel, and P. Kannelakis, Eds. Morgan Kaufmann, San Mateo, Calif.
[16]
MARLOWE, T. J. AND RYDER, B.G. 1990. An efficient hybrid algorithm for incremental data flow analysis. In Conference Record of the Annual ACM Symposium on Principles of Programming Languages (San Francisco, Calif.). ACM, New York, 184-196.
[17]
POLLOCK, L. L. AND SOFFA, M.L. 1989. An incremental version of iterative data flow analysis. IEEE Trans. Softw. Eng. 15, 12 (Dec.), 1537-1549.
[18]
REPS, T., TEITELBAUM, T., AND DEMERS, A. 1983. Incremental context-dependent analysis for language-based editors. ACM Trans. Program. Lang. Syst. 5, 3 (July), 449-477.
[19]
RYDER, B.G. 1982. incremental data flow analysis. In Conference Record of the 9th Annual ACM Symposium on the Principles of Programming Languages (Albuquerque, N.M.). ACM, New York, 167-176.
[20]
SCHWARTZ, M. D., DELISLE, N. M., AND S. BEGWANI, V. 1984. Incremental compilation in Magpie. In Proceedings of the SIGPLAN Symposium on Compiler Construction. SIGPLAN Not. 19, 6 (June), 122-131.
[21]
SHILLING, J. 1986. Incremental 11(1) parsing in language-based editors. Tech. Rep. RC 12772, IBM, Armonk, N.Y.
[22]
SLEATOR, D. D. AND TARJAN, R.E. 1983. A data structure for dynamic trees. J. Comput. Syst. Sci. 26, 362-391.
[23]
WEGMAN, M. 1980. Parsing for structural editors. In FOCS, Annual Symposium on Foundations of Computer Science (Syracuse, N.Y.). pp. 320-327.
[24]
YEH, D. AND KASTENS, U. 1988. Automatic construction of incremental LR(1)-parsers. SIG- PLAN Not. 23, 3 (Mar.), 33-42.
[25]
ZADECK, F. K. 1984. Incremental data flow analysis in a structured program editor. In Proceedings of the SIGPLAN Symposium on Compiler Construction. SIGPLAN Not. 19, 6 (June), 132-143.

Cited By

View all
  • (2019)Pushdown Automata and ParsingFormal Languages and Compilation10.1007/978-3-030-04879-2_4(199-381)Online publication date: 18-Apr-2019
  • (2017)Incremental packrat parsingProceedings of the 10th ACM SIGPLAN International Conference on Software Language Engineering10.1145/3136014.3136022(14-25)Online publication date: 23-Oct-2017
  • (2015)Parallel parsing made practicalScience of Computer Programming10.1016/j.scico.2015.09.002112:P3(195-226)Online publication date: 15-Nov-2015
  • Show More Cited By

Recommendations

Reviews

Frank Lawrence Friedman

The author describes how an incremental parser driven by LALR(1) tables can achieve optimal reuse of internal representations of parsed strings with the same time complexity as an exhaustive parser. Two definitions of optimality are used: maximum node reuse, and minimal subtree substitution in response to substring text substitution. It is shown how an incremental LALR(1) parser can either map a substring to a minimal subtree substitution or maximize node reuse while reparsing after such a substitution. The discussions of the minimal subtree substitution and maximal node reuse mechanisms are based on manipulations of threaded trees, as described in earlier works on incremental parsing. The trees, augmented with attribute values, are viewed as a typical form of parser output usable by other modules of a complete compiling system. The optimality and correctness proof outlines given in the paper are based entirely on the properties of the threaded tree data structure. These trees provide the ability to better see relations between derivations (as relations between threaded trees), which is necessary to describe incremental changes in a natural way. Optimality in the substring-to-subtree mapping assumes the existence of well-formed sentences in all cases, and the proof is based on finding the optimal grafting point using a lazy nearest common ancestor computation. Maximal node reuse is shown to be achievable using the same basic concepts and “essentially the same procedures” as those used for minimal subtree substitution. Algorithm costs are shown to be proportional to the length of the program being analyzed. The author appears to have a good command of the full scope of the literature on the subjects discussed, and goes to reasonable lengths to position the contribution of this paper in light of previous results. Aside from works by the author, there are no citations of papers published between 1991 and 1995.

Access critical reviews of Computing literature here

Become a reviewer for Computing Reviews.

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Transactions on Programming Languages and Systems
ACM Transactions on Programming Languages and Systems  Volume 17, Issue 1
Jan. 1995
179 pages
ISSN:0164-0925
EISSN:1558-4593
DOI:10.1145/200994
Issue’s Table of Contents

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 January 1995
Published in TOPLAS Volume 17, Issue 1

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. incremental parsing
  2. threaded trees

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)101
  • Downloads (Last 6 weeks)8
Reflects downloads up to 14 Dec 2024

Other Metrics

Citations

Cited By

View all
  • (2019)Pushdown Automata and ParsingFormal Languages and Compilation10.1007/978-3-030-04879-2_4(199-381)Online publication date: 18-Apr-2019
  • (2017)Incremental packrat parsingProceedings of the 10th ACM SIGPLAN International Conference on Software Language Engineering10.1145/3136014.3136022(14-25)Online publication date: 23-Oct-2017
  • (2015)Parallel parsing made practicalScience of Computer Programming10.1016/j.scico.2015.09.002112:P3(195-226)Online publication date: 15-Nov-2015
  • (2013)Pushdown Automata and ParsingFormal Languages and Compilation10.1007/978-1-4471-5514-0_4(141-291)Online publication date: 2013
  • (2012)Graph transformations for MDE, adaptation, and models at runtimeProceedings of the 12th international conference on Formal Methods for the Design of Computer, Communication, and Software Systems: formal methods for model-driven engineering10.1007/978-3-642-30982-3_5(137-191)Online publication date: 18-Jun-2012
  • (2005)A Tool for Constructing Syntax-Directed EditorsProceedings of the 12th Asia-Pacific Software Engineering Conference10.1109/APSEC.2005.20(697-704)Online publication date: 15-Dec-2005
  • (2005)Integrating incremental analysis with version managementSoftware Engineering — ESEC '9510.1007/3-540-60406-5_16(205-218)Online publication date: 18-Aug-2005
  • (2004)Incremental validation of XML documentsACM Transactions on Database Systems10.1145/1042046.104205029:4(710-751)Online publication date: 12-Dec-2004
  • (2003)Incremental Validation of XML DocumentsProceedings of the 9th International Conference on Database Theory10.5555/645505.656442(47-63)Online publication date: 8-Jan-2003
  • (2003)Validation of XML Document Updates Based on XML Schema in XML DatabasesDatabase and Expert Systems Applications10.1007/978-3-540-45227-0_11(98-108)Online publication date: 2003
  • Show More Cited By

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Full Access

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media