Parsing Expression Grammar
summary
Builds a working parser for a plaintext ledger that tracks conference stickers, using a Parsing Expression Grammar implemented with the Go generator pigeon. Grammar parses date, payee, and postings where amounts are eight digits followed by literal STK, accounts are letter sequences optionally colon-delimited, and whitespace/newlines are handled explicitly. Action blocks convert matches into posting structs; repeated transactions become slices via type assertions; pigeon generates three parse functions and the parser runs successfully.
AI-written summary · about
chapters (6)
- 0:00Start
- 1:00Pidgin Parser Expression Grammar Generator
- 1:27The Code Block
- 1:52Grammar Rules
- 2:26Primitive Rules
- 2:54Whitespace
related talks
23mA Verified Packrat Parser Interpreter for Parsing Expression Grammars
14mFast Incremental PEG Parsing
44mParsing Text with a Virtual Machine
52mBuilding a parser in C#, from first principles
32mTime flies like an arrow; Fruit flies like a banana: Parsers for Great Good
37mThe Art of Parsing
52mA bird's eye view of a parser
23mHow to Write an Expression Engine?
