Bison Parser Generator

Bison Parser Generator

www.gnu.org

2

About this website

Bison is a general-purpose parser generator that converts an annotated context-free grammar into a deterministic LR or generalized LR (GLR) parser. As the GNU replacement for yacc (Yet Another Compiler Compiler), Bison was originally written by Robert Corbett in 1985 and later maintained by Richard Stallman, Wilfred Hansen, and the Free Software Foundation. Key features: accepts LALR(1), IELR(1), and canonical LR(1) grammars for constructing efficient table-driven parsers, with the ability to resolve shift-reduce and reduce-reduce conflicts through operator precedence and associativity declarations. GLR (Generalized LR) parsing mode for handling ambiguous grammars and non-deterministic languages, useful for natural language processing and C++ parsing. IELR(1) algorithm for generating parsers with fewer conflicts and smaller tables than traditional LALR(1). Input grammar specification in a yacc-compatible format with sections for declarations, grammar rules, and user code, supporting embedded C actions for semantic processing. Mid-rule actions for executing code at arbitrary points during parsing. Token types and semantic values using unions and typed semantic values ( YYSTYPE) for passing information between grammar rules. Locations tracking (error position) via YYLTYPE for precise error reporting with file name, line, and column numbers. Multiple output language backends including C, C++, D, and Java. Internationalized error messages via gettext. Detailed conflict resolution reporting with examples of conflicting parses. Integration with Flex (the GNU lexer generator) for building complete compiler front-ends. Named references to symbols and mid-rule action values for readable grammar specifications. Skeleton files for customizing parser output. Widely used in compilers (GCC, Ruby, PHP, Go), interpreters, and configuration parsers. Open source under GPL.

Statistics

2
Views
0
Clicks
0
Like
0
Dislike

Comments

Log In to post a comment

No comments yet. Be the first!