doc: more examples of the formula interface

* src/tl/formula.hh, src/tl/formula.cc: Add an operator<< to print
formulas.
* doc/org/tut01.org, doc/org/tut02.org: Adjust.
* doc/org/tut03.org: New file.
* doc/org/tut.org, doc/Makefile.am: Add it.
This commit is contained in:
Alexandre Duret-Lutz 2015-09-28 23:17:04 +02:00
parent cb39210166
commit c67540db14
7 changed files with 387 additions and 25 deletions

View file

@ -27,6 +27,7 @@
#include <cstring>
#include <algorithm>
#include "misc/bareword.hh"
#include "print.hh"
#ifndef HAVE_STRVERSCMP
// If the libc does not have this, a version is compiled in lib/.
@ -1743,4 +1744,9 @@ namespace spot
return out;
}
std::ostream& operator<<(std::ostream& os, const formula& f)
{
return print_psl(os, f);
}
}

View file

@ -164,19 +164,19 @@ namespace spot
return c;
}
uint8_t min() const
unsigned min() const
{
assert(op_ == op::FStar || op_ == op::Star);
return min_;
}
uint8_t max() const
unsigned max() const
{
assert(op_ == op::FStar || op_ == op::Star);
return max_;
}
uint8_t size() const
unsigned size() const
{
return size_;
}
@ -1001,17 +1001,17 @@ namespace spot
}
#endif
uint8_t min() const
unsigned min() const
{
return ptr_->min();
}
uint8_t max() const
unsigned max() const
{
return ptr_->max();
}
uint8_t size() const
unsigned size() const
{
return ptr_->size();
}
@ -1258,6 +1258,9 @@ namespace spot
/// List the properties of formula \a f.
SPOT_API
std::list<std::string> list_formula_props(const formula& f);
SPOT_API
std::ostream& operator<<(std::ostream& os, const formula& f);
}
#ifndef SWIG