|
ABSTRACT
A major research goal for compilers and environments is the automatic derivation of tools from formal specifications. However, the formal model of the language is often inadequate; in particular, LR(k) grammars are unable to describe the natural syntax of many languages, such as C++ and Fortran, which are inherently non-deterministic. Designers of batch compilers work around such limitations by combining generated components with ad hoc techniques (for instance, performing partial type and scope analysis in tandem with parsing). Unfortunately, the complexity of incremental systems precludes the use of batch solutions. The inability to generate incremental tools for important languages inhibits the widespread use of language-rich interactive environments.We address this problem by extending the language model itself, introducing a program representation based on parse dags that is suitable for both batch and incremental analysis. Ambiguities unresolved by one stage are retained in this representation until further stages can complete the analysis, even if the reaolution depends on further actions by the user. Representing ambiguity explicitly increases the number and variety of languages that can be analyzed incrementally using existing methods.To create this representation, we have developed an efficient incremental parser for general context-free grammars. Our algorithm combines Tomita's generalized LR parser with reuse of entire subtrees via state-matching. Disambiguation can occur statically, during or after parsing, or during semantic analysis (using existing incremental techniques); program errors that preclude disambiguation retsin multiple interpretations indefinitely. Our representation and analyses gain efficiency by exploiting the local nature of ambiguities: for the SPEC95 C programs, the explicit representation of ambiguity requires only 0.5% additional space and less than 1% additional time during reconstruction.
REFERENCES
Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.
 |
1
|
|
 |
2
|
|
| |
3
|
|
| |
4
|
M. V. Ferro and B. A. Dion. Efficient incremental parsing for context-free languages. In Proc. 1994 IEEE Intl. Conf. Comp. Lang., pages 241-252. IEEE Computer Society Press, May 1994.
|
| |
5
|
Robert Giegerich. Considerate code selection. In Robert Giegerich and Susan L. Graham, editors, Code Generation --Concepts, Tools, Techniques., Workshops in Computing, pages 51-65, Berlin, May 1991. Springer-Verlag.
|
| |
6
|
J. Heering, P. R. H. Hendriks, P. Klint, and J. Rekers. The syntax definition formalism SDF ~ Reference Manual, Dec. 1992.
|
 |
7
|
|
 |
8
|
|
| |
9
|
Mark Johnson. The computational complexity of GLR parsing. In Masaru Tomita, editor, Generalized LR Parsing, pages 35-42. Kluwer Academic Publishers, 1991.
|
| |
10
|
|
| |
11
|
Paul Klint and Eelco Visser Using filters for the disambiguation of context-free grammars. In Proc. ASMICS Workshop on Parsing Theory, Milan, Italy, 1994.
|
 |
12
|
|
| |
13
|
Marc Lankhorst. An empirical comparison of generalized LR tables. In R. Heemels. A. Nijholt, and K. Sikkel, editors, Tomita's Algorithm: Extensions and Applications (TWLT1), number 91-68 of Memoranda Informatica in Twente Workshops on Language Technology, pages 87-93. Universeit Twente, 1991.
|
 |
14
|
|
| |
15
|
Maryellen C. MacDonald, Marcel Adam Just, and Patricia A. Carpenter. Working memory constraints on the processing of syntactic ambiguity. Cog. Psych., 24(1):56-98, 1992.
|
| |
16
|
|
| |
17
|
Akira Miyake, Marcel Adam Just, and Patricia A. Carpenter. Working memory constraints on the resolution of lexical ambiguity: Maintaining multiple interpretations in neutral contexts. J. Memory and Lang., 33(2):175-202, Apr. 1994.
|
| |
18
|
R. Nozohoor-Farshi. GLR parsing for ~-grammars. In Masaru Tomita, editor, Generalized LR Parsing, pages 61- 75. K}uwer Academic Publishers, 1991.
|
| |
19
|
|
| |
20
|
Jan Rekers. Parser Generation for Interactive Environments. Ph.D. dissertation, University of Amsterdam, 1992.
|
| |
21
|
|
| |
22
|
|
| |
23
|
Eelco Visser. A case study in optimizing parsing schemata by disambiguation filters. Technical Report P9507, Programming Research Group, University of Amsterdam, Jul. 1995.
|
| |
24
|
Eelco Visser. Scannerless generalized-LR parsing, 1997. In preparation.
|
 |
25
|
|
| |
26
|
|
| |
27
|
Tim A~ Wagner and Susan L. Graham. Isolating errors--a history-based approach, 1997. In preparation.
|
| |
28
|
|
CITED BY 6
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Robert L. Akers , Ira D. Baxter , Michael Mehlich , Brian J. Ellis , Kenn R. Luecke, Case study: Re-engineering C++ component models via automatic program transformation, Information and Software Technology, v.49 n.3, p.275-291, March, 2007
|
|
|
|
|