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,5 +1,5 @@
## Copyright (C) 2008, 2009, 2010, 2011, 2012 Laboratoire de Recherche
## et Développement de l'Epita (LRDE).
## Copyright (C) 2008, 2009, 2010, 2011, 2012, 2013 Laboratoire de
## Recherche et Développement de l'Epita (LRDE).
## Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris
## 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
## Université Pierre et Marie Curie.
@ -31,8 +31,6 @@ LTLPARSE_YY = ltlparse.yy
FROM_LTLPARSE_YY_MAIN = ltlparse.cc
FROM_LTLPARSE_YY_OTHERS = \
stack.hh \
position.hh \
location.hh \
ltlparse.hh
FROM_LTLPARSE_YY = $(FROM_LTLPARSE_YY_MAIN) $(FROM_LTLPARSE_YY_OTHERS)
@ -60,6 +58,5 @@ libltlparse_la_SOURCES = \
ltlparse_HEADERS = \
ltlfile.hh \
location.hh \
public.hh \
position.hh
public.hh

View file

@ -1,5 +1,5 @@
// Copyright (C) 2010, 2012 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
// Copyright (C) 2010, 2012, 2013 Laboratoire de Recherche et
// Développement de l'Epita (LRDE).
// Copyright (C) 2003, 2004, 2005 Laboratoire d'Informatique de Paris
// 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
// Université Pierre et Marie Curie.
@ -60,7 +60,7 @@ namespace spot
parse_error_list::iterator it;
for (it = error_list.begin(); it != error_list.end(); ++it)
{
ltlyy::location& l = it->first;
location& l = it->first;
l.begin.column = b2u[l.begin.column];
l.end.column = b2u[l.end.column];
}
@ -78,7 +78,7 @@ namespace spot
for (it = error_list.begin(); it != error_list.end(); ++it)
{
os << ">>> " << ltl_string << std::endl;
const ltlyy::location& l = it->first;
const location& l = it->first;
unsigned n = 1;
for (; n < 4 + l.begin.column; ++n)

View file

@ -1,8 +1,9 @@
/* Copyright (C) 2009, 2010, 2011, 2012 Laboratoire de Recherche et
** Développement de l'Epita (LRDE).
/* -*- coding: utf-8 -*-
** Copyright (C) 2009, 2010, 2011, 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),
** 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.
**
@ -27,6 +28,7 @@
%error-verbose
%expect 0
%lex-param { spot::ltl::parse_error_list& error_list }
%define api.location.type "spot::location"
%code requires
{
@ -90,7 +92,7 @@ using namespace spot::ltl;
const formula*
try_recursive_parse(const std::string& str,
const ltlyy::location& location,
const spot::location& location,
spot::ltl::environment& env,
bool debug,
parser_type type,

View file

@ -1,7 +1,8 @@
// Copyright (C) 2010, 2012 Laboratoire de Recherche et Développement de
// l'Epita (LRDE)
// -*- coding: utf-8 -*-
// Copyright (C) 2010, 2012, 2013 Laboratoire de Recherche et
// Développement de l'Epita (LRDE)
// Copyright (C) 2003, 2005 Laboratoire d'Informatique de Paris 6 (LIP6),
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
// et Marie Curie.
//
// This file is part of Spot, a model checking library.
@ -23,11 +24,11 @@
# define SPOT_LTLPARSE_PARSEDECL_HH
#include "ltlparse.hh"
#include "location.hh"
#include "misc/location.hh"
# define YY_DECL \
int ltlyylex (ltlyy::parser::semantic_type *yylval, \
ltlyy::location *yylloc, \
spot::location *yylloc, \
spot::ltl::parse_error_list& error_list)
YY_DECL;

View file

@ -24,10 +24,7 @@
# define SPOT_LTLPARSE_PUBLIC_HH
# include "ltlast/formula.hh"
// Unfortunately Bison 2.3 uses the same guards in all parsers :(
# undef BISON_LOCATION_HH
# undef BISON_POSITION_HH
# include "ltlparse/location.hh"
# include "misc/location.hh"
# include "ltlenv/defaultenv.hh"
# include <string>
# include <list>
@ -43,7 +40,7 @@ namespace spot
#ifndef SWIG
/// \brief A parse diagnostic with its location.
typedef std::pair<ltlyy::location, std::string> parse_error;
typedef std::pair<location, std::string> parse_error;
/// \brief A list of parser diagnostics, as filled by parse.
typedef std::list<parse_error> parse_error_list;
#else