00001 // -*- C++ -*- 00002 // 00003 // Copyright (c) 2006 by Rafael Ostertag 00004 // 00005 // This program is free software; you can redistribute it and/or modify 00006 // it under the terms of the GNU General Public License as published by 00007 // the Free Software Foundation; either version 2 of the License, or 00008 // (at your option) any later version. 00009 // 00010 // This program is distributed in the hope that it will be useful, 00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 // GNU General Public License for more details. 00014 // 00015 // You should have received a copy of the GNU General Public License 00016 // along with this program; if not, write to the Free Software 00017 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00018 // 00019 // 00020 // $Id: casterm.h,v 1.17 2006/12/28 19:01:25 rafi Exp $ 00021 // 00022 00032 #ifndef _CASTERM_H 00033 #define _CASTERM_H 00034 00035 #ifdef HAVE_CONFIG_H 00036 #include "config.h" 00037 #endif 00038 00039 #include "casobject.h" 00040 #include "casgarbage.h" 00041 #include "castype.h" 00042 00060 class CASTerm : public CASObject { 00061 protected: 00069 std::vector<CASObject*> operands; 00070 00074 virtual void GetNonSingleValues ( std::vector<const CASObject*> &lst ) const; 00075 00079 virtual void GetSingleValues ( std::vector<const CASObject*> &lst ) const; 00080 00085 virtual bool HaveSameOperands ( const CASObject *o ) const; 00086 00091 virtual void GetOperands ( const CASTerm *t, std::vector<const CASObject*> &out ) const; 00092 00097 virtual void SetOperands ( CASTerm *t, const std::vector<const CASObject*> &in ) const; 00102 virtual void SetOperands ( CASTerm *t, const std::vector<CASObject*> &in ) const; 00103 00104 public: 00108 CASTerm(); 00112 virtual ~CASTerm(); 00113 00117 virtual CASObject *Power ( const CASObject* exp ) const; 00118 00123 virtual bool IsEqual ( const CASObject* o ) const; 00128 virtual bool IsLT ( const CASObject* o ) const; 00133 virtual bool IsGT ( const CASObject* o ) const; 00134 00138 unsigned long NumOperands() const; 00139 00151 virtual CASObject* Collect() const = 0; 00163 virtual CASObject* Expand() const = 0; 00164 00168 virtual void Append ( const CASObject* a ); 00172 virtual CASObject* SortWeight() const; 00176 virtual void Sort(); 00181 virtual bool IsPureNumerical() const; 00182 00190 virtual void RemoveNoOpElements() = 0; 00191 00196 virtual void UnsetAllEvaluated(); 00200 virtual void SetAllEvaluated(); 00201 }; 00202 00207 #endif /* _CASTERM_H */
1.4.7