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 AGGREGATEFUNCTEXPRESSION_H
00036 #define AGGREGATEFUNCTEXPRESSION_H
00037
00038 #include <iomanip>
00039 #include "operandexpression.h"
00040 #include "varstepexpression.h"
00041 #include "forexpression.h"
00042 #include "miscfunctions.h"
00043
00052 class AggregateFunctExpression:public OperandExpression {
00053
00054 public:
00060 AggregateFunctExpression(EXP_TYPE _type, VarExpression * _var);
00061
00067 AggregateFunctExpression(EXP_TYPE _type, VarStepExpression * _varstep);
00068
00072 virtual ~ AggregateFunctExpression();
00073
00077 virtual void scopeCheck(vector < unsigned >&def_vars,
00078 vector < unsigned >&introduced_vars,
00079 vector < unsigned >&violating_vars);
00080
00084 virtual void replaceVarId(unsigned old_id, unsigned new_id);
00085
00089 virtual void extractFSAMap(FSAMap * fsamap, unsigned parent_var);
00090
00094 virtual void extractParVarMap(ParVarMap * parvarmap);
00095
00099 virtual void extractDependencies(vector < DependencySet * >*depset);
00100
00104 virtual Expression *placeSignOffs(vector < SignOffExpression * >&signoffs);
00105
00109 void rewriteAggregateFuncts();
00110
00114 virtual void print(OutputStream & dos) const;
00115
00119 virtual void init(BufferNode * root);
00120
00124 virtual void eval(OutputStream & eos, Environment * env, unsigned modus) =
00125 0;
00126
00130 inline bool isSingleValued() {
00131 return true;
00132 } virtual void prepareOperand(OutputStream & eos, Environment * env,
00136 unsigned modus);
00137
00141 inline void unprepareOperand() {
00142 initial = true;
00143 }
00144
00148 virtual Value *getNextValue();
00149
00150 private:
00160 virtual long double calculateValue(OutputStream & eos, Environment * env,
00161 unsigned modus, bool & empty_sequence) =
00162 0;
00163
00164 protected:
00170 VarExpression * var;
00171
00177 VarStepExpression *varstep;
00178
00186 ForExpression *forexp;
00187
00194 BufferIterator *bit;
00195 };
00196
00197 #endif // AGGREGATEFUNCTEXPRESSION_H