* Makefile.cfg (local-checks-to-skip): Add changelog-check,

since we don't want to insist on a version number at the start
of the changelog every time.
* Makefile.maint: Sync from coreutils a bit better.
(sc_trailing_blank): Renamed from sc_trailing_space.
All uses changed.
(sc_no_if_have_config_h, sc_require_config_h):
(sc_prohibit_assert_without_use): New rules.
(sc_obsolete_symbols): Don't catch Makefile.maint itself.
(sc_dd_max_sym_length): Fix leading spaces in rule.
(sc_system_h_headers): Prefix with @.
(sc_useless_cpp_parens, m4-check): Output line numbers.
(changelog-check): Allow version only in head.
* data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
satisfy new Makefile.maint rule.
* data/glr.c: Likewise.
* data/glr.cc: Likewise.
* data/lalr1.cc: Likewise.
* data/yacc.c: Likewise.
* lib/ebitsetv.c: Likewise.
* lib/lbitset.c: Likewise.
* lib/subpipe.c: Likewise.
* lib/timevar.c: Likewise.
* src/system.h: Likewise.
* data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
* djgpp/Makefile.maint: Add copyright notice.
* djgpp/README.in: Likewise.
* djgpp/config.bat: Likewise.
* djgpp/config.site: Likewise.
* djgpp/config_h.sed: Likewise.
* djgpp/djunpack.bat: Likewise.
* djgpp/config.sed: Fix copyright notice to match standard format.
* djgpp/subpipe.h: Likewise.
* lib/bitsetv-print.c: Likewise.
* lib/bitsetv.c: Likewise.
* lib/subpipe.h: Likewise.
* lib/timevar.c: Likewise.
* lib/timevar.h: Likewise.
* djgpp/subpipe.c: Use standard recipe for config.h.
* lib/abitset.c: Likewise.
* lib/bitset.c: Likewise.
* lib/bitset_stats.c: Likewise.
* lib/bitsetv-print.c: Likewise.
* lib/bitsetv.c: Likewise.
* lib/ebitsetv.c: Likewise.
* lib/get-errno.c: Likewise.
* lib/lbitset.c: Likewise.
* lib/subpipe.c: Likewise.
* lib/timevar.c: Likewise.
* lib/vbitset.c: Likewise.
* tests/local.at: Likewise.
* src/scan-gram.l: Don't include verify.h, since system.h does
that for us.
* .x-sc_require_config_h: New file.
* .x-sc_unmarked_diagnostics: New file.
This commit is contained in:
Paul Eggert
2006-01-22 07:38:49 +00:00
parent 68cae94e0b
commit 02650b7f0e
34 changed files with 736 additions and 584 deletions

View File

@@ -1,3 +1,61 @@
2006-01-21 Paul Eggert <eggert@cs.ucla.edu>
* Makefile.cfg (local-checks-to-skip): Add changelog-check,
since we don't want to insist on a version number at the start
of the changelog every time.
* Makefile.maint: Sync from coreutils a bit better.
(sc_trailing_blank): Renamed from sc_trailing_space.
All uses changed.
(sc_no_if_have_config_h, sc_require_config_h):
(sc_prohibit_assert_without_use): New rules.
(sc_obsolete_symbols): Don't catch Makefile.maint itself.
(sc_dd_max_sym_length): Fix leading spaces in rule.
(sc_system_h_headers): Prefix with @.
(sc_useless_cpp_parens, m4-check): Output line numbers.
(changelog-check): Allow version only in head.
* data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
satisfy new Makefile.maint rule.
* data/glr.c: Likewise.
* data/glr.cc: Likewise.
* data/lalr1.cc: Likewise.
* data/yacc.c: Likewise.
* lib/ebitsetv.c: Likewise.
* lib/lbitset.c: Likewise.
* lib/subpipe.c: Likewise.
* lib/timevar.c: Likewise.
* src/system.h: Likewise.
* data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
* djgpp/Makefile.maint: Add copyright notice.
* djgpp/README.in: Likewise.
* djgpp/config.bat: Likewise.
* djgpp/config.site: Likewise.
* djgpp/config_h.sed: Likewise.
* djgpp/djunpack.bat: Likewise.
* djgpp/config.sed: Fix copyright notice to match standard format.
* djgpp/subpipe.h: Likewise.
* lib/bitsetv-print.c: Likewise.
* lib/bitsetv.c: Likewise.
* lib/subpipe.h: Likewise.
* lib/timevar.c: Likewise.
* lib/timevar.h: Likewise.
* djgpp/subpipe.c: Use standard recipe for config.h.
* lib/abitset.c: Likewise.
* lib/bitset.c: Likewise.
* lib/bitset_stats.c: Likewise.
* lib/bitsetv-print.c: Likewise.
* lib/bitsetv.c: Likewise.
* lib/ebitsetv.c: Likewise.
* lib/get-errno.c: Likewise.
* lib/lbitset.c: Likewise.
* lib/subpipe.c: Likewise.
* lib/timevar.c: Likewise.
* lib/vbitset.c: Likewise.
* tests/local.at: Likewise.
* src/scan-gram.l: Don't include verify.h, since system.h does
that for us.
* .x-sc_require_config_h: New file.
* .x-sc_unmarked_diagnostics: New file.
2006-01-20 Paul Eggert <eggert@cs.ucla.edu>
Be a bit more systematic about using 'abort'.

View File

@@ -1,5 +1,5 @@
# Customize Makefile.maint for Bison. -*- makefile -*-
# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
# Copyright (C) 2003, 2005, 2006 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -44,7 +44,5 @@ cvs_files = \
$(build_aux_dir)/mkinstalldirs
# Tests not to run.
# local-checks-to-skip ?= \
# author_mark_check \
# strftime-check syntax-check makefile_path_separator_check \
# makefile-check
local-checks-to-skip = \
changelog-check

View File

