{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,8,23]],"date-time":"2026-08-23T15:03:40Z","timestamp":1787497420440,"version":"build-2736575974"},"reference-count":35,"publisher":"Association for Computing Machinery (ACM)","issue":"PLDI","license":[{"start":{"date-parts":[[2023,6,6]],"date-time":"2023-06-06T00:00:00Z","timestamp":1686009600000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/"}],"funder":[{"DOI":"10.13039\/501100000781","name":"European Research Council","doi-asserted-by":"publisher","award":["101002277"],"award-info":[{"award-number":["101002277"]}],"id":[{"id":"10.13039\/501100000781","id-type":"DOI","asserted-by":"publisher"}]},{"DOI":"10.13039\/501100004815","name":"Isaac Newton Trust","doi-asserted-by":"publisher","award":["G101121"],"award-info":[{"award-number":["G101121"]}],"id":[{"id":"10.13039\/501100004815","id-type":"DOI","asserted-by":"publisher"}]}],"content-domain":{"domain":["dl.acm.org"],"crossmark-restriction":true},"short-container-title":["Proc. ACM Program. Lang."],"published-print":{"date-parts":[[2023,6,6]]},"abstract":"<jats:p>Lexers and parsers are typically defined separately and connected by a token stream. This separate definition is important for modularity and reduces the potential for parsing ambiguity. However, materializing tokens as data structures and case-switching on tokens comes with a cost.<\/jats:p>\n                  <jats:p>\n                    We show how to\n                    <jats:italic>fuse<\/jats:italic>\n                    separately-defined lexers and parsers, drastically improving performance without compromising modularity or increasing ambiguity. We propose a deterministic variant of Greibach Normal Form that ensures deterministic parsing with a single token of lookahead and makes fusion strikingly simple, and prove that normalizing context free expressions into the deterministic normal form is semantics-preserving. Our staged parser combinator library, flap, provides a standard interface, but generates specialized token-free code that runs two to six times faster than ocamlyacc on a range of benchmarks.\n                  <\/jats:p>","DOI":"10.1145\/3591269","type":"journal-article","created":{"date-parts":[[2023,6,6]],"date-time":"2023-06-06T16:06:24Z","timestamp":1686067584000},"page":"1194-1217","update-policy":"https:\/\/doi.org\/10.1145\/crossmark-policy","source":"Crossref","is-referenced-by-count":9,"title":["flap: A Deterministic Parser with Fused Lexing"],"prefix":"10.1145","volume":"7","author":[{"ORCID":"https:\/\/orcid.org\/0009-0002-1650-6340","authenticated-orcid":false,"given":"Jeremy","family":"Yallop","sequence":"first","affiliation":[{"name":"University of Cambridge, UK"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-5961-1493","authenticated-orcid":false,"given":"Ningning","family":"Xie","sequence":"additional","affiliation":[{"name":"University of Toronto, Canada"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0003-2838-5865","authenticated-orcid":false,"given":"Neel","family":"Krishnaswami","sequence":"additional","affiliation":[{"name":"University of Cambridge, UK"}],"role":[{"vocabulary":"crossref","role":"author"}]}],"member":"320","published-online":{"date-parts":[[2023,6,6]]},"reference":[{"key":"e_1_2_1_1_1","unstructured":"Alfred V Aho Ravi Sethi and Jeffrey D Ullman. 2007. Compilers: principles techniques and tools. 2 Addison-wesley Reading. Alfred V Aho Ravi Sethi and Jeffrey D Ullman. 2007. Compilers: principles techniques and tools. 2 Addison-wesley Reading."},{"key":"e_1_2_1_2_1","doi-asserted-by":"publisher","DOI":"10.1006\/inco.1998.2772"},{"key":"e_1_2_1_3_1","volume-title":"STACS 92","author":"Br\u00fcggemann-Klein Anne","unstructured":"Anne Br\u00fcggemann-Klein and Derick Wood . 1992. Deterministic regular languages . In STACS 92 , Alain Finkel and Matthias Jantzen (Eds.). Springer Berlin Heidelberg , Berlin, Heidelberg . 173\u2013184. isbn:978-3-540-46775-5 Anne Br\u00fcggemann-Klein and Derick Wood. 1992. Deterministic regular languages. In STACS 92, Alain Finkel and Matthias Jantzen (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg. 173\u2013184. isbn:978-3-540-46775-5"},{"key":"e_1_2_1_4_1","doi-asserted-by":"publisher","DOI":"10.1145\/321239.321249"},{"key":"e_1_2_1_5_1","unstructured":"Chris Casinghino and Cody Roux. 2020. ParTS: Final Report. HR001120C0016 - Final Report. Chris Casinghino and Cody Roux. 2020. ParTS: Final Report. HR001120C0016 - Final Report."},{"key":"e_1_2_1_6_1","doi-asserted-by":"publisher","DOI":"10.1145\/1291151.1291199"},{"key":"e_1_2_1_7_1","doi-asserted-by":"publisher","DOI":"10.1145\/236114.236119"},{"key":"e_1_2_1_8_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-642-00722-4_10"},{"key":"e_1_2_1_9_1","doi-asserted-by":"publisher","DOI":"10.1007\/s11227-015-1483-z"},{"key":"e_1_2_1_10_1","doi-asserted-by":"publisher","DOI":"10.1145\/581478.581483"},{"key":"e_1_2_1_11_1","doi-asserted-by":"publisher","DOI":"10.1016\/S0012-365X(76)80004-0"},{"key":"e_1_2_1_12_1","doi-asserted-by":"publisher","DOI":"10.1145\/321250.321254"},{"key":"e_1_2_1_13_1","volume-title":"OCaml Workshop.","author":"Christopher","unstructured":"Christopher S. Hardin and Roshan P. James. 2013. Core_bench: Micro-Benchmarking for OCaml . OCaml Workshop. Christopher S. Hardin and Roshan P. James. 2013. Core_bench: Micro-Benchmarking for OCaml. OCaml Workshop."},{"key":"e_1_2_1_14_1","doi-asserted-by":"publisher","DOI":"10.1145\/2660193.2660241"},{"key":"e_1_2_1_15_1","doi-asserted-by":"publisher","DOI":"10.1145\/3009837"},{"key":"e_1_2_1_16_1","volume-title":"Towards effective two-level supercompilation. Preprint 81","author":"Klyuchnikov Ilya","unstructured":"Ilya Klyuchnikov . 2010. Towards effective two-level supercompilation. Preprint 81 . Keldysh Institute of Applied Mathematics , Moscow . Ilya Klyuchnikov. 2010. Towards effective two-level supercompilation. Preprint 81. Keldysh Institute of Applied Mathematics, Moscow."},{"key":"e_1_2_1_17_1","doi-asserted-by":"publisher","DOI":"10.1145\/3314221.3314625"},{"key":"e_1_2_1_18_1","doi-asserted-by":"publisher","DOI":"10.1145\/3314221"},{"key":"e_1_2_1_19_1","volume-title":"Usability Engineering","author":"Nielsen Jakob","year":"1840","unstructured":"Jakob Nielsen . 1993. Usability Engineering . Morgan Kaufmann Publishers Inc ., San Francisco, CA, USA. isbn:0125 1840 50 Jakob Nielsen. 1993. Usability Engineering. Morgan Kaufmann Publishers Inc., San Francisco, CA, USA. isbn:0125184050"},{"key":"e_1_2_1_20_1","first-page":"395","article-title":"Strict Deterministic Grammars and Greibach Normal Form","volume":"15","author":"Nijholt Anton","year":"1979","unstructured":"Anton Nijholt . 1979 . Strict Deterministic Grammars and Greibach Normal Form . J. Inf. Process. Cybern. , 15 , 8\/9 (1979), 395 \u2013 401 . Anton Nijholt. 1979. Strict Deterministic Grammars and Greibach Normal Form. J. Inf. Process. Cybern., 15, 8\/9 (1979), 395\u2013401.","journal-title":"J. Inf. Process. Cybern."},{"key":"e_1_2_1_21_1","doi-asserted-by":"publisher","DOI":"10.1017\/S0956796808007090"},{"key":"e_1_2_1_22_1","doi-asserted-by":"publisher","DOI":"10.1145\/2660193.2660202"},{"key":"e_1_2_1_23_1","unstructured":"Fran\u00e7ois Pottier and Yann R\u00e9gis-Gianas. [n. d.]. The Menhir parser generator. http:\/\/gallium.inria.fr\/ fpottier\/menhir\/ Fran\u00e7ois Pottier and Yann R\u00e9gis-Gianas. [n. d.]. The Menhir parser generator. http:\/\/gallium.inria.fr\/ fpottier\/menhir\/"},{"key":"e_1_2_1_24_1","doi-asserted-by":"publisher","DOI":"10.1145\/3434326"},{"key":"e_1_2_1_25_1","doi-asserted-by":"publisher","DOI":"10.1145\/3314221.3314626"},{"key":"e_1_2_1_26_1","doi-asserted-by":"publisher","DOI":"10.17487\/RFC4180"},{"key":"e_1_2_1_27_1","doi-asserted-by":"publisher","DOI":"10.1017\/S0956796818000102"},{"key":"e_1_2_1_28_1","unstructured":"Walid Taha. 1999. Multi-Stage Programming: Its Theory and Applications. Walid Taha. 1999. Multi-Stage Programming: Its Theory and Applications."},{"key":"e_1_2_1_29_1","doi-asserted-by":"publisher","DOI":"10.1007\/3-540-45937-5_12"},{"key":"e_1_2_1_30_1","doi-asserted-by":"publisher","DOI":"10.1145\/1289971.1289983"},{"key":"e_1_2_1_31_1","doi-asserted-by":"publisher","DOI":"10.5555\/5280.5288"},{"key":"e_1_2_1_32_1","doi-asserted-by":"publisher","DOI":"10.1016\/0304-3975(90)90147-A"},{"key":"e_1_2_1_33_1","doi-asserted-by":"publisher","DOI":"10.1145\/3294032.3294078"},{"key":"e_1_2_1_34_1","doi-asserted-by":"publisher","DOI":"10.5281\/zenodo.7824835"},{"key":"e_1_2_1_35_1","doi-asserted-by":"crossref","unstructured":"Jeremy Yallop Ningning Xie and Neel Krishnaswami. 2023. flap: A Deterministic Parser with Fused Lexing. arxiv:2304.05276. Jeremy Yallop Ningning Xie and Neel Krishnaswami. 2023. flap: A Deterministic Parser with Fused Lexing. arxiv:2304.05276.","DOI":"10.1145\/3591269"}],"container-title":["Proceedings of the ACM on Programming Languages"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3591269","content-type":"unspecified","content-version":"vor","intended-application":"text-mining"},{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.1145\/3591269","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2025,6,17]],"date-time":"2025-06-17T12:47:20Z","timestamp":1750164440000},"score":1,"resource":{"primary":{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3591269"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2023,6,6]]},"references-count":35,"journal-issue":{"issue":"PLDI","published-print":{"date-parts":[[2023,6,6]]}},"alternative-id":["10.1145\/3591269"],"URL":"https:\/\/doi.org\/10.1145\/3591269","relation":{},"ISSN":["2475-1421"],"issn-type":[{"value":"2475-1421","type":"electronic"}],"subject":[],"published":{"date-parts":[[2023,6,6]]},"assertion":[{"value":"2023-06-06","order":2,"name":"published","label":"Published","group":{"name":"publication_history","label":"Publication History"}}]}}