Semantics-preserving Migration of Semantic Rules During Left Recursion Removal in Attribute Grammars
Author(s) -
Wolfgang Lohmann,
Günter Riedewald,
Markus Stoy
Publication year - 2004
Publication title -
electronic notes in theoretical computer science
Language(s) - English
Resource type - Journals
SCImago Journal Rank - 0.242
H-Index - 60
ISSN - 1571-0661
DOI - 10.1016/j.entcs.2004.06.006
Subject(s) - computer science , programming language , recursion (computer science) , attribute grammar , parsing , grammar , rule based machine translation , l attributed grammar , adaptive grammar , affix grammar , natural language processing , generative grammar , emergent grammar , artificial intelligence , context free grammar , mildly context sensitive grammar formalism , linguistics , philosophy
everal 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
Accelerating Research
Robert Robinson Avenue,
Oxford Science Park, Oxford
OX4 4GP, United Kingdom
Address
John Eccles HouseRobert Robinson Avenue,
Oxford Science Park, Oxford
OX4 4GP, United Kingdom