{"title":"从程序中提取基于关键字的语法规则的确定性技术","authors":"Alpana Dubey, P. Jalote, S. Aggarwal","doi":"10.1145/1141277.1141659","DOIUrl":null,"url":null,"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.","PeriodicalId":269830,"journal":{"name":"Proceedings of the 2006 ACM symposium on Applied computing","volume":null,"pages":null},"PeriodicalIF":0.0000,"publicationDate":"2006-04-23","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"6","resultStr":"{\"title\":\"A deterministic technique for extracting keyword based grammar rules from programs\",\"authors\":\"Alpana Dubey, P. Jalote, S. Aggarwal\",\"doi\":\"10.1145/1141277.1141659\",\"DOIUrl\":null,\"url\":null,\"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.\",\"PeriodicalId\":269830,\"journal\":{\"name\":\"Proceedings of the 2006 ACM symposium on Applied computing\",\"volume\":null,\"pages\":null},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2006-04-23\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"6\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"Proceedings of the 2006 ACM symposium on Applied computing\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.1145/1141277.1141659\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of the 2006 ACM symposium on Applied computing","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/1141277.1141659","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
A deterministic technique for extracting keyword based grammar rules from programs
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.