An Overview of flex and bison

BNF Grammer Basics Context-free grammars are often described using Backus-Naur Form (BNF). For example: expression : expression '+' expression | expression '-' expression | NUMBER ; This defines a rule for expression with three alternatives (productions). Each production has a leeft-hand side (LHS) and a right ...

Posted on Sat, 12 Sep 2026 16:23:55 +0000 by alfonsomr

Resolving Bison Shift-Reduce Conflicts for If-Else Statements with Virtual Token Priority

selection_statement : IF_P LPAREN expr RPAREN stmt_e ELSE_P stmt_e | IF_P LPAREN expr RPAREN stmt_e %prec LOW_PRI | SWITCH_P LPAREN expr RPAREN stmt_e ; Bison may flag a shift/reduce conflict on token ELSE_P when parsing nested if-else structures like if (...) if (...) stmt • ELSE stmt. The parser cannot decide whether to shift ...

Posted on Sat, 08 Aug 2026 16:27:17 +0000 by sintax63

PostgreSQL's Parser Implementation with Flex and Bison

Understanding PostgreSQL's Parser Architecture When examining PostgreSQL's source code, one might notice that the conventional Bison parser function yyparse is replaced by base\_yyparse(). This modification is part of PostgreSQL's customized implementation of Flex and Bison for its SQL parsing needs. The PostgreSQL parser configuration in gram. ...

Posted on Tue, 23 Jun 2026 16:50:25 +0000 by jstarkweather

MySQL SQL Parser Architecture: Understanding Flex and Bison Integration

MySQL SQL Parser Architecture: Understanding Flex and Bison Integration This technical overview examines how MySQL 8.0.34 implements SQL query parsing using bison-generated parser code. The analysis focuses on key implementation details and customizations that differ from standard bison usage patterns. Grammar Definition Location MySQL stores i ...

Posted on Sun, 10 May 2026 01:26:46 +0000 by Plagel