Merge branch 'branch-2.6' into maint

* origin/branch-2.6:
  regen
  yacc.c: do not define location support when not using locations
  maint: be compilable with GCC 4.0
  tests: address a warning from GCC 4.4
  tests: don't use options that Clang does not support
  tests: restore the tests on -Werror
  regen
  parse-gram: update the Bison interface
  fix comment
This commit is contained in:
Akim Demaille
2012-10-26 16:33:20 +02:00
14 changed files with 274 additions and 243 deletions

View File

@@ -49,7 +49,7 @@
#include "quote.h"
#include "uniqstr.h"
bool debug_flag;
bool debug;
bool defines_flag;
bool graph_flag;
bool xml_flag;
@@ -665,7 +665,7 @@ getargs (int argc, char *argv[])
break;
case 't':
debug_flag = true;
debug = true;
break;
case 'v':

View File

@@ -34,7 +34,7 @@ extern int skeleton_prio;
/* for -I */
extern char const *include;
extern bool debug_flag; /* for -t */
extern bool debug; /* for -t */
extern bool defines_flag; /* for -d */
extern bool graph_flag; /* for -g */
extern bool xml_flag; /* for -x */

View File

@@ -88,7 +88,7 @@ typedef struct
} location;
#define YYLTYPE location
#define GRAM_LTYPE location
#define EMPTY_LOCATION_INIT {{NULL, 0, 0}, {NULL, 0, 0}}
extern location const empty_location;

View File

@@ -626,7 +626,7 @@ prepare (void)
use_push_for_pull_flag = true;
/* Flags. */
MUSCLE_INSERT_BOOL ("debug_flag", debug_flag);
MUSCLE_INSERT_BOOL ("debug_flag", debug);
MUSCLE_INSERT_BOOL ("defines_flag", defines_flag);
MUSCLE_INSERT_BOOL ("error_verbose_flag", error_verbose);
MUSCLE_INSERT_BOOL ("glr_flag", glr_parser);

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,4 @@
/* A Bison parser, made by GNU Bison 2.6.3.3-b10d3. */
/* A Bison parser, made by GNU Bison 2.6.4.11-d01f-dirty. */
/* Bison interface for Yacc-like parsers in C
@@ -33,19 +33,27 @@
#ifndef YY_GRAM__________SRC_PARSE_GRAM_H_INCLUDED
# define YY_GRAM__________SRC_PARSE_GRAM_H_INCLUDED
/* Enabling traces. */
#ifndef YYDEBUG
# define YYDEBUG 1
#endif
#if YYDEBUG
#ifndef GRAM_DEBUG
# if defined YYDEBUG
# if YYDEBUG
# define GRAM_DEBUG 1
# else
# define GRAM_DEBUG 0
# endif
# else /* ! defined YYDEBUG */
# define GRAM_DEBUG 1
# endif /* ! defined YYDEBUG */
#endif /* ! defined GRAM_DEBUG */
#if GRAM_DEBUG
extern int gram_debug;
#endif
/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
#ifndef GRAM_TOKENTYPE
# define GRAM_TOKENTYPE
/* Put the tokens into the symbol table, so that GDB and other debuggers
know about them. */
enum yytokentype {
enum gram_tokentype {
GRAM_EOF = 0,
STRING = 258,
INT = 259,
@@ -164,10 +172,10 @@ extern int gram_debug;
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
#if ! defined GRAM_STYPE && ! defined GRAM_STYPE_IS_DECLARED
typedef union GRAM_STYPE
{
/* Line 2077 of yacc.c */
/* Line 2072 of yacc.c */
#line 115 "parse-gram.y"
symbol *symbol;
@@ -181,25 +189,25 @@ typedef union YYSTYPE
named_ref *named_ref;
/* Line 2077 of yacc.c */
#line 186 "parse-gram.h"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
/* Line 2072 of yacc.c */
#line 194 "parse-gram.h"
} GRAM_STYPE;
# define GRAM_STYPE_IS_TRIVIAL 1
# define gram_stype GRAM_STYPE /* obsolescent; will be withdrawn */
# define GRAM_STYPE_IS_DECLARED 1
#endif
#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
typedef struct YYLTYPE
#if ! defined GRAM_LTYPE && ! defined GRAM_LTYPE_IS_DECLARED
typedef struct GRAM_LTYPE
{
int first_line;
int first_column;
int last_line;
int last_column;
} YYLTYPE;
# define yyltype YYLTYPE /* obsolescent; will be withdrawn */
# define YYLTYPE_IS_DECLARED 1
# define YYLTYPE_IS_TRIVIAL 1
} GRAM_LTYPE;
# define gram_ltype GRAM_LTYPE /* obsolescent; will be withdrawn */
# define GRAM_LTYPE_IS_DECLARED 1
# define GRAM_LTYPE_IS_TRIVIAL 1
#endif

View File

@@ -94,14 +94,14 @@ current_lhs(symbol *sym, location loc, named_ref *ref)
%}
%debug
%verbose
%defines
%locations
%pure-parser
%error-verbose
%define api.prefix "gram_"
%define api.pure
%define parse.lac full
%name-prefix="gram_"
%defines
%error-verbose
%expect 0
%locations
%verbose
%initial-action
{
@@ -252,7 +252,7 @@ prologue_declaration:
plain_code.code, @1);
code_scanner_last_string_free ();
}
| "%debug" { debug_flag = true; }
| "%debug" { debug = true; }
| "%define" variable content.opt
{
muscle_percent_define_insert ($2, @2, $3,

View File

@@ -51,9 +51,9 @@ void grammar_current_rule_prec_set (symbol *precsym, location loc);
void grammar_current_rule_dprec_set (int dprec, location loc);
void grammar_current_rule_merge_set (uniqstr name, location loc);
void grammar_current_rule_symbol_append (symbol *sym, location loc,
named_ref *named_ref);
named_ref *nref);
void grammar_current_rule_action_append (const char *action, location loc,
named_ref *named_ref);
named_ref *nref);
void reader (void);
void free_merger_functions (void);

View File

@@ -32,7 +32,7 @@ void gram_scanner_last_string_free (void);
extern FILE *gram_out;
extern int gram_lineno;
# define GRAM_LEX_DECL int gram_lex (YYSTYPE *val, location *loc)
# define GRAM_LEX_DECL int gram_lex (GRAM_STYPE *val, location *loc)
GRAM_LEX_DECL;
#endif /* !SCAN_GRAM_H_ */