An interactive method for extracting grammar from programs

  • Authors:
  • Rahul Jain;Sanjeev Kumar Aggarwal;Pankaj Jalote;Shiladitya Biswas

  • Affiliations:
  • Department of Computer Science and Engineering, Indian Institute of Technology, Kanpur 208016, India;Department of Computer Science and Engineering, Indian Institute of Technology, Kanpur 208016, India;Department of Computer Science and Engineering, Indian Institute of Technology, Kanpur 208016, India;Department of Computer Science and Engineering, Indian Institute of Technology, Kanpur 208016, India

  • Venue:
  • Software—Practice & Experience - Research Articles
  • Year:
  • 2004

Quantified Score

Hi-index 0.00

Visualization

Abstract

The grammar of the language in which some given code is written is essential for developing automated tools for maintenance, reengineering, and program analysis. Frequently grammar is available for a language but not for its variants that are implemented by various vendors and in which the given code may be written. In this work we address the problem of obtaining the grammar from source code, which can then be used for generating tools for the programs. We propose an incremental method for obtaining grammar for a particular language variant, from a set of programs written in the language variant and an approximate grammar (presumably of the standard language) with some user interaction. We also present the design of a tool for implementing this approach and our experience in working with grammars of C, C++ and COBOL. Copyright © 2004 John Wiley & Sons, Ltd.