skip to main content
10.1145/1141277.1141659acmconferencesArticle/Chapter ViewAbstractPublication PagessacConference Proceedingsconference-collections
Article

A deterministic technique for extracting keyword based grammar rules from programs

Published: 23 April 2006 Publication History

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.

References

[1]
A. Dubey, S. K. Aggarwal, and P. Jalote. A technique for extracting keyword based rules from a set of programs. In CSMR '05: Proceedings of the Ninth European Conference on Software Maintenance and Reengineering (CSMR'05), pages 217--225, Manchester, UK, 2005. IEEE Computer Society.
[2]
A. Dubey, P. Jalote, and S. K. Aggarwal. Learning context free grammar rules from a set of programs. Technical Report TRCS-2005-258, Indian Institute of Technology Kanpur, India, 2005. Available at, http://www.cse.iitk.ac. in/reports/view. jsp?colname=530.
[3]
R. Jain, S. K. Agarwal, P. Jalote, and S. Biswas. An interactive method for extracting grammar from programs. Software---Practice & Experience, 2004.
[4]
T. Kasami. An efficient recognition and syntax analysis algorithm for context free languages. special, Air Force Cambridge Research Laboratory, BedFord, MA, 1965.
[5]
R. Lämmel and C. Verhoef. Semi-automatic Grammar Recovery. Software---Practice & Experience, 31(15):1395--1438, December 2001.
[6]
M. Mernik, G. Gerlic, V. Zumer, and B. Bryant. Can a parser be generated from examples? In Proceedings of 18th ACM symposium on applied computing, pages 1063--1067. ACM Press, 2003.

Cited By

View all

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
SAC '06: Proceedings of the 2006 ACM symposium on Applied computing
April 2006
1967 pages
ISBN:1595931082
DOI:10.1145/1141277
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 23 April 2006

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. CYK parser
  2. LR parser
  3. grammar extraction
  4. programming language dialects
  5. programming languages

Qualifiers

  • Article

Conference

SAC06
Sponsor:

Acceptance Rates

Overall Acceptance Rate 1,650 of 6,669 submissions, 25%

Upcoming Conference

SAC '25
The 40th ACM/SIGAPP Symposium on Applied Computing
March 31 - April 4, 2025
Catania , Italy

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)1
  • Downloads (Last 6 weeks)0
Reflects downloads up to 12 Jan 2025

Other Metrics

Citations

Cited By

View all
  • (2018)Recovering grammar relationships for the Java Language SpecificationSoftware Quality Journal10.1007/s11219-010-9116-519:2(333-378)Online publication date: 24-Dec-2018
  • (2015)Interactive parser synthesis by exampleProceedings of the 36th ACM SIGPLAN Conference on Programming Language Design and Implementation10.1145/2737924.2738002(565-574)Online publication date: 3-Jun-2015
  • (2006)Goodness criteria for programming language grammar rulesACM SIGPLAN Notices10.1145/1229493.122950041:12(44-53)Online publication date: 1-Dec-2006
  • (2006)Inferring grammar rules of programming language dialectsProceedings of the 8th international conference on Grammatical Inference: algorithms and applications10.1007/11872436_17(201-213)Online publication date: 20-Sep-2006

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media