gcc config
[prop.git] / prop-src / T5.cc
bloba47937a05703ea68363a286c99e47085c6f62e40
1 ///////////////////////////////////////////////////////////////////////////////
2 // This file is generated automatically using Prop (version 2.3.4),
3 // last updated on Apr 3, 1997.
4 // The original source file is "T5.pcc".
5 ///////////////////////////////////////////////////////////////////////////////
7 #define PROP_REWRITING_USED
8 #define PROP_QUARK_USED
9 #include <propdefs.h>
10 #line 1 "T5.pcc"
11 ///////////////////////////////////////////////////////////////////////////////
13 // Forward class definition for T
15 ///////////////////////////////////////////////////////////////////////////////
16 #ifndef datatype_T_defined
17 #define datatype_T_defined
18 class a_T;
19 typedef a_T * T;
20 #endif
22 # define a (T)0
23 # define b (T)1
24 # define c (T)2
26 ///////////////////////////////////////////////////////////////////////////////
28 // Base class for datatype T
30 ///////////////////////////////////////////////////////////////////////////////
31 class a_T {
32 public:
33 enum Tag_T {
34 tag_f = 0, tag_g = 1
37 public:
38 const Tag_T tag__; // variant tag
39 protected:
40 inline a_T(Tag_T t__) : tag__(t__) {}
41 public:
43 inline int boxed(const a_T * x) { return (unsigned long)x >= 3; }
44 inline int untag(const a_T * x) { return boxed(x) ? x->tag__ + 3 : (int)x; }
45 ///////////////////////////////////////////////////////////////////////////////
47 // Class for datatype constructor T::f
49 ///////////////////////////////////////////////////////////////////////////////
50 class T_f : public a_T {
51 public:
52 #line 1 "T5.pcc"
53 T _1; T _2;
54 inline T_f (T x_1, T x_2)
55 : a_T(tag_f), _1(x_1), _2(x_2)
60 ///////////////////////////////////////////////////////////////////////////////
62 // Class for datatype constructor T::g
64 ///////////////////////////////////////////////////////////////////////////////
65 class T_g : public a_T {
66 public:
67 #line 1 "T5.pcc"
68 T _1; T _2;
69 inline T_g (T x_1, T x_2)
70 : a_T(tag_g), _1(x_1), _2(x_2)
75 ///////////////////////////////////////////////////////////////////////////////
77 // Datatype constructor functions for T
79 ///////////////////////////////////////////////////////////////////////////////
80 inline a_T * f (T x_1, T x_2)
82 return new T_f (x_1, x_2);
84 inline a_T * g (T x_1, T x_2)
86 return new T_g (x_1, x_2);
88 ///////////////////////////////////////////////////////////////////////////////
90 // Downcasting functions for T
92 ///////////////////////////////////////////////////////////////////////////////
93 inline T_f * _f(const a_T * _x_) { return (T_f *)_x_; }
94 inline T_g * _g(const a_T * _x_) { return (T_g *)_x_; }
96 #line 1 "T5.pcc"
97 #line 1 "T5.pcc"
100 T foo(T e)
103 #line 5 "T5.pcc"
104 #line 11 "T5.pcc"
105 extern void _T_5co_X1_rewrite(T & );
106 _T_5co_X1_rewrite(e);
107 #line 11 "T5.pcc"
108 #line 11 "T5.pcc"
111 #line 13 "T5.pcc"
112 class _T_5co_X1 : public BURS {
113 private:
114 _T_5co_X1(const _T_5co_X1&); // no copy constructor
115 void operator = (const _T_5co_X1&); // no assignment
116 public:
117 struct _T_5co_X1_StateRec * stack__, * stack_top__;
118 public:
119 void labeler(const char *, int&, int);
120 void labeler(Quark, int&, int);
121 void labeler(T & redex, int&, int);
122 inline virtual void operator () (T & redex) { int s; labeler(redex,s,0); }
123 private:
124 public:
125 inline _T_5co_X1() {}
127 void _T_5co_X1_rewrite(T & _x_)
128 { _T_5co_X1 _r_;
129 _r_(_x_);
132 ///////////////////////////////////////////////////////////////////////////////
134 // This macro can be redefined by the user for debugging
136 ///////////////////////////////////////////////////////////////////////////////
137 #ifndef DEBUG__T_5co_X1
138 #define DEBUG__T_5co_X1(repl,redex,file,line,rule) repl
139 #else
140 static const char * _T_5co_X1_file_name = "T5.pcc";
141 #endif
143 inline void _T_5co_X1::labeler(char const * redex,int& s__,int)
146 s__ = 0;
150 inline void _T_5co_X1::labeler(Quark redex,int& s__,int)
153 s__ = 0;
157 void _T_5co_X1::labeler (T & redex, int& s__, int r__)
159 replacement__:
160 for (int topdown__ = 0; topdown__ <= 1; topdown__++) {
162 if (boxed(redex)) {
163 if (redex->tag__) {
165 #line 10 "T5.pcc"
166 { redex = DEBUG__T_5co_X1(f(_g(redex)->_1,_g(redex)->_2),redex,_T_5co_X1_file_name,10,"g (X, Y): ...");
167 r__ = 1; goto replacement__; }
168 #line 11 "T5.pcc"
169 } else {
171 if (boxed(_f(redex)->_1)) {} else {
172 switch ((int)_f(redex)->_1) {
173 case ((int)a): {
174 if (boxed(_f(redex)->_2)) {} else {
175 switch ((int)_f(redex)->_2) {
176 case ((int)a): {} break;
177 case ((int)b): {
178 #line 8 "T5.pcc"
179 { redex = DEBUG__T_5co_X1(b,redex,_T_5co_X1_file_name,8,"f (a, b): ...");
180 r__ = 1; goto replacement__; }
181 #line 9 "T5.pcc"
182 } break;
183 default: {
184 #line 9 "T5.pcc"
185 { redex = DEBUG__T_5co_X1(c,redex,_T_5co_X1_file_name,9,"f (a, c): ...");
186 r__ = 1; goto replacement__; }
187 #line 10 "T5.pcc"
188 } break;
191 } break;
192 default: {} break;
196 } else {}
198 if (boxed(redex)) {
199 if (redex->tag__) {
200 int s0__;
201 int s1__;
202 labeler(_g(redex)->_1, s0__, r__);
203 labeler(_g(redex)->_2, s1__, r__);
204 s__ = 0;
205 } else {
206 int s0__;
207 int s1__;
208 labeler(_f(redex)->_1, s0__, r__);
209 labeler(_f(redex)->_2, s1__, r__);
210 s__ = 0;
212 } else {
213 switch(((int)redex)) {
214 case ((int)a): { s__ = 0;} break;
215 case ((int)b): { s__ = 0;} break;
216 default: { s__ = 0;} break;
224 ------------------------------- Statistics -------------------------------
225 Merge matching rules = yes
226 Number of DFA nodes merged = 15
227 Number of ifs generated = 4
228 Number of switches generated = 2
229 Number of labels = 0
230 Number of gotos = 0
231 Adaptive matching = disabled
232 Fast string matching = disabled
233 Inline downcasts = disabled
234 --------------------------------------------------------------------------