Use 'short int' rather than 'short', and similarly for 'long', 'unsigned', etc.

This commit is contained in:
Paul Eggert
2004-03-31 00:37:21 +00:00
parent 2ae64eed27
commit 779e7ceb93
25 changed files with 171 additions and 126 deletions

View File

@@ -1,3 +1,44 @@
2004-03-30 Paul Eggert <eggert@twinsun.com>
* src/getargs.c (version): Update copyright year to 2004.
* data/c.m4 (b4_int_type): Use 'short int' rather than
'short', and similarly for 'long', 'unsigned', etc.
* data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
yy_yypstack, yydumpstack): Likewise.
* data/lalr1.cc (user_token_number_max_, user_token_number_max_,
translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
Likewise.
* data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
yy_stack_print, yyparse): Likewise.
* doc/bison.texinfo (Prologue, Multiple Types): Likewise.
* lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
* lib/bitset.c (bitset_print): Likewise.
* lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
* lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
* lib/bitsetv.c (bitsetv_dump): Likewise.
* lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
* lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
Likewise.
* src/LR0.c (allocate_itemsets): Likewise.
* src/gram.h (rule_number, rule): Likewise.
* src/lalr.h (goto_number): Likewise.
* src/nullable.c (nullable_compute): Likewise.
* src/output.c (prepare_rules): Likewise.
* src/relation.c (relation_print, relation_digraph): Likewise.
* src/relation.h (relation_node): Likewise.
* src/state.h (state_number, transitions, errs, reductions,
struct state): Likewise.
* src/symtab.h (symbol_number, struct symbol): Likewise.
* src/tables.c (vector_number, tally, action_number,
default_goto, goto_actions): Likewise.
* tests/existing.at (GNU Cim Grammar): Likewise.
* tests/regression.at (Web2c Actions): Likewise.
* src/output.c (muscle_insert_short_int_table): Renamed from
muscle_insert_short_table. All uses changed.
2004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU> 2004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
* src/parse-gram.y: Define PERCENT_EXPECT_RR. * src/parse-gram.y: Define PERCENT_EXPECT_RR.

View File

