publications: - title: "Component-based LR parsing" author: - name: "Xiaoqing Wu" link: "https://researchr.org/alias/xiaoqing-wu" - name: "Barrett R. Bryant" link: "http://www.cis.uab.edu/bryant" - name: "Jeffrey G. Gray" link: "http://www.gray-area.org/" - name: "Marjan Mernik" link: "http://lpm.uni-mb.si/mernik/" year: "2010" doi: "http://dx.doi.org/10.1016/j.cl.2009.01.002" abstract: "A language implementation with proper compositionality enables a compiler developer to divide-and-conquer the complexity of building a large language by constructing a set of smaller languages. Ideally, these small language implementations should be independent of each other such that they can be designed, implemented and debugged individually, and later be reused in different applications (e.g., building domain-specific languages). However, the language composition offered by several existing parser generators resides at the grammar level, which means all the grammar modules need to be composed together and all corresponding ambiguities have to be resolved before generating a single parser for the language. This produces tight coupling between grammar modules, which harms information hiding and affects independent development of language features. To address this problem, we have developed a novel parsing algorithm that we call Component-based LR (CLR) parsing, which provides code-level compositionality for language development by producing a separate parser for each grammar component. In addition to shift and reduce actions, the algorithm extends general LR parsing by introducing switch and return actions to empower the parsing action to jump from one parser to another. Our experimental evaluation demonstrates that CLR increases the comprehensibility, reusability, changeability and independent development ability of the language implementation. Moreover, the loose coupling among parser components enables CLR to describe grammars that contain LR parsing conflicts or require ambiguous token definitions, such as island grammars and embedded languages." links: doi: "http://dx.doi.org/10.1016/j.cl.2009.01.002" dblp: "http://dblp.uni-trier.de/rec/bibtex/journals/cl/WuBGM10" tags: - "parsing algorithm" - "reusable components" - "rule-based" - "design complexity" - "composition" - "language design" - "reuse" - "information hiding" - "debugging" - "compiler" - "parsing" - "grammar" - "domain-specific language" researchr: "https://researchr.org/publication/WuBGM10" cites: 38 citedby: 0 journal: "Comp. Lang., Syst. \\& Struct." volume: "36" number: "1" pages: "16-33" kind: "article" key: "WuBGM10"