Files
bison/examples
Akim Demaille 4fd1fc70e0 examples: ship them
Currently, the examples are extracted on the user's side.
Unfortunately, that requires that the user has Perl, which is
otherwise not needed for Bison.  Let's ship the examples instead.

The examples were handled this way so that we could depend on
configure flags: if --enable-gcc-warnings is passed, it is understood
as "I'm a maintainer", so the examples are generated with `#line`s.
Regular users should not see them, so they are now unconditionally
removed when rolling a tarball.

Reported by Mike Frysinger.
https://lists.gnu.org/archive/html/bison-patches/2015-04/msg00000.html

* examples/local.mk: Ship all the extracted files.
(examples-unline): New.
Make sure that the generated tarballs do not contain the #lines.
2018-11-06 13:23:13 +01:00
..
2018-10-26 07:42:28 +02:00
2018-11-06 13:23:13 +01:00
2018-10-26 08:40:07 +02:00

This directory contains examples of Bison grammar files.

Most of them come from the documentation, which should be installed together
with Bison.  The URLs are provided for convenience.


* Examples in C

** rpcalc - Reverse Polish Notation Calculator
The first example is that of a simple double-precision Reverse Polish
Notation calculator (a calculator using postfix operators). This example
provides a good starting point, since operator precedence is not an issue.

Extracted from the documentation: "Reverse Polish Notation Calculator"
https://www.gnu.org/software/bison/manual/html_node/RPN-Calc.html

** mfcalc - Multi-Function Calculator
A more complete C example: a multi-function calculator.

Extracted from the documentation: "Multi-Function Calculator: mfcalc".
https://www.gnu.org/software/bison/manual/html_node/Multi_002dfunction-Calc.html



* Examples in C++

** c++ - A directory of simple C++ examples

** calc++ - A Complete C++ Example
A fully featured C++ version of the canonical example for parsers: a
calculator.  Also uses Flex for the scanner.

Extracted from the documentation: "A Complete C++ Example".
https://www.gnu.org/software/bison/manual/html_node/A-Complete-C_002b_002b-Example.html


-----

Local Variables:
mode: outline
fill-column: 76
ispell-dictionary: "american"
End:

Copyright (C) 2018 Free Software Foundation, Inc.

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with no
Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
Texts.  A copy of the license is included in the "GNU Free
Documentation License" file as part of this distribution.

# LocalWords:  mfcalc calc parsers yy