Semantics-preserving Migration of Semantic Rules During Left Recursion Removal in Attribute Grammars

  • Authors:
  • Wolfgang Lohmann;Günter Riedewald;Markus Stoy

  • Affiliations:
  • Department of Computer Science, University of Rostock, 18051 Rostock, Germany;Department of Computer Science, University of Rostock, 18051 Rostock, Germany;Department of Computer Science, University of Rostock, 18051 Rostock, Germany

  • Venue:
  • Electronic Notes in Theoretical Computer Science (ENTCS)
  • Year:
  • 2004

Quantified Score

Hi-index 0.00

Visualization

Abstract

Several tools for source-to-source transformation are based on top down parsers. This restricts the user to use grammars without left recursion. Removing left recursion of a given grammar often makes it unreadable, preventing a user from concentrating on the original grammar. Additionally, the question arises, whether the tool implements the semantics of the original language, if it is implemented based on a different grammar than in the original language definition. Moreover, existing implementations of semantics for the original grammar cannot be reused directly. The paper contributes to the field of automatic migration of software (here semantic rules) induced by a grammar change. It revises removal of left recursion in the context of grammar adaptations and demonstrates, that while removing left recursion at the same time the semantic rules can be migrated automatically. Thus, a programmer can continue to use semantic rules on a left recursive grammar. The problem is explained and justified.