How to write parsers fast

I had a fun time writing the openQASM parser over two years ago during my two week visit at UMD College Park. Since then, I have been quite fascinated with parsers. Today, I was trying to write a parser for Lambda Q#, but I wanted to figure out if I could reduce the work I need to do and avoid boilerplate.

I found a few projects that seem helpful:

  • Steffen Smolka’s Nice Parser that is meant exactly for this need.
  • LĂ©lio Brun’s Obelisk, which I may end up using to generate good documentation for the grammar.

Further, since LambdaQs is based on the Modernized Algol (MA) language of Bob Harper, I somehow also stumbled upon a bunch of projects by Jon Sterling, specifically:

The latter two projects will be helpful for me to translate Q# source syntax directly into PFPL-style ABTs.


Turns out what I am really looking for is BNF Converter.

Edit this page

Kartik
Graduate Student

Design and Verification of Programming Languages for realistic Quantum Computing

Next
Previous