00001 00002 /* 00003 | Author: Michael Schmidt; 00004 | Gunnar Jehl 00005 | 00006 | ************************* SOFTWARE LICENSE AGREEMENT *********************** 00007 | This source code is published under the BSD License. 00008 | 00009 | See file 'LICENSE.txt' that comes with this distribution or 00010 | http://dbis.informatik.uni-freiburg.de/index.php?project=GCX/license.php 00011 | for the full license agreement. 00012 | 00013 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00014 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00015 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00016 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 00017 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 00018 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 00019 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 00020 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 00021 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 00022 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00023 | POSSIBILITY OF SUCH DAMAGE. 00024 | **************************************************************************** 00025 */ 00026 00035 #ifndef IFEXPRESSION_H 00036 #define IFEXPRESSION_H 00037 00038 #include "expression.h" 00039 #include "condexpression.h" 00040 #include "varstepexpression.h" 00041 #include "forexpression.h" 00042 00054 class IfExpression:public Expression { 00055 00056 public: 00063 IfExpression(CondExpression * _cond, Expression * _thenexp, 00064 Expression * _elseexp); 00065 00069 virtual ~ IfExpression(); 00070 00074 virtual void scopeCheck(vector < unsigned >&def_vars, 00075 vector < unsigned >&introduced_vars, 00076 vector < unsigned >&violating_vars); 00077 00081 virtual void replaceVarId(unsigned old_id, unsigned new_id); 00082 00086 virtual void mergeSequences(); 00087 00091 virtual void extractFSAMap(FSAMap * fsamap, unsigned parent_var); 00092 00096 virtual void extractParVarMap(ParVarMap * parvarmap); 00097 00101 virtual void extractDependencies(vector < DependencySet * >*depset); 00102 00106 virtual Expression *placeSignOffs(vector < SignOffExpression * >&signoffs); 00107 00111 virtual void rewriteWhereExps(); 00112 00116 virtual void rewriteEmptyFuncts(); 00117 00121 virtual void rewriteVarstepCondExps(); 00122 00126 virtual void rewriteAggregateFuncts(); 00127 00131 virtual void rewriteVarsteps(); 00132 00136 virtual void print(OutputStream & dos) const; 00137 00141 virtual void init(BufferNode * root); 00142 00146 virtual void eval(OutputStream & eos, Environment * env, unsigned modus); 00147 00151 virtual bool containsDirectOutput(); 00152 00153 private: 00159 CondExpression * cond; 00160 00166 Expression *thenexp; 00167 00173 Expression *elseexp; 00174 }; 00175 00176 #endif // IFEXPRESSION_H