@@ -113,7 +113,7 @@ syntax-check-rules = \
sc_sun_os_names \
sc_system_h_headers \
sc_tight_scope \
sc_trailing_space \
sc_trailing_blank \
sc_unmarked_diagnostics \
sc_useless_cpp_parens
@@ -174,10 +174,32 @@ sc_file_system:
'rewrite to use "file system"' 1>&2; \
exit 1; } || :
sc_no_if_have_config_h:
@grep -n '^# *if HAVE_CONFIG_H' $$($(CVS_LIST_EXCEPT)) && \
{ echo '$(ME): found use of #if HAVE_CONFIG_H; use #ifdef' \
1>&2; exit 1; } || :
# Nearly all .c files must include <config.h>.
sc_require_config_h:
@grep -L '^# *include <config\.h>' \
$$($(CVS_LIST_EXCEPT) | grep '\.c$$') \
| grep . && \
{ echo '$(ME): the above files do not include <config.h>' \
1>&2; exit 1; } || :
# Prohibit the inclusion of assert.h without an actual use of assert.
sc_prohibit_assert_without_use:
@files=$$(grep -l '# *include <assert\.h>' \
$$($(CVS_LIST_EXCEPT) | grep '\.c$$')) && \
grep -L '\<assert (' $$files \
| grep . && \
{ echo "$(ME): the above files include <assert.h> but don't use it" \
1>&2; exit 1; } || :
sc_obsolete_symbols:
@grep -nE '\<(\<(HAVE_FCNTL_H|O_NDELAY)\>' \
@grep -nE '\<(HAVE''_FCNTL_H|O''_NDELAY)\>' \
$$($(CVS_LIST_EXCEPT)) && \
{ echo '$(ME): do not use HAVE_FCNTL_H or O_NDELAY' \
{ echo '$(ME): do not use HAVE''_FCNTL_H or O''_NDELAY' \
1>&2; exit 1; } || :
# FIXME: warn about definitions of EXIT_FAILURE, EXIT_SUCCESS, STREQ
@@ -197,7 +219,7 @@ ifneq ($(wildcard $(dd_c)),)
len=$$( (sed -n '/conversions\[\] =$$/,/^};/p' $(dd_c); \
sed -n '/flags\[\] =$$/,/^};/p' $(dd_c) ) \
|sed -n '/"/s/^[^"]*"\([^"]*\)".*/\1/p' \
| wc --max-line-length); \
| wc --max-line-length); \
max=$$(sed -n '/^#define LONGEST_SYMBOL /s///p' $(dd_c) \
|tr -d '"' | wc --max-line-length); \
if test "$$len" = "$$max"; then :; else \
@@ -239,7 +261,7 @@ sc_root_tests:
# Files in src/ should not include directly any of
# the headers already included via system.h.
sc_system_h_headers: .re-list
if test -f $(srcdir)/src/system.h; then \
@if test -f $(srcdir)/src/system.h; then \
trap 'rc=$$?; rm -f .re-list; exit $$rc' 0 1 2 3 15; \
grep -nE -f .re-list \
$$($(CVS_LIST) src | \
@@ -258,9 +280,9 @@ sc_sun_os_names:
sc_tight_scope:
$(MAKE) -C src $@
sc_trailing_space:
sc_trailing_blank:
@grep -n '[ ]$$' $$($(CVS_LIST_EXCEPT)) && \
{ echo '$(ME): found trailing space(s)' \
{ echo '$(ME): found trailing blank(s)' \
1>&2; exit 1; } || :
# Look for diagnostics that aren't marked for translation.
@@ -275,7 +297,7 @@ sc_unmarked_diagnostics:
# Avoid useless parentheses like those in this example:
# #if defined (SYMBOL) || defined (SYM2)
sc_useless_cpp_parens:
@grep '^# *if .*defined *(' $$($(CVS_LIST_EXCEPT)) && \
@grep -n '^# *if .*defined *(' $$($(CVS_LIST_EXCEPT)) && \
{ echo '$(ME): found useless parentheses in cpp directive' \
1>&2; exit 1; } || :
@@ -312,7 +334,7 @@ news-date-check: NEWS
fi
changelog-check:
if grep 'Version $(VERSION_REGEXP)\.$$' ChangeLog \
if head ChangeLog | grep 'Version $(VERSION_REGEXP)\.$$' \
>/dev/null; then \
:; \
else \
@@ -321,7 +343,7 @@ changelog-check:
fi
m4-check:
@grep 'AC_DEFUN([^[]' m4/*.m4 \
@grep -n 'AC_DEFUN([^[]' m4/*.m4 \
&& { echo 'Makefile.maint: quote the first arg to AC_DEFUN' 1>&2; \
exit 1; } || :

View File

@@ -142,7 +142,7 @@ m4_define([b4_int_type],
m4_eval([0 <= $1]), [1], [unsigned int],
[int])])
[int])])
# b4_int_type_for(NAME)
@@ -228,7 +228,7 @@ m4_define([b4_token_enums],
enum yytokentype {
m4_map_sep([ b4_token_enum], [,
],
[$@])
[$@])
};
#endif
])])
@@ -259,8 +259,8 @@ m4_define([b4_token_enums_defines],
# Consider a C++ compiler to be modern if it defines __cplusplus.
#
m4_define([b4_c_modern],
[[(defined (__STDC__) || defined (__C99__FUNC__) \
|| defined (__cplusplus) || defined (_MSC_VER))]])
[[(defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)]])
# b4_c_function_def(NAME, RETURN-VALUE, [DECL1, NAME1], ...)
# ----------------------------------------------------------
@@ -290,9 +290,9 @@ $1 (b4_c_ansi_formals(m4_shiftn(2, $@)))[]dnl
# Output the arguments ANSI-C definition.
m4_define([b4_c_ansi_formals],
[m4_case([$@],
[], [void],
[[]], [void],
[m4_map_sep([b4_c_ansi_formal], [, ], [$@])])])
[], [void],
[[]], [void],
[m4_map_sep([b4_c_ansi_formal], [, ], [$@])])])
m4_define([b4_c_ansi_formal],
[$1])
@@ -313,9 +313,9 @@ m4_define([b4_c_knr_formal_name],
# Output the K&R argument declarations.
m4_define([b4_c_knr_formal_decls],
[m4_map_sep([b4_c_knr_formal_decl],
[
[
],
[$@])])
[$@])])
m4_define([b4_c_knr_formal_decl],
[ $1;])
@@ -331,7 +331,7 @@ m4_define([b4_c_knr_formal_decl],
# -----------------------------------------------------------
# Declare the function NAME.
m4_define([b4_c_function_decl],
[#if defined (__STDC__) || defined (__cplusplus)
[#if defined __STDC__ || defined __cplusplus
b4_c_ansi_function_decl($@)
#else
$2 $1 ();
@@ -398,9 +398,9 @@ m4_define([b4_symbol_actions],
m4_pushdef([b4_at_dollar], [(*yylocationp)])dnl
case $4: /* $3 */
b4_syncline([$2], [$1])
$5;
$5;
b4_syncline([@oline@], [@ofile@])
break;
break;
m4_popdef([b4_at_dollar])dnl
m4_popdef([b4_dollar_dollar])dnl
])
@@ -438,7 +438,7 @@ b4_parse_param_use[]dnl
{
]m4_map([b4_symbol_actions], m4_defn([b4_symbol_destructors]))[
default:
break;
break;
}
}]dnl
])
@@ -458,9 +458,9 @@ m4_define_default([b4_yy_symbol_print_generate],
/*ARGSUSED*/
]$1([yy_symbol_value_print],
[static void],
[[FILE *yyoutput], [yyoutput]],
[[int yytype], [yytype]],
[[const YYSTYPE * const yyvaluep], [yyvaluep]][]dnl
[[FILE *yyoutput], [yyoutput]],
[[int yytype], [yytype]],
[[const YYSTYPE * const yyvaluep], [yyvaluep]][]dnl
b4_location_if([, [[const YYLTYPE * const yylocationp], [yylocationp]]])[]dnl
m4_ifset([b4_parse_param], [, b4_parse_param]))[
{
@@ -479,7 +479,7 @@ b4_parse_param_use[]dnl
{
]m4_map([b4_symbol_actions], m4_defn([b4_symbol_printers]))dnl
[ default:
break;
break;
}
}
@@ -490,9 +490,9 @@ b4_parse_param_use[]dnl
]$1([yy_symbol_print],
[static void],
[[FILE *yyoutput], [yyoutput]],
[[int yytype], [yytype]],
[[const YYSTYPE * const yyvaluep], [yyvaluep]][]dnl
[[FILE *yyoutput], [yyoutput]],
[[int yytype], [yytype]],
[[const YYSTYPE * const yyvaluep], [yyvaluep]][]dnl
b4_location_if([, [[const YYLTYPE * const yylocationp], [yylocationp]]])[]dnl
m4_ifset([b4_parse_param], [, b4_parse_param]))[
{

View File

@@ -171,7 +171,7 @@ m4_define([b4_shared_declarations],
/* Copy the first part of user declarations. */
]b4_pre_prologue[
#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
]m4_ifdef([b4_stype],
[typedef union m4_bregexp(b4_stype, [^{], [YYSTYPE ])
b4_stype
@@ -183,7 +183,7 @@ b4_syncline([@oline@], [@ofile@])
# define YYSTYPE_IS_TRIVIAL 1
#endif
#if ! defined (YYLTYPE) && ! defined (YYLTYPE_IS_DECLARED)
#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
typedef struct YYLTYPE
{
]b4_location_if([
@@ -253,7 +253,7 @@ b4_syncline([@oline@], [@ofile@])
#endif
/* Suppress unused-variable warnings by "using" E. */
#if !defined (lint) || defined (__GNUC__)
#if ! defined lint || defined __GNUC__
# define YYUSE(e) ((void) (e))
#else
# define YYUSE(e) /* empty */
@@ -302,7 +302,7 @@ b4_syncline([@oline@], [@ofile@])
#ifndef __attribute__
/* This feature is available in gcc versions 2.5 and later. */
# if (!defined (__GNUC__) || __GNUC__ < 2 \
# if (! defined __GNUC__ || __GNUC__ < 2 \
|| (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__)
# define __attribute__(Spec) /* empty */
# endif
@@ -563,9 +563,9 @@ typedef enum { yyok, yyaccept, yyabort, yyerr } YYRESULTTAG;
#if YYDEBUG
#if ! defined (YYFPRINTF)
# ifndef YYFPRINTF
# define YYFPRINTF fprintf
#endif
# endif
# define YYDPRINTF(Args) \
do { \
@@ -621,9 +621,9 @@ int yydebug;
#define YYHEADROOM 2
#ifndef YYSTACKEXPANDABLE
# if (! defined (__cplusplus) \
|| (]b4_location_if([[defined (YYLTYPE_IS_TRIVIAL) && YYLTYPE_IS_TRIVIAL \
&& ]])[defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL))
# if (! defined __cplusplus \
|| (]b4_location_if([[defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
&& ]])[defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))
# define YYSTACKEXPANDABLE 1
# else
# define YYSTACKEXPANDABLE 0
@@ -648,7 +648,7 @@ int yydebug;
#if YYERROR_VERBOSE
# ifndef yystpcpy
# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
# define yystpcpy stpcpy
# else
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in

View File

@@ -74,9 +74,9 @@ m4_define([b4_yy_symbol_print_generate],
[[FILE *], []],
[[int yytype], [yytype]],
[[const yy::b4_parser_class_name::semantic_type *yyvaluep],
[yyvaluep]],
[yyvaluep]],
[[const yy::b4_parser_class_name::location_type *yylocationp],
[yylocationp]],
[yylocationp]],
b4_parse_param)[
{
]b4_parse_param_use[]dnl
@@ -143,7 +143,7 @@ m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl
inline void
]b4_parser_class_name[::yy_symbol_value_print_ (int yytype,
const semantic_type* yyvaluep, const location_type* yylocationp)
const semantic_type* yyvaluep, const location_type* yylocationp)
{
/* Pacify ``unused variable'' warnings. */
YYUSE (yyvaluep);
@@ -152,18 +152,18 @@ m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl
{
]m4_map([b4_symbol_actions], m4_defn([b4_symbol_printers]))dnl
[ default:
break;
break;
}
}
void
]b4_parser_class_name[::yy_symbol_print_ (int yytype,
const semantic_type* yyvaluep, const location_type* yylocationp)
const semantic_type* yyvaluep, const location_type* yylocationp)
{
*yycdebug_ << (yytype < YYNTOKENS ? "token" : "nterm")
<< ' ' << yytname[yytype] << " ("
<< *yylocationp << ": ";
<< ' ' << yytname[yytype] << " ("
<< *yylocationp << ": ";
yy_symbol_value_print_ (yytype, yyvaluep, yylocationp);
*yycdebug_ << ')';
}
@@ -203,10 +203,10 @@ m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl
# Let glr.c believe that the user arguments include the parser itself.
m4_ifset([b4_parse_param],
[m4_pushdef([b4_parse_param],
m4_dquote([[[yy::b4_parser_class_name& yyparser], [[yyparser]]],]
m4_dquote([[[yy::b4_parser_class_name& yyparser], [[yyparser]]],]
m4_defn([b4_parse_param])))],
[m4_pushdef([b4_parse_param],
[[[[yy::b4_parser_class_name& yyparser], [[yyparser]]]]])
[[[[yy::b4_parser_class_name& yyparser], [[yyparser]]]]])
])
m4_include(b4_pkgdatadir/[glr.c])
m4_popdef([b4_parse_param])
@@ -214,7 +214,7 @@ m4_popdef([b4_parse_param])
@output @output_header_name@
b4_copyright([C++ Skeleton parser for GLALR(1) parsing with Bison],
[2002, 2003, 2004, 2005, 2006])[
[2002, 2003, 2004, 2005, 2006])[
/* C++ GLR parser skeleton written by Akim Demaille. */
@@ -294,7 +294,7 @@ namespace yy
{
public:
/// Symbol semantic values.
#if ! defined (YYSTYPE)
#ifndef YYSTYPE
]m4_ifdef([b4_stype],
[ union semantic_type
b4_stype
@@ -349,15 +349,15 @@ b4_syncline([@oline@], [@ofile@])
/// \param yyvaluep Its semantic value.
/// \param yylocationp Its location.
virtual void yy_symbol_value_print_ (int yytype,
const semantic_type* yyvaluep,
const location_type* yylocationp);
const semantic_type* yyvaluep,
const location_type* yylocationp);
/// \brief Report a symbol on the debug stream.
/// \param yytype The token type.
/// \param yyvaluep Its semantic value.
/// \param yylocationp Its location.
virtual void yy_symbol_print_ (int yytype,
const semantic_type* yyvaluep,
const location_type* yylocationp);
const semantic_type* yyvaluep,
const location_type* yylocationp);
private:
#endif /* ! YYDEBUG */
@@ -368,9 +368,9 @@ b4_syncline([@oline@], [@ofile@])
/// \param yyvaluep Its semantic value.
/// \param yylocationp Its location.
inline void yydestruct_ (const char* yymsg,
int yytype,
semantic_type* yyvaluep,
location_type* yylocationp);
int yytype,
semantic_type* yyvaluep,
location_type* yylocationp);
/* Debugging. */
std::ostream* yycdebug_;

View File

@@ -30,7 +30,7 @@ m4_divert(0)dnl
m4_if(b4_defines_flag, 0, [],
[@output @output_header_name@
b4_copyright([C++ Skeleton parser for LALR(1) parsing with Bison],
[2002, 2003, 2004, 2005, 2006])
[2002, 2003, 2004, 2005, 2006])
dnl FIXME: This is wrong, we want computed header guards.
[
/* C++ LALR(1) parser skeleton written by Akim Demaille. */
@@ -102,7 +102,7 @@ namespace yy
{
public:
/// Symbol semantic values.
#if ! defined (YYSTYPE)
#ifndef YYSTYPE
]m4_ifdef([b4_stype],
[ union semantic_type
b4_stype
@@ -159,15 +159,15 @@ b4_error_verbose_if([, int tok])[);
/// \param yyvaluep Its semantic value.
/// \param yylocationp Its location.
virtual void yy_symbol_value_print_ (int yytype,
const semantic_type* yyvaluep,
const location_type* yylocationp);
const semantic_type* yyvaluep,
const location_type* yylocationp);
/// \brief Report a symbol on the debug stream.
/// \param yytype The token type.
/// \param yyvaluep Its semantic value.
/// \param yylocationp Its location.
virtual void yy_symbol_print_ (int yytype,
const semantic_type* yyvaluep,
const location_type* yylocationp);
const semantic_type* yyvaluep,
const location_type* yylocationp);
#endif /* ! YYDEBUG */
@@ -256,9 +256,9 @@ b4_error_verbose_if([, int tok])[);
/// \param yyvaluep Its semantic value.
/// \param yylocationp Its location.
inline void yydestruct_ (const char* yymsg,
int yytype,
semantic_type* yyvaluep,
location_type* yylocationp);
int yytype,
semantic_type* yyvaluep,
location_type* yylocationp);
/// Pop \a n symbols the three stacks.
inline void yypop_ (unsigned int n = 1);
@@ -296,7 +296,7 @@ b4_error_verbose_if([, int tok])[);
])dnl
@output @output_parser_name@
b4_copyright([C++ Skeleton parser for LALR(1) parsing with Bison],
[2002, 2003, 2004, 2005, 2006])
[2002, 2003, 2004, 2005, 2006])
m4_if(b4_prefix[], [yy], [],
[
// Take the name prefix into account.
@@ -429,7 +429,7 @@ namespace yy
inline void
]b4_parser_class_name[::yy_symbol_value_print_ (int yytype,
const semantic_type* yyvaluep, const location_type* yylocationp)
const semantic_type* yyvaluep, const location_type* yylocationp)
{
YYUSE (yylocationp);
YYUSE (yyvaluep);
@@ -437,18 +437,18 @@ namespace yy
{
]m4_map([b4_symbol_actions], m4_defn([b4_symbol_printers]))dnl
[ default:
break;
break;
}
}
void
]b4_parser_class_name[::yy_symbol_print_ (int yytype,
const semantic_type* yyvaluep, const location_type* yylocationp)
const semantic_type* yyvaluep, const location_type* yylocationp)
{
*yycdebug_ << (yytype < yyntokens_ ? "token" : "nterm")
<< ' ' << yytname_[yytype] << " ("
<< *yylocationp << ": ";
<< ' ' << yytname_[yytype] << " ("
<< *yylocationp << ": ";
yy_symbol_value_print_ (yytype, yyvaluep, yylocationp);
*yycdebug_ << ')';
}
@@ -456,7 +456,7 @@ namespace yy
void
]b4_parser_class_name[::yydestruct_ (const char* yymsg,
int yytype, semantic_type* yyvaluep, location_type* yylocationp)
int yytype, semantic_type* yyvaluep, location_type* yylocationp)
{
YYUSE (yylocationp);
YYUSE (yymsg);
@@ -467,8 +467,8 @@ namespace yy
switch (yytype)
{
]m4_map([b4_symbol_actions], m4_defn([b4_symbol_destructors]))[
default:
break;
default:
break;
}
}
@@ -575,9 +575,9 @@ b4_syncline([@oline@], [@ofile@])])dnl
/* Read a look-ahead token. */
if (yychar == yyempty_)
{
YYCDEBUG << "Reading a token: ";
yychar = ]b4_c_function_call([yylex], [int],
[[YYSTYPE*], [&yylval]][]dnl
YYCDEBUG << "Reading a token: ";
yychar = ]b4_c_function_call([yylex], [int],
[[YYSTYPE*], [&yylval]][]dnl
b4_location_if([, [[location*], [&yylloc]]])dnl
m4_ifdef([b4_lex_param], [, ]b4_lex_param))[;
}
@@ -586,13 +586,13 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param))[;
/* Convert token to internal form. */
if (yychar <= yyeof_)
{
yychar = yytoken = yyeof_;
YYCDEBUG << "Now at end of input." << std::endl;
yychar = yytoken = yyeof_;
YYCDEBUG << "Now at end of input." << std::endl;
}
else
{
yytoken = yytranslate_ (yychar);
YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
yytoken = yytranslate_ (yychar);
YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
}
/* If the proper action on seeing token YYTOKEN is to reduce or to
@@ -605,10 +605,10 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param))[;
yyn = yytable_[yyn];
if (yyn <= 0)
{
if (yyn == 0 || yyn == yytable_ninf_)
goto yyerrlab;
yyn = -yyn;
goto yyreduce;
if (yyn == 0 || yyn == yytable_ninf_)
goto yyerrlab;
yyn = -yyn;
goto yyreduce;
}
/* Accept? */
@@ -665,10 +665,10 @@ m4_ifdef([b4_lex_param], [, ]b4_lex_param))[;
YY_REDUCE_PRINT (yyn);
switch (yyn)
{
]b4_actions
]b4_actions
/* Line __line__ of lalr1.cc. */
b4_syncline([@oline@], [@ofile@])[
default: break;
default: break;
}
YY_SYMBOL_PRINT ("-> $$ =", yyr1_[yyn], &yyval, &yyloc);
@@ -683,7 +683,7 @@ b4_syncline([@oline@], [@ofile@])[
yyn = yyr1_[yyn];
yystate = yypgoto_[yyn - yyntokens_] + yystate_stack_[0];
if (0 <= yystate && yystate <= yylast_
&& yycheck_[yystate] == yystate_stack_[0])
&& yycheck_[yystate] == yystate_stack_[0])
yystate = yytable_[yystate];
else
yystate = yydefgoto_[yyn - yyntokens_];
@@ -696,28 +696,28 @@ b4_syncline([@oline@], [@ofile@])[
/* If not already recovering from an error, report this error. */
if (!yyerrstatus_)
{
++yynerrs_;
error (yylloc, yysyntax_error_ (yystate]dnl
++yynerrs_;
error (yylloc, yysyntax_error_ (yystate]dnl
b4_error_verbose_if([, yytoken])[));
}
yyerror_range[0] = yylloc;
if (yyerrstatus_ == 3)
{
/* If just tried and failed to reuse look-ahead token after an
error, discard it. */
/* If just tried and failed to reuse look-ahead token after an
error, discard it. */
if (yychar <= yyeof_)
{
/* Return failure if at end of input. */
if (yychar == yyeof_)
YYABORT;
}
else
{
yydestruct_ ("Error: discarding", yytoken, &yylval, &yylloc);
yychar = yyempty_;
}
if (yychar <= yyeof_)
{
/* Return failure if at end of input. */
if (yychar == yyeof_)
YYABORT;
}
else
{
yydestruct_ ("Error: discarding", yytoken, &yylval, &yylloc);
yychar = yyempty_;
}
}
/* Else will try to reuse look-ahead token after shifting the error
@@ -752,29 +752,29 @@ b4_error_verbose_if([, yytoken])[));
for (;;)
{
yyn = yypact_[yystate];
if (yyn != yypact_ninf_)
{
yyn += yyterror_;
if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_)
{
yyn = yytable_[yyn];
if (0 < yyn)
break;
}
}
yyn = yypact_[yystate];
if (yyn != yypact_ninf_)
{
yyn += yyterror_;
if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_)
{
yyn = yytable_[yyn];
if (0 < yyn)
break;
}
}
/* Pop the current state because it cannot handle the error token. */
if (yystate_stack_.height () == 1)
YYABORT;
/* Pop the current state because it cannot handle the error token. */
if (yystate_stack_.height () == 1)
YYABORT;
yyerror_range[0] = yylocation_stack_[0];
yydestruct_ ("Error: popping",
yystos_[yystate],
&yysemantic_stack_[0], &yylocation_stack_[0]);
yypop_ ();
yystate = yystate_stack_[0];
YY_STACK_PRINT ();
yyerror_range[0] = yylocation_stack_[0];
yydestruct_ ("Error: popping",
yystos_[yystate],
&yysemantic_stack_[0], &yylocation_stack_[0]);
yypop_ ();
yystate = yystate_stack_[0];
YY_STACK_PRINT ();
}
if (yyn == yyfinal_)
@@ -789,7 +789,7 @@ b4_error_verbose_if([, yytoken])[));
/* Shift the error token. */
YY_SYMBOL_PRINT ("Shifting", yystos_[yyn],
&yysemantic_stack_[0], &yylocation_stack_[0]);
&yysemantic_stack_[0], &yylocation_stack_[0]);
yystate = yyn;
goto yynewstate;
@@ -813,11 +813,11 @@ b4_error_verbose_if([, yytoken])[));
yypop_ (yylen);
while (yystate_stack_.height () != 1)
{
yydestruct_ ("Cleanup: popping",
yystos_[yystate_stack_[0]],
&yysemantic_stack_[0],
&yylocation_stack_[0]);
yypop_ ();
yydestruct_ ("Cleanup: popping",
yystos_[yystate_stack_[0]],
&yysemantic_stack_[0],
&yylocation_stack_[0]);
yypop_ ();
}
return yyresult;
@@ -834,38 +834,38 @@ b4_error_verbose_if([, int tok])[)
int yyn = yypact_[yystate];
if (yypact_ninf_ < yyn && yyn < yylast_)
{
/* Start YYX at -YYN if negative to avoid negative indexes in
YYCHECK. */
int yyxbegin = yyn < 0 ? -yyn : 0;
/* Start YYX at -YYN if negative to avoid negative indexes in
YYCHECK. */
int yyxbegin = yyn < 0 ? -yyn : 0;
/* Stay within bounds of both yycheck and yytname. */
int yychecklim = yylast_ - yyn;
int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
int count = 0;
for (int x = yyxbegin; x < yyxend; ++x)
if (yycheck_[x + yyn] == x && x != yyterror_)
++count;
/* Stay within bounds of both yycheck and yytname. */
int yychecklim = yylast_ - yyn;
int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
int count = 0;
for (int x = yyxbegin; x < yyxend; ++x)
if (yycheck_[x + yyn] == x && x != yyterror_)
++count;
// FIXME: This method of building the message is not compatible
// with internationalization. It should work like yacc.c does it.
// That is, first build a string that looks like this:
// "syntax error, unexpected %s or %s or %s"
// Then, invoke YY_ on this string.
// Finally, use the string as a format to output
// yytname_[tok], etc.
// Until this gets fixed, this message appears in English only.
res = "syntax error, unexpected ";
res += yytnamerr_ (yytname_[tok]);
if (count < 5)
{
count = 0;
for (int x = yyxbegin; x < yyxend; ++x)
if (yycheck_[x + yyn] == x && x != yyterror_)
{
res += (!count++) ? ", expecting " : " or ";
res += yytnamerr_ (yytname_[x]);
}
}
// FIXME: This method of building the message is not compatible
// with internationalization. It should work like yacc.c does it.
// That is, first build a string that looks like this:
// "syntax error, unexpected %s or %s or %s"
// Then, invoke YY_ on this string.
// Finally, use the string as a format to output
// yytname_[tok], etc.
// Until this gets fixed, this message appears in English only.
res = "syntax error, unexpected ";
res += yytnamerr_ (yytname_[tok]);
if (count < 5)
{
count = 0;
for (int x = yyxbegin; x < yyxend; ++x)
if (yycheck_[x + yyn] == x && x != yyterror_)
{
res += (!count++) ? ", expecting " : " or ";
res += yytnamerr_ (yytname_[x]);
}
}
}
else
#endif
@@ -994,7 +994,7 @@ b4_error_verbose_if([, int tok])[)
{
*yycdebug_ << "Stack now";
for (state_stack_type::const_iterator i = yystate_stack_.begin ();
i != yystate_stack_.end (); ++i)
i != yystate_stack_.end (); ++i)
*yycdebug_ << ' ' << *i;
*yycdebug_ << std::endl;
}
@@ -1007,13 +1007,13 @@ b4_error_verbose_if([, int tok])[)
int yynrhs = yyr2_[yyrule];
/* Print the symbols being reduced, and their result. */
*yycdebug_ << "Reducing stack by rule " << yyrule - 1
<< " (line " << yylno << "), ";
<< " (line " << yylno << "), ";
/* The symbols being reduced. */
for (int yyi = 0; yyi < yynrhs; yyi++)
YY_SYMBOL_PRINT (" $" << yyi + 1 << " =",
yyrhs_[yyprhs_[yyrule] + yyi],
&]b4_rhs_value(yynrhs, yyi + 1)[,
&]b4_rhs_location(yynrhs, yyi + 1)[);
yyrhs_[yyprhs_[yyrule] + yyi],
&]b4_rhs_value(yynrhs, yyi + 1)[,
&]b4_rhs_location(yynrhs, yyi + 1)[);
}
#endif // YYDEBUG