@@ -1,7 +1,7 @@
m4_divert(-1) -*- Autoconf -*- m4_divert(-1) -*- Autoconf -*-
# C M4 Macros for Bison. # C M4 Macros for Bison.
# Copyright (C) 2002 Free Software Foundation, Inc. # Copyright (C) 2002, 2004 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by
@@ -114,8 +114,8 @@ m4_define([b4_int_type],
[m4_if(b4_ints_in($@, [0], [255]), [1], [unsigned char], [m4_if(b4_ints_in($@, [0], [255]), [1], [unsigned char],
b4_ints_in($@, [-128], [127]), [1], [signed char], b4_ints_in($@, [-128], [127]), [1], [signed char],
b4_ints_in($@, [0], [65535]), [1], [unsigned short], b4_ints_in($@, [0], [65535]), [1], [unsigned short int],
b4_ints_in($@, [-32768], [32767]), [1], [short], b4_ints_in($@, [-32768], [32767]), [1], [short int],
m4_eval([0 <= $1]), [1], [unsigned int], m4_eval([0 <= $1]), [1], [unsigned int],

View File

@@ -137,7 +137,7 @@ m4_define([b4_rhs_location],
m4_changecom() m4_changecom()
m4_divert(0)dnl m4_divert(0)dnl
@output @output_parser_name@ @output @output_parser_name@
b4_copyright([Skeleton parser for GLR parsing with Bison], [2002, 2003]) b4_copyright([Skeleton parser for GLR parsing with Bison], [2002, 2003, 2004])
[ [
/* This is the parser code for GLR (Generalized LR) parser. */ /* This is the parser code for GLR (Generalized LR) parser. */
@@ -282,7 +282,7 @@ b4_syncline([@oline@], [@ofile@])
#define YYTRANSLATE(YYX) \ #define YYTRANSLATE(YYX) \
((YYX <= 0) ? YYEOF : \ ((YYX <= 0) ? YYEOF : \
(unsigned)(YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) (unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
static const ]b4_int_type_for([b4_translate])[ yytranslate[] = static const ]b4_int_type_for([b4_translate])[ yytranslate[] =
@@ -394,9 +394,9 @@ static const ]b4_int_type_for([b4_conflict_list_heads])[ yyconflp[] =
/* YYCONFL[I] -- lists of conflicting rule numbers, each terminated by /* YYCONFL[I] -- lists of conflicting rule numbers, each terminated by
0, pointed into by YYCONFLP. */ 0, pointed into by YYCONFLP. */
]dnl Do not use b4_int_type_for here, since there are places where ]dnl Do not use b4_int_type_for here, since there are places where
dnl pointers onto yyconfl are taken, which type is "short *". dnl pointers onto yyconfl are taken, which type is "short int *".
dnl We probably ought to introduce a type for confl. dnl We probably ought to introduce a type for confl.
[static const short yyconfl[] = [static const short int yyconfl[] =
{ {
]b4_conflicting_rules[ ]b4_conflicting_rules[
}; };
@@ -552,10 +552,10 @@ typedef int yyStateNum;
typedef int yyRuleNum; typedef int yyRuleNum;
/** Grammar symbol */ /** Grammar symbol */
typedef short yySymbol; typedef short int yySymbol;
/** Item references, as in LALR(1) machine */ /** Item references, as in LALR(1) machine */
typedef short yyItemNum; typedef short int yyItemNum;
typedef struct yyGLRState yyGLRState; typedef struct yyGLRState yyGLRState;
typedef struct yySemanticOption yySemanticOption; typedef struct yySemanticOption yySemanticOption;
@@ -809,7 +809,7 @@ yydefaultAction (yyStateNum yystate)
*/ */
static inline void static inline void
yygetLRActions (yyStateNum yystate, int yytoken, yygetLRActions (yyStateNum yystate, int yytoken,
int* yyaction, const short** yyconflicts) int* yyaction, const short int** yyconflicts)
{ {
int yyindex = yypact[yystate] + yytoken; int yyindex = yypact[yystate] + yytoken;
if (yyindex < 0 || YYLAST < yyindex || yycheck[yyindex] != yytoken) if (yyindex < 0 || YYLAST < yyindex || yycheck[yyindex] != yytoken)
@@ -1539,7 +1539,7 @@ yyprocessOneStack (yyGLRStack* yystack, int yyk,
]b4_user_formals[) ]b4_user_formals[)
{ {
int yyaction; int yyaction;
const short* yyconflicts; const short int* yyconflicts;
yyRuleNum yyrule; yyRuleNum yyrule;
yySymbol* const yytokenp = yystack->yytokenp; yySymbol* const yytokenp = yystack->yytokenp;
@@ -1840,7 +1840,7 @@ yyrecoverSyntaxError (yyGLRStack* yystack,
{ {
yyRuleNum yyrule; yyRuleNum yyrule;
int yyaction; int yyaction;
const short* yyconflicts; const short int* yyconflicts;
yyStateNum yystate = yystack.yytops.yystates[0]->yylrState; yyStateNum yystate = yystack.yytops.yystates[0]->yylrState;
YYDPRINTF ((stderr, "Entering state %d\n", yystate)); YYDPRINTF ((stderr, "Entering state %d\n", yystate));
@@ -1942,7 +1942,7 @@ yy_yypstack (yyGLRState* yys)
yy_yypstack (yys->yypred); yy_yypstack (yys->yypred);
fprintf (stderr, " -> "); fprintf (stderr, " -> ");
} }
fprintf (stderr, "%d@@%lu", yys->yylrState, (unsigned long) yys->yyposn); fprintf (stderr, "%d@@%lu", yys->yylrState, (unsigned long int) yys->yyposn);
} }
static void static void
@@ -1972,30 +1972,30 @@ yypdumpstack (yyGLRStack* yystack)
size_t yyi; size_t yyi;
for (yyp = yystack->yyitems; yyp < yystack->yynextFree; yyp += 1) for (yyp = yystack->yyitems; yyp < yystack->yynextFree; yyp += 1)
{ {
fprintf (stderr, "%3lu. ", (unsigned long) (yyp - yystack->yyitems)); fprintf (stderr, "%3lu. ", (unsigned long int) (yyp - yystack->yyitems));
if (*(yybool *) yyp) if (*(yybool *) yyp)
{ {
fprintf (stderr, "Res: %d, LR State: %d, posn: %lu, pred: %ld", fprintf (stderr, "Res: %d, LR State: %d, posn: %lu, pred: %ld",
yyp->yystate.yyresolved, yyp->yystate.yylrState, yyp->yystate.yyresolved, yyp->yystate.yylrState,
(unsigned long) yyp->yystate.yyposn, (unsigned long int) yyp->yystate.yyposn,
(long) YYINDEX (yyp->yystate.yypred)); (long int) YYINDEX (yyp->yystate.yypred));
if (! yyp->yystate.yyresolved) if (! yyp->yystate.yyresolved)
fprintf (stderr, ", firstVal: %ld", fprintf (stderr, ", firstVal: %ld",
(long) YYINDEX (yyp->yystate.yysemantics.yyfirstVal)); (long int) YYINDEX (yyp->yystate.yysemantics.yyfirstVal));
} }
else else
{ {
fprintf (stderr, "Option. rule: %d, state: %ld, next: %ld", fprintf (stderr, "Option. rule: %d, state: %ld, next: %ld",
yyp->yyoption.yyrule, yyp->yyoption.yyrule,
(long) YYINDEX (yyp->yyoption.yystate), (long int) YYINDEX (yyp->yyoption.yystate),
(long) YYINDEX (yyp->yyoption.yynext)); (long int) YYINDEX (yyp->yyoption.yynext));
} }
fprintf (stderr, "\n"); fprintf (stderr, "\n");
} }
fprintf (stderr, "Tops:"); fprintf (stderr, "Tops:");
for (yyi = 0; yyi < yystack->yytops.yysize; yyi += 1) for (yyi = 0; yyi < yystack->yytops.yysize; yyi += 1)
fprintf (stderr, "%lu: %ld; ", (unsigned long) yyi, fprintf (stderr, "%lu: %ld; ", (unsigned long int) yyi,
(long) YYINDEX (yystack->yytops.yystates[yyi])); (long int) YYINDEX (yystack->yytops.yystates[yyi]));
fprintf (stderr, "\n"); fprintf (stderr, "\n");
} }
] ]
@@ -2003,7 +2003,7 @@ yypdumpstack (yyGLRStack* yystack)
b4_epilogue b4_epilogue
m4_if(b4_defines_flag, 0, [], m4_if(b4_defines_flag, 0, [],
[@output @output_header_name@ [@output @output_header_name@
b4_copyright([Skeleton parser for GLR parsing with Bison], [2002, 2003]) b4_copyright([Skeleton parser for GLR parsing with Bison], [2002, 2003, 2004])
b4_token_defines(b4_tokens) b4_token_defines(b4_tokens)

View File

@@ -1,6 +1,6 @@
m4_divert(-1) m4_divert(-1)
# C++ skeleton for Bison # C++ skeleton for Bison
# Copyright (C) 2002, 2003 Free Software Foundation, Inc. # Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by
@@ -128,7 +128,7 @@ m4_divert(0)dnl
m4_if(b4_defines_flag, 0, [], m4_if(b4_defines_flag, 0, [],
[@output @output_header_name@ [@output @output_header_name@
b4_copyright([C++ Skeleton parser for LALR(1) parsing with Bison], b4_copyright([C++ Skeleton parser for LALR(1) parsing with Bison],
[2002, 2003])[ [2002, 2003, 2004])[
/* FIXME: This is wrong, we want computed header guards. /* FIXME: This is wrong, we want computed header guards.
I don't know why the macros are missing now. :( */ I don't know why the macros are missing now. :( */
#ifndef PARSER_HEADER_H #ifndef PARSER_HEADER_H
@@ -291,7 +291,7 @@ namespace yy
static const int terror_; static const int terror_;
static const int errcode_; static const int errcode_;
static const int ntokens_; static const int ntokens_;
static const unsigned user_token_number_max_; static const unsigned int user_token_number_max_;
static const TokenNumberType undef_token_; static const TokenNumberType undef_token_;
/* State. */ /* State. */
@@ -334,7 +334,7 @@ namespace yy
])dnl ])dnl
@output @output_parser_name@ @output @output_parser_name@
b4_copyright([C++ Skeleton parser for LALR(1) parsing with Bison], b4_copyright([C++ Skeleton parser for LALR(1) parsing with Bison],
[2002, 2003]) [2002, 2003, 2004])
m4_if(b4_defines_flag, 0, [], [#include @output_header_name@])[ m4_if(b4_defines_flag, 0, [], [#include @output_header_name@])[
@@ -885,7 +885,7 @@ yy::]b4_parser_class_name[::translate_ (int token)
{ {
]b4_translate[ ]b4_translate[
}; };
if ((unsigned) token <= user_token_number_max_) if ((unsigned int) token <= user_token_number_max_)
return translate_table[token]; return translate_table[token];
else else
return undef_token_; return undef_token_;
@@ -900,13 +900,13 @@ const int yy::]b4_parser_class_name[::terror_ = 1;
const int yy::]b4_parser_class_name[::errcode_ = 256; const int yy::]b4_parser_class_name[::errcode_ = 256;
const int yy::]b4_parser_class_name[::ntokens_ = ]b4_tokens_number[; const int yy::]b4_parser_class_name[::ntokens_ = ]b4_tokens_number[;
const unsigned yy::]b4_parser_class_name[::user_token_number_max_ = ]b4_user_token_number_max[; const unsigned int yy::]b4_parser_class_name[::user_token_number_max_ = ]b4_user_token_number_max[;
const yy::]b4_parser_class_name[::TokenNumberType yy::]b4_parser_class_name[::undef_token_ = ]b4_undef_token_number[; const yy::]b4_parser_class_name[::TokenNumberType yy::]b4_parser_class_name[::undef_token_ = ]b4_undef_token_number[;
]b4_epilogue ]b4_epilogue
dnl dnl
@output stack.hh @output stack.hh
b4_copyright([Stack handling for Bison C++ parsers], [2002, 2003])[ b4_copyright([Stack handling for Bison C++ parsers], [2002, 2003, 2004])[
#ifndef BISON_STACK_HH #ifndef BISON_STACK_HH
# define BISON_STACK_HH # define BISON_STACK_HH
@@ -927,20 +927,20 @@ namespace yy
{ {
} }
Stack (unsigned n) : seq_ (n) Stack (unsigned int n) : seq_ (n)
{ {
} }
inline inline
T& T&
operator [] (unsigned i) operator [] (unsigned int i)
{ {
return seq_[i]; return seq_[i];
} }
inline inline
const T& const T&
operator [] (unsigned i) const operator [] (unsigned int i) const
{ {
return seq_[i]; return seq_[i];
} }
@@ -954,14 +954,14 @@ namespace yy
inline inline
void void
pop (unsigned n = 1) pop (unsigned int n = 1)
{ {
for (; n; --n) for (; n; --n)
seq_.pop_front (); seq_.pop_front ();
} }
inline inline
unsigned unsigned int
height () const height () const
{ {
return seq_.size (); return seq_.size ();
@@ -981,14 +981,14 @@ namespace yy
public: public:
Slice (const S& stack, Slice (const S& stack,
unsigned range) : stack_ (stack), unsigned int range) : stack_ (stack),
range_ (range) range_ (range)
{ {
} }
inline inline
const T& const T&
operator [] (unsigned i) const operator [] (unsigned int i) const
{ {
return stack_[range_ - i]; return stack_[range_ - i];
} }
@@ -996,14 +996,14 @@ namespace yy
private: private:
const S& stack_; const S& stack_;
unsigned range_; unsigned int range_;
}; };
} }
#endif // not BISON_STACK_HH] #endif // not BISON_STACK_HH]
dnl dnl
@output position.hh @output position.hh
b4_copyright([Position class for Bison C++ parsers], [2002, 2003])[ b4_copyright([Position class for Bison C++ parsers], [2002, 2003, 2004])[
/** /**
** \file position.hh ** \file position.hh
@@ -1116,7 +1116,7 @@ namespace yy
} }
#endif // not BISON_POSITION_HH] #endif // not BISON_POSITION_HH]
@output location.hh @output location.hh
b4_copyright([Location class for Bison C++ parsers], [2002, 2003])[ b4_copyright([Location class for Bison C++ parsers], [2002, 2003, 2004])[
/** /**
** \file location.hh ** \file location.hh
@@ -1187,7 +1187,7 @@ namespace yy
} }
/** \brief Add two Location objects */ /** \brief Add two Location objects */
inline const Location operator+ (const Location& begin, unsigned width) inline const Location operator+ (const Location& begin, unsigned int width)
{ {
Location res = begin; Location res = begin;
res.columns (width); res.columns (width);
@@ -1195,7 +1195,7 @@ namespace yy
} }
/** \brief Add and assign a Location */ /** \brief Add and assign a Location */
inline Location &operator+= (Location& res, unsigned width) inline Location &operator+= (Location& res, unsigned int width)
{ {
res.columns (width); res.columns (width);
return res; return res;

View File

@@ -1,7 +1,7 @@
m4_divert(-1) -*- C -*- m4_divert(-1) -*- C -*-
# Yacc compatible skeleton for Bison # Yacc compatible skeleton for Bison
# Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 # Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004
# Free Software Foundation, Inc. # Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
@@ -76,8 +76,8 @@ m4_define([b4_int_type],
[m4_if(b4_ints_in($@, [0], [255]), [1], [unsigned char], [m4_if(b4_ints_in($@, [0], [255]), [1], [unsigned char],
b4_ints_in($@, [-128], [127]), [1], [yysigned_char], b4_ints_in($@, [-128], [127]), [1], [yysigned_char],
b4_ints_in($@, [0], [65535]), [1], [unsigned short], b4_ints_in($@, [0], [65535]), [1], [unsigned short int],
b4_ints_in($@, [-32768], [32767]), [1], [short], b4_ints_in($@, [-32768], [32767]), [1], [short int],
m4_eval([0 <= $1]), [1], [unsigned int], m4_eval([0 <= $1]), [1], [unsigned int],
@@ -134,7 +134,7 @@ m4_changecom()
m4_divert(0)dnl m4_divert(0)dnl
@output @output_parser_name@ @output @output_parser_name@
b4_copyright([Skeleton parser for Yacc-like parsing with Bison], b4_copyright([Skeleton parser for Yacc-like parsing with Bison],
[1984, 1989, 1990, 2000, 2001, 2002, 2003])[ [1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004])[
/* As a special exception, when this file is copied by Bison into a /* As a special exception, when this file is copied by Bison into a
Bison output file, you may use that output file without restriction. Bison output file, you may use that output file without restriction.
@@ -261,7 +261,7 @@ b4_syncline([@oline@], [@ofile@])[
/* A type that is properly aligned for any stack member. */ /* A type that is properly aligned for any stack member. */
union yyalloc union yyalloc
{ {
short yyss; short int yyss;
YYSTYPE yyvs; YYSTYPE yyvs;
]b4_location_if([ YYLTYPE yyls; ]b4_location_if([ YYLTYPE yyls;
])dnl ])dnl
@@ -274,10 +274,10 @@ union yyalloc
N elements. */ N elements. */
]b4_location_if( ]b4_location_if(
[# define YYSTACK_BYTES(N) \ [# define YYSTACK_BYTES(N) \
((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ ((N) * (sizeof (short int) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
+ 2 * YYSTACK_GAP_MAXIMUM)], + 2 * YYSTACK_GAP_MAXIMUM)],
[# define YYSTACK_BYTES(N) \ [# define YYSTACK_BYTES(N) \
((N) * (sizeof (short) + sizeof (YYSTYPE)) \ ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \
+ YYSTACK_GAP_MAXIMUM)])[ + YYSTACK_GAP_MAXIMUM)])[
/* Copy COUNT objects from FROM to TO. The source and destination do /* Copy COUNT objects from FROM to TO. The source and destination do
@@ -319,7 +319,7 @@ union yyalloc
#if defined (__STDC__) || defined (__cplusplus) #if defined (__STDC__) || defined (__cplusplus)
typedef signed char yysigned_char; typedef signed char yysigned_char;
#else #else
typedef short yysigned_char; typedef short int yysigned_char;
#endif #endif
/* YYFINAL -- State number of the termination state. */ /* YYFINAL -- State number of the termination state. */
@@ -560,8 +560,8 @@ do { \
`------------------------------------------------------------------*/ `------------------------------------------------------------------*/
]b4_c_function_def([yy_stack_print], [static void], ]b4_c_function_def([yy_stack_print], [static void],
[[short *bottom], [bottom]], [[short int *bottom], [bottom]],
[[short *top], [top]])[ [[short int *top], [top]])[
{ {
YYFPRINTF (stderr, "Stack now"); YYFPRINTF (stderr, "Stack now");
for (/* Nothing. */; bottom <= top; ++bottom) for (/* Nothing. */; bottom <= top; ++bottom)
@@ -763,9 +763,9 @@ b4_c_function_def([yyparse], [int], b4_parse_param)
to reallocate them elsewhere. */ to reallocate them elsewhere. */
/* The state stack. */ /* The state stack. */
short yyssa[YYINITDEPTH]; short int yyssa[YYINITDEPTH];
short *yyss = yyssa; short int *yyss = yyssa;
register short *yyssp; register short int *yyssp;
/* The semantic value stack. */ /* The semantic value stack. */
YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE yyvsa[YYINITDEPTH];
@@ -842,7 +842,7 @@ b4_syncline([@oline@], [@ofile@])])dnl
these so that the &'s don't force the real ones into these so that the &'s don't force the real ones into
memory. */ memory. */
YYSTYPE *yyvs1 = yyvs; YYSTYPE *yyvs1 = yyvs;
short *yyss1 = yyss; short int *yyss1 = yyss;
]b4_location_if([ YYLTYPE *yyls1 = yyls;])[ ]b4_location_if([ YYLTYPE *yyls1 = yyls;])[
/* Each stack pointer address is followed by the size of the /* Each stack pointer address is followed by the size of the
@@ -870,7 +870,7 @@ b4_syncline([@oline@], [@ofile@])])dnl
yystacksize = YYMAXDEPTH; yystacksize = YYMAXDEPTH;
{ {
short *yyss1 = yyss; short int *yyss1 = yyss;
union yyalloc *yyptr = union yyalloc *yyptr =
(union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
if (! yyptr) if (! yyptr)
@@ -1241,7 +1241,7 @@ b4_epilogue
m4_if(b4_defines_flag, 0, [], m4_if(b4_defines_flag, 0, [],
[@output @output_header_name@ [@output @output_header_name@
b4_copyright([Skeleton parser for Yacc-like parsing with Bison], b4_copyright([Skeleton parser for Yacc-like parsing with Bison],
[1984, 1989, 1990, 2000, 2001, 2002, 2003]) [1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004])
/* As a special exception, when this file is copied by Bison into a /* As a special exception, when this file is copied by Bison into a
Bison output file, you may use that output file without restriction. Bison output file, you may use that output file without restriction.

View File

@@ -2338,7 +2338,7 @@ can be done with two @var{Prologue} blocks, one before and one after the
%@} %@}
%union @{ %union @{
long n; long int n;
tree t; /* @r{@code{tree} is defined in @file{ptypes.h}.} */ tree t; /* @r{@code{tree} is defined in @file{ptypes.h}.} */
@} @}
@@ -2755,7 +2755,7 @@ This macro definition must go in the prologue of the grammar file
In most programs, you will need different data types for different kinds In most programs, you will need different data types for different kinds
of tokens and groupings. For example, a numeric constant may need type of tokens and groupings. For example, a numeric constant may need type
@code{int} or @code{long}, while a string constant needs type @code{char *}, @code{int} or @code{long int}, while a string constant needs type @code{char *},
and an identifier might need a pointer to an entry in the symbol table. and an identifier might need a pointer to an entry in the symbol table.
To use more than one data type for semantic values in one parser, Bison To use more than one data type for semantic values in one parser, Bison

View File

@@ -1,5 +1,5 @@
/* Base bitset stuff. /* Base bitset stuff.
Copyright (C) 2002, 2003 Free Software Foundation, Inc. Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz). Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
@@ -48,8 +48,8 @@ extern const char * const bitset_type_names[];
enum bitset_alloc_type {BITSET_MALLOC, BITSET_OBALLOC}; enum bitset_alloc_type {BITSET_MALLOC, BITSET_OBALLOC};
/* Data type used to store a word of bits. */ /* Data type used to store a word of bits. */
typedef unsigned long bitset_word; typedef unsigned long int bitset_word;
#define BITSET_WORD_BITS ((unsigned) (CHAR_BIT * sizeof (bitset_word))) #define BITSET_WORD_BITS ((unsigned int) (CHAR_BIT * sizeof (bitset_word)))
/* Bit index. In theory we might need a type wider than size_t, but /* Bit index. In theory we might need a type wider than size_t, but
in practice we lose at most a factor of CHAR_BIT by going with in practice we lose at most a factor of CHAR_BIT by going with

View File

@@ -1,5 +1,5 @@
/* General bitsets. /* General bitsets.
Copyright (C) 2002, 2003 Free Software Foundation, Inc. Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz). Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
@@ -296,7 +296,7 @@ bitset_print (FILE *file, bitset bset, bool verbose)
if (verbose) if (verbose)
fprintf (file, "n_bits = %lu, set = {", fprintf (file, "n_bits = %lu, set = {",
(unsigned long) bitset_size (bset)); (unsigned long int) bitset_size (bset));
pos = 30; pos = 30;
BITSET_FOR_EACH (iter, bset, i, 0) BITSET_FOR_EACH (iter, bset, i, 0)

View File

@@ -1,5 +1,5 @@
/* Bitset statistics. /* Bitset statistics.
Copyright (C) 2002, 2003 Free Software Foundation, Inc. Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz). Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
@@ -160,8 +160,8 @@ bitset_log_histogram_print (FILE *file, const char *name, const char *msg,
for (; i < n_bins; i++) for (; i < n_bins; i++)
fprintf (file, "%*lu-%lu\t%8u (%5.1f%%)\n", fprintf (file, "%*lu-%lu\t%8u (%5.1f%%)\n",
max_width - ((unsigned int) (0.30103 * (i) + 0.9999) + 1), max_width - ((unsigned int) (0.30103 * (i) + 0.9999) + 1),
(unsigned long) 1 << (i - 1), 1UL << (i - 1),
((unsigned long) 1 << i) - 1, (1UL << i) - 1,
bins[i], bins[i],
(100.0 * bins[i]) / total); (100.0 * bins[i]) / total);
} }

View File

@@ -1,5 +1,5 @@
/* Bitset vectors. /* Bitset vectors.
Copyright (C) 2001, 2002 Free Software Foundation, Inc. Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc.
This file is part of Bison. This file is part of Bison.
@@ -57,7 +57,7 @@ bitsetv_matrix_dump (FILE * out, const char *title, bitsetv bset)
/* Contents. */ /* Contents. */
for (i = 0; bset[i]; ++i) for (i = 0; bset[i]; ++i)
{ {
fprintf (out, "%2lu|", (unsigned long) i); fprintf (out, "%2lu|", (unsigned long int) i);
for (j = 0; j < hsize; ++j) for (j = 0; j < hsize; ++j)
fputs (bitset_test (bset[i], j) ? "1" : " ", out); fputs (bitset_test (bset[i], j) ? "1" : " ", out);
fputs ("|\n", out); fputs ("|\n", out);

View File

@@ -1,5 +1,5 @@
/* Bitset vectors. /* Bitset vectors.
Copyright (C) 2001, 2002 Free Software Foundation, Inc. Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc.
This file is part of GCC. This file is part of GCC.
@@ -149,7 +149,7 @@ bitsetv_dump (FILE *file, char const *title, char const *subtitle,
fprintf (file, "%s\n", title); fprintf (file, "%s\n", title);
for (i = 0; bsetv[i]; i++) for (i = 0; bsetv[i]; i++)
{ {
fprintf (file, "%s %lu\n", subtitle, (unsigned long) i); fprintf (file, "%s %lu\n", subtitle, (unsigned long int) i);
bitset_dump (file, bsetv[i]); bitset_dump (file, bsetv[i]);
} }
@@ -164,7 +164,7 @@ debug_bitsetv (bitsetv bsetv)
for (i = 0; bsetv[i]; i++) for (i = 0; bsetv[i]; i++)
{ {
fprintf (stderr, "%lu: ", (unsigned long) i); fprintf (stderr, "%lu: ", (unsigned long int) i);
debug_bitset (bsetv[i]); debug_bitset (bsetv[i]);
} }

View File

@@ -1,5 +1,5 @@
/* Functions to support expandable bitsets. /* Functions to support expandable bitsets.
Copyright (C) 2002, 2003 Free Software Foundation, Inc. Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz). Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
@@ -52,7 +52,7 @@
/* Number of bits stored in each element. */ /* Number of bits stored in each element. */
#define EBITSET_ELT_BITS \ #define EBITSET_ELT_BITS \
((unsigned) (EBITSET_ELT_WORDS * BITSET_WORD_BITS)) ((unsigned int) (EBITSET_ELT_WORDS * BITSET_WORD_BITS))
/* Ebitset element. We use an array of bits. */ /* Ebitset element. We use an array of bits. */
typedef struct ebitset_elt_struct typedef struct ebitset_elt_struct
@@ -216,7 +216,7 @@ ebitset_elt_alloc (void)
obstack_specify_allocation (&ebitset_obstack, OBSTACK_CHUNK_SIZE, obstack_specify_allocation (&ebitset_obstack, OBSTACK_CHUNK_SIZE,
__alignof__ (ebitset_elt), __alignof__ (ebitset_elt),
(void *(*)PARAMS ((long))) (void *(*)PARAMS ((long int)))
OBSTACK_CHUNK_ALLOC, OBSTACK_CHUNK_ALLOC,
(void (*)PARAMS ((void *))) (void (*)PARAMS ((void *)))
OBSTACK_CHUNK_FREE); OBSTACK_CHUNK_FREE);

View File

@@ -1,5 +1,5 @@
/* Functions to support link list bitsets. /* Functions to support link list bitsets.
Copyright (C) 2002, 2003 Free Software Foundation, Inc. Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz). Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz).
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
@@ -54,7 +54,7 @@ typedef bitset_word lbitset_word;
/* Number of bits stored in each element. */ /* Number of bits stored in each element. */
#define LBITSET_ELT_BITS \ #define LBITSET_ELT_BITS \
((unsigned) (LBITSET_ELT_WORDS * LBITSET_WORD_BITS)) ((unsigned int) (LBITSET_ELT_WORDS * LBITSET_WORD_BITS))
/* Lbitset element. We use an array of bits for each element. /* Lbitset element. We use an array of bits for each element.
These are linked together in a doubly-linked list. */ These are linked together in a doubly-linked list. */
@@ -127,7 +127,7 @@ lbitset_elt_alloc (void)
obstack_specify_allocation (&lbitset_obstack, OBSTACK_CHUNK_SIZE, obstack_specify_allocation (&lbitset_obstack, OBSTACK_CHUNK_SIZE,
__alignof__ (lbitset_elt), __alignof__ (lbitset_elt),
(void *(*)PARAMS ((long))) (void *(*)PARAMS ((long int)))
OBSTACK_CHUNK_ALLOC, OBSTACK_CHUNK_ALLOC,
(void (*)PARAMS ((void *))) (void (*)PARAMS ((void *)))
OBSTACK_CHUNK_FREE); OBSTACK_CHUNK_FREE);
@@ -1390,7 +1390,7 @@ debug_lbitset (bitset bset)
for (elt = LBITSET_HEAD (bset); elt; elt = elt->next) for (elt = LBITSET_HEAD (bset); elt; elt = elt->next)
{ {
fprintf (stderr, "Elt %lu\n", (unsigned long) elt->index); fprintf (stderr, "Elt %lu\n", (unsigned long int) elt->index);
for (i = 0; i < LBITSET_ELT_WORDS; i++) for (i = 0; i < LBITSET_ELT_WORDS; i++)
{ {
unsigned int j; unsigned int j;

View File

@@ -1,7 +1,7 @@
/* Generate the nondeterministic finite state machine for Bison. /* Generate the nondeterministic finite state machine for Bison.
Copyright (C) 1984, 1986, 1989, 2000, 2001, 2002 Free Software Copyright (C) 1984, 1986, 1989, 2000, 2001, 2002, 2004 Free
Foundation, Inc. Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler. This file is part of Bison, the GNU Compiler Compiler.
@@ -106,7 +106,8 @@ allocate_itemsets (void)
browsed too, hence we need to allocate room for _all_ the browsed too, hence we need to allocate room for _all_ the
symbols. */ symbols. */
int count = 0; int count = 0;
short *symbol_count = CALLOC (symbol_count, nsyms + nuseless_nonterminals); short int *symbol_count = CALLOC (symbol_count,
nsyms + nuseless_nonterminals);
for (r = 0; r < nrules; ++r) for (r = 0; r < nrules; ++r)
for (rhsp = rules[r].rhs; *rhsp >= 0; ++rhsp) for (rhsp = rules[r].rhs; *rhsp >= 0; ++rhsp)

View File

@@ -1,6 +1,6 @@
/* Data definitions for internal representation of Bison's input. /* Data definitions for internal representation of Bison's input.
Copyright (C) 1984, 1986, 1989, 1992, 2001, 2002, 2003 Copyright (C) 1984, 1986, 1989, 1992, 2001, 2002, 2003, 2004
Free Software Foundation, Inc. Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler. This file is part of Bison, the GNU Compiler Compiler.
@@ -139,7 +139,7 @@ item_number_as_symbol_number (item_number i)
} }
/* Rule numbers. */ /* Rule numbers. */
typedef short rule_number; typedef short int rule_number;
extern rule_number nrules; extern rule_number nrules;
static inline item_number static inline item_number
@@ -175,8 +175,8 @@ typedef struct
/* This symbol provides both the associativity, and the precedence. */ /* This symbol provides both the associativity, and the precedence. */
symbol *prec; symbol *prec;
short dprec; short int dprec;
short merger; short int merger;
/* This symbol was attached to the rule via %prec. */ /* This symbol was attached to the rule via %prec. */
symbol *precsym; symbol *precsym;

View File

@@ -1,5 +1,7 @@
/* Compute look-ahead criteria for bison, /* Compute look-ahead criteria for bison,
Copyright (C) 1984, 1986, 1989, 2000, 2002 Free Software Foundation, Inc.
Copyright (C) 1984, 1986, 1989, 2000, 2002, 2004 Free Software
Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler. This file is part of Bison, the GNU Compiler Compiler.
@@ -54,7 +56,7 @@ void lalr_free (void);
together and GOTO_MAP[I - NTOKENS] is the index in FROM_STATE and together and GOTO_MAP[I - NTOKENS] is the index in FROM_STATE and
TO_STATE of the first of them. */ TO_STATE of the first of them. */
typedef short goto_number; typedef short int goto_number;
# define GOTO_NUMBER_MAXIMUM SHRT_MAX # define GOTO_NUMBER_MAXIMUM SHRT_MAX
extern goto_number *goto_map; extern goto_number *goto_map;

View File

@@ -1,7 +1,7 @@
/* Calculate which nonterminals can expand into the null string for Bison. /* Calculate which nonterminals can expand into the null string for Bison.
Copyright (C) 1984, 1989, 2000, 2001, 2002, 2003 Free Software Copyright (C) 1984, 1989, 2000, 2001, 2002, 2003, 2004 Free
Foundation, Inc. Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler. This file is part of Bison, the GNU Compiler Compiler.
@@ -62,7 +62,7 @@ nullable_compute (void)
rule_list *p; rule_list *p;
symbol_number *squeue = CALLOC (squeue, nvars); symbol_number *squeue = CALLOC (squeue, nvars);
short *rcount = CALLOC (rcount, nrules); short int *rcount = CALLOC (rcount, nrules);
/* RITEM contains all the rules, including useless productions. /* RITEM contains all the rules, including useless productions.
Hence we must allocate room for useless nonterminals too. */ Hence we must allocate room for useless nonterminals too. */
rule_list **rsets = CALLOC (rsets, nvars); rule_list **rsets = CALLOC (rsets, nvars);

View File

@@ -1,6 +1,6 @@
/* Output the generated parsing program for Bison. /* Output the generated parsing program for Bison.
Copyright (C) 1984, 1986, 1989, 1992, 2000, 2001, 2002, 2003 Copyright (C) 1984, 1986, 1989, 1992, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc. Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler. This file is part of Bison, the GNU Compiler Compiler.
@@ -106,7 +106,7 @@ Name (const char *name, \
GENERATE_MUSCLE_INSERT_TABLE(muscle_insert_unsigned_int_table, unsigned int) GENERATE_MUSCLE_INSERT_TABLE(muscle_insert_unsigned_int_table, unsigned int)
GENERATE_MUSCLE_INSERT_TABLE(muscle_insert_int_table, int) GENERATE_MUSCLE_INSERT_TABLE(muscle_insert_int_table, int)
GENERATE_MUSCLE_INSERT_TABLE(muscle_insert_short_table, short) GENERATE_MUSCLE_INSERT_TABLE(muscle_insert_short_int_table, short int)
GENERATE_MUSCLE_INSERT_TABLE(muscle_insert_base_table, base_number) GENERATE_MUSCLE_INSERT_TABLE(muscle_insert_base_table, base_number)
GENERATE_MUSCLE_INSERT_TABLE(muscle_insert_rule_number_table, rule_number) GENERATE_MUSCLE_INSERT_TABLE(muscle_insert_rule_number_table, rule_number)
GENERATE_MUSCLE_INSERT_TABLE(muscle_insert_symbol_number_table, symbol_number) GENERATE_MUSCLE_INSERT_TABLE(muscle_insert_symbol_number_table, symbol_number)
@@ -217,8 +217,8 @@ prepare_rules (void)
unsigned int *rline = MALLOC (rline, nrules); unsigned int *rline = MALLOC (rline, nrules);
symbol_number *r1 = MALLOC (r1, nrules); symbol_number *r1 = MALLOC (r1, nrules);
unsigned int *r2 = MALLOC (r2, nrules); unsigned int *r2 = MALLOC (r2, nrules);
short *dprec = MALLOC (dprec, nrules); short int *dprec = MALLOC (dprec, nrules);
short *merger = MALLOC (merger, nrules); short int *merger = MALLOC (merger, nrules);
for (r = 0; r < nrules; ++r) for (r = 0; r < nrules; ++r)
{ {
@@ -249,8 +249,8 @@ prepare_rules (void)
muscle_insert_unsigned_int_table ("rline", rline, 0, 0, nrules); muscle_insert_unsigned_int_table ("rline", rline, 0, 0, nrules);
muscle_insert_symbol_number_table ("r1", r1, 0, 0, nrules); muscle_insert_symbol_number_table ("r1", r1, 0, 0, nrules);
muscle_insert_unsigned_int_table ("r2", r2, 0, 0, nrules); muscle_insert_unsigned_int_table ("r2", r2, 0, 0, nrules);
muscle_insert_short_table ("dprec", dprec, 0, 0, nrules); muscle_insert_short_int_table ("dprec", dprec, 0, 0, nrules);
muscle_insert_short_table ("merger", merger, 0, 0, nrules); muscle_insert_short_int_table ("merger", merger, 0, 0, nrules);
MUSCLE_INSERT_INT ("rules_number", nrules); MUSCLE_INSERT_INT ("rules_number", nrules);
MUSCLE_INSERT_INT ("max_left_semantic_context", max_left_semantic_context); MUSCLE_INSERT_INT ("max_left_semantic_context", max_left_semantic_context);

View File

@@ -1,5 +1,5 @@
/* Binary relations. /* Binary relations.
Copyright (C) 2002 Free Software Foundation, Inc. Copyright (C) 2002, 2004 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler. This file is part of Bison, the GNU Compiler Compiler.
@@ -28,7 +28,8 @@
void void
relation_print (relation r, size_t size, FILE *out) relation_print (relation r, size_t size, FILE *out)
{ {
unsigned i, j; unsigned int i;
unsigned int j;
for (i = 0; i < size; ++i) for (i = 0; i < size; ++i)
{ {
@@ -94,7 +95,7 @@ traverse (int i)
void void
relation_digraph (relation r, size_t size, bitsetv *function) relation_digraph (relation r, size_t size, bitsetv *function)
{ {
unsigned i; unsigned int i;
infinity = size + 2; infinity = size + 2;
CALLOC (INDEX, size + 1); CALLOC (INDEX, size + 1);

View File

@@ -1,5 +1,5 @@
/* Binary relations. /* Binary relations.
Copyright (C) 2002 Free Software Foundation, Inc. Copyright (C) 2002, 2004 Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler. This file is part of Bison, the GNU Compiler Compiler.
@@ -27,7 +27,7 @@
If GRAPH is a relation, then GRAPH[Node] is a list of adjacent If GRAPH is a relation, then GRAPH[Node] is a list of adjacent
nodes, ended with -1. */ nodes, ended with -1. */
typedef short relation_node; typedef short int relation_node;
typedef relation_node *relation_nodes; typedef relation_node *relation_nodes;
typedef relation_nodes *relation; typedef relation_nodes *relation;

View File

@@ -1,7 +1,7 @@
/* Type definitions for nondeterministic finite state machine for Bison. /* Type definitions for nondeterministic finite state machine for Bison.
Copyright (C) 1984, 1989, 2000, 2001, 2002, 2003 Free Software Copyright (C) 1984, 1989, 2000, 2001, 2002, 2003, 2004 Free
Foundation, Inc. Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler. This file is part of Bison, the GNU Compiler Compiler.
@@ -94,7 +94,7 @@
| Numbering states. | | Numbering states. |
`-------------------*/ `-------------------*/
typedef short state_number; typedef short int state_number;
# define STATE_NUMBER_MAXIMUM SHRT_MAX # define STATE_NUMBER_MAXIMUM SHRT_MAX
/* Be ready to map a state_number to an int. */ /* Be ready to map a state_number to an int. */
@@ -113,7 +113,7 @@ typedef struct state state;
typedef struct typedef struct
{ {
short num; short int num;
state *states[1]; state *states[1];
} transitions; } transitions;
@@ -171,7 +171,7 @@ struct state *transitions_to (transitions *shifts, symbol_number sym);
typedef struct typedef struct
{ {
short num; short int num;
symbol *symbols[1]; symbol *symbols[1];
} errs; } errs;
@@ -184,7 +184,7 @@ errs *errs_new (int num, symbol **tokens);
typedef struct typedef struct
{ {
short num; short int num;
bitset *lookaheads; bitset *lookaheads;
rule *rules[1]; rule *rules[1];
} reductions; } reductions;
@@ -212,7 +212,7 @@ struct state
/* Its items. Must be last, since ITEMS can be arbitrarily large. /* Its items. Must be last, since ITEMS can be arbitrarily large.
*/ */
unsigned short nitems; unsigned short int nitems;
item_number items[1]; item_number items[1];
}; };

View File

@@ -1,6 +1,6 @@
/* Definitions for symtab.c and callers, part of Bison. /* Definitions for symtab.c and callers, part of Bison.
Copyright (C) 1984, 1989, 1992, 2000, 2001, 2002 Copyright (C) 1984, 1989, 1992, 2000, 2001, 2002, 2004
Free Software Foundation, Inc. Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler. This file is part of Bison, the GNU Compiler Compiler.
@@ -41,7 +41,7 @@ typedef enum
/* Internal token numbers. */ /* Internal token numbers. */
typedef short symbol_number; typedef short int symbol_number;
#define SYMBOL_NUMBER_MAXIMUM SHRT_MAX #define SYMBOL_NUMBER_MAXIMUM SHRT_MAX
@@ -61,7 +61,7 @@ struct symbol
location printer_location; location printer_location;
symbol_number number; symbol_number number;
short prec; short int prec;
assoc assoc; assoc assoc;
int user_token_number; int user_token_number;

View File

@@ -1,6 +1,6 @@
/* Output the generated parsing program for Bison. /* Output the generated parsing program for Bison.
Copyright (C) 1984, 1986, 1989, 1992, 2000, 2001, 2002, 2003 Copyright (C) 1984, 1986, 1989, 1992, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc. Free Software Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler. This file is part of Bison, the GNU Compiler Compiler.
@@ -42,7 +42,7 @@
Of course vector_number_t ought to be wide enough to contain Of course vector_number_t ought to be wide enough to contain
state_number and symbol_number. */ state_number and symbol_number. */
typedef short vector_number; typedef short int vector_number;
static inline vector_number static inline vector_number
state_number_to_vector_number (state_number s) state_number_to_vector_number (state_number s)
@@ -84,7 +84,7 @@ int nvectors;
static base_number **froms = NULL; static base_number **froms = NULL;
static base_number **tos = NULL; static base_number **tos = NULL;
static unsigned int **conflict_tos = NULL; static unsigned int **conflict_tos = NULL;
static short *tally = NULL; static short int *tally = NULL;
static base_number *width = NULL; static base_number *width = NULL;
@@ -94,7 +94,7 @@ static base_number *width = NULL;
If N = MIN, stands for `raise a syntax error'. If N = MIN, stands for `raise a syntax error'.
If N > 0, stands for `shift SYMBOL and go to n'. If N > 0, stands for `shift SYMBOL and go to n'.
If N < 0, stands for `reduce -N'. */ If N < 0, stands for `reduce -N'. */
typedef short action_number; typedef short int action_number;
#define ACTION_NUMBER_MINIMUM SHRT_MIN #define ACTION_NUMBER_MINIMUM SHRT_MIN
static action_number *actrow = NULL; static action_number *actrow = NULL;
@@ -512,7 +512,7 @@ save_column (symbol_number sym, state_number default_state)
`-------------------------------------------------------------*/ `-------------------------------------------------------------*/
static state_number static state_number
default_goto (symbol_number sym, short state_count[]) default_goto (symbol_number sym, short int state_count[])
{ {
state_number s; state_number s;
int i; int i;
@@ -554,7 +554,7 @@ static void
goto_actions (void) goto_actions (void)
{ {
symbol_number i; symbol_number i;
short *state_count = CALLOC (state_count, nstates); short int *state_count = CALLOC (state_count, nstates);
MALLOC (yydefgoto, nvars); MALLOC (yydefgoto, nvars);
/* For a given nterm I, STATE_COUNT[S] is the number of times there /* For a given nterm I, STATE_COUNT[S] is the number of times there

View File

@@ -1,6 +1,6 @@
# Exercising Bison on actual grammars. -*- Autotest -*- # Exercising Bison on actual grammars. -*- Autotest -*-
# Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003 # Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003, 2004
# Free Software Foundation, Inc. # Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
@@ -372,9 +372,9 @@ AT_SETUP([GNU Cim Grammar])
AT_DATA([[input.y]], AT_DATA([[input.y]],
[[%union { [[%union {
long token; long int token;
long ival; long int ival;
long arrdim; long int arrdim;
double rval; double rval;
char *ident; char *ident;
char *tval; char *tval;

View File

@@ -1,5 +1,5 @@
# Bison Regressions. -*- Autotest -*- # Bison Regressions. -*- Autotest -*-
# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. # Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by
@@ -535,7 +535,7 @@ AT_CLEANUP
# #
# It used to be wrong on yydefact only: # It used to be wrong on yydefact only:
# #
# static const short yydefact[] = # static const short int yydefact[] =
# { # {
# - 2, 0, 1, 0, 0, 2, 3, 2, 5, 4, # - 2, 0, 1, 0, 0, 2, 3, 2, 5, 4,
# + 2, 0, 1, 0, 0, 0, 3, 2, 5, 4, # + 2, 0, 1, 0, 0, 0, 3, 2, 5, 4,
@@ -613,7 +613,7 @@ static const char *const yytname[] =
"$end", "error", "$undefined", "\"if\"", "\"const\"", "\"then\"", "$end", "error", "$undefined", "\"if\"", "\"const\"", "\"then\"",
"\"else\"", "$accept", "statement", "struct_stat", "if", "else", 0 "\"else\"", "$accept", "statement", "struct_stat", "if", "else", 0
}; };
static const unsigned short yytoknum[] = static const unsigned short int yytoknum[] =
{ {
0, 256, 257, 258, 259, 260, 261 0, 256, 257, 258, 259, 260, 261
}; };