Generalized Parsing and Term Rewriting: Semantics Driven Disambiguation

Mark G. J. van den Brand, Steven Klusener, Leon Moonen, Jurgen J. Vinju. Generalized Parsing and Term Rewriting: Semantics Driven Disambiguation. Electronic Notes in Theoretical Computer Science, 82(3):575-591, 2003. [doi]

Abstract

Generalized parsing technology provides the power and flexibility to attack real-world parsing applications.

However, many programming languages have syntactical ambiguities that can only be solved using semantical analysis.

In this paper we propose to apply the paradigm of term rewriting to filter ambiguities based on semantical information. We start with the definition of a representation of ambiguous derivations. Then we extend term rewriting with means to handle such derivations. Finally, we apply these tools to some real world examples, namely C and COBOL.

The resulting architecture is simple and efficient as compared to semantic directed parsing.