PLDB
Languages Features Calendar CSV Lists Blog About Sponsor Add Language
GitHub icon

Bison

Bison

Bison is a grammar language created in 1985.

#251on PLDB 37Years Old 846Users
2Books 1Papers 196Repos

GNU bison, commonly known as Bison, is a parser generator that is part of the GNU Project. Bison reads a specification of a context-free language, warns about any parsing ambiguities, and generates a parser (either in C, C++, or Java) which reads sequences of tokens and decides whether the sequence conforms to the syntax specified by the grammar. Bison by default generates LALR parsers but can also create GLR parsers. Read more on Wikipedia...


Example from the web:
/* Reverse Polish Notation calculator. */ %{ #include <stdio.h> #include <math.h> int yylex (void); void yyerror (char const *); %} %define api.value.type {double} %token NUM %% /* Grammar rules and actions follow. */
Example from Wikipedia:
# Makefile FILES = Lexer.c Parser.c Expression.c main.c CC = g++ CFLAGS = -g -ansi test: $(FILES) $(CC) $(CFLAGS) $(FILES) -o test Lexer.c: Lexer.l flex Lexer.l Parser.c: Parser.y Lexer.c bison Parser.y clean: rm -f *.o *~ Lexer.c Lexer.h Parser.c Parser.h test

Language features

Feature Supported Example Token
Comments
// A comment
MultiLine Comments
/* A comment
*/
/* */
Line Comments
// A comment
//
Semantic Indentation ϴ

Books about Bison from ISBNdb

title authors year publisher
flex & bison John Levine 20090805 O'Reilly Media, Inc.
flex & bison John Levine 20090805 O'Reilly Media, Inc.

Publications about Bison from Semantic Scholar

title authors year citations influentialCitations
Why bison is becoming extinct John Aycock 2001 9 1
tla.html · bison.html · ooxml.html

View source

PLDB - Build the next great programming language · v2022 · Day 31 · Docs · Build · Acknowledgements · Traffic Today · Traffic Trends · Mirrors · GitHub · feedback@pldb.com