A Case Study in Optimizing Parsing Schemata by Disambiguation Filters

Disambiguation methods for context-free grammars enable concise specification of programming languages by ambiguous grammars. A disambiguation filter is · a function that selects a subset from a set of parse trees­ the possible parse trees for an ambiguous sentence. The framework of filters provides a declarative description of disambiguation methods independent of parsing. Although filters can be implemented straightforwardly as functions that prune the parse forest produced by some generalized parser, this can be too inefficient for practical applications. In this paper the optimization of parsing schemata, a framework for high-level description of parsing algorithms, by disambiguation filters is consider�d in order to find efficient parsing algorithms for declaratively specified dis­ ambiguation methods. As a case study the optimization of the parsing schema of Barley's parsing algorithm by two filters is investigated. The main result is a technique for generation of efficient LR-like parsers for ambiguous grammars disambiguated by means of priorities.

[1]  Franklin L. DeRemer,et al.  Simple LR(k) grammars , 1971, Commun. ACM.

[2]  Stuart M. Shieber,et al.  Principles and Implementation of Deductive Parsing , 1994, J. Log. Program..

[3]  Jay Earley,et al.  An efficient context-free parsing algorithm , 1970, Commun. ACM.

[4]  Leslie Lamport,et al.  How to Write a Proof , 1995 .

[5]  Annika Aasa,et al.  User Defined Syntax , 1992 .

[6]  E. Visser A Family of Syntax Definition Formalisms , 1995 .

[7]  Eelco Visser,et al.  Scannerless Generalized-LR Parsing , 1997 .

[8]  Mikkel Thorup,et al.  Controlled grammatic ambiguity , 1994, TOPL.

[9]  Donald E. Knuth,et al.  On the Translation of Languages from Left to Right , 1965, Inf. Control..

[10]  Klaas Sikkel,et al.  How to compare the structure of parsing algorithms , 1994 .

[11]  Klaas Sikkel,et al.  Parsing Schemata , 1997, Texts in Theoretical Computer Science An EATCS Series.

[12]  Alfred V. Aho,et al.  Deterministic parsing of ambiguous grammars , 1975, Commun. ACM.

[13]  Masaru Tomita,et al.  Efficient Parsing for Natural Language: A Fast Algorithm for Practical Systems , 1985 .

[14]  Paul Klint,et al.  The syntax definition formalism SDF—reference manual— , 1989, SIGP.

[15]  Annika Aasa,et al.  Precedences in Specifications and Implementations of Programming Languages , 1991, Theor. Comput. Sci..

[16]  J. Rekers,et al.  Parser Generation for Interactive Environments , 1992 .

[17]  Jean-Pierre Jouannaud,et al.  On Multiset Orderings , 1982, Inf. Process. Lett..

[18]  Eelco Visser,et al.  Using Filters for the Disambiguation of Context-free Grammars , 1994 .