ignore .lib and .exe
[prop.git] / prop-src / setl-ast.h
blobb914c5b68134e2eb1bcadde8955bf44f516a80ea
1 ///////////////////////////////////////////////////////////////////////////////
2 // This file is generated automatically using Prop (version 2.3.6),
3 // last updated on Nov 2, 1999.
4 // The original source file is "setl-ast.ph".
5 ///////////////////////////////////////////////////////////////////////////////
7 #line 1 "setl-ast.ph"
8 ///////////////////////////////////////////////////////////////////////////////
9 //
10 // This file contains the abstract syntax tree definitions for the
11 // SETL-like extension language of Prop.
13 ///////////////////////////////////////////////////////////////////////////////
14 #ifndef setl_extension_abstract_syntax_tree_h
15 #define setl_extension_abstract_syntax_tree_h
17 #include "basics.h"
18 #include "ir.h"
20 ///////////////////////////////////////////////////////////////////////////////
22 // Forward AST declarations.
24 ///////////////////////////////////////////////////////////////////////////////
25 #line 18 "setl-ast.ph"
26 #line 22 "setl-ast.ph"
27 ///////////////////////////////////////////////////////////////////////////////
29 // Forward class definition for Exp
31 ///////////////////////////////////////////////////////////////////////////////
32 #ifndef datatype_Exp_defined
33 #define datatype_Exp_defined
34 class a_Exp;
35 typedef a_Exp * Exp;
36 #endif
38 ///////////////////////////////////////////////////////////////////////////////
40 // Forward class definition for Decl
42 ///////////////////////////////////////////////////////////////////////////////
43 #ifndef datatype_Decl_defined
44 #define datatype_Decl_defined
45 class a_Decl;
46 typedef a_Decl * Decl;
47 #endif
49 ///////////////////////////////////////////////////////////////////////////////
51 // Forward class definition for Time
53 ///////////////////////////////////////////////////////////////////////////////
54 #ifndef datatype_Time_defined
55 #define datatype_Time_defined
56 class a_Time;
57 typedef a_Time * Time;
58 #endif
60 ///////////////////////////////////////////////////////////////////////////////
62 // Forward class definition for Space
64 ///////////////////////////////////////////////////////////////////////////////
65 #ifndef datatype_Space_defined
66 #define datatype_Space_defined
67 class a_Space;
68 typedef a_Space * Space;
69 #endif
71 #line 22 "setl-ast.ph"
72 #line 22 "setl-ast.ph"
75 ///////////////////////////////////////////////////////////////////////////////
77 // AST for definitions, signatures, statements and bindings
79 ///////////////////////////////////////////////////////////////////////////////
81 ///////////////////////////////////////////////////////////////////////////////
83 // Type 'Def' represents definitions.
85 ///////////////////////////////////////////////////////////////////////////////
86 #line 35 "setl-ast.ph"
87 #line 100 "setl-ast.ph"
88 ///////////////////////////////////////////////////////////////////////////////
90 // Forward class definition for Def
92 ///////////////////////////////////////////////////////////////////////////////
93 #ifndef datatype_Def_defined
94 #define datatype_Def_defined
95 class a_Def;
96 typedef a_Def * Def;
97 #endif
99 # define NOdef (Def)0
101 ///////////////////////////////////////////////////////////////////////////////
103 // Forward class definition for Sig
105 ///////////////////////////////////////////////////////////////////////////////
106 #ifndef datatype_Sig_defined
107 #define datatype_Sig_defined
108 class a_Sig;
109 typedef a_Sig * Sig;
110 #endif
112 # define NOsig (Sig)0
114 ///////////////////////////////////////////////////////////////////////////////
116 // Forward class definition for Stmt
118 ///////////////////////////////////////////////////////////////////////////////
119 #ifndef datatype_Stmt_defined
120 #define datatype_Stmt_defined
121 class a_Stmt;
122 typedef a_Stmt * Stmt;
123 #endif
125 # define NOstmt (Stmt)0
127 ///////////////////////////////////////////////////////////////////////////////
128 // Definition of type LabSig
129 ///////////////////////////////////////////////////////////////////////////////
130 #line 94 "setl-ast.ph"
131 typedef struct { Id id; Sig sig; } LabSig;
133 ///////////////////////////////////////////////////////////////////////////////
134 // Definition of type LabSigs
135 ///////////////////////////////////////////////////////////////////////////////
136 #line 95 "setl-ast.ph"
137 typedef a_List<LabSig> * LabSigs;
139 ///////////////////////////////////////////////////////////////////////////////
140 // Definition of type Defs
141 ///////////////////////////////////////////////////////////////////////////////
142 #line 96 "setl-ast.ph"
143 typedef a_List<Def> * Defs;
145 ///////////////////////////////////////////////////////////////////////////////
146 // Definition of type Sigs
147 ///////////////////////////////////////////////////////////////////////////////
148 #line 97 "setl-ast.ph"
149 typedef a_List<Sig> * Sigs;
151 ///////////////////////////////////////////////////////////////////////////////
152 // Definition of type Stmts
153 ///////////////////////////////////////////////////////////////////////////////
154 #line 98 "setl-ast.ph"
155 typedef a_List<Stmt> * Stmts;
157 ///////////////////////////////////////////////////////////////////////////////
158 // Definition of type Generators
159 ///////////////////////////////////////////////////////////////////////////////
160 #line 99 "setl-ast.ph"
161 typedef a_List<Generator> * Generators;
163 ///////////////////////////////////////////////////////////////////////////////
165 // Base class for datatype Def
167 ///////////////////////////////////////////////////////////////////////////////
168 class a_Def : public Loc {
169 public:
170 enum Tag_Def {
171 tag_VARdef = 0, tag_FUNCTIONdef = 1, tag_MODULEdef = 2,
172 tag_SIGNATUREdef = 3, tag_TYPEdef = 4, tag_LAMBDAdef = 5
175 public:
176 const Tag_Def tag__; // variant tag
177 protected:
178 inline a_Def(Tag_Def t__) : tag__(t__) {}
179 public:
181 inline int boxed(const a_Def * x) { return x != 0; }
182 inline int untag(const a_Def * x) { return x ? (x->tag__+1) : 0; }
183 ///////////////////////////////////////////////////////////////////////////////
185 // Class for datatype constructor Def::VARdef
187 ///////////////////////////////////////////////////////////////////////////////
188 class Def_VARdef : public a_Def {
189 public:
190 #line 37 "setl-ast.ph"
191 Id id; Ty ty; Exp init_exp;
192 Def_VARdef (Id x_id, Ty x_ty, Exp x_init_exp = NOexp);
195 ///////////////////////////////////////////////////////////////////////////////
197 // Class for datatype constructor Def::FUNCTIONdef
199 ///////////////////////////////////////////////////////////////////////////////
200 class Def_FUNCTIONdef : public a_Def {
201 public:
202 #line 41 "setl-ast.ph"
203 Id id; LabTys args; Ty return_ty; Defs local_defs; Stmts body;
204 Def_FUNCTIONdef (Id x_id, LabTys x_args, Ty x_return_ty, Defs x_local_defs, Stmts x_body);
207 ///////////////////////////////////////////////////////////////////////////////
209 // Class for datatype constructor Def::MODULEdef
211 ///////////////////////////////////////////////////////////////////////////////
212 class Def_MODULEdef : public a_Def {
213 public:
214 #line 47 "setl-ast.ph"
215 Id id; LabSigs args; Sig sig; Defs body;
216 Def_MODULEdef (Id x_id, LabSigs x_args, Sig x_sig, Defs x_body);
219 ///////////////////////////////////////////////////////////////////////////////
221 // Class for datatype constructor Def::SIGNATUREdef
223 ///////////////////////////////////////////////////////////////////////////////
224 class Def_SIGNATUREdef : public a_Def {
225 public:
226 #line 52 "setl-ast.ph"
227 Id id; LabSigs args; Sig sig;
228 Def_SIGNATUREdef (Id x_id, LabSigs x_args, Sig x_sig);
231 ///////////////////////////////////////////////////////////////////////////////
233 // Class for datatype constructor Def::TYPEdef
235 ///////////////////////////////////////////////////////////////////////////////
236 class Def_TYPEdef : public a_Def {
237 public:
238 #line 56 "setl-ast.ph"
239 Decl TYPEdef;
240 Def_TYPEdef (Decl x_TYPEdef);
243 ///////////////////////////////////////////////////////////////////////////////
245 // Class for datatype constructor Def::LAMBDAdef
247 ///////////////////////////////////////////////////////////////////////////////
248 class Def_LAMBDAdef : public a_Def {
249 public:
250 #line 57 "setl-ast.ph"
251 LabTys _1; Defs _2;
252 Def_LAMBDAdef (LabTys x_1, Defs x_2);
255 ///////////////////////////////////////////////////////////////////////////////
257 // Datatype constructor functions for Def
259 ///////////////////////////////////////////////////////////////////////////////
260 extern a_Def * VARdef (Id x_id, Ty x_ty, Exp x_init_exp = NOexp);
261 extern a_Def * FUNCTIONdef (Id x_id, LabTys x_args, Ty x_return_ty, Defs x_local_defs, Stmts x_body);
262 extern a_Def * MODULEdef (Id x_id, LabSigs x_args, Sig x_sig, Defs x_body);
263 extern a_Def * SIGNATUREdef (Id x_id, LabSigs x_args, Sig x_sig);
264 extern a_Def * TYPEdef (Decl x_TYPEdef);
265 extern a_Def * LAMBDAdef (LabTys x_1, Defs x_2);
267 ///////////////////////////////////////////////////////////////////////////////
269 // Base class for datatype Sig
271 ///////////////////////////////////////////////////////////////////////////////
272 class a_Sig : public Loc {
273 public:
274 enum Tag_Sig {
275 tag_IDsig = 0, tag_DOTsig = 1, tag_APPsig = 2,
276 tag_DEFsig = 3, tag_LAMBDAsig = 4
279 public:
280 const Tag_Sig tag__; // variant tag
281 protected:
282 inline a_Sig(Tag_Sig t__) : tag__(t__) {}
283 public:
285 inline int boxed(const a_Sig * x) { return x != 0; }
286 inline int untag(const a_Sig * x) { return x ? (x->tag__+1) : 0; }
287 ///////////////////////////////////////////////////////////////////////////////
289 // Class for datatype constructor Sig::IDsig
291 ///////////////////////////////////////////////////////////////////////////////
292 class Sig_IDsig : public a_Sig {
293 public:
294 #line 66 "setl-ast.ph"
295 Id IDsig;
296 Sig_IDsig (Id x_IDsig);
299 ///////////////////////////////////////////////////////////////////////////////
301 // Class for datatype constructor Sig::DOTsig
303 ///////////////////////////////////////////////////////////////////////////////
304 class Sig_DOTsig : public a_Sig {
305 public:
306 #line 67 "setl-ast.ph"
307 Sig _1; Id _2;
308 Sig_DOTsig (Sig x_1, Id x_2);
311 ///////////////////////////////////////////////////////////////////////////////
313 // Class for datatype constructor Sig::APPsig
315 ///////////////////////////////////////////////////////////////////////////////
316 class Sig_APPsig : public a_Sig {
317 public:
318 #line 68 "setl-ast.ph"
319 Sig _1; Sigs _2;
320 Sig_APPsig (Sig x_1, Sigs x_2);
323 ///////////////////////////////////////////////////////////////////////////////
325 // Class for datatype constructor Sig::DEFsig
327 ///////////////////////////////////////////////////////////////////////////////
328 class Sig_DEFsig : public a_Sig {
329 public:
330 #line 69 "setl-ast.ph"
331 Defs DEFsig;
332 Sig_DEFsig (Defs x_DEFsig);
335 ///////////////////////////////////////////////////////////////////////////////
337 // Class for datatype constructor Sig::LAMBDAsig
339 ///////////////////////////////////////////////////////////////////////////////
340 class Sig_LAMBDAsig : public a_Sig {
341 public:
342 #line 70 "setl-ast.ph"
343 LabSigs _1; Sig _2;
344 Sig_LAMBDAsig (LabSigs x_1, Sig x_2);
347 ///////////////////////////////////////////////////////////////////////////////
349 // Datatype constructor functions for Sig
351 ///////////////////////////////////////////////////////////////////////////////
352 extern a_Sig * IDsig (Id x_IDsig);
353 extern a_Sig * DOTsig (Sig x_1, Id x_2);
354 extern a_Sig * APPsig (Sig x_1, Sigs x_2);
355 extern a_Sig * DEFsig (Defs x_DEFsig);
356 extern a_Sig * LAMBDAsig (LabSigs x_1, Sig x_2);
358 ///////////////////////////////////////////////////////////////////////////////
360 // Base class for datatype Stmt
362 ///////////////////////////////////////////////////////////////////////////////
363 class a_Stmt : public Loc {
364 public:
365 enum Tag_Stmt {
366 tag_ASSIGNstmt = 0, tag_BLOCKstmt = 1, tag_WHILEstmt = 2,
367 tag_IFstmt = 3, tag_MATCHstmt = 4, tag_REWRITEstmt = 5,
368 tag_REPLACEMENTstmt = 6, tag_FORALLstmt = 7, tag_RETURNstmt = 8
371 public:
372 const Tag_Stmt tag__; // variant tag
373 protected:
374 inline a_Stmt(Tag_Stmt t__) : tag__(t__) {}
375 public:
377 inline int boxed(const a_Stmt * x) { return x != 0; }
378 inline int untag(const a_Stmt * x) { return x ? (x->tag__+1) : 0; }
379 ///////////////////////////////////////////////////////////////////////////////
381 // Class for datatype constructor Stmt::ASSIGNstmt
383 ///////////////////////////////////////////////////////////////////////////////
384 class Stmt_ASSIGNstmt : public a_Stmt {
385 public:
386 #line 79 "setl-ast.ph"
387 Exp _1; Exp _2;
388 Stmt_ASSIGNstmt (Exp x_1, Exp x_2);
391 ///////////////////////////////////////////////////////////////////////////////
393 // Class for datatype constructor Stmt::BLOCKstmt
395 ///////////////////////////////////////////////////////////////////////////////
396 class Stmt_BLOCKstmt : public a_Stmt {
397 public:
398 #line 80 "setl-ast.ph"
399 Defs _1; Stmts _2;
400 Stmt_BLOCKstmt (Defs x_1, Stmts x_2);
403 ///////////////////////////////////////////////////////////////////////////////
405 // Class for datatype constructor Stmt::WHILEstmt
407 ///////////////////////////////////////////////////////////////////////////////
408 class Stmt_WHILEstmt : public a_Stmt {
409 public:
410 #line 81 "setl-ast.ph"
411 Exp _1; Stmt _2;
412 Stmt_WHILEstmt (Exp x_1, Stmt x_2);
415 ///////////////////////////////////////////////////////////////////////////////
417 // Class for datatype constructor Stmt::IFstmt
419 ///////////////////////////////////////////////////////////////////////////////
420 class Stmt_IFstmt : public a_Stmt {
421 public:
422 #line 82 "setl-ast.ph"
423 Exp _1; Stmt _2; Stmt _3;
424 Stmt_IFstmt (Exp x_1, Stmt x_2, Stmt x_3);
427 ///////////////////////////////////////////////////////////////////////////////
429 // Class for datatype constructor Stmt::MATCHstmt
431 ///////////////////////////////////////////////////////////////////////////////
432 class Stmt_MATCHstmt : public a_Stmt {
433 public:
434 #line 83 "setl-ast.ph"
435 Decl MATCHstmt;
436 Stmt_MATCHstmt (Decl x_MATCHstmt);
439 ///////////////////////////////////////////////////////////////////////////////
441 // Class for datatype constructor Stmt::REWRITEstmt
443 ///////////////////////////////////////////////////////////////////////////////
444 class Stmt_REWRITEstmt : public a_Stmt {
445 public:
446 #line 84 "setl-ast.ph"
447 Decl REWRITEstmt;
448 Stmt_REWRITEstmt (Decl x_REWRITEstmt);
451 ///////////////////////////////////////////////////////////////////////////////
453 // Class for datatype constructor Stmt::REPLACEMENTstmt
455 ///////////////////////////////////////////////////////////////////////////////
456 class Stmt_REPLACEMENTstmt : public a_Stmt {
457 public:
458 #line 85 "setl-ast.ph"
459 Decl REPLACEMENTstmt;
460 Stmt_REPLACEMENTstmt (Decl x_REPLACEMENTstmt);
463 ///////////////////////////////////////////////////////////////////////////////
465 // Class for datatype constructor Stmt::FORALLstmt
467 ///////////////////////////////////////////////////////////////////////////////
468 class Stmt_FORALLstmt : public a_Stmt {
469 public:
470 #line 86 "setl-ast.ph"
471 Generators _1; Stmt _2;
472 Stmt_FORALLstmt (Generators x_1, Stmt x_2);
475 ///////////////////////////////////////////////////////////////////////////////
477 // Class for datatype constructor Stmt::RETURNstmt
479 ///////////////////////////////////////////////////////////////////////////////
480 class Stmt_RETURNstmt : public a_Stmt {
481 public:
482 #line 87 "setl-ast.ph"
483 Exp RETURNstmt;
484 Stmt_RETURNstmt (Exp x_RETURNstmt);
487 ///////////////////////////////////////////////////////////////////////////////
489 // Datatype constructor functions for Stmt
491 ///////////////////////////////////////////////////////////////////////////////
492 extern a_Stmt * ASSIGNstmt (Exp x_1, Exp x_2);
493 extern a_Stmt * BLOCKstmt (Defs x_1, Stmts x_2);
494 extern a_Stmt * WHILEstmt (Exp x_1, Stmt x_2);
495 extern a_Stmt * IFstmt (Exp x_1, Stmt x_2, Stmt x_3);
496 extern a_Stmt * MATCHstmt (Decl x_MATCHstmt);
497 extern a_Stmt * REWRITEstmt (Decl x_REWRITEstmt);
498 extern a_Stmt * REPLACEMENTstmt (Decl x_REPLACEMENTstmt);
499 extern a_Stmt * FORALLstmt (Generators x_1, Stmt x_2);
500 extern a_Stmt * RETURNstmt (Exp x_RETURNstmt);
502 #line 100 "setl-ast.ph"
503 #line 100 "setl-ast.ph"
506 ///////////////////////////////////////////////////////////////////////////////
508 // Pretty printing routines for definitions, statements and generators
510 ///////////////////////////////////////////////////////////////////////////////
511 extern std::ostream& operator << (std::ostream&, Def);
512 extern std::ostream& operator << (std::ostream&, Defs);
513 extern std::ostream& operator << (std::ostream&, Sig);
514 extern std::ostream& operator << (std::ostream&, Sigs);
515 extern std::ostream& operator << (std::ostream&, Stmt);
516 extern std::ostream& operator << (std::ostream&, Stmts);
517 extern std::ostream& operator << (std::ostream&, LabSig);
518 extern std::ostream& operator << (std::ostream&, LabSigs);
519 extern std::ostream& operator << (std::ostream&, Generator);
520 extern std::ostream& operator << (std::ostream&, Generators);
522 #endif
523 #line 119 "setl-ast.ph"
525 ------------------------------- Statistics -------------------------------
526 Merge matching rules = yes
527 Number of DFA nodes merged = 0
528 Number of ifs generated = 0
529 Number of switches generated = 0
530 Number of labels = 0
531 Number of gotos = 0
532 Adaptive matching = enabled
533 Fast string matching = disabled
534 Inline downcasts = enabled
535 --------------------------------------------------------------------------