Implement to_utf8_string().

* src/ltlvisit/tostring.cc, src/ltlvisit/tostring.hh: Here.
* src/ltltest/randltl.cc: Add option -8 to display utf-8 formulae.
* src/ltltest/utf8.test: Test it.
This commit is contained in:
Alexandre Duret-Lutz 2012-04-29 00:40:27 +02:00
parent 6f29141174
commit 53f38c2ccd
4 changed files with 106 additions and 23 deletions

View file

@ -1,7 +1,8 @@
// Copyright (C) 2010, 2011 Laboratoire de Recherche et Développement de
// l'Epita (LRDE).
// -*- coding: utf-8 -*-
// Copyright (C) 2010, 2011, 2012 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
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
// et Marie Curie.
//
// This file is part of Spot, a model checking library.
@ -54,6 +55,27 @@ namespace spot
std::string
to_string(const formula* f, bool full_parent = false, bool ratexp = false);
/// \brief Output a formula as an utf8 string which is parsable unless
/// the formula contains automaton operators (used in ELTL formulae).
/// \param f The formula to translate.
/// \param os The stream where it should be output.
/// \param full_parent Whether or not the string should by fully
/// parenthesized.
/// \param ratexp Whether we are printing a SERE.
std::ostream&
to_utf8_string(const formula* f, std::ostream& os, bool full_parent = false,
bool ratexp = false);
/// \brief Output a formula as an utf8 string which is parsable
/// unless the formula contains automaton operators (used in ELTL formulae).
/// \param f The formula to translate.
/// \param full_parent Whether or not the string should by fully
/// parenthesized.
/// \param ratexp Whether we are printing a SERE.
std::string
to_utf8_string(const formula* f, bool full_parent = false,
bool ratexp = false);
/// \brief Output a formula as a (parsable by Spin) string.
/// \param f The formula to translate.
/// \param os The stream where it should be output.