Files
bison/examples/c++
Akim Demaille eff6739124 c++: workaround portability issue
On some systems (x86_64-pc-solaris2.11), with Developer Studio 12.5's
CC, we get:

    ".../include/CC/Cstd/vector.cc", line 127: Error: Cannot assign const yy::parser::stack_symbol_type to yy::parser::stack_symbol_type without "yy::parser::stack_symbol_type::operator=(const yy::parser::stack_symbol_type&)";.
    ".../include/CC/Cstd/vector", line 475:     Where: While instantiating "std::vector<yy::parser::stack_symbol_type>::__insert_aux(yy::parser::stack_symbol_type*, const yy::parser::stack_symbol_type&)".
    ".../include/CC/Cstd/vector", line 475:     Where: Instantiated from non-template code.
    1 Error(s) detected.

Don't expect __cplusplus to be always defined.  If it's not, consider
this is C++98.

Reported by Nelson H. F. Beebe.

* data/c++.m4, data/lalr1.cc, examples/c++/variant.yy, tests/local.at,
* tests/testsuite.h:
An undefined __cplusplus means pre C++11.
2018-11-04 08:00:01 +01:00
..
2018-10-26 08:40:07 +02:00
2018-11-04 08:00:01 +01:00

This directory contains examples of Bison grammar files in C++.

* Examples in C++

You can run `make` to compile these examples.  And `make clean` to tidy
afterwards.

** simple.yy - Simple example in C++14
A very simple example in C++, based on variants and symbol constructors.
Variants allow to use any C++ type as semantic value type, and symbol
constructors ensure consistency between declared token type and effective
semantic value.

Run as `./simple`.

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

** variant.yy - Self-contained example in C++98
A variation of simple.yy, in C++98.

Run as `./variant`.

** variant-11.yy - Self-contained example in modern C++
Another variation of simple.yy, closely related to the previous one, but
exhibiting support for C++11's move semantics.

Run as `./variant` or `./variant NUMBER`.

-----

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 ispell american