Hacker News with Generative AI: Parsing

(Right-Nulled) Generalised LR Parsing (jeffsmits.net)
I hope you know a bit about LR parsing, otherwise this blog post won’t make much sense to you. You can read all about it in a previous post of mine. Today I want to discuss the problems with getting your language parsed in LR(1), or even LR(k). And how an old way to solve those problems is with a more powerful algorithm, that can parse any context-free grammar, no restrictions, no complaints about conflicts.
(Right-Nulled) Generalised LR Parsing (jeffsmits.net)
I hope you know a bit about LR parsing, otherwise this blog post won’t make much sense to you. You can read all about it in a previous post of mine. Today I want to discuss the problems with getting your language parsed in LR(1), or even LR(k). And how an old way to solve those problems is with a more powerful algorithm, that can parse any context-free grammar, no restrictions, no complaints about conflicts.
C "clockwise/spiral" rule to understand declarations (c-faq.com)
There is a technique known as the ``Clockwise/Spiral Rule'' which enables any C programmer to parse in their head any C declaration!
Syntax error recovery in parsing expression grammars (PEG parsers) (arxiv.org)
Parsing Expression Grammars (PEGs) are a formalism used to describe top-down parsers with backtracking. As PEGs do not provide a good error recovery mechanism, PEG-based parsers usually do not recover from syntax errors in the input, or recover from syntax errors using ad-hoc, implementation-specific features. The lack of proper error recovery makes PEG parsers unsuitable for using with Integrated Development Environments (IDEs), which need to build syntactic trees even for incomplete, syntactically invalid programs.
Linear-Time Parser Combinators (blogspot.com)
My birthday just passed, and to relax I wrote a parser combinator library.
Structured Editing and Incremental Parsing (tratt.net)
As someone who has from time to time written on parsing, and even published some parsing research, I get asked questions about parsing fairly regularly, some of which I’m even capable of answering.
Runtime-Extensible SQL Parsers Using Peg (duckdb.org)
TL;DR: Despite their central role in processing queries, parsers have not received any noticeable attention in the data systems space. State-of-the art systems are content with ancient old parser generators. These generators create monolithic, inflexible and unforgiving parsers that hinder innovation in query languages and frustrate users. Instead, parsers should be rewritten using modern abstractions like Parser Expression Grammars (PEG), which allow dynamic changes to the accepted query syntax and better error recovery.
From string to AST: parsing (2019) (kubuszok.com)
Whether you have to do with data in form of CSV, JSON or a full-blooded programming language like C, JavaScript, Scala, or maybe a query language like SQL, you always transform some sequence of characters (or binary values) into a structured representation.
Rust for tokenising and parsing (xnacly.me)
I am currently writing a analysis tool for Sql: sqleibniz, specifically for the sqlite dialect.
Why I love Rust for tokenising and parsing (xnacly.me)
I am currently writing a analysis tool for Sql: sqleibniz, specifically for the sqlite dialect.
How Dwarf Works: Parsing Just Enough ELF (calabro.io)
This is part of the series on DWARF.
Making libjson RFC 8259 compilant (xnacly.me)
I wrote a json parser in go, because I wanted to do some language developement, write a lexer and a parser while doing a lot of performance work. So here i am, almost at the performance of encoding/json1, but I expose a different way of interacting with the json object via the xnacly/libjson package api.
Interval parsing grammars for file format parsing (2023) (dl.acm.org)
Parsing Protobuf Definitions with Tree-sitter (relistan.com)
Show HN: Gosax – A high-performance SAX XML parser for Go (github.com/orisano)
Parsing JSON Is a Minefield (2018) (seriot.ch)
Arena-based parsers (iliabylich.github.io)
Ruff v0.4.0: a hand-written recursive descent parser for Python (astral.sh)
Parsing and all that (jeffsmits.net)