mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 04:13:03 +00:00
* src/lex.c (percent_table): Also accept `%yacc', `%fixed_output_files', `%defines', `%no_parser', `%verbose', and `%debug'. Handle the actions for `%semantic_parser' and `%pure_parser' here, instead of returning a token. * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused. * src/reader.c (read_declarations): Adjust. * src/files.c (open_files): Don't call `compute_base_names', don't compute `attrsfile' since they depend upon data which might be *in* the input file now. (output_files): Do it here. * src/output.c (output_headers): Document the fact that this patch introduces a guaranteed SEGV for semantic parsers. * doc/bison.texinfo: Document them. * tests/suite.at: Exercise these %options.
62 lines
1.8 KiB
Plaintext
62 lines
1.8 KiB
Plaintext
#! /bin/sh
|
|
# -*- Autoconf -*-
|
|
# Validation suite for Bison.
|
|
# Copyright 2000 Free Software Foundation, Inc.
|
|
|
|
AT_INIT([bison])
|
|
|
|
## ---------------------------- ##
|
|
## Checking output file names. ##
|
|
## ---------------------------- ##
|
|
|
|
# AT_CHECK_BISON_FLAGS(FLAGS, EXPECTED-FILES-SORTED)
|
|
# --------------------------------------------------
|
|
AT_DEFINE([AT_CHECK_BISON_FLAGS],
|
|
[AT_SETUP([Output files: $1.])
|
|
AT_DATA([foo.y],
|
|
[[%%
|
|
foo: {}
|
|
]])
|
|
rm -rf $2
|
|
AT_CHECK([bison -dv foo.y $1], 0, ignore, ignore)
|
|
AT_CHECK([ls $2 | sort | tr '\n' ' ' | sed 's/.$//g'], 0, [$2])
|
|
rm -f $2
|
|
AT_CLEANUP
|
|
])
|
|
|
|
AT_CHECK_BISON_FLAGS([], [foo.output foo.tab.c foo.tab.h])
|
|
AT_CHECK_BISON_FLAGS([-o foo.c], [foo.c foo.h foo.output])
|
|
AT_CHECK_BISON_FLAGS([-o foo.tab.c], [foo.output foo.tab.c foo.tab.h])
|
|
AT_CHECK_BISON_FLAGS([-y], [y.output y.tab.c y.tab.h])
|
|
AT_CHECK_BISON_FLAGS([-b bar], [bar.output bar.tab.c bar.tab.h])
|
|
|
|
|
|
|
|
# AT_CHECK_BISON_PERCENT(GRAMMAR-OPTIONS, EXPECTED-FILES-SORTED)
|
|
# --------------------------------------------------------------
|
|
AT_DEFINE([AT_CHECK_BISON_PERCENT],
|
|
[AT_SETUP([Output files: $1.])
|
|
AT_DATA([foo.y],
|
|
[[$1
|
|
%defines
|
|
%verbose
|
|
%%
|
|
foo: {}
|
|
]])
|
|
rm -rf $2
|
|
AT_CHECK([bison foo.y], 0, ignore, ignore)
|
|
AT_CHECK([ls $2 | sort | tr '\n' ' ' | sed 's/.$//g'], 0, [$2])
|
|
rm -f $2
|
|
AT_CLEANUP
|
|
])
|
|
|
|
# The sames, but using the % directives.
|
|
AT_CHECK_BISON_PERCENT([], [foo.output foo.tab.c foo.tab.h])
|
|
# AT_CHECK_BISON_PERCENT([%output foo.c], [foo.c foo.h foo.output])
|
|
# AT_CHECK_BISON_PERCENT([%output foo.tab.c], [foo.output foo.tab.c foo.tab.h])
|
|
AT_CHECK_BISON_PERCENT([%yacc], [y.output y.tab.c y.tab.h])
|
|
# AT_CHECK_BISON_PERCENT([%file_prefix bar], [bar.output bar.tab.c bar.tab.h])
|
|
|
|
AT_INCLUDE([calc.at])
|
|
AT_INCLUDE([regression.at])
|