View File

@@ -41,8 +41,8 @@ m4_define_default([b4_stack_depth_init], [200])
# Expand IF-TRUE, if %pure-parser and %parse-param, IF-FALSE otherwise.
m4_define([b4_yacc_pure_if],
[b4_pure_if([m4_ifset([b4_parse_param],
[$1], [$2])],
[$2])])
[$1], [$2])],
[$2])])
# b4_yyerror_args
@@ -82,7 +82,7 @@ m4_define([b4_int_type],
m4_eval([0 <= $1]), [1], [unsigned int],
[int])])
[int])])
## ----------------- ##
@@ -187,9 +187,9 @@ b4_location_if([#define yylloc b4_prefix[]lloc])])[
# define YYTOKEN_TABLE ]b4_token_table[
#endif
#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
]m4_ifdef([b4_stype],
[typedef union m4_bregexp(b4_stype, [^{], [YYSTYPE ])
[typedef union[]m4_bregexp(b4_stype, [^{], [ YYSTYPE])
b4_stype
/* Line __line__ of yacc.c. */
b4_syncline([@oline@], [@ofile@])
@@ -200,7 +200,7 @@ b4_syncline([@oline@], [@ofile@])
# define YYSTYPE_IS_TRIVIAL 1
#endif
]b4_location_if([#if ! defined (YYLTYPE) && ! defined (YYLTYPE_IS_DECLARED)
]b4_location_if([#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
typedef struct YYLTYPE
{
int first_line;
@@ -221,11 +221,11 @@ typedef struct YYLTYPE
b4_syncline([@oline@], [@ofile@])[
#ifndef YYSIZE_T
# if defined (__SIZE_TYPE__)
# ifdef __SIZE_TYPE__
# define YYSIZE_T __SIZE_TYPE__
# elif defined (size_t)
# elif defined size_t
# define YYSIZE_T size_t
# elif ! defined (YYSIZE_T) && ]b4_c_modern[
# elif ! defined YYSIZE_T && ]b4_c_modern[
# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
# define YYSIZE_T size_t
# else
@@ -248,7 +248,7 @@ b4_syncline([@oline@], [@ofile@])[
#endif
/* Suppress unused-variable warnings by "using" E. */
#if !defined (lint) || defined (__GNUC__)
#if ! defined lint || defined __GNUC__
# define YYUSE(e) ((void) (e))
#else
# define YYUSE(e) /* empty */
@@ -264,7 +264,7 @@ b4_syncline([@oline@], [@ofile@])[
}
#endif
#if ! defined (yyoverflow) || YYERROR_VERBOSE
#if ! defined yyoverflow || YYERROR_VERBOSE
/* The parser invokes alloca or malloc; define the necessary symbols. */
@@ -272,16 +272,16 @@ b4_syncline([@oline@], [@ofile@])[
# if YYSTACK_USE_ALLOCA
# ifdef __GNUC__
# define YYSTACK_ALLOC __builtin_alloca
# elif defined (__BUILTIN_VA_ARG_INCR)
# elif defined __BUILTIN_VA_ARG_INCR
# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
# elif defined (_AIX)
# elif defined _AIX
# define YYSTACK_ALLOC __alloca
# elif defined (_MSC_VER)
# elif defined _MSC_VER
# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
# define alloca _alloca
# else
# define YYSTACK_ALLOC alloca
# if ! defined (_ALLOCA_H) && ! defined (_STDLIB_H) && ]b4_c_modern[
# if ! defined _ALLOCA_H && ! defined _STDLIB_H && ]b4_c_modern[
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
# ifndef _STDLIB_H
# define _STDLIB_H 1
@@ -312,13 +312,13 @@ extern "C" {
# endif
# ifndef YYMALLOC
# define YYMALLOC malloc
# if ! defined (malloc) && ! defined (_STDLIB_H) && ]b4_c_modern[
# if ! defined malloc && ! defined _STDLIB_H && ]b4_c_modern[
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
# endif
# endif
# ifndef YYFREE
# define YYFREE free
# if ! defined (free) && ! defined (_STDLIB_H) && ]b4_c_modern[
# if ! defined free && ! defined _STDLIB_H && ]b4_c_modern[
void free (void *); /* INFRINGES ON USER NAME SPACE */
# endif
# endif
@@ -326,13 +326,13 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */
}
# endif
# endif
#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
#if (! defined (yyoverflow) \
&& (! defined (__cplusplus) \
|| (]b4_location_if([[defined (YYLTYPE_IS_TRIVIAL) && YYLTYPE_IS_TRIVIAL \
&& ]])[defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
#if (! defined yyoverflow \
&& (! defined __cplusplus \
|| (]b4_location_if([[defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
&& ]])[defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
/* A type that is properly aligned for any stack member. */
union yyalloc
@@ -359,7 +359,7 @@ union yyalloc
/* Copy COUNT objects from FROM to TO. The source and destination do
not overlap. */
# ifndef YYCOPY
# if defined (__GNUC__) && 1 < __GNUC__
# if defined __GNUC__ && 1 < __GNUC__
# define YYCOPY(To, From, Count) \
__builtin_memcpy (To, From, (Count) * sizeof (*(From)))
# else
@@ -600,8 +600,8 @@ while (YYID (0))
# if YYLTYPE_IS_TRIVIAL
# define YY_LOCATION_PRINT(File, Loc) \
fprintf (File, "%d.%d-%d.%d", \
(Loc).first_line, (Loc).first_column, \
(Loc).last_line, (Loc).last_column)
(Loc).first_line, (Loc).first_column, \
(Loc).last_line, (Loc).last_column)
# else
# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
# endif
@@ -636,7 +636,7 @@ do { \
{ \
YYFPRINTF (stderr, "%s ", Title); \
yy_symbol_print (stderr, \
Type, Value]b4_location_if([, Location])[]b4_user_args[); \
Type, Value]b4_location_if([, Location])[]b4_user_args[); \
YYFPRINTF (stderr, "\n"); \
} \
} while (YYID (0))
@@ -649,8 +649,8 @@ do { \
`------------------------------------------------------------------*/
]b4_c_function_def([yy_stack_print], [static void],
[[short int *bottom], [bottom]],
[[short int *top], [top]])[
[[short int *bottom], [bottom]],
[[short int *top], [top]])[
{
YYFPRINTF (stderr, "Stack now");
for (; bottom <= top; ++bottom)
@@ -670,24 +670,24 @@ do { \
`------------------------------------------------*/
]b4_c_function_def([yy_reduce_print], [static void],
[[YYSTYPE *yyvsp], [yyvsp]],
[[YYSTYPE *yyvsp], [yyvsp]],
b4_location_if([[[YYLTYPE *yylsp], [yylsp]],])
[[int yyrule], [yyrule]]m4_ifset([b4_parse_param], [,])
b4_parse_param)[
b4_parse_param)[
{
int yynrhs = yyr2[yyrule];
int yyi;
unsigned long int yylno = yyrline[yyrule];
YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
yyrule - 1, yylno);
yyrule - 1, yylno);
/* The symbols being reduced. */
for (yyi = 0; yyi < yynrhs; yyi++)
{
fprintf (stderr, " $%d = ", yyi + 1);
yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
&]b4_rhs_value(yynrhs, yyi + 1)[
]b4_location_if([, &]b4_rhs_location(yynrhs, yyi + 1))[]dnl
b4_user_args[);
&]b4_rhs_value(yynrhs, yyi + 1)[
]b4_location_if([, &]b4_rhs_location(yynrhs, yyi + 1))[]dnl
b4_user_args[);
fprintf (stderr, "\n");
}
}
@@ -730,7 +730,7 @@ int yydebug;
#if YYERROR_VERBOSE
# ifndef yystrlen
# if defined (__GLIBC__) && defined (_STRING_H)
# if defined __GLIBC__ && defined _STRING_H
# define yystrlen strlen
# else
/* Return the length of YYSTR. */
@@ -746,7 +746,7 @@ int yydebug;
# endif
# ifndef yystpcpy
# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
# define yystpcpy stpcpy
# else
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
@@ -840,7 +840,7 @@ yysyntax_error (char *yyresult, int yystate, int yychar)
# if 0
/* This is so xgettext sees the translatable formats that are
constructed on the fly. */
constructed on the fly. */
YY_("syntax error, unexpected %s");
YY_("syntax error, unexpected %s, expecting %s");
YY_("syntax error, unexpected %s, expecting %s or %s");
@@ -853,13 +853,13 @@ yysyntax_error (char *yyresult, int yystate, int yychar)
static char const yyexpecting[] = ", expecting %s";
static char const yyor[] = " or %s";
char yyformat[sizeof yyunexpected
+ sizeof yyexpecting - 1
+ ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
* (sizeof yyor - 1))];
+ sizeof yyexpecting - 1
+ ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
* (sizeof yyor - 1))];
char const *yyprefix = yyexpecting;
/* Start YYX at -YYN if negative to avoid negative indexes in
YYCHECK. */
YYCHECK. */
int yyxbegin = yyn < 0 ? -yyn : 0;
/* Stay within bounds of both yycheck and yytname. */
@@ -871,22 +871,22 @@ yysyntax_error (char *yyresult, int yystate, int yychar)
yyfmt = yystpcpy (yyformat, yyunexpected);
for (yyx = yyxbegin; yyx < yyxend; ++yyx)
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
{
if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
{
yycount = 1;
yysize = yysize0;
yyformat[sizeof yyunexpected - 1] = '\0';
break;
}
yyarg[yycount++] = yytname[yyx];
yysize1 = yysize + yytnamerr (0, yytname[yyx]);
yysize_overflow |= (yysize1 < yysize);
yysize = yysize1;
yyfmt = yystpcpy (yyfmt, yyprefix);
yyprefix = yyor;
}
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
{
if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
{
yycount = 1;
yysize = yysize0;
yyformat[sizeof yyunexpected - 1] = '\0';
break;
}
yyarg[yycount++] = yytname[yyx];
yysize1 = yysize + yytnamerr (0, yytname[yyx]);
yysize_overflow |= (yysize1 < yysize);
yysize = yysize1;
yyfmt = yystpcpy (yyfmt, yyprefix);
yyprefix = yyor;
}
yyf = YY_(yyformat);
yysize1 = yysize + yystrlen (yyf);
@@ -898,25 +898,25 @@ yysyntax_error (char *yyresult, int yystate, int yychar)
if (yyresult)
{
/* Avoid sprintf, as that infringes on the user's name space.
Don't have undefined behavior even if the translation
produced a string with the wrong number of "%s"s. */
char *yyp = yyresult;
int yyi = 0;
while ((*yyp = *yyf) != '\0')
{
if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
{
yyp += yytnamerr (yyp, yyarg[yyi++]);
yyf += 2;
}
else
{
yyp++;
yyf++;
}
}
}
/* Avoid sprintf, as that infringes on the user's name space.
Don't have undefined behavior even if the translation
produced a string with the wrong number of "%s"s. */
char *yyp = yyresult;
int yyi = 0;
while ((*yyp = *yyf) != '\0')
{
if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
{
yyp += yytnamerr (yyp, yyarg[yyi++]);
yyf += 2;
}
else
{
yyp++;
yyf++;
}
}
}
return yysize;
}
}
@@ -956,7 +956,7 @@ YYLTYPE yylloc;])
m4_divert_pop([KILL])dnl# ====================== End of M4 code.
b4_pure_if([],
[b4_declare_parser_variables])
[b4_declare_parser_variables])
/*----------.
@@ -1323,15 +1323,15 @@ yyerrlab:
error, discard it. */
if (yychar <= YYEOF)
{
{
/* Return failure if at end of input. */
if (yychar == YYEOF)
YYABORT;
}
}
else
{
yydestruct ("Error: discarding",
yytoken, &yylval]b4_location_if([, &yylloc])[]b4_user_args[);
yytoken, &yylval]b4_location_if([, &yylloc])[]b4_user_args[);
yychar = YYEMPTY;
}
}
@@ -1388,7 +1388,7 @@ yyerrlab1:
]b4_location_if([[ yyerror_range[0] = *yylsp;]])[
yydestruct ("Error: popping",
yystos[yystate], yyvsp]b4_location_if([, yylsp])[]b4_user_args[);
yystos[yystate], yyvsp]b4_location_if([, yylsp])[]b4_user_args[);
YYPOPSTACK (1);
yystate = *yyssp;
YY_STACK_PRINT (yyss, yyssp);
@@ -1475,9 +1475,9 @@ b4_copyright([Skeleton parser for Yacc-like parsing with Bison],
b4_token_enums_defines(b4_tokens)
#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
m4_ifdef([b4_stype],
[typedef union m4_bregexp(b4_stype, [^{], [YYSTYPE ])
[typedef union[]m4_bregexp(b4_stype, [^{], [ YYSTYPE])
b4_stype
/* Line __line__ of yacc.c. */
b4_syncline([@oline@], [@ofile@])
@@ -1492,7 +1492,7 @@ b4_pure_if([],
[extern YYSTYPE b4_prefix[]lval;])
b4_location_if(
[#if ! defined (YYLTYPE) && ! defined (YYLTYPE_IS_DECLARED)
[#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
typedef struct YYLTYPE
{
int first_line;

View File

@@ -1,6 +1,22 @@
# DJGPP Maintainer's Makefile -*-Makefile-*-
# DJGPP Maintainer's Makefile -*-Makefile-*-
# Requires GNU sed
## Copyright (C) 2005, 2006 Free Software Foundation, Inc.
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2, or (at your option)
## any later version.
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software Foundation,
## Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
top_srcdir = ..
srcdir = .
@@ -9,8 +25,8 @@ SHELL = /bin/sh
all: README
README: README.in $(top_srcdir)/configure
PACKAGE=`grep "^[ ]*PACKAGE=" $(top_srcdir)/configure | sed -e 's/^[ ]*PACKAGE=//' -e s/[\"\']//g`; \
VERSION=`grep "^[ ]*VERSION=" $(top_srcdir)/configure | sed -e 's/^[ ]*VERSION=//' -e s/[\"\']//g`; \
PACKAGE=`grep "^[ ]*PACKAGE=" $(top_srcdir)/configure | sed -e 's/^[ ]*PACKAGE=//' -e s/[\"\']//g`; \
VERSION=`grep "^[ ]*VERSION=" $(top_srcdir)/configure | sed -e 's/^[ ]*VERSION=//' -e s/[\"\']//g`; \
package_version=`echo "$${VERSION}" | sed 's/\.//g'`; \
tree_version=`echo "$${VERSION}" | sed 's/\.//2g'`; \
sed \

View File

@@ -1,177 +1,193 @@
This is a port of GNU Bison @VERSION@ to MSDOS/DJGPP.
Copyright (C) 2005 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1.: DJGPP specific changes.
=======================
=======================
The DJGPP port of Bison offers LFN and SFN support depending on which
OS it is running. If LFN support is available or not is determinated at
run time. If LFN support is available (DOS session under Win9X), the
standard posix file name extensions will be used. These are: y.tab.c,
y.tab.c++, y.tab.h, y.output, etc. If only SFN support is available
(plain DOS), then the standard MSDOS short file names will be used.
These are: y_tab.c, y_tab.h, y.out, etc.
It should be noticed that this bison version needs the m4 program as
back end to generate the parser file (y.tab.c etc.) from the skeleton
files. This implies that m4 must always be installed to get bison
working. m4 will use a couple of m4 scripts that will be installed in
/dev/env/DJDIR/share/bison and shall not be removed.
It should also be noticed that the skeleton files bison.simple and
bison.hairy are no longer supported. This applies also to the environ-
ment variables BISON_HAIRY and BISON_SIMPLE. Those variables are *no*
longer honored at all.
The kind of skeleton file bison.hairy is no longer supported at all.
The skeleton file bison.simple is now called yacc.c and is an m4 script.
The other two skeleton files supported by this bison version are glr.c
and lalr1.cc. The first one is a generalized LR C parser based on
Bison's LALR(1) tables and the second one is a experimental C++ parser
class.
As has been told before, bison uses m4 to generate the parser file.
This is done by forking and using pipes for the IPC. MSDOS does not
support this functionality so this has been reproduced in the usual
way by redirecting stdin and stdout of bison and m4 to temporary files
and processing these files in sequence. All the changes to the sources
are documented in the djgpp/diffs file.
The DJGPP port of Bison offers LFN and SFN support depending on which
OS it is running. If LFN support is available or not is determinated at
run time. If LFN support is available (DOS session under Win9X), the
standard posix file name extensions will be used. These are: y.tab.c,
y.tab.c++, y.tab.h, y.output, etc. If only SFN support is available
(plain DOS), then the standard MSDOS short file names will be used.
These are: y_tab.c, y_tab.h, y.out, etc.
It should be noticed that this bison version needs the m4 program as
back end to generate the parser file (y.tab.c etc.) from the skeleton
files. This implies that m4 must always be installed to get bison
working. m4 will use a couple of m4 scripts that will be installed in
/dev/env/DJDIR/share/bison and shall not be removed.
It should also be noticed that the skeleton files bison.simple and
bison.hairy are no longer supported. This applies also to the environ-
ment variables BISON_HAIRY and BISON_SIMPLE. Those variables are *no*
longer honored at all.
The kind of skeleton file bison.hairy is no longer supported at all.
The skeleton file bison.simple is now called yacc.c and is an m4 script.
The other two skeleton files supported by this bison version are glr.c
and lalr1.cc. The first one is a generalized LR C parser based on
Bison's LALR(1) tables and the second one is a experimental C++ parser
class.
As has been told before, bison uses m4 to generate the parser file.
This is done by forking and using pipes for the IPC. MSDOS does not
support this functionality so this has been reproduced in the usual
way by redirecting stdin and stdout of bison and m4 to temporary files
and processing these files in sequence. All the changes to the sources
are documented in the djgpp/diffs file.
Please **read** the docs.
Please **read** the docs.
2.: Installing the binary package.
==============================
==============================
2.1.: Copy the binary distribution into the top DJGPP installation directory,
just unzip it preserving the directory structure running *ONE* of the
following commands:
unzip32 bsn@PACKAGE_VERSION@b.zip or
djtarx bsn@PACKAGE_VERSION@b.zip or
pkunzip -d bsn@PACKAGE_VERSION@b.zip
just unzip it preserving the directory structure running *ONE* of the
following commands:
unzip32 bsn@PACKAGE_VERSION@b.zip or
djtarx bsn@PACKAGE_VERSION@b.zip or
pkunzip -d bsn@PACKAGE_VERSION@b.zip
3.: Building the binaries from sources.
===================================
===================================
3.1.: Create a temporary directory and copy the source package into the
directory. If you download the source distribution from one of the
DJGPP sites, just unzip it preserving the directory structure
running *ONE* of the following commands:
unzip32 bsn@PACKAGE_VERSION@s.zip or
djtarx bsn@PACKAGE_VERSION@s.zip or
pkunzip -d bsn@PACKAGE_VERSION@s.zip
and proceed to the paragraph 3.3, below.
directory. If you download the source distribution from one of the
DJGPP sites, just unzip it preserving the directory structure
running *ONE* of the following commands:
unzip32 bsn@PACKAGE_VERSION@s.zip or
djtarx bsn@PACKAGE_VERSION@s.zip or
pkunzip -d bsn@PACKAGE_VERSION@s.zip
and proceed to the paragraph 3.3, below.
3.2.: Source distributions downloaded from one of the GNU FTP sites need
some more work to unpack, if LFN support is not available. If LFN is
available then you can extract the source files from the archive with
any unzip program and proceed to the paragraph 3.3, below. Any file
name issue will be handled by the the DJGPP configuration files.
To unpack the source distribution on SFN systems, first, you MUST use
the `djunpack' batch file to unzip the package. That is because some
file names in the official distributions need to be changed to avoid
problems on the various platforms supported by DJGPP.
`djunpack' invokes the `djtar' program (that is part of the basic DJGPP
development kit) to rename these files on the fly given a file with
name mappings; the distribution includes a file `djgpp/fnchange.lst'
with the necessary mappings. So you need first to retrieve that batch
file, and then invoke it to unpack the distribution. Here's how:
some more work to unpack, if LFN support is not available. If LFN is
available then you can extract the source files from the archive with
any unzip program and proceed to the paragraph 3.3, below. Any file
name issue will be handled by the the DJGPP configuration files.
To unpack the source distribution on SFN systems, first, you MUST use
the `djunpack' batch file to unzip the package. That is because some
file names in the official distributions need to be changed to avoid
problems on the various platforms supported by DJGPP.
`djunpack' invokes the `djtar' program (that is part of the basic DJGPP
development kit) to rename these files on the fly given a file with
name mappings; the distribution includes a file `djgpp/fnchange.lst'
with the necessary mappings. So you need first to retrieve that batch
file, and then invoke it to unpack the distribution. Here's how:
djtar -x -p -o bison-2.1/djgpp/djunpack.bat bison-2.1.tar.gz > djunpack.bat
djunpack bison-2.1.tar.gz
djtar -x -p -o bison-2.1/djgpp/djunpack.bat bison-2.1.tar.gz > djunpack.bat
djunpack bison-2.1.tar.gz
(The name of the distribution archive and the leading directory of the
path to `djunpack.bat' in the distribution will be different for
versions of Bison other than 2.1.)
(The name of the distribution archive and the leading directory of the
path to `djunpack.bat' in the distribution will be different for
versions of Bison other than 2.1.)
If the argument to `djunpack.bat' include leading directories, it MUST
be given with the DOS-style backslashes; Unix-style forward slashes
will NOT work.
If the argument to `djunpack.bat' include leading directories, it MUST
be given with the DOS-style backslashes; Unix-style forward slashes
will NOT work.
If the distribution comes as a .tar.bz2 archive, and your version of
`djtar' doesn't support bzip2 decompression, you need to unpack it as
follows:
If the distribution comes as a .tar.bz2 archive, and your version of
`djtar' doesn't support bzip2 decompression, you need to unpack it as
follows:
bnzip2 bison-2.1.tar.bz2
djtar -x -p -o bison-2.1/djgpp/djunpack.bat bison-2.1.tar > djunpack.bat
djunpack bison-2.1.tar
bnzip2 bison-2.1.tar.bz2
djtar -x -p -o bison-2.1/djgpp/djunpack.bat bison-2.1.tar > djunpack.bat
djunpack bison-2.1.tar
3.3.: To build the binaries you will need the following binary packages:
djdev203.zip (or a later but NOT a prior version)
bsh204b.zip (or a later but NOT a prior version)
gcc400b.zip, gpp400b.zip, bnu215b.zip, mak3791b.zip,
fil40b.zip, shl20jb.zip, txt20b.zip,
txi48b.zip, grep24b.zip, sed414b.zip,
m4-144b.zip.
djdev203.zip (or a later but NOT a prior version)
bsh204b.zip (or a later but NOT a prior version)
gcc400b.zip, gpp400b.zip, bnu215b.zip, mak3791b.zip,
fil40b.zip, shl20jb.zip, txt20b.zip,
txi48b.zip, grep24b.zip, sed414b.zip,
m4-144b.zip.
If you want to run the check you will need also:
dif281b.zip
If you want to run the check you will need also:
dif281b.zip
All this packages can be found in the v2gnu directory of any
ftp.delorie.com mirror.
You will need bsh203b.zip or later and *NOT* a prior version or
the build will fail. The same applies to djdev203.zip. Please note
that Bison requires m4-144b.zip or later to work properly. All the
other packages are the ones I have used to build the binaries
from this source. Previuos versions of this packages may do the
job as well but I have not tested this.
All this packages can be found in the v2gnu directory of any
ftp.delorie.com mirror.
You will need bsh203b.zip or later and *NOT* a prior version or
the build will fail. The same applies to djdev203.zip. Please note
that Bison requires m4-144b.zip or later to work properly. All the
other packages are the ones I have used to build the binaries
from this source. Previuos versions of this packages may do the
job as well but I have not tested this.
3.4.: If for some reason you want to reconfigure the package cd into the top
srcdir (bison-@TREE_VERSION@) and run the following commands:
del djgpp\config.cache
make clean
djgpp\config
srcdir (bison-@TREE_VERSION@) and run the following commands:
del djgpp\config.cache
make clean
djgpp\config
Please note that you *MUST* delete the config.cache file in the djgpp
subdir or you will not really reconfigure the sources because the
configuration informations will be read from the cache file instead
of being newly computed.
To build the programs in a directory other than where the sources are,
you must add the parameter that specifies the source directory,
e.g:
x:\src\gnu\bison-@TREE_VERSION@\djgpp\config x:/src/gnu/bison-@TREE_VERSION@
Please note that you *MUST* delete the config.cache file in the djgpp
subdir or you will not really reconfigure the sources because the
configuration informations will be read from the cache file instead
of being newly computed.
To build the programs in a directory other than where the sources are,
you must add the parameter that specifies the source directory,
e.g:
x:\src\gnu\bison-@TREE_VERSION@\djgpp\config x:/src/gnu/bison-@TREE_VERSION@
Lets assume you want to build the binaries in a directory placed on a
different drive (z:\build in this case) from where the sources are,
then you will run the following commands:
z:
md \build
cd \build
x:\src\gnu\bison-@TREE_VERSION@\djgpp\config x:/src/gnu/bison-@TREE_VERSION@
Lets assume you want to build the binaries in a directory placed on a
different drive (z:\build in this case) from where the sources are,
then you will run the following commands:
z:
md \build
cd \build
x:\src\gnu\bison-@TREE_VERSION@\djgpp\config x:/src/gnu/bison-@TREE_VERSION@
The order of the options and the srcdir option does not matter. You
*MUST* use forward slashes to specify the source directory.
The order of the options and the srcdir option does not matter. You
*MUST* use forward slashes to specify the source directory.
The batch file will set same environment variables, make MSDOS specific
modifications to the Makefile.in's and supply all other needed options
to the configure script.
The batch file will set same environment variables, make MSDOS specific
modifications to the Makefile.in's and supply all other needed options
to the configure script.
3.5.: To compile the package run from the top srcdir the command:
make
make
3.6.: Now you can run the tests if you like. From the top srcdir run the
command:
make check
command:
make check
No test should fail.
Please note that the testsuite only works with LFN available. On plain
DOS, most of the tests will fail due to invalid DOS names.
No test should fail.
Please note that the testsuite only works with LFN available. On plain
DOS, most of the tests will fail due to invalid DOS names.
3.7.: To install the binaries, header, library, catalogs, and info docs
run the following command from the top srcdir:
make install
run the following command from the top srcdir:
make install
This will install the products into your DJGPP installation tree given
by the default prefix "/dev/env/DJDIR". If you prefer to install them
into some other directory you will have to set prefix to the appropiate
value:
make install prefix=z:/some/other/place
This will install the products into your DJGPP installation tree given
by the default prefix "/dev/env/DJDIR". If you prefer to install them
into some other directory you will have to set prefix to the appropiate
value:
make install prefix=z:/some/other/place
Send GNU bison specific bug reports to <bug-bison@gnu.org>.
Send suggestions and bug reports concerning the DJGPP port to
comp.os.msdos.djgpp or <djgpp@delorie.com>.
Send GNU bison specific bug reports to <bug-bison@gnu.org>.
Send suggestions and bug reports concerning the DJGPP port to
comp.os.msdos.djgpp or <djgpp@delorie.com>.
Enjoy.
Guerrero, Juan Manuel <juan.guerrero@gmx.de>
Guerrero, Juan Manuel <juan.guerrero@gmx.de>

View File

@@ -1,8 +1,26 @@
@echo off
Rem Configure Bison for DJGPP.
Rem WARNING WARNING WARNING: This file needs to have DOS CRLF end-of-line
Rem format, or else stock DOS/Windows shells will refuse to run it.
echo Configuring GNU Bison for DJGPP v2.x...
Rem Copyright (C) 2005, 2006 Free Software Foundation, Inc.
Rem This program is free software; you can redistribute it and/or modify
Rem it under the terms of the GNU General Public License as published by
Rem the Free Software Foundation; either version 2, or (at your option)
Rem any later version.
Rem This program is distributed in the hope that it will be useful,
Rem but WITHOUT ANY WARRANTY; without even the implied warranty of
Rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Rem GNU General Public License for more details.
Rem You should have received a copy of the GNU General Public License
Rem along with this program; if not, write to the Free Software Foundation,
Rem Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
echo Configuring Bison for DJGPP v2.x...
Rem The SmallEnv tests protect against fixed and too small size
Rem of the environment in stock DOS shell.
@@ -248,28 +266,28 @@ test -f %XSRC%/examples/calcxx/calcxx.cc
if errorlevel 1 mv -f %XSRC%/examples/calcxx/calcpp.cc %XSRC%/examples/calcxx/calcxx.cc
Rem Fixing #include lines in calcxx files.
sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx.cc > calcxx.cc
sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx.cc > calcxx.cc
if errorlevel 1 goto calcxxFileError
mv ./calcxx.cc %XSRC%/examples/calcxx/calcxx.cc
sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-driver.cc > calcxx-driver.cc
sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-driver.cc > calcxx-driver.cc
if errorlevel 1 goto calcxxFileError
mv ./calcxx-driver.cc %XSRC%/examples/calcxx/calcxx-driver.cc
sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-driver.hh > calcxx-driver.hh
sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-driver.hh > calcxx-driver.hh
if errorlevel 1 goto calcxxFileError
mv ./calcxx-driver.hh %XSRC%/examples/calcxx/calcxx-driver.hh
sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-parser.cc > calcxx-parser.cc
sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-parser.cc > calcxx-parser.cc
if errorlevel 1 goto calcxxFileError
mv ./calcxx-parser.cc %XSRC%/examples/calcxx/calcxx-parser.cc
sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-parser.hh > calcxx-parser.hh
sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-parser.hh > calcxx-parser.hh
if errorlevel 1 goto calcxxFileError
mv ./calcxx-parser.hh %XSRC%/examples/calcxx/calcxx-parser.hh
:sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-parser.yy > calcxx-parser.yy
:sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-parser.yy > calcxx-parser.yy
:if errorlevel 1 goto calcxxFileError
:mv ./calcxx-parser.yy %XSRC%/examples/calcxx/calcxx-parser.yy
sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-scanner.cc > calcxx-scanner.cc
sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-scanner.cc > calcxx-scanner.cc
if errorlevel 1 goto calcxxFileError
mv ./calcxx-scanner.cc %XSRC%/examples/calcxx/calcxx-scanner.cc
:sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-scanner.ll > calcxx-scanner.ll
:sed "/#[ ]*include/s/++/xx/" %XSRC%/examples/calcxx/calcxx-scanner.ll > calcxx-scanner.ll
:if errorlevel 1 goto calcxxFileError
:mv ./calcxx-scanner.ll %XSRC%/examples/calcxx/calcxx-scanner.ll
sed "s/calc++/calcxx/" %XSRC%/examples/calcxx/test > test

View File

@@ -13,12 +13,11 @@
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301 USA
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# Additional editing of Makefiles
/(echo[ ]*':t/ a\
/(echo[ ]*':t/ a\
# DJGPP specific Makefile changes.\
/^aliaspath * *=/s,:,";",g;t t\
/TEXINPUTS=/s,:,";",g;t t\
@@ -70,7 +69,7 @@ yacc.bat:\\\
# a Windows box, where leading dots in file names are allowed).
s,\.deps,_deps,g
s,\.libs,_libs,g
/^rmdir[ ]*\.tst/ i\
/^rmdir[ ]*\.tst/ i\
am__leading_dot=_
# Replace (command) > /dev/null with `command > /dev/null`, since
@@ -79,10 +78,10 @@ am__leading_dot=_
/if ([^|;`]*null/{
s,(,`,
s,),,
/null[ ]*2>&1/ s,2>&1,&`,
/null[ ]*2>&1/ s,2>&1,&`,
/null.*null/ s,null.*null,&`,
/null.*null/ !{
/null[ ]*2>&1/ !s,null,&`,
/null[ ]*2>&1/ !s,null,&`,
}
}
@@ -105,7 +104,7 @@ am__leading_dot=_
# and compiling across partitions.
# 1) The given srcdir value is always translated from the
# "x:" syntax into "/dev/x" syntax while we run configure.
/^[ ]*-srcdir=\*.*$/ a\
/^[ ]*-srcdir=\*.*$/ a\
ac_optarg=`echo "$ac_optarg" | sed "s,^\\([A-Za-z]\\):,/dev/\\1,"`
/set X `ls -Lt \$srcdir/ i\
if `echo $srcdir | grep "^/dev/" - > /dev/null`; then\
@@ -128,19 +127,19 @@ install_sh=`echo "$install_sh" | sed 's%/dev.*/bison-[0-9]\\{1,1\\}[-.0-9A-z]*%$
# ${top_srcdir}/tests/testsuite.dir
# holds. The explicit names are of no importance.
# ../../. == ${top_srcdir}
/\.)[ ]*ac_abs_builddir=/,/^esac$/ {
/\.)[ ]*ac_abs_builddir=/,/^esac$/ {
/^esac$/ a\
ac_abs_builddir=`echo "$ac_abs_builddir" | sed "s%/dev.*/bison-[0-9]\\{1,1\\}[-.0-9A-z]*/[^/]*%../../.%;s%.:.*/bison-[0-9]\\{1,1\\}[-.0-9A-z]*/[^/]*%../../.%"`
}
/\.)[ ]*ac_abs_top_builddir=/,/^esac$/ {
/\.)[ ]*ac_abs_top_builddir=/,/^esac$/ {
/^esac$/ a\
ac_abs_top_builddir=`echo "$ac_abs_top_builddir" | sed "s%/dev.*/bison-[0-9]\\{1,1\\}[-.0-9A-z]*/[^/]*%../../../%;s%.:.*/bison-[0-9]\\{1,1\\}[-.0-9A-z]*/[^/]*%../../../%"`
}
/\.)[ ]*ac_abs_srcdir=/,/^esac$/ {
/\.)[ ]*ac_abs_srcdir=/,/^esac$/ {
/^esac$/ a\
ac_abs_srcdir=`echo "$ac_abs_srcdir" | sed "s%/dev.*/bison-[0-9]\\{1,1\\}[-.0-9A-z]*/[^/]*%../../.%;s%.:.*/bison-[0-9]\\{1,1\\}[-.0-9A-z]*/[^/]*%../../.%"`
}
/\.)[ ]*ac_abs_top_srcdir=/,/^esac$/ {
/\.)[ ]*ac_abs_top_srcdir=/,/^esac$/ {
/^esac$/ a\
ac_abs_top_srcdir=`echo "$ac_abs_top_srcdir" | sed "s%/dev.*/bison-[0-9]\\{1,1\\}[-.0-9A-z]*/[^/]*%../../../%;s%.:.*/bison-[0-9]\\{1,1\\}[-.0-9A-z]*/[^/]*%../../../%"`
}
@@ -149,7 +148,7 @@ ac_abs_top_srcdir=`echo "$ac_abs_top_srcdir" | sed "s%/dev.*/bison-[0-9]\\{1,1\\
/^#define VERSION/ s/\$VERSION/& (DJGPP port (r1))/
# We need makeinfo to make the html formated docs.
/\$am_missing_run[ ]*makeinfo/ s,\$am_missing_run,,
/\$am_missing_run[ ]*makeinfo/ s,\$am_missing_run,,
# The path to the FORTRAN compiler and libraries
# shall contain no absolute path reference so it

View File

@@ -3,6 +3,23 @@
# This is the config.site file for configuring GNU packages
# which are to be built with DJGPP tools.
# Copyright (C) 2005 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# Include the djgpp subdirectory in PATH, so that getconf is found
PATH="$srcdir/djgpp;$PATH"

View File

@@ -1,15 +1,29 @@
# sed script for DJGPP specific editing of config.hin
# Copyright (C) 2005, 2006 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
$ a\
\
\
/* DJGPP specific defines. */\
/* DJGPP specific defines. */\
\
#include <unistd.h>\
#define TAB_EXT ((pathconf(NULL, _PC_NAME_MAX) > 12) ? ".tab" : "_tab")\
#define OUTPUT_EXT ((pathconf(NULL, _PC_NAME_MAX) > 12) ? ".output" : ".out")\
\
#define DEFAULT_TMPDIR "/dev/env/DJDIR/tmp"

View File

@@ -7,6 +7,23 @@ Rem This batch file unpacks the Bison distribution while simultaneously
Rem renaming some of the files whose names are invalid on DOS or conflict
Rem with other file names after truncation to DOS 8+3 namespace.
Rem
Rem Copyright (C) 2005 Free Software Foundation, Inc.
Rem
Rem This program is free software; you can redistribute it and/or modify
Rem it under the terms of the GNU General Public License as published by
Rem the Free Software Foundation; either version 2, or (at your option)
Rem any later version.
Rem
Rem This program is distributed in the hope that it will be useful,
Rem but WITHOUT ANY WARRANTY; without even the implied warranty of
Rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Rem GNU General Public License for more details.
Rem
Rem You should have received a copy of the GNU General Public License
Rem along with this program; if not, write to the Free Software Foundation,
Rem Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Rem
Rem
Rem Invoke like this:
Rem
Rem djunpack bison-XYZ.tar

View File

@@ -1,6 +1,6 @@
/* Subprocesses with pipes.
Copyright (C) 2005 Free Software Foundation, Inc.
Copyright (C) 2005, 2006 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -19,7 +19,7 @@
/* Written by Juan Manuel Guerrero <juan.guerrero@gmx.de>. */
#if HAVE_CONFIG_H
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
@@ -77,7 +77,7 @@ init_subpipe(void)
if (fd < 0)
error(EXIT_FAILURE, 0, _("creation of a temporary file failed"));
close (fd);
strcpy(tmp_file_name[1], "/dev/env/TMPDIR/bnXXXXXX");
fd = mkstemp(tmp_file_name[1]);
if (fd < 0)
@@ -230,10 +230,10 @@ end_of_output_subpipe(pid_t pid, int fd[2])
remove_tmp_file(STDIN_FILENO, tmp_file_name[0]);
remove_tmp_file(STDOUT_FILENO, tmp_file_name[1]);
error(EXIT_FAILURE, 0, _(errno == ENOENT
? "subsidiary program `%s' not found"
: status < 1
? "subsidiary program `%s' failed"
: "subsidiary program `%s' failed (status=%i, errno=%i)"), program, status, errno);
? "subsidiary program `%s' not found"
: status < 1
? "subsidiary program `%s' failed"
: "subsidiary program `%s' failed (status=%i, errno=%i)"), program, status, errno);
}

