00001 #ifndef _ASSERTION_H
00002 #define _ASSERTION_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include <stream.h>
00025
00026 #ifdef POLARIS_GNU_PRAGMAS
00027 #pragma interface
00028 #endif
00029
00030 #include "../Boolean.h"
00031 #include "../Expression/Expression.h"
00032 #include "../Listable.h"
00033 #include "../StringElem.h"
00034 #include "../Collection/List.h"
00035 #include "../Collection/RefList.h"
00036
00037 enum AssertionType {
00038 AS_NONE,
00039 AS_COMMENT,
00040 AS_CRITICAL,
00041 AS_EPILOGUE,
00042 AS_LASTVALUE,
00043 AS_PARALLEL,
00044 AS_PRIVATE,
00045 AS_PROLOGUE,
00046 AS_REDUCTION,
00047 AS_RELATION,
00048 AS_SERIAL,
00049 AS_SUBST,
00050 AS_LOOPLABEL,
00051 AS_SHARED,
00052 AS_FIRSTVALUE,
00053 AS_PRIVATEREFS,
00054 AS_READONLYREFS,
00055 AS_SHAREDREFS,
00056 AS_RTSHADOW,
00057 AS_INLINE,
00058 AS_RECURSIVEINLINE,
00059 AS_NOINLINE,
00060 AS_NOPUTGET,
00061
00062 AS_NOWAIT,
00063
00064 AS_RUNTIMETEST,
00065 AS_SCHEDULE,
00066 AS_DYNLASTVALUE,
00067 AS_RANGEWRITTEN,
00068 AS_PREAMBLE,
00069 AS_POSTAMBLE,
00070 AS_MAYMOD,
00071 AS_NOMOD,
00072 AS_INDUCTION,
00073 AS_PARCONDITION,
00074 AS_SAFE_CONDITION,
00075 AS_OVERLAP,
00076 AS_OVERLAP_SORT,
00077 AS_PRIVATE_DESCR,
00078 AS_REDUCT_DESCR,
00079 AS_TEST_MONOTONE,
00080 AS_DEP_OVERLAP,
00081 AS_DEP_RO_RW,
00082 AS_DEP_RW_WF,
00083 AS_DEP_WF_RO,
00084 AS_DEP_IO,
00085 AS_INSTRUMENT,
00086 AS_FORWARD,
00087 AS_SIDE_EFFECT_FREE,
00088 AS_NODEPENDENCE,
00089 AS_RECURRENCE,
00090
00091 AS_PARTIAL_REDUCTION,
00092 AS_PARTIAL_FIRSTVALUE,
00093
00094
00095 AS_UNKNOWN_SHARED,
00096
00097
00098
00099
00100
00101
00102 AS_NUM_ASSERTIONS
00103 };
00104
00105 class AssertionList;
00106 class ProgramUnit;
00107
00108 class Assertion : public Listable {
00109 friend inline ostream & operator << (ostream & o, const Assertion & a)
00110 { a.print(o); return o; }
00111
00112 protected:
00113 AssertionType _type;
00114 RefList<Assertion> _assertion_list;
00115
00116 public:
00117 Assertion();
00118
00119
00120 Assertion(const Assertion & a);
00121
00122
00123 virtual const List<Expression> & arg_list_guarded() const;
00124 virtual List<Expression> & arg_list_guarded();
00125
00126
00127 virtual Boolean arg_list_valid() const;
00128
00129
00130 virtual const List<StringElem> & string_arg_list_guarded() const;
00131 virtual List<StringElem> & string_arg_list_guarded();
00132
00133
00134 virtual Boolean string_arg_list_valid() const;
00135
00136
00137 virtual RefList<Assertion> & assertion_list() const;
00138
00139
00140 virtual Assertion *clone() const;
00141
00142
00143 virtual void relink_aptrs( ProgramUnit &p );
00144
00145
00146 AssertionType type() const;
00147
00148
00149 virtual ~Assertion();
00150
00151
00152 virtual void print(ostream &o) const;
00153
00154
00155 virtual Assertion & operator = (const Assertion &a);
00156
00157
00158 virtual Listable *listable_clone() const;
00159
00160 };
00161
00162 #endif