Back to search

State University of New York at Buffalo

Typed, Algebraic Parser in Idris2

Abstract

dc:description.abstract

Parsing transforms raw input into a structured representation using a set of rules. For example, in compilers, a parser converts a stream of characters into an intermediate representation like a Parse Tree or an Abstract Syntax Tree. Parser combinators are a popular way of building parsers, which use the tools in the host programming language to build small parsers and compose them into more complex parsers. Parser combinators are usually built using a recursive descent approach with backtracking and multiple lookahead tokens, resulting in poor worst-case time complexities. In this thesis, we have implemented a parser combinator library in Idris2 using a typed, algebraic approach. Internally, the library uses a custom type system defined for context-free expressions to identify ambiguous grammars. Furthermore, a typed grammar is deterministically parsed with no backtracking and a single lookahead token, guaranteeing linear-time performance. To demonstrate the practical application of the library, we have implemented parsers for S-expression, JSON, and the IMP programming language. These examples showcase the expressiveness of parser combinators and the robustness of the type checker without sacrificing performance.

Degree

thesis:*
Grantor dc:publisher
State University of New York at Buffalo
Year dc:date.issued
2025

Author and committee

dc:creator, dc:contributor.*
Author dc:creator
  • Bellam, Vamsi Krishna
Contributors dc:contributor
  • Hirsch, Andrew
  • Computer Science and Engineering

Subjects

dc:subject × 1

Rights

dc:rights
Statement dc:rights
  • Copyright retained by author. Users of works found in University at Buffalo Institutional Repository (UBIR) are responsible for identifying and contacting the copyright owner for permission to reuse. University at Buffalo Libraries do not manage rights for copyright-protected works and cannot assist with permissions.
Language dc:language
eng

Identifiers

dc:identifier.*
Handle dc:identifier
http://hdl.handle.net/10477/90399

Chain of custody

source
Harvested from
Buffalo
Base URL
ubir.buffalo.edu/oai/request
Last updated
2026-11-19
Source record
OAI-PMH GetRecord
related terms
citation

Bellam, Vamsi Krishna. Typed, Algebraic Parser in Idris2. State University of New York at Buffalo, 2025. http://hdl.handle.net/10477/90399