00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00035 #ifndef ROUNDINGEXPRESSION_H
00036 #define ROUNDINGEXPRESSION_H
00037
00038 #include <math.h>
00039 #include "operandexpression.h"
00040 #include "aggregatefunctexpression.h"
00041 #include "outputstream.h"
00042
00051 class RoundingExpression:public OperandExpression {
00052
00053 public:
00059 RoundingExpression(EXP_TYPE _type, AggregateFunctExpression * _aggfunct);
00060
00064 virtual ~ RoundingExpression();
00065
00069 virtual void scopeCheck(vector < unsigned >&def_vars,
00070 vector < unsigned >&introduced_vars,
00071 vector < unsigned >&violating_vars);
00072
00076 virtual void replaceVarId(unsigned old_id, unsigned new_id);
00077
00081 virtual void extractFSAMap(FSAMap * fsamap, unsigned parent_var);
00082
00086 virtual void extractParVarMap(ParVarMap * parvarmap);
00087
00091 virtual void extractDependencies(vector < DependencySet * >*depset);
00092
00096 virtual Expression *placeSignOffs(vector < SignOffExpression * >&signoffs);
00097
00101 virtual void rewriteAggregateFuncts();
00102
00106 virtual void print(OutputStream & dos) const;
00107
00111 virtual void init(BufferNode * root);
00112
00116 virtual void eval(OutputStream & eos, Environment * env, unsigned modus) =
00117 0;
00118
00122 inline bool isSingleValued() {
00123 return true;
00124 } virtual void prepareOperand(OutputStream & eos, Environment * env,
00128 unsigned modus);
00129
00133 inline void unprepareOperand() {
00134 initial = true;
00135 }
00136
00140 virtual Value *getNextValue();
00141
00142 private:
00153 virtual long double calculateValue(OutputStream & eos, Environment * env,
00154 unsigned modus, bool & non_value) = 0;
00155
00156 protected:
00161 AggregateFunctExpression * aggfunct;
00162 };
00163
00164 #endif // ROUNDINGEXPRESSION_H