Add support for printing LTL formulas using Wring's syntax.

* src/ltlvisit/tostring.hh, src/ltlvisit/tostring.cc
(to_wring_string): New option.
* src/bin/common_output.hh, src/bin/common_output.cc:
Add support for a --wring option.
* src/bin/ltlcheck.cc: Add %w and %W format specifiers.
This commit is contained in:
Alexandre Duret-Lutz 2012-10-20 13:32:05 +02:00
parent bf765480b1
commit 0fc3c6bcff
5 changed files with 102 additions and 7 deletions

View file

@ -26,6 +26,7 @@
#include "error.h"
#define OPT_SPOT 1
#define OPT_WRING 2
output_format_t output_format = spot_output;
bool full_parenth = false;
@ -37,6 +38,7 @@ static const argp_option options[] =
{ "spin", 's', 0, 0, "output in Spin's syntax", -20 },
{ "spot", OPT_SPOT, 0, 0, "output in Spot's syntax (default)", -20 },
{ "lbt", 'l', 0, 0, "output in LBT's syntax", -20 },
{ "wring", OPT_WRING, 0, 0, "output in Wring's syntax", -20 },
{ "utf8", '8', 0, 0, "output using UTF-8 characters", -20 },
{ 0, 0, 0, 0, 0, 0 }
};
@ -64,6 +66,9 @@ parse_opt_output(int key, char*, struct argp_state*)
case OPT_SPOT:
output_format = spot_output;
break;
case OPT_WRING:
output_format = wring_output;
break;
default:
return ARGP_ERR_UNKNOWN;
}
@ -105,6 +110,12 @@ output_formula(const spot::ltl::formula* f, const char* filename, int linenum)
else
report_not_ltl(f, filename, linenum, "Spin");
break;
case wring_output:
if (f->is_ltl_formula())
spot::ltl::to_wring_string(f, std::cout);
else
report_not_ltl(f, filename, linenum, "Wring");
break;
case utf8_output:
spot::ltl::to_utf8_string(f, std::cout, full_parenth);
break;