LL(k) parsing for attributed grammars
We have defined a parser which makes efficient use of the wealth of syntactic information available in the attributes of an attributed grammar. Moreover, we have found that, with contextual predicates, ALL(k) grammars can naturally express context-sensitive syntax, and, with disambiguating predicates, can significantly reduce the size of context-free grammars.
A compiler generator (the Aparse system) based on ALL(k) grammars has now been implemented. In combining the traditional usage of attributed grammars as a method for organizing translations) with their new role as a technique for structuring syntactic analysis, Aparse has been found to be a system of considerable flexibility and power ([MKR 79]).
KeywordsInput String Derivation Tree Terminal Symbol Attribute Grammar Pushdown Automaton
Unable to display preview. Download preview PDF.
- [AU 72]Aho, A. V., and J. D. Ullman. The Theory of Parsing, Translation, and Compiling, Volume 1: Parsing, Prentice-Hall, Englewood Cliffs, N. J., 1972.Google Scholar
- [Bra 76]Branquart, P., J.-P. Cardinael, J. Lewi, J.-P. Delescaille, and M. Vanbegin. An Optimized Translation Process and its Application to ALGOL 68, Springer-Verlag, Berlin, 1976.Google Scholar
- [Fan 72]Fang, I. "FOLDS, A Declarative Formal Language Definition System," Ph.D. Thesis, Stanford Univ., 1972.Google Scholar
- [Knu 68]Knuth, D. E. "Semantics of Context-free Languages," Mathematical Systems Theory, Vol. 2, No. 2, June 1968, pp. 127–146.Google Scholar
- [Kos 71]Koster, C. H. A. "Affix Grammars," in: ALGOL 68 Implementation (J. E. Peck, ed.), North-Holland, Amsterdam, 1971.Google Scholar
- [LRS 74]Lewis, P. M. II, D. J. Rosenkrantz, and R. E. Stearns. "Attributed Translations," Journal of Computer and System Sciences, Vol. 9, No. 3, Dec. 1974, pp. 279–307.Google Scholar
- [LRS 76]Lewis, P. M. II, D. J. Rosenkrantz, and R. E. Stearns. Compiler Design Theory, Addison-Wesley, Reading, Mass., 1976.Google Scholar
- [LS 68]Lewis, P. M. II, and R. E. Stearns, "Syntax-Directed Transduction," Journal of the ACM, Vol. 15, No. 3, July 1968, pp. 465–488.Google Scholar
- [Mil 77]Milton, D. R. "Syntactic Specification and Analysis with Attributed Grammars," Ph.D. Thesis, University of Wisconsin-Madison, Comp. Sci. Dept. Tech. Rept. #304, 1977.Google Scholar
- [MKR 79]Milton, D. R., L. W. Kirchhoff, and B. R. Rowland. "An ALL(1) Compiler Generator," Conference Record of the SIGPLAN Symposium on Compiler Construction, Aug. 1979 (to appear).Google Scholar
- [RS 70]Rosenkrantz, D. J., and R. E. Stearns. "Properties of Deterministic Top-down Grammars," Information and Control, Vol. 17, No. 3, Oct. 1970, pp. 226–256.Google Scholar
- [Sal 73]Salomaa, A. Formal Languages, Academic Press, New York, 1973.Google Scholar
- [Wat 77]Watt, D. A. "The Parsing Problem for Affix Grammars," Acta Informatica, Vol. 8, 1977, pp. 1–20.Google Scholar
- [Wij 75]Wijngaarden, A. van, B. J. Mailloux, J. E. L. Peck, C. H. A. Koster, M. Sintzoff, C. H. Lindsey, L. G. L. T. Meertens, and R. G. Fisher. "Revised Report on the Algorithmic Language ALGOL 68," Acta Informatica, Vol. 5, 1975.Google Scholar
- [Wil 71]Wilner, W. T. "Declarative Semantic Definition," Ph.D. Thesis, Stanford Univ., 1971.Google Scholar