IT lexicon › Programming › Parse

Parse

Programming På svenska → Updated: 2026-05-26

Analyze structure of input according to a formal grammar → build an AST (Abstract Syntax Tree). Basis for compilers, query parsers, JSON/XML parsing, regex engines.

Three layers: lexer/tokenizer (chars → tokens), parser (tokens → AST), semantic analyzer (type checks). Classic parser types: recursive descent (hand-written, common modern choice), LL(k) (top-down), LR(k) (bottom-up, yacc/bison), PEG (Parsing Expression Grammar, ANTLR), Pratt parser (operator precedence). Modern tools: tree-sitter (incremental parser, used by Neovim/Atom/GitHub), nom (Rust), Lark (Python). LLM era: parsing output has become its own discipline (JSON mode, function calling, BNF-constrained generation).

← Back to the lexicon