* src/ltlparse/ltlscan.ll: Pass yyleng to the std::string constructor,

so it doesn't have to compute it.
* src/tgbaparse/tgbascan.ll: Likewise.
(YY_USER_INIT, current_file): Remove, it is too costly to use
yy::Location::filename in the current implementation
of yy::Location (this attribute is duplicated for each token).
Leaving it empty divides the parsing time by 3.
* src/tgbaparse/fmterror.cc, src/tgbaparse/public.hh
(format_tgba_parse_errors): Take the filename as argument.
* src/tgbatest/explprod.cc, src/tgbatest/ltl2tgba.cc,
src/tgbatest/mixprod.cc, src/tgbatest/powerset.cc,
src/tgbatest/readsave.cc, src/tgbatest/reductgba.cc,
src/tgbatest/tgbaread.cc, src/tgbatest/tripprod.cc,
iface/gspn/dottyssp.cc, iface/gspn/ltlgspn.cc: Adjust calls
to format_tgba_parse_errors.
This commit is contained in:
Alexandre Duret-Lutz 2004-12-16 12:33:37 +00:00
parent 704f237a22
commit 0efca0f644
15 changed files with 44 additions and 31 deletions

View file

@ -47,11 +47,11 @@ main(int argc, char** argv)
spot::ltl::environment& env(spot::ltl::default_environment::instance());
spot::tgba_parse_error_list pel1;
spot::tgba_explicit* a1 = spot::tgba_parse(argv[1], pel1, dict, env);
if (spot::format_tgba_parse_errors(std::cerr, pel1))
if (spot::format_tgba_parse_errors(std::cerr, argv[1], pel1))
return 2;
spot::tgba_parse_error_list pel2;
spot::tgba_explicit* a2 = spot::tgba_parse(argv[2], pel2, dict, env);
if (spot::format_tgba_parse_errors(std::cerr, pel2))
if (spot::format_tgba_parse_errors(std::cerr, argv[2], pel2))
return 2;
{

View file

@ -280,7 +280,8 @@ main(int argc, char** argv)
spot::tgba_parse_error_list pel;
system = spot::tgba_parse(argv[formula_index] + 2,
pel, dict, env, debug_opt);
if (spot::format_tgba_parse_errors(std::cerr, pel))
if (spot::format_tgba_parse_errors(std::cerr,
argv[formula_index] + 2, pel))
return 2;
system->merge_transitions();
std::clog << argv[formula_index] + 2 << " read" << std::endl;
@ -528,7 +529,7 @@ main(int argc, char** argv)
spot::tgba_parse_error_list pel;
spot::tgba_explicit* e;
to_free = a = e = spot::tgba_parse(input, pel, dict, env, debug_opt);
if (spot::format_tgba_parse_errors(std::cerr, pel))
if (spot::format_tgba_parse_errors(std::cerr, input, pel))
{
delete to_free;
delete dict;

View file

@ -56,7 +56,7 @@ main(int argc, char** argv)
spot::tgba_parse_error_list pel2;
spot::tgba_explicit* a2 = spot::tgba_parse(argv[2], pel2, dict, env);
if (spot::format_tgba_parse_errors(std::cerr, pel2))
if (spot::format_tgba_parse_errors(std::cerr, argv[2], pel2))
return 2;
{

View file

@ -48,7 +48,7 @@ main(int argc, char** argv)
spot::ltl::environment& env(spot::ltl::default_environment::instance());
spot::tgba_parse_error_list pel;
spot::tgba_explicit* a = spot::tgba_parse(argv[1], pel, dict, env);
if (spot::format_tgba_parse_errors(std::cerr, pel))
if (spot::format_tgba_parse_errors(std::cerr, argv[1], pel))
return 2;

View file

@ -60,7 +60,7 @@ main(int argc, char** argv)
pel, dict, env, debug);
exit_code =
spot::format_tgba_parse_errors(std::cerr, pel);
spot::format_tgba_parse_errors(std::cerr, argv[filename_index], pel);
if (a)
{

View file

@ -106,7 +106,7 @@ main(int argc, char** argv)
#ifdef REDUCCMP
spot::tgba_parse_error_list pel;
automata = spot::tgba_parse(argv[2], pel, dict, env, false);
if (spot::format_tgba_parse_errors(std::cerr, pel))
if (spot::format_tgba_parse_errors(std::cerr, argv[2], pel))
return 2;
#else
spot::ltl::parse_error_list p1;

View file

@ -57,7 +57,7 @@ main(int argc, char** argv)
spot::tgba_explicit* a = spot::tgba_parse(argv[filename_index],
pel, dict, env, debug);
if (spot::format_tgba_parse_errors(std::cerr, pel))
if (spot::format_tgba_parse_errors(std::cerr, argv[filename_index], pel))
return 2;
if (a)

View file

@ -47,15 +47,15 @@ main(int argc, char** argv)
spot::ltl::environment& env(spot::ltl::default_environment::instance());
spot::tgba_parse_error_list pel1;
spot::tgba_explicit* a1 = spot::tgba_parse(argv[1], pel1, dict, env);
if (spot::format_tgba_parse_errors(std::cerr, pel1))
if (spot::format_tgba_parse_errors(std::cerr, argv[1], pel1))
return 2;
spot::tgba_parse_error_list pel2;
spot::tgba_explicit* a2 = spot::tgba_parse(argv[2], pel2, dict, env);
if (spot::format_tgba_parse_errors(std::cerr, pel2))
if (spot::format_tgba_parse_errors(std::cerr, argv[2], pel2))
return 2;
spot::tgba_parse_error_list pel3;
spot::tgba_explicit* a3 = spot::tgba_parse(argv[3], pel3, dict, env);
if (spot::format_tgba_parse_errors(std::cerr, pel3))
if (spot::format_tgba_parse_errors(std::cerr, argv[3], pel3))
return 2;
{