{"title":"Grammar partitioning and modular deterministic parsing1","authors":"Stefano Crespi Reghizzi, Giuseppe Psaila","doi":"10.1016/S0096-0551(98)00012-5","DOIUrl":null,"url":null,"abstract":"<div><p>Complex languages are often modularized into sublanguages and the compiler is accordingly organized as a set of separate modules. Modularization (called <em>federalization</em>) is beneficial for beating complexity, for maintenance, and for reuse. Focusing on syntax analysis, we consider the decomposition of a grammar into deterministic subgrammars. We study three conditions for determinism in grammar partitioning: first using homogeneous modules of the LR(1) or LL(1) kind; then using heterogeneous modules (LR(1) or LL(1)). Federalization slightly decreases the generality of LR(1) parsers, but not of LL(1) ones, and it allows to handle some grammars which are not LALR(1). Experimental results show that LR(1) federal automata have fewer (up to 60%) states than monolithic LR(1) automata. Criteria for modularization, practical experiences and hints to semantic decomposition issues conclude the paper.</p></div>","PeriodicalId":100315,"journal":{"name":"Computer Languages","volume":"24 4","pages":"Pages 197-227"},"PeriodicalIF":0.0000,"publicationDate":"1998-12-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"https://sci-hub-pdf.com/10.1016/S0096-0551(98)00012-5","citationCount":"5","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Computer Languages","FirstCategoryId":"1085","ListUrlMain":"https://www.sciencedirect.com/science/article/pii/S0096055198000125","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 5
Abstract
Complex languages are often modularized into sublanguages and the compiler is accordingly organized as a set of separate modules. Modularization (called federalization) is beneficial for beating complexity, for maintenance, and for reuse. Focusing on syntax analysis, we consider the decomposition of a grammar into deterministic subgrammars. We study three conditions for determinism in grammar partitioning: first using homogeneous modules of the LR(1) or LL(1) kind; then using heterogeneous modules (LR(1) or LL(1)). Federalization slightly decreases the generality of LR(1) parsers, but not of LL(1) ones, and it allows to handle some grammars which are not LALR(1). Experimental results show that LR(1) federal automata have fewer (up to 60%) states than monolithic LR(1) automata. Criteria for modularization, practical experiences and hints to semantic decomposition issues conclude the paper.