Building a parser in C#, from first principles
summary
Builds a hand-rolled C# parser using parser combinators and the Superpower library, showing both character-level and token-driven parsing approaches, a tokenizer builder, and how to compose small parsers into an expression grammar with operator precedence. Implements a duration-and-arithmetic expression language (numbers, 150h style durations, parentheses, keywords like now) that evaluates to DateTime/TimeSpan, includes unit tests for tiny parsers, and demonstrates error reporting improvements and practical debugging/refactoring techniques.
AI-written summary · about
chapters (10)
- 0:00Start
- 4:31Octopus Deploy
- 8:47Input and Result
- 16:31Text Parser
- 19:16Numeric Decimal Double
- 23:08The Expression Tree
- 31:14Token Driven Pausing
- 31:33Token Based Parser
- 33:07Tokenizer
- 33:29Tokenizer Builder
related talks
58mParsing in C# from first principles
53mUnderstanding parser combinators: a deep dive
01h 27mBoost.Parser (Part 1 of 2) - A Parser Combinator Library for C++
32mTime flies like an arrow; Fruit flies like a banana: Parsers for Great Good
01h 18mExpressive Compile-Time Parsers in C++
01h 48mBoost.Parser (Part 2 of 2) - A Parser Combinator Library for C++
01h 00mHow I built Rockstar: Parsing esoteric languages with .NET
29mMy Little Parser: Tooling is Magic
