[2304.05276] flap: A Deterministic Parser with Fused Lexing
-->
Computer Science > Programming Languages
arXiv:2304.05276 (cs)
[Submitted on 11 Apr 2023 (v1), last revised 14 Apr 2023 (this version, v3)]
Title:flap: A Deterministic Parser with Fused Lexing
Authors:Jeremy Yallop, Ningning Xie, Neel Krishnaswami<br>View a PDF of the paper titled flap: A Deterministic Parser with Fused Lexing, by Jeremy Yallop and 2 other authors
View PDF
Abstract: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. We show how to fuse 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.
Comments:<br>PLDI 2023 with appendix
Subjects:
Programming Languages (cs.PL)
Cite as:<br>arXiv:2304.05276 [cs.PL]
(or<br>arXiv:2304.05276v3 [cs.PL] for this version)
https://doi.org/10.48550/arXiv.2304.05276
Focus to learn more
arXiv-issued DOI via DataCite
Related DOI:
https://doi.org/10.1145/3591269
Focus to learn more
DOI(s) linking to related resources
Submission history<br>From: Ningning Xie [view email]<br>[v1]<br>Tue, 11 Apr 2023 15:21:25 UTC (115 KB)
[v2]<br>Thu, 13 Apr 2023 00:10:11 UTC (115 KB)
[v3]<br>Fri, 14 Apr 2023 00:41:22 UTC (116 KB)
Full-text links:<br>Access Paper:
View a PDF of the paper titled flap: A Deterministic Parser with Fused Lexing, by Jeremy Yallop and 2 other authors<br>View PDF<br>TeX Source
view license
Current browse context:
cs.PL
next >
new<br>recent<br>| 2023-04
Change to browse by:
cs
References & Citations
NASA ADS<br>Google Scholar
Semantic Scholar
export BibTeX citation<br>Loading...
BibTeX formatted citation
×
loading...
Data provided by:
Bookmark
Bibliographic Tools
Bibliographic and Citation Tools
Bibliographic Explorer Toggle
Bibliographic Explorer (What is the Explorer?)
Connected Papers Toggle
Connected Papers (What is Connected Papers?)
Litmaps Toggle
Litmaps (What is Litmaps?)
scite.ai Toggle
scite Smart Citations (What are Smart Citations?)
Code, Data, Media
Code, Data and Media Associated with this Article
alphaXiv Toggle
alphaXiv (What is alphaXiv?)
Links to Code Toggle
CatalyzeX Code Finder for Papers (What is CatalyzeX?)
DagsHub Toggle
DagsHub (What is DagsHub?)
GotitPub Toggle
Gotit.pub (What is GotitPub?)
Huggingface Toggle
Hugging Face (What is Huggingface?)
ScienceCast Toggle
ScienceCast (What is ScienceCast?)
Demos
Demos
Replicate Toggle
Replicate (What is Replicate?)
Spaces Toggle
Hugging Face Spaces (What is Spaces?)
Spaces Toggle
TXYZ.AI (What is TXYZ.AI?)
Related Papers
Recommenders and Search Tools
Link to Influence Flower
Influence Flower (What are Influence Flowers?)
Core recommender toggle
CORE Recommender (What is CORE?)
Author
Venue
Institution
Topic
About arXivLabs
arXivLabs: experimental projects with community collaborators
arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.
Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.
Have an idea for a project that will add value for arXiv's community? Learn more about arXivLabs .
Which authors of this paper are endorsers? |<br>Disable MathJax (What is MathJax?)