{"title":"一种实用的任意前瞻性LR解析技术","authors":"M. Bermudez, Karl M. Schimpf","doi":"10.1145/12276.13325","DOIUrl":null,"url":null,"abstract":"We present a practical technique that provides an <italic>LR</italic> (0) parser with either fixed or arbitrary look-ahead. The construction algorithm is based on certain paths in the <italic>LR</italic> (0) state diagram, which must be restricted to a maximum length <italic>m</italic>. The technique determines the amount of look-ahead required, and the user is spared the task of guessing it. Instead, the user provides <italic>m</italic>. In situations where single symbol look-ahead is sufficient, the corresponding grammar class (called <italic>LAR</italic> (<italic>m</italic> )) is identical to the <italic>NQLALR</italic> (1) class. For practical grammars that require arbitrary look-ahead, the storage requirements typically do not exceed an amount linear in the size of the corresponding <italic>LR</italic> (0) parser. The technique is shown to work for a practical programming language grammar, and has been used to solve particular cases of the PL/1 keyword problem.","PeriodicalId":414056,"journal":{"name":"SIGPLAN Conferences and Workshops","volume":"14 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"1986-07-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"15","resultStr":"{\"title\":\"A practical arbitrary look-ahead LR parsing technique\",\"authors\":\"M. Bermudez, Karl M. Schimpf\",\"doi\":\"10.1145/12276.13325\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"We present a practical technique that provides an <italic>LR</italic> (0) parser with either fixed or arbitrary look-ahead. The construction algorithm is based on certain paths in the <italic>LR</italic> (0) state diagram, which must be restricted to a maximum length <italic>m</italic>. The technique determines the amount of look-ahead required, and the user is spared the task of guessing it. Instead, the user provides <italic>m</italic>. In situations where single symbol look-ahead is sufficient, the corresponding grammar class (called <italic>LAR</italic> (<italic>m</italic> )) is identical to the <italic>NQLALR</italic> (1) class. For practical grammars that require arbitrary look-ahead, the storage requirements typically do not exceed an amount linear in the size of the corresponding <italic>LR</italic> (0) parser. The technique is shown to work for a practical programming language grammar, and has been used to solve particular cases of the PL/1 keyword problem.\",\"PeriodicalId\":414056,\"journal\":{\"name\":\"SIGPLAN Conferences and Workshops\",\"volume\":\"14 1\",\"pages\":\"0\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"1986-07-01\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"15\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"SIGPLAN Conferences and Workshops\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.1145/12276.13325\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"SIGPLAN Conferences and Workshops","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/12276.13325","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
A practical arbitrary look-ahead LR parsing technique
We present a practical technique that provides an LR (0) parser with either fixed or arbitrary look-ahead. The construction algorithm is based on certain paths in the LR (0) state diagram, which must be restricted to a maximum length m. The technique determines the amount of look-ahead required, and the user is spared the task of guessing it. Instead, the user provides m. In situations where single symbol look-ahead is sufficient, the corresponding grammar class (called LAR (m )) is identical to the NQLALR (1) class. For practical grammars that require arbitrary look-ahead, the storage requirements typically do not exceed an amount linear in the size of the corresponding LR (0) parser. The technique is shown to work for a practical programming language grammar, and has been used to solve particular cases of the PL/1 keyword problem.