mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
Currently the example really looks like C. Instead of a union of structs to implement the AST, use a hierarchy. It would be nice to feature a C++17 version with std variants. * examples/c++/glr/c++-types.yy (Node, free_node, new_nterm) (new_term): Move into... * examples/c++/glr/ast.hh: here, a proper C++ hierarchy.
This directory contains examples of Bison grammar files, sorted per language.
Several of them come from the documentation, which should be installed together with Bison. The URLs are provided for convenience.
These examples come with a README and a Makefile. Not only can they be used to toy with Bison, they can also be starting points for your own grammars.
Please, be sure to read the C examples before looking at the other languages, as these examples are simpler.