View File

@@ -1,22 +1,19 @@
/* Subprocesses with pipes.
Copyright (C) 2005 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
Bison is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
Bison is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Bison; see the file COPYING. If not, write to the Free
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
/* Written by Juan Manuel Guerrero <juan.guerrero@gmx.de>. */

View File

@@ -13,12 +13,11 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifdef HAVE_CONFIG_H
#include "config.h"
# include <config.h>
#endif
#include "abitset.h"

View File

@@ -13,11 +13,11 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifdef HAVE_CONFIG_H
#include "config.h"
# include <config.h>
#endif
#include <stdlib.h>

View File

@@ -13,20 +13,18 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
/* This file is a wrapper bitset implementation for the other bitset
implementations. It provides bitset compatibility checking and
statistics gathering without having to instrument the bitset
implementations. When statistics gathering is enabled, the bitset
operations get vectored through here and we then call the appropriate
routines.
*/
routines. */
#ifdef HAVE_CONFIG_H
#include "config.h"
# include <config.h>
#endif
#include "bbitset.h"

View File

@@ -1,25 +1,22 @@
/* Bitset vectors.
Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc.
Copyright (C) 2001, 2002, 2004, 2006 Free Software Foundation, Inc.
This file is part of Bison.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
Bison is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2, or (at your option) any later
version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
Bison is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with Bison; see the file COPYING. If not, write to the Free
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifdef HAVE_CONFIG_H
#include "config.h"
# include <config.h>
#endif
#include <stdlib.h>

View File

@@ -1,25 +1,22 @@
/* Bitset vectors.
Copyright (C) 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
Copyright (C) 2001, 2002, 2004, 2005, 2006 Free Software Foundation, Inc.
This file is part of GCC.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2, or (at your option) any later
version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING. If not, write to the Free
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA. */
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifdef HAVE_CONFIG_H
#include "config.h"
# include <config.h>
#endif
#include <stdlib.h>

