Search Results

Documents authored by Cheng, Luyu


Artifact
InteractiveResource
Online Web Demonstration of A Simple Recipe for Writing Decent Recursive Descent Parsers

Authors: Luyu Cheng and Lionel Parreaux


Abstract

Cite as

Luyu Cheng, Lionel Parreaux. Online Web Demonstration of A Simple Recipe for Writing Decent Recursive Descent Parsers (InteractiveResource, Online demonstration). Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2026)


Copy BibTex To Clipboard

@misc{dagstuhl-artifact-26720,
   title = {{Online Web Demonstration of A Simple Recipe for Writing Decent Recursive Descent Parsers}}, 
   author = {Cheng, Luyu and Parreaux, Lionel},
   note = {InteractiveResource (visited on 2026-06-25)},
   url = {https://recursive-descent-parsing.mlscript.dev},
   doi = {10.4230/artifacts.26720},
}
Document
Pearl/Brave New Idea
A Simple Recipe for Writing Decent Recursive Descent Parsers (Pearl/Brave New Idea)

Authors: Luyu Cheng and Lionel Parreaux

Published in: LIPIcs, Volume 372, 40th European Conference on Object-Oriented Programming (ECOOP 2026)


Abstract
Parsing well-designed computer languages should not be a hard problem, be it for humans or for machines. This is not a new idea: in 1973, Vaughan R. Pratt argued against formalistic grammar specifications and in favor of a more intuitive and meaningful approach to designing and parsing syntax. In this Pearl, we take the reader on a journey through handwritten recursive descent parsing, revisiting Pratt’s original philosophy in a modern, statically-typed functional programming language. Contrary to many existing tutorials on the subject, we do not stop at simple expression languages: we also discuss how to tackle the full syntax of a simple programming language while avoiding the pitfalls of ad-hoc implementations. Indeed, a downside of recursive descent parsing is that the specification of what the parser accepts is written in code, which may contain subtle bugs and is not easily accessible to end users. We describe a simple recipe for architecting extensible recursive descent parsers that can automatically produce a readable representation of the syntax specification. We illustrate our approach by implementing a parser for a variant of Caml Light. Overall, this paper serves both as a pedagogical introduction to Pratt parsing in a modern programming language and as a practical guide to programmers who just want to implement, without unnecessary headaches, a computer language that is easy to parse and easy to read.

Cite as

Luyu Cheng and Lionel Parreaux. A Simple Recipe for Writing Decent Recursive Descent Parsers (Pearl/Brave New Idea). In 40th European Conference on Object-Oriented Programming (ECOOP 2026). Leibniz International Proceedings in Informatics (LIPIcs), Volume 372, pp. 30:1-30:28, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2026)


Copy BibTex To Clipboard

@InProceedings{cheng_et_al:LIPIcs.ECOOP.2026.30,
  author =	{Cheng, Luyu and Parreaux, Lionel},
  title =	{{A Simple Recipe for Writing Decent Recursive Descent Parsers}},
  booktitle =	{40th European Conference on Object-Oriented Programming (ECOOP 2026)},
  pages =	{30:1--30:28},
  series =	{Leibniz International Proceedings in Informatics (LIPIcs)},
  ISBN =	{978-3-95977-423-9},
  ISSN =	{1868-8969},
  year =	{2026},
  volume =	{372},
  editor =	{Krebbers, Robbert and Silva, Alexandra},
  publisher =	{Schloss Dagstuhl -- Leibniz-Zentrum f{\"u}r Informatik},
  address =	{Dagstuhl, Germany},
  URL =		{https://drops.dagstuhl.de/entities/document/10.4230/LIPIcs.ECOOP.2026.30},
  URN =		{urn:nbn:de:0030-drops-261261},
  doi =		{10.4230/LIPIcs.ECOOP.2026.30},
  annote =	{Keywords: Parsing, Pratt Parsing, Operator Precedence, Recursive Descent}
}
Document
Artifact
A Simple Recipe for Writing Decent Recursive Descent Parsers (Artifact)

Authors: Luyu Cheng and Lionel Parreaux

Published in: DARTS, Volume 12, Issue 1, Special Issue of the 40th European Conference on Object-Oriented Programming (ECOOP 2026)


Abstract
This artifact consists of the MLscript implementation of the generalized Pratt parser introduced in the related article, together with a standalone browser demo written in MLscript. The demo parses full Caml Light programs, a lightweight precursor to OCaml, as well as examples with dynamically extended syntax, and displays syntax trees, tokens, parser traces, precedence information, syntax diagrams, and parser errors. For convenience, the package also includes the MLscript compiler project used to rebuild the parser and demo, and the tests that exercise the examples and generated web-demo artifacts.

Cite as

Luyu Cheng and Lionel Parreaux. A Simple Recipe for Writing Decent Recursive Descent Parsers (Artifact). In Special Issue of the 40th European Conference on Object-Oriented Programming (ECOOP 2026). Dagstuhl Artifacts Series (DARTS), Volume 12, Issue 1, pp. 17:1-17:4, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2026)


Copy BibTex To Clipboard

@Article{cheng_et_al:DARTS.12.1.17,
  author =	{Cheng, Luyu and Parreaux, Lionel},
  title =	{{A Simple Recipe for Writing Decent Recursive Descent Parsers (Artifact)}},
  pages =	{17:1--17:4},
  journal =	{Dagstuhl Artifacts Series},
  ISSN =	{2509-8195},
  year =	{2026},
  volume =	{12},
  number =	{1},
  editor =	{Cheng, Luyu and Parreaux, Lionel},
  publisher =	{Schloss Dagstuhl -- Leibniz-Zentrum f{\"u}r Informatik},
  address =	{Dagstuhl, Germany},
  URL =		{https://drops.dagstuhl.de/entities/document/10.4230/DARTS.12.1.17},
  URN =		{urn:nbn:de:0030-drops-261543},
  doi =		{10.4230/DARTS.12.1.17},
  annote =	{Keywords: Parsing, Pratt Parsing, Recursive Descent, Extensible Syntax, Artifact}
}
Any Issues?
X

Feedback on the Current Page

CAPTCHA

Thanks for your feedback!

Feedback submitted to Dagstuhl Publishing

Could not send message

Please try again later or send an E-mail