CONTROLLED GRAMMATIC AMBIGUITY

Authors
Citation
M. Thorup, CONTROLLED GRAMMATIC AMBIGUITY, ACM transactions on programming languages and systems, 16(3), 1994, pp. 1024-1050
Citations number
28
Categorie Soggetti
Computer Sciences","Computer Science Software Graphycs Programming
ISSN journal
01640925
Volume
16
Issue
3
Year of publication
1994
Pages
1024 - 1050
Database
ISI
SICI code
0164-0925(1994)16:3<1024:CGA>2.0.ZU;2-C
Abstract
A new approach to ambiguity of context-free grammars is presented, and within this approach the LL and LR techniques are generalized to solv e the following problems for large classes of ambiguous grammars: Cons truction of a parser that accepts all sentences generated by the gramm ar, and which always terminates in linear time. Identification of the structural ambiguity: a finite set of pairs of partial parse trees is constructed; if for each pair the two partial parse trees are semantic ally equivalent, the ambiguity of the grammar is semantically irreleva nt. The user may control the parser generation so as to get a parser w hich finds some specific parse trees for the sentences. The generalize d LL and LR techniques will still guarantee that the resulting parser accepts all sentences and terminates in linear time on all input.