Use the same location.hh and position.hh in all parsers.

* src/misc/location.hh, src/misc/position.hh: New files,
from Bison 2.7.
* src/misc/Makefile.am: Distribute them.
* src/eltlparse/Makefile.am, src/eltlparse/eltlparse.yy,
src/eltlparse/parsedecl.hh, src/eltlparse/public.hh,
src/kripkeparse/Makefile.am, src/kripkeparse/kripkeparse.yy,
src/kripkeparse/parsedecl.hh, src/kripkeparse/public.hh,
src/ltlparse/Makefile.am, src/ltlparse/fmterror.cc,
src/ltlparse/ltlparse.yy, src/ltlparse/parsedecl.hh,
src/ltlparse/public.hh, src/neverparse/Makefile.am,
src/neverparse/neverclaimparse.yy, src/neverparse/parsedecl.hh,
src/neverparse/public.hh, src/tgbaparse/Makefile.am,
src/tgbaparse/parsedecl.hh, src/tgbaparse/public.hh,
src/tgbaparse/tgbaparse.yy: Adjust to use and include
misc/location.hh.
* NEWS: Mention this change.
This commit is contained in:
Alexandre Duret-Lutz 2013-06-28 18:12:10 +02:00
parent a0f5d53ea4
commit 8c2d7fcb7f
25 changed files with 436 additions and 125 deletions

View file

@ -1,8 +1,9 @@
## Copyright (C) 2008, 2009, 2011 Laboratoire de Recherche et
## Développement de l'Epita (LRDE).
## -*- coding: utf-8 -*-
## Copyright (C) 2008, 2009, 2011, 2013 Laboratoire de Recherche et
## Développement de l'Epita (LRDE).
## Copyright (C) 2003, 2004, 2006 Laboratoire d'Informatique de
## Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
## Université Pierre et Marie Curie.
## Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
## Université Pierre et Marie Curie.
##
## This file is part of Spot, a model checking library.
##
@ -25,10 +26,7 @@ AM_CXXFLAGS = $(WARNING_CXXFLAGS:-Werror=)
tgbaparsedir = $(pkgincludedir)/tgbaparse
tgbaparse_HEADERS = \
public.hh \
location.hh \
position.hh
tgbaparse_HEADERS = public.hh
noinst_LTLIBRARIES = libtgbaparse.la
@ -36,8 +34,6 @@ TGBAPARSE_YY = tgbaparse.yy
FROM_TGBAPARSE_YY_MAIN = tgbaparse.cc
FROM_TGBAPARSE_YY_OTHERS = \
stack.hh \
position.hh \
location.hh \
tgbaparse.hh
FROM_TGBAPARSE_YY = $(FROM_TGBAPARSE_YY_MAIN) $(FROM_TGBAPARSE_YY_OTHERS)

View file

@ -1,6 +1,7 @@
// Copyright (C) 2003, 2005 Laboratoire d'Informatique de Paris 6 (LIP6),
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
// et Marie Curie.
// -*- coding: utf-8 -*-
// Copyright (C) 2003, 2005, 2013 Laboratoire d'Informatique de Paris
// 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
// Université Pierre et Marie Curie.
//
// This file is part of Spot, a model checking library.
//
@ -22,11 +23,11 @@
#include <string>
#include "tgbaparse.hh"
#include "location.hh"
#include "misc/location.hh"
# define YY_DECL \
int tgbayylex (tgbayy::parser::semantic_type *yylval, \
tgbayy::location *yylloc)
spot::location *yylloc)
YY_DECL;
namespace spot

View file

@ -1,5 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2009, 2012 Laboratoire de Recherche et Développement
// Copyright (C) 2009, 2012, 2013 Laboratoire de Recherche et Développement
// de l'Epita.
// Copyright (C) 2003, 2004, 2005, 2006 Laboratoire
// d'Informatique de Paris 6 (LIP6), département Systèmes Répartis
@ -24,10 +24,7 @@
# define SPOT_TGBAPARSE_PUBLIC_HH
# include "tgba/tgbaexplicit.hh"
// Unfortunately Bison 2.3 uses the same guards in all parsers :(
# undef BISON_LOCATION_HH
# undef BISON_POSITION_HH
# include "tgbaparse/location.hh"
# include "misc/location.hh"
# include "ltlenv/defaultenv.hh"
# include <string>
# include <list>
@ -41,7 +38,7 @@ namespace spot
#ifndef SWIG
/// \brief A parse diagnostic with its location.
typedef std::pair<tgbayy::location, std::string> tgba_parse_error;
typedef std::pair<spot::location, std::string> tgba_parse_error;
/// \brief A list of parser diagnostics, as filled by parse.
typedef std::list<tgba_parse_error> tgba_parse_error_list;
#else

View file

@ -1,5 +1,5 @@
/* -*- coding: utf-8 -*-
** Copyright (C) 2009, 2010, 2012 Laboratoire de Recherche et
** Copyright (C) 2009, 2010, 2012, 2013 Laboratoire de Recherche et
** Développement de l'Epita (LRDE).
** Copyright (C) 2003, 2004, 2005, 2006 Laboratoire d'Informatique de
** Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
@ -26,6 +26,7 @@
%name-prefix "tgbayy"
%debug
%error-verbose
%define api.location.type "spot::location"
%code requires
{
@ -55,9 +56,6 @@ typedef std::map<std::string, bdd> formula_cache;
%code
{
#include "ltlast/constant.hh"
/* Unfortunately Bison 2.3 uses the same guards in all parsers :( */
#undef BISON_POSITION_HH
#undef BISON_LOCATION_HH
#include "ltlparse/public.hh"
#include <map>
@ -119,7 +117,7 @@ line: strident ',' strident ',' condition ',' acc_list ';'
i != pel.end(); ++i)
{
// Adjust the diagnostic to the current position.
location here = @5;
spot::location here = @5;
here.end.line = here.begin.line + i->first.end.line - 1;
here.end.column =
here.begin.column + i->first.end.column;
@ -239,7 +237,7 @@ namespace spot
if (tgbayyopen(name))
{
error_list.push_back
(tgba_parse_error(tgbayy::location(),
(tgba_parse_error(spot::location(),
std::string("Cannot open file ") + name));
return 0;
}