Commit Graph

15 Commits

Author SHA1 Message Date
Akim Demaille
678853da7e examples: reccalc: really compile cleanly in C99
The previous fix does not suffice, and actually managed to make things
worse by defining yyscan_t twice in parse.y...

Reported by kencu.
https://trac.macports.org/ticket/59927#comment:29

* examples/c/reccalc/parse.y (yyscan_t): Define it with the same
guards as used by Flex.
2020-04-05 08:34:40 +02:00
Akim Demaille
e3e21cc0d8 examples: reccalc: compile cleanly in C99
See https://trac.macports.org/ticket/59927.

* examples/c/reccalc/parse.y: C99 does not allow multiple typedefs.
2020-04-02 07:14:19 +02:00
Akim Demaille
b437b16603 examples: use consistently the GFDL header for readmes
* examples/c++/README.md, examples/c++/calc++/README.md,
* examples/c/calc/README.md, examples/c/lexcalc/README.md,
* examples/c/reccalc/README.md:
Prefer the GFDL banner to the GPL one.
2020-03-06 08:31:34 +01:00
Akim Demaille
c67daa9a97 package: bump copyrights to 2020
Run 'make update-copyright'.
2020-01-10 19:16:23 +01:00
Akim Demaille
7f01adced9 tests: don't fail if seq is no available
As is the case on Solaris.
Reported by Dennis Clarke.
https://lists.gnu.org/archive/html/bug-bison/2019-12/msg00011.html

* examples/c/reccalc/reccalc.test: Skip if there is no seq.
2019-12-14 17:19:53 +01:00
Akim Demaille
719395c9cd examples: fix missing dependencies
Reported by Thomas Petazzoni.
https://lists.gnu.org/archive/html/bug-bison/2019-08/msg00000.html

* examples/c/reccalc/local.mk: Complete dependencies, including for
earlier versions of Automake (for sake of our CI, on top of Ubuntu
Xenial/Bionic, which feature only Automake 1.15).
(%D%/scan.c %D%/scan.h): Upgrade to the full version provided in
Automake's documentation.
2019-10-24 18:01:53 +02:00
Akim Demaille
17e21f6158 gitignore: update 2019-10-23 23:09:56 +02:00
Akim Demaille
21aa4b2713 style: comment changes
* examples/c/lexcalc/local.mk, examples/c/reccalc/local.mk:
Here.
2019-06-27 07:57:21 +02:00
Akim Demaille
1934304acf examples: don't run those that require f?lex when it's not available
Reported by Bruno Haible.
http://lists.gnu.org/archive/html/bug-bison/2019-05/msg00026.html

* configure.ac (FLEX_WORKS): New.
* examples/c/lexcalc/local.mk, examples/c/reccalc/local.mk: Use it.
2019-05-19 18:41:59 +02:00
Akim Demaille
3f25104caf build: do not use $< in plain rules
It works only in implicit rules (or with GNU Make, but not with
Solaris Make).

Reported by Bruno Haible.
http://lists.gnu.org/archive/html/bug-bison/2019-05/msg00009.html
Diagnosed thanks to Kiyoshi Kanazawa.

* examples/c/reccalc/local.mk, examples/d/local.mk,
* examples/java/local.mk: Don't use $< in non implicit rules.
2019-05-13 22:16:23 +02:00
Akim Demaille
02a1600994 package: add missing CLEANFILES
* examples: here.
2019-04-28 11:39:10 +02:00
Akim Demaille
0cc04eaa2a package: don't ship the sources generated from the parser
Because some of our examples use

    %C%_reccalc_SOURCES = %D%/parse.y

Automake ships parse.y and parse.c, and possibly parse.h when it
"understands" that there is one.  This is not what we want: ship only
parser.y.  Yet we still want to use Automake to compile the sources
from parser.y.  The easiest seems to use

    nodist_%C%_reccalc_SOURCES = %D%/parse.y

together with

    dist_reccalc_DATA = %D%/parse.y %D%/scan.l %D%/Makefile %D%/README.md

which guarantees that parse.y is indeed shipped.

* examples/c/calc/local.mk, examples/c/lexcalc/local.mk,
* examples/c/reccalc/local.mk: Always use nodist_*SOURCES for parsers,
let the dist_*_DATA rules do their job.
2019-04-28 11:39:10 +02:00
Akim Demaille
57290d63fd package: various fixes for syntax-check
* cfg.mk: Disable checks where needed (e.g., we do want to check the
behavior with tabs).
(sc_at_parser_check): Remove.  Unfortunately since
a11c144609 we no longer use the './'
prefix to run programs in the current directory.  That was so that we
could run Java programs like the other, although they are no run with
the `./` prefix (see 967a59d2c0).
As a consequence this sc check no longer makes sense.
However, since now AT_PARSER_CHECK passes the `./` prefix itself, this
sc-check was superfluous.
* examples/c/reccalc/scan.l: Use memcpy, not strncpy.
* src/ielr.c, src/reader.c: Obfuscate "lr(0)" so that the sc-check for
"space before paren" does not fire.
* tests/diagnostics.at: Avoid space-tab, use tab-tab.
2019-04-28 08:24:31 +02:00
Akim Demaille
1e76448ced examples: remove stray examples
* examples/c/reentrant-calc: Remove.
I did not mean to include this example, it was replaced by
examples/c/reccalc.
2019-02-23 11:42:55 +01:00
Akim Demaille
6289d673a0 examples: add an example with a reentrant parser in Flex+Bison
Suggested by Eric S. Raymond.
https://lists.gnu.org/archive/html/bison-patches/2019-02/msg00066.html

* examples/c/reentrant-calc/Makefile, examples/c/reentrant-calc/README.md,
* examples/c/reentrant-calc/parse.y, examples/c/reentrant-calc/scan.l
* examples/c/reentrant-calc/lexcalc.test,
* examples/c/reentrant-calc/local.mk:
New.
2019-02-17 11:31:51 +01:00