* src/evtgbaparse/evtgbaparse.yy, src/evtgbaparse/evtgbascan.ll,
src/evtgbaparse/fmterror.cc, src/evtgbaparse/parsedecl.hh, src/evtgbaparse/public.hh, src/evtgbatest/product.cc, src/evtgbatest/readsave.cc, src/ltlparse/fmterror.cc, src/ltlparse/ltlparse.yy, src/ltlparse/parsedecl.hh, src/ltlparse/public.hh, src/tgbaparse/parsedecl.hh, src/tgbaparse/public.hh, src/tgbaparse/tgbaparse.yy: Update to Bison 2.0.
This commit is contained in:
parent
461fcd3732
commit
5cd58f9aaf
16 changed files with 64 additions and 66 deletions
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
|
||||
/* Copyright (C) 2004, 2005 Laboratoire d'Informatique de Paris 6 (LIP6),
|
||||
** département Systèmes Répartis Coopératifs (SRC), Université Pierre
|
||||
** et Marie Curie.
|
||||
**
|
||||
|
|
@ -55,6 +55,12 @@
|
|||
%token ACC_DEF
|
||||
%token INIT_DEF
|
||||
|
||||
%destructor { delete $$; } STRING UNTERMINATED_STRING IDENT
|
||||
strident string acc_list
|
||||
|
||||
%printer { debug_stream() << *$$; } STRING UNTERMINATED_STRING IDENT
|
||||
strident string
|
||||
|
||||
%%
|
||||
evtgba: lines
|
||||
|
||||
|
|
@ -114,14 +120,7 @@ init_decl:
|
|||
%%
|
||||
|
||||
void
|
||||
yy::Parser::print_()
|
||||
{
|
||||
if (looka_ == STRING || looka_ == IDENT)
|
||||
YYCDEBUG << " '" << *value.str << "'";
|
||||
}
|
||||
|
||||
void
|
||||
yy::Parser::error_()
|
||||
yy::parser::error(const location_type& location, const std::string& message)
|
||||
{
|
||||
error_list.push_back(spot::evtgba_parse_error(location, message));
|
||||
}
|
||||
|
|
@ -136,12 +135,13 @@ namespace spot
|
|||
if (evtgbayyopen(name))
|
||||
{
|
||||
error_list.push_back
|
||||
(evtgba_parse_error(yy::Location(),
|
||||
(evtgba_parse_error(yy::location(),
|
||||
std::string("Cannot open file ") + name));
|
||||
return 0;
|
||||
}
|
||||
evtgba_explicit* result = new evtgba_explicit();
|
||||
evtgbayy::Parser parser(debug, yy::Location(), error_list, result);
|
||||
evtgbayy::parser parser(error_list, result);
|
||||
parser.set_debug_level(debug);
|
||||
parser.parse();
|
||||
evtgbayyclose();
|
||||
return result;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
|
||||
/* Copyright (C) 2004, 2005 Laboratoire d'Informatique de Paris 6 (LIP6),
|
||||
** département Systèmes Répartis Coopératifs (SRC), Université Pierre
|
||||
** et Marie Curie.
|
||||
**
|
||||
|
|
@ -31,16 +31,8 @@
|
|||
#define YY_USER_ACTION \
|
||||
yylloc->columns(yyleng);
|
||||
|
||||
#define YY_USER_INIT \
|
||||
do { \
|
||||
yylloc->begin.filename = current_file; \
|
||||
yylloc->end.filename = current_file; \
|
||||
} while (0)
|
||||
|
||||
#define YY_NEVER_INTERACTIVE 1
|
||||
|
||||
static std::string current_file;
|
||||
|
||||
%}
|
||||
|
||||
eol \n|\r|\n\r|\r\n
|
||||
|
|
@ -99,12 +91,10 @@ namespace spot
|
|||
if (name == "-")
|
||||
{
|
||||
yyin = stdin;
|
||||
current_file = "standard input";
|
||||
}
|
||||
else
|
||||
{
|
||||
yyin = fopen (name.c_str (), "r");
|
||||
current_file = name;
|
||||
if (!yyin)
|
||||
return 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
|
||||
// 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.
|
||||
//
|
||||
|
|
@ -26,14 +26,16 @@ namespace spot
|
|||
{
|
||||
bool
|
||||
format_evtgba_parse_errors(std::ostream& os,
|
||||
const std::string& filename,
|
||||
evtgba_parse_error_list& error_list)
|
||||
{
|
||||
bool printed = false;
|
||||
spot::evtgba_parse_error_list::iterator it;
|
||||
for (it = error_list.begin(); it != error_list.end(); ++it)
|
||||
{
|
||||
if (it->first.begin.filename != "")
|
||||
os << it->first << ": ";
|
||||
if (filename != "-")
|
||||
os << filename << ":";
|
||||
os << it->first << ": ";
|
||||
os << it->second << std::endl;
|
||||
printed = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
|
||||
// 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.
|
||||
//
|
||||
|
|
@ -27,7 +27,7 @@
|
|||
#include "location.hh"
|
||||
|
||||
# define YY_DECL \
|
||||
int evtgbayylex (yystype *yylval, yy::Location *yylloc)
|
||||
int evtgbayylex (yystype *yylval, yy::location *yylloc)
|
||||
YY_DECL;
|
||||
|
||||
namespace spot
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
|
||||
// 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.
|
||||
//
|
||||
|
|
@ -32,7 +32,7 @@
|
|||
namespace spot
|
||||
{
|
||||
/// \brief A parse diagnostic with its location.
|
||||
typedef std::pair<yy::Location, std::string> evtgba_parse_error;
|
||||
typedef std::pair<yy::location, std::string> evtgba_parse_error;
|
||||
/// \brief A list of parser diagnostics, as filled by parse.
|
||||
typedef std::list<evtgba_parse_error> evtgba_parse_error_list;
|
||||
|
||||
|
|
@ -56,10 +56,12 @@ namespace spot
|
|||
|
||||
/// \brief Format diagnostics produced by spot::evtgba_parse.
|
||||
/// \param os Where diagnostics should be output.
|
||||
/// \param filename The filename that should appear in the diagnostics.
|
||||
/// \param error_list The error list filled by spot::ltl::parse while
|
||||
/// parsing \a ltl_string.
|
||||
/// \return \c true iff any diagnostic was output.
|
||||
bool format_evtgba_parse_errors(std::ostream& os,
|
||||
const std::string& filename,
|
||||
evtgba_parse_error_list& error_list);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue