spot.i 1.79 KB
Newer Older
1
2
3
4
5
6
%module spot

%include "std_string.i"
%include "std_list.i"

%{
7
8
9
10
11
12
13
14
15
#include "ltlast/formula.hh"
#include "ltlast/refformula.hh"
#include "ltlast/atomic_prop.hh"
#include "ltlast/binop.hh"
#include "ltlast/constant.hh"
#include "ltlast/multop.hh"
#include "ltlast/unop.hh"
#include "ltlast/visitor.hh"

16
17
#include "ltlenv/environment.hh"
#include "ltlenv/defaultenv.hh"
18

19
20
21
#include "ltlparse/public.hh"

#include "ltlvisit/clone.hh"
22
#include "ltlvisit/destroy.hh"
23
24
25
26
27
#include "ltlvisit/dotty.hh"
#include "ltlvisit/dump.hh"
#include "ltlvisit/lunabbrev.hh"
#include "ltlvisit/nenoform.hh"
#include "ltlvisit/tostring.hh"
28
#include "ltlvisit/tunabbrev.hh"
29
30
31
32

using namespace spot::ltl;
%}

33
34
35
36
37
38
39
40
41
%include "ltlast/formula.hh"
%include "ltlast/refformula.hh"
%include "ltlast/atomic_prop.hh"
%include "ltlast/binop.hh"
%include "ltlast/constant.hh"
%include "ltlast/multop.hh"
%include "ltlast/unop.hh"
%include "ltlast/visitor.hh"

42
43
%include "ltlenv/environment.hh"
%include "ltlenv/defaultenv.hh"
44

45
46
47
%include "ltlparse/public.hh"

%include "ltlvisit/clone.hh"
48
%include "ltlvisit/destroy.hh"
49
50
51
52
53
%include "ltlvisit/dotty.hh"
%include "ltlvisit/dump.hh"
%include "ltlvisit/lunabbrev.hh"
%include "ltlvisit/nenoform.hh"
%include "ltlvisit/tostring.hh"
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
%include "ltlvisit/tunabbrev.hh"


%extend spot::ltl::formula {

  // When comparing formula, make sure Python compare our
  // pointers, not the pointers to its wrappers.
  int
  __cmp__(const spot::ltl::formula* b)
  {
    return b - self;
  }

  std::string
  __str__(void)
  {
    return spot::ltl::to_string(self);
  }

}
74
75
76

%inline %{

77
spot::ltl::parse_error_list
78
79
80
81
82
83
empty_parse_error_list()
{
  parse_error_list l;
  return l;
}

84
std::ostream&
85
86
87
88
89
get_cout()
{
  return std::cout;
}

90
std::ostream&
91
92
93
94
95
get_cerr()
{
  return std::cerr;
}

96
void
97
98
99
100
101
print_on(std::ostream& on, const std::string& what)
{
  on << what;
}
%}