publications: - title: "A Coroutine Approach to Parsing" author: - name: "Hanan Samet" link: "http://www.cs.umd.edu/~hjs/" year: "1980" doi: "http://doi.acm.org/10.1145/357103.357106" abstract: "A method is presented for parsing syntactic constructs that are permitted to appear independently anywhere in a program. Some examples include comments, macros, and constructs for conditional compilation. Each such construct is defined by its own grammar and parsed by a separate coroutine. The coroutine model of parsing allows the program text to be parsed in one pass despite the syntactic inconsistencies among the program text and the additional constructs. The usefulness of the model is demonstrated by showing how a production language parsing method is extended to handle multiple syntax specifications. The implementation of conditional compilation by carrying along two parses in a coroutine manner is also given. The utility of the model is further demonstrated by showing its adaptation to a recursive descent parser. " links: doi: "http://doi.acm.org/10.1145/357103.357106" tags: - "programming languages" - "meta programming" - "meta-model" - "modeling language" - "modeling" - "language modeling" - "macros" - "Meta-Environment" - "parsing" - "systematic-approach" - "grammar" researchr: "https://researchr.org/publication/Samet-TOPLAS-1980" cites: 16 citedby: 0 journal: "ACM Transactions on Programming Languages and Systems" volume: "2" number: "3" pages: "290-306" kind: "article" key: "Samet-TOPLAS-1980"