Summary
The use of context-free grammars to define the syntax of programming languages is complicated by the phenomenon of ambiguity. Ambiguity can be resolved by the specification of a unique canonical parse. A set of rules is given which defines a canonical bottom-up parse, and these rules are implemented in a left-to-right bottom-up parsing algorithm. A second set of rules is given which defines a canonical top-down parse, and these rules are similarly implemented in a left-to-right top-down parsing algorithm.
Similar content being viewed by others
References
Aho, A. V., Ullman, J. D.: The theory of parsing, translation, and compiling, Vol. 1. Englewood Cliffs (N. J.): Prentice-Hall 1973
Hopcroft, J. E., Ullman, J. D.: Formal languages and their relation to automata. Reading (Mass.): Addison-Wesley 1969
Naur, P. (ed): Revised report on the algorithmic language ALGOL 60. Comm. ACM 8, 1–17 (1963)
Knuth, D. E.: On the translation of languages from left to right. Information and Control 8, 607–639 (1965)
Aho, A. V., Johnson, S. C., Ullman, J. D.: Deterministic parsing of ambiguous grammars. Comm. ACM 18, 441–452 (1975)
McKeeman, W. M., Horning, J. J., Wortman, D. B.: A compiler generator. Englewood Cliffs (N. J.): Prentice-Hall 1970
Knuth, D. E.: The art of computer programming, Vol.1. Reading (Mass.): Addison-Wesley 1969
Author information
Authors and Affiliations
Rights and permissions
About this article
Cite this article
Wharton, R.M. Resolution of ambiguity in parsing. Acta Informatica 6, 387–395 (1976). https://doi.org/10.1007/BF00268139
Received:
Issue Date:
DOI: https://doi.org/10.1007/BF00268139