View File

@@ -13,12 +13,11 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifdef HAVE_CONFIG_H
#include "config.h"
# include <config.h>
#endif
#include "ebitset.h"
@@ -210,7 +209,7 @@ ebitset_elt_alloc (void)
#define OBSTACK_CHUNK_FREE free
#endif
#if !defined(__GNUC__) || (__GNUC__ < 2)
#if ! defined __GNUC__ || __GNUC__ < 2
#define __alignof__(type) 0
#endif

View File

@@ -1,6 +1,6 @@
/* get-errno.h - get and set errno.
/* get-errno.c - get and set errno.
Copyright (C) 2002 Free Software Foundation, Inc.
Copyright (C) 2002, 2006 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -18,7 +18,7 @@
/* Written by Paul Eggert. */
#if HAVE_CONFIG_H
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

View File

@@ -13,12 +13,11 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifdef HAVE_CONFIG_H
#include "config.h"
# include <config.h>
#endif
#include "lbitset.h"
@@ -121,7 +120,7 @@ lbitset_elt_alloc (void)
#define OBSTACK_CHUNK_FREE free
#endif
#if !defined(__GNUC__) || (__GNUC__ < 2)
#if ! defined __GNUC__ || __GNUC__ < 2
#define __alignof__(type) 0
#endif

View File

@@ -19,7 +19,7 @@
/* Written by Paul Eggert <eggert@twinsun.com>
and Florian Krohm <florian@edamail.fishkill.ibm.com>. */
#if HAVE_CONFIG_H
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
@@ -73,7 +73,7 @@
#ifndef __attribute__
/* This feature is available in gcc versions 2.5 and later. */
# if !defined (__GNUC__) || __GNUC__ < 2 || \
# if ! defined __GNUC__ || __GNUC__ < 2 || \
(__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
# define __attribute__(Spec) /* empty */
# endif

View File

@@ -1,22 +1,19 @@
/* Subprocesses with pipes.
Copyright (C) 2002, 2004 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
Bison is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
Bison is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Bison; see the file COPYING. If not, write to the Free
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA. */
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
/* Written by Paul Eggert <eggert@twinsun.com>
and Florian Krohm <florian@edamail.fishkill.ibm.com>. */

View File

@@ -1,25 +1,24 @@
/* Timing variables for measuring compiler performance.
Copyright (C) 2000, 2002, 2004, 2005 Free Software Foundation, Inc.
Copyright (C) 2000, 2002, 2004, 2005, 2006 Free Software Foundation, Inc.
Contributed by Alex Samuel <samuel@codesourcery.com>
This file is part of Bison, the GNU Compiler Compiler.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
Bison is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2, or (at your option) any later
version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
Bison is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
You should have received a copy of the GNU General Public License
along with Bison; see the file COPYING. If not, write to the Free
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA. */
#include "config.h"
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#if IN_GCC
@@ -448,7 +447,7 @@ timevar_print (fp)
FILE *fp;
{
/* Only print stuff if we have some sort of time information. */
#if defined (HAVE_USER_TIME) || defined (HAVE_SYS_TIME) || defined (HAVE_WALL_TIME)
#if defined HAVE_USER_TIME || defined HAVE_SYS_TIME || defined HAVE_WALL_TIME
unsigned int /* timevar_id_t */ id;
struct timevar_time_def *total = &timevars[TV_TOTAL].elapsed;
struct timevar_time_def now;
@@ -489,7 +488,7 @@ timevar_print (fp)
continue;
/* Don't print timing variables if we're going to get a row of
zeroes. */
zeroes. */
if (tv->elapsed.user < tiny
&& tv->elapsed.sys < tiny
&& tv->elapsed.wall < tiny)

View File

@@ -2,22 +2,19 @@
Copyright (C) 2000, 2002, 2004 Free Software Foundation, Inc.
Contributed by Alex Samuel <samuel@codesourcery.com>
This file is part of Bison, the GNU Compiler Compiler.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
Bison is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
Bison is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
License for more details.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Bison; see the file COPYING. If not, write to the Free
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA. */
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifndef GCC_TIMEVAR_H
#define GCC_TIMEVAR_H

View File

@@ -1,5 +1,5 @@
/* Variable array bitsets.
Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
This program is free software; you can redistribute it and/or modify
@@ -13,12 +13,11 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifdef HAVE_CONFIG_H
#include "config.h"
# include <config.h>
#endif
#include "vbitset.h"

View File

@@ -40,7 +40,6 @@
#include "gram.h"
#include "quotearg.h"
#include "reader.h"
#include "verify.h"
#include "uniqstr.h"
#define YY_USER_INIT \

View File

@@ -92,8 +92,8 @@ char *base_name (char const *name);
#ifndef __attribute__
/* This feature is available in gcc versions 2.5 and later. */
# if !defined (__GNUC__) || __GNUC__ < 2 || \
(__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
# if (! defined __GNUC__ || __GNUC__ < 2 \
|| (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__)
# define __attribute__(Spec) /* empty */
# endif
#endif

View File

@@ -60,41 +60,41 @@ m4_pushdef([AT_PURE_IF],
[m4_bmatch([$3], [%pure-parser], [$1], [$2])])
m4_pushdef([AT_PURE_AND_LOC_IF],
[m4_bmatch([$3], [%locations.*%pure-parser\|%pure-parser.*%locations],
[$1], [$2])])
[$1], [$2])])
m4_pushdef([AT_GLR_OR_PARAM_IF],
[m4_bmatch([$3], [%glr-parser\|%parse-param], [$1], [$2])])
# yyerror receives the location if %location & %pure & (%glr or %parse-param).
m4_pushdef([AT_YYERROR_ARG_LOC_IF],
[AT_GLR_OR_PARAM_IF([AT_PURE_AND_LOC_IF([$1], [$2])],
[$2])])
[$2])])
# yyerror always sees the locations (when activated), except if
# yacc & pure & !param.
m4_pushdef([AT_YYERROR_SEES_LOC_IF],
[AT_LOCATION_IF([AT_YACC_IF([AT_PURE_IF([AT_PARAM_IF([$1], [$2])],
[$1])],
[$1])],
[$2])])
[$1])],
[$1])],
[$2])])
# The interface is pure: either because %pure-parser, or because we
# are using the C++ parsers.
m4_pushdef([AT_PURE_LEX_IF],
[AT_PURE_IF([$1],
[AT_LALR1_CC_IF([$1], [$2])])])
[AT_LALR1_CC_IF([$1], [$2])])])
AT_PURE_LEX_IF(
[m4_pushdef([AT_LOC], [(*llocp)])
m4_pushdef([AT_VAL], [(*lvalp)])
m4_pushdef([AT_LEX_FORMALS],
[YYSTYPE *lvalp[]AT_LOCATION_IF([, YYLTYPE *llocp])])
[YYSTYPE *lvalp[]AT_LOCATION_IF([, YYLTYPE *llocp])])
m4_pushdef([AT_LEX_ARGS],
[lvalp[]AT_LOCATION_IF([, llocp])])
[lvalp[]AT_LOCATION_IF([, llocp])])
m4_pushdef([AT_USE_LEX_ARGS],
[(void) lvalp;AT_LOCATION_IF([(void) llocp])])
[(void) lvalp;AT_LOCATION_IF([(void) llocp])])
m4_pushdef([AT_LEX_PRE_FORMALS],
[AT_LEX_FORMALS, ])
[AT_LEX_FORMALS, ])
m4_pushdef([AT_LEX_PRE_ARGS],
[AT_LEX_ARGS, ])
[AT_LEX_ARGS, ])
],
[m4_pushdef([AT_LOC], [(yylloc)])
m4_pushdef([AT_VAL], [(yylval)])
@@ -144,7 +144,7 @@ m4_popdef([AT_LALR1_CC_IF])
# meant to be compiled.
m4_define([AT_DATA_GRAMMAR_PROLOGUE],
[[%{
#if HAVE_CONFIG_H
#ifdef HAVE_CONFIG_H
# include <config.h>
/* We don't need perfect functions for these tests. */
# undef malloc
@@ -188,7 +188,7 @@ m4_define([AT_COMPILE_CXX],
[AT_KEYWORDS(c++)
AT_CHECK([$BISON_CXX_WORKS], 0, ignore, ignore)
AT_CHECK([$CXX $CXXFLAGS $CPPFLAGS m4_bmatch([$1], [[.]], [], [$LDFLAGS ])-o $1 m4_default([$2], [$1.cc])[]m4_bmatch([$1], [[.]], [], [ $LIBS])],
0, [ignore], [ignore])])
0, [ignore], [ignore])])

View File

@@ -40,55 +40,55 @@ AT_CLEANUP
])
AT_CHECK_OUTPUT([foo.y], [], [-dv],
[foo.output foo.tab.c foo.tab.h])
[foo.output foo.tab.c foo.tab.h])
AT_CHECK_OUTPUT([foo.y], [], [-dv],
[foo.output foo.tab.c foo.tab.h],
[>&-])
[foo.output foo.tab.c foo.tab.h],
[>&-])
AT_CHECK_OUTPUT([foo.y], [], [-dv -o foo.c],
[foo.c foo.h foo.output])
[foo.c foo.h foo.output])
AT_CHECK_OUTPUT([foo.y], [], [-dv -o foo.tab.c],
[foo.output foo.tab.c foo.tab.h])
[foo.output foo.tab.c foo.tab.h])
AT_CHECK_OUTPUT([foo.y], [], [-dv -y],
[y.output y.tab.c y.tab.h])
[y.output y.tab.c y.tab.h])
AT_CHECK_OUTPUT([foo.y], [], [-dv -b bar],
[bar.output bar.tab.c bar.tab.h])
[bar.output bar.tab.c bar.tab.h])
AT_CHECK_OUTPUT([foo.y], [], [-dv -g -o foo.c],
[foo.c foo.h foo.output foo.vcg])
[foo.c foo.h foo.output foo.vcg])
AT_CHECK_OUTPUT([foo.y], [%defines %verbose], [],
[foo.output foo.tab.c foo.tab.h])
[foo.output foo.tab.c foo.tab.h])
AT_CHECK_OUTPUT([foo.y], [%defines %verbose %yacc],[],
[y.output y.tab.c y.tab.h])
[y.output y.tab.c y.tab.h])
AT_CHECK_OUTPUT([foo.yy], [%defines %verbose %yacc],[],
[y.output y.tab.c y.tab.h])
[y.output y.tab.c y.tab.h])
# Exercise %output and %file-prefix
AT_CHECK_OUTPUT([foo.y], [%file-prefix="bar" %defines %verbose], [],
[bar.output bar.tab.c bar.tab.h])
[bar.output bar.tab.c bar.tab.h])
AT_CHECK_OUTPUT([foo.y], [%output="bar.c" %defines %verbose %yacc],[],
[bar.output bar.c bar.h])
[bar.output bar.c bar.h])
AT_CHECK_OUTPUT([foo.y],
[%file-prefix="baz" %output="bar.c" %defines %verbose %yacc],
[],
[bar.output bar.c bar.h])
[%file-prefix="baz" %output="bar.c" %defines %verbose %yacc],
[],
[bar.output bar.c bar.h])
# Check priorities of extension control.
AT_CHECK_OUTPUT([foo.yy], [%defines %verbose], [],
[foo.output foo.tab.cc foo.tab.hh])
[foo.output foo.tab.cc foo.tab.hh])
AT_CHECK_OUTPUT([foo.yy], [%defines %verbose ], [-o foo.c],
[foo.c foo.h foo.output])
[foo.c foo.h foo.output])
AT_CHECK_OUTPUT([foo.yy], [],
[--defines=foo.hpp -o foo.c++],
[foo.c++ foo.hpp])
[--defines=foo.hpp -o foo.c++],
[foo.c++ foo.hpp])
AT_CHECK_OUTPUT([foo.yy], [],
[-o foo.c++ --graph=foo.gph],
[foo.c++ foo.gph])
[-o foo.c++ --graph=foo.gph],
[foo.c++ foo.gph])
## ------------ ##
@@ -102,13 +102,13 @@ AT_CHECK([grep 'include .subdir/' $1.hh], 1, [])
])
AT_CHECK_OUTPUT([foo.yy], [%skeleton "lalr1.cc" %defines %verbose], [],
[foo.tab.cc foo.tab.hh foo.output location.hh stack.hh position.hh])
[foo.tab.cc foo.tab.hh foo.output location.hh stack.hh position.hh])
AT_CHECK_OUTPUT([subdir/foo.yy], [%skeleton "lalr1.cc" %defines %verbose], [],
[foo.tab.cc foo.tab.hh foo.output location.hh stack.hh position.hh],
[], [AT_CHECK_NO_SUBDIR_PART([foo.tab])])
[foo.tab.cc foo.tab.hh foo.output location.hh stack.hh position.hh],
[], [AT_CHECK_NO_SUBDIR_PART([foo.tab])])
AT_CHECK_OUTPUT([subdir/foo.yy], [%skeleton "lalr1.cc" %defines %verbose],
[-o subdir/foo.cc],
[subdir/foo.cc subdir/foo.hh subdir/foo.output subdir/location.hh subdir/stack.hh subdir/position.hh],
[subdir/foo.cc subdir/foo.hh subdir/foo.output subdir/location.hh subdir/stack.hh subdir/position.hh],
[], [AT_CHECK_NO_SUBDIR_PART([subdir/foo])])