{"title":"为BNF语法生成解析器","authors":"F. DeRemer","doi":"10.1145/1476793.1476928","DOIUrl":null,"url":null,"abstract":"The procedure described herein is in essence an extension, albeit a simplification, of the work Earley which in turn was based on Evans, Feldman, Floyd, and Standish. For a large subset of grammars, the procedure maps the Backus Naur Form (BNF) definition of the grammar of a language into a deterministic, left-to-right parser for the sentences in that language. It is shown below that the procedure by design, covers all bounded right context grammars and, as a by-product, some LR(k) grammars which are not bounded right context. See Knuth for the definitions of these classes of grammars. If two parameters are incorporated a priori into the procedure, one limiting the look-back and the other limiting the look-ahead capabilities of the parser to be generated, an algorithm results. For each BNF grammar G the algorithm either rejects G as not bounded right context for the specified limits or it generates a parser for G.","PeriodicalId":326625,"journal":{"name":"AFIPS '69 (Spring)","volume":"70 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"1969-05-14","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"6","resultStr":"{\"title\":\"Generating parsers for BNF grammars\",\"authors\":\"F. DeRemer\",\"doi\":\"10.1145/1476793.1476928\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"The procedure described herein is in essence an extension, albeit a simplification, of the work Earley which in turn was based on Evans, Feldman, Floyd, and Standish. For a large subset of grammars, the procedure maps the Backus Naur Form (BNF) definition of the grammar of a language into a deterministic, left-to-right parser for the sentences in that language. It is shown below that the procedure by design, covers all bounded right context grammars and, as a by-product, some LR(k) grammars which are not bounded right context. See Knuth for the definitions of these classes of grammars. If two parameters are incorporated a priori into the procedure, one limiting the look-back and the other limiting the look-ahead capabilities of the parser to be generated, an algorithm results. For each BNF grammar G the algorithm either rejects G as not bounded right context for the specified limits or it generates a parser for G.\",\"PeriodicalId\":326625,\"journal\":{\"name\":\"AFIPS '69 (Spring)\",\"volume\":\"70 1\",\"pages\":\"0\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"1969-05-14\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"6\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"AFIPS '69 (Spring)\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.1145/1476793.1476928\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"AFIPS '69 (Spring)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/1476793.1476928","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 6
摘要
这里描述的过程本质上是对Earley工作的扩展,尽管是简化,而Earley的工作又以Evans, Feldman, Floyd和Standish为基础。对于大量语法子集,该过程将语言语法的Backus Naur Form (BNF)定义映射到该语言中句子的确定性、从左到右的解析器。如下所示,该过程通过设计涵盖了所有有界右上下文语法,并且作为副产品,还涵盖了一些非有界右上下文的LR(k)语法。有关这些语法类的定义,请参阅Knuth。如果将两个参数先验地合并到过程中,一个限制回看,另一个限制要生成的解析器的预看功能,则生成一个算法。对于每个BNF语法G,该算法要么拒绝G作为指定限制的无界右上下文,要么为G生成一个解析器。
The procedure described herein is in essence an extension, albeit a simplification, of the work Earley which in turn was based on Evans, Feldman, Floyd, and Standish. For a large subset of grammars, the procedure maps the Backus Naur Form (BNF) definition of the grammar of a language into a deterministic, left-to-right parser for the sentences in that language. It is shown below that the procedure by design, covers all bounded right context grammars and, as a by-product, some LR(k) grammars which are not bounded right context. See Knuth for the definitions of these classes of grammars. If two parameters are incorporated a priori into the procedure, one limiting the look-back and the other limiting the look-ahead capabilities of the parser to be generated, an algorithm results. For each BNF grammar G the algorithm either rejects G as not bounded right context for the specified limits or it generates a parser for G.