A deterministic technique for extracting keyword based grammar rules from programs

  • Authors:
  • Alpana Dubey;Pankaj Jalote;Sanjeev Kumar Aggarwal

  • Affiliations:
  • IIT Kanpur, India;IIT Kanpur, India;IIT Kanpur, India

  • Venue:
  • Proceedings of the 2006 ACM symposium on Applied computing
  • Year:
  • 2006

Quantified Score

Hi-index 0.00

Visualization

Abstract

This paper presents a technique for extracting grammar rules, given a set of programs and an approximate grammar. Grammar is an important artifact used in the generation of tools for program analysis, modification, etc. Current grammar extraction techniques are heuristic in nature. This work proposes a deterministic technique for extracting keyword based grammar rules. The technique uses CYK-parser and LR-parser to build a set of possible rules. For each rule it checks whether the grammar after including that rule is able to parse all the programs or not. As this results in a large set of possible rules, a set of optimizations are proposed to reduce the search space of possible rules. The proposed optimizations utilize the knowledge from multiple programs and exploit the abundance of unit productions in the grammar of programming languages. The proposed approach and optimizations are experimentally checked on a set of input programs.