Semi-automatic grammar recovery
Software—Practice & Experience
Can a parser be generated from examples?
Proceedings of the 2003 ACM symposium on Applied computing
A Technique for Extracting Keyword Based Rules from a Set of Programs
CSMR '05 Proceedings of the Ninth European Conference on Software Maintenance and Reengineering
An interactive method for extracting grammar from programs
Software—Practice & Experience - Research Articles
Goodness criteria for programming language grammar rules
ACM SIGPLAN Notices
Recovering grammar relationships for the Java Language Specification
Software Quality Control
Inferring grammar rules of programming language dialects
ICGI'06 Proceedings of the 8th international conference on Grammatical Inference: algorithms and applications
Hi-index | 0.00 |
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.