skip to main content
article

Goodness criteria for programming language grammar rules

Published:01 December 2006Publication History
Skip Abstract Section

Abstract

The grammar of a programming language is important as it is used in developing software engineering tools. Sometimes grammars of programming languages are not readily available or they are incomplete; hence they are inferred from a set of valid programs. An exact grammar can not be learned from a set of positive samples (set of valid programs) alone as there exists many grammars which accept the given input programs; we call these grammars complete grammars. Therefore, given an incomplete grammar, there exists many sets of grammar rules which can make it complete. Due to many possible sets of grammar rules, the grammar inference process faces the problem of selecting a good set of grammar rules. We address the problem of grammar rule selection when they are inferred using an automatic are traditionally used for assessing the complexity of grammar based software. The experiments show that the grammar based metrics are not sufficient for this purpose as there exist several rules which have the same metric value. Hence we propose two rule selection criteria. Experiments are done to assess different criteria. Experiments show that proposed criteria, when coupled with grammar metrics, select reasonably good grammar rules.

References

  1. Compilers & interpreters. URL: http://www.angelfire.com/ar/CompiladoresUCSE/COMPILERS.html.Google ScholarGoogle Scholar
  2. Alfred V. Aho, Ravi Sethi, and Jeffrey D. Ullman. Compilers Principles, Techniques, and Tools. Pearson Education (Singapore) Pte. Ltd., 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Alfred V. Aho and Jeffrey D. Ullman. The Theory of Parsing, Translation, and Compiling. Prentice Hall Professional Technical Reference, 1972. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Erzsébet Csuhaj-Varjú and Alica Kelemenová. Descriptional complexity of context-free grammar forms. Theor. Comput. Sci., 112(2):277--289, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Alpana Dubey, Pankaj Jalote, and Sanjeev K. Aggarwal. A deterministic technique for extracting keyword based grammar rules from programs. In Proceedings of 21st Annual ACM Symposium on Applied Computing, PL track, pages 1631--1632, Dijon, France, April 2006. ACM SIGAPP. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. James F. Power and Brian A. Malloy. A metrics suite for grammar-based software. Special Issue: Analyzing the Evolution of Large-Scale Software, Journal of Software Maintenance and Evolution: Research and Practice, 16:405--426, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. R. Lämmel and C. Verhoef. Cracking the 500-Language Problem. IEEE Software, pages 78--88, November/December 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. R. Lämmel and C. Verhoef. Semi-automatic Grammar Recovery. Software---Practice & Experience, 31(15):1395--1438, December 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Kaizhong Zhang and Dennis Shasha. Simple fast algorithms for the editing distance between trees and related problems. SIAM J. Comput., 18(6):1245--1262, 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library

Recommendations

Comments

Login options

Check if you have access through your login credentials or your institution to get full access on this article.

Sign in

Full Access

PDF Format

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader
About Cookies On This Site

We use cookies to ensure that we give you the best experience on our website.

Learn more

Got it!