spot.i 3.26 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
11
#include <iostream>
#include <fstream>

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

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

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

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

35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#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"

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

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

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

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

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

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

86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
// 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124

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

}
125

126
127
128
129
130
131
132
133
134
135
136
%nodefault std::ostream;
namespace std {
  class ostream {};
  class ofstream : public ostream
  {
  public:
     ofstream(const char *fn);
     ~ofstream();
  };
}

137
138
%inline %{

139
spot::ltl::parse_error_list
140
141
142
143
144
145
empty_parse_error_list()
{
  parse_error_list l;
  return l;
}

146
std::ostream&
147
148
149
150
151
get_cout()
{
  return std::cout;
}

152
std::ostream&
153
154
155
156
157
get_cerr()
{
  return std::cerr;
}

158
void
159
160
161
162
print_on(std::ostream& on, const std::string& what)
{
  on << what;
}
163

164
%}