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

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

6
7
%import "buddy.i"

8
%{
9
10
#include <iostream>
#include <fstream>
11
#include <sstream>
12

13
14
15
16
17
18
19
20
21
#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"

22
23
#include "ltlenv/environment.hh"
#include "ltlenv/defaultenv.hh"
24

25
26
27
#include "ltlparse/public.hh"

#include "ltlvisit/clone.hh"
28
#include "ltlvisit/destroy.hh"
29
30
31
32
33
#include "ltlvisit/dotty.hh"
#include "ltlvisit/dump.hh"
#include "ltlvisit/lunabbrev.hh"
#include "ltlvisit/nenoform.hh"
#include "ltlvisit/tostring.hh"
34
#include "ltlvisit/tunabbrev.hh"
35

36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include "tgba/bdddict.hh"
#include "tgba/bddprint.hh"
#include "tgba/state.hh"
#include "tgba/succiter.hh"
#include "tgba/tgba.hh"
#include "tgba/statebdd.hh"
#include "tgba/tgbabddcoredata.hh"
#include "tgba/succiterconcrete.hh"
#include "tgba/tgbabddconcrete.hh"
#include "tgba/tgbaexplicit.hh"
#include "tgba/tgbaproduct.hh"
#include "tgba/tgbatba.hh"

#include "tgbaalgos/ltl2tgba.hh"
#include "tgbaalgos/dotty.hh"
#include "tgbaalgos/lbtt.hh"
#include "tgbaalgos/magic.hh"
#include "tgbaalgos/save.hh"

55
using namespace spot::ltl;
56
using namespace spot;
57
58
%}

59
60
61
62
63
64
65
66
67
%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"

68
69
%include "ltlenv/environment.hh"
%include "ltlenv/defaultenv.hh"
70

71
72
73
%include "ltlparse/public.hh"

%include "ltlvisit/clone.hh"
74
%include "ltlvisit/destroy.hh"
75
76
77
78
79
%include "ltlvisit/dotty.hh"
%include "ltlvisit/dump.hh"
%include "ltlvisit/lunabbrev.hh"
%include "ltlvisit/nenoform.hh"
%include "ltlvisit/tostring.hh"
80
81
%include "ltlvisit/tunabbrev.hh"

82
%feature("new") spot::ltl_to_tgba;
83
84
85
%feature("new") spot::tgba::get_init_state;
%feature("new") spot::tgba::succ_iter;
%feature("new") spot::tgba_succ_iterator::current_state;
86

87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
// Help SWIG with namespace lookups.
#define ltl spot::ltl
%include "tgba/bdddict.hh"
%include "tgba/bddprint.hh"
%include "tgba/state.hh"
%include "tgba/succiter.hh"
%include "tgba/tgba.hh"
%include "tgba/statebdd.hh"
%include "tgba/tgbabddcoredata.hh"
%include "tgba/succiterconcrete.hh"
%include "tgba/tgbabddconcrete.hh"
%include "tgba/tgbaexplicit.hh"
%include "tgba/tgbaproduct.hh"
%include "tgba/tgbatba.hh"

%include "tgbaalgos/ltl2tgba.hh"
%include "tgbaalgos/dotty.hh"
%include "tgbaalgos/lbtt.hh"
%include "tgbaalgos/magic.hh"
%include "tgbaalgos/save.hh"
#undef ltl
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125

%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);
  }

}
126

127
128
129
130
131
132
133
134
135
%nodefault std::ostream;
namespace std {
  class ostream {};
  class ofstream : public ostream
  {
  public:
     ofstream(const char *fn);
     ~ofstream();
  };
136
137
138
139
140
141
142
  class ostringstream : public ostream
  {
  public:
     ostringstream();
     std::string str() const;
     ~ofstream();
  };
143
144
}

145
146
%inline %{

147
spot::ltl::parse_error_list
148
149
150
151
152
153
empty_parse_error_list()
{
  parse_error_list l;
  return l;
}

154
std::ostream&
155
156
157
158
159
get_cout()
{
  return std::cout;
}

160
std::ostream&
161
162
163
164
165
get_cerr()
{
  return std::cerr;
}

166
void
167
168
169
170
print_on(std::ostream& on, const std::string& what)
{
  on << what;
}
171

172
%}