Deriving tolerant grammars from a base-line grammar

  • Authors:
  • Steven Klusener;Ralf Lämmel

  • Affiliations:
  • -;-

  • Venue:
  • ICSM '03 Proceedings of the International Conference on Software Maintenance
  • Year:
  • 2003

Quantified Score

Hi-index 0.00

Visualization

Abstract

A grammar-based approach to tool development in re- andreverse engineering promises precise structure awareness,but it is problematic in two respects. Firstly, it is a considerableup-front investment to obtain a grammar for a relevantlanguage or cocktail of languages. Existing work ongrammar recovery addresses this concern to some extent.Secondly, it is often not feasible to insist on a precise grammar,e.g., when different dialects need to be covered. Thiscalls for tolerant grammars.In this paper, we provide a well-engineered approach to thederivation of tolerant grammars, which is based on previouswork on error recovery, fuzzy parsing, and island grammars.The technology of this paper has been used in a complexCobol restructuring project on several millions of linesof code in different Cobol dialects.Our approach is founded on an approximation relation betweena tolerant grammar and a base-line grammar whichserves as a point of reference. Thereby, we avoid false positivesand false negatives when parsing constructs of interestin a tolerant mode. Our approach accomplishes the effectivederivation of a tolerant grammar from the syntacticalstructure that is relevant for a certain re- or reverse engineeringtool. To this end, the productions for the constructsof interest are reused from the base-line grammar togetherwith further productions that are needed for completion.