|
Aegis
4.25.D505
|
00001 // 00002 // aegis - project change supervisor 00003 // Copyright (C) 1997, 2002, 2005-2008, 2012 Peter Miller 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 3 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, see 00017 // <http://www.gnu.org/licenses/>. 00018 // 00019 00020 #ifndef AEFIND_TREE_LOGICAL_H 00021 #define AEFIND_TREE_LOGICAL_H 00022 00023 #include <aefind/tree/diadic.h> 00024 #include <aefind/tree/monadic.h> 00025 00026 class tree_list; // forward 00027 00032 class tree_and: 00033 public tree_diadic 00034 { 00035 public: 00039 virtual ~tree_and(); 00040 00041 private: 00051 tree_and(const pointer &left, const pointer &right); 00052 00053 public: 00063 static pointer create(const pointer &left, const pointer &right); 00064 00072 static pointer create_l(const tree_list &args); 00073 00074 protected: 00075 // See base class for documentation. 00076 const char *name() const; 00077 00078 // See base class for documentation. 00079 rpt_value::pointer evaluate(string_ty *, string_ty *, string_ty *, 00080 struct stat *) const; 00081 00082 // See base class for documentation. 00083 tree::pointer optimize() const; 00084 00085 private: 00089 tree_and(); 00090 00094 tree_and(const tree_and &); 00095 00099 tree_and &operator=(const tree_and &); 00100 }; 00101 00102 00107 class tree_or: 00108 public tree_diadic 00109 { 00110 public: 00114 virtual ~tree_or(); 00115 00116 private: 00126 tree_or(const pointer &left, const pointer &right); 00127 00128 public: 00138 static pointer create(const pointer &left, const pointer &right); 00139 00147 static pointer create_l(const tree_list &args); 00148 00149 protected: 00150 // See base class for documentation. 00151 const char *name() const; 00152 00153 // See base class for documentation. 00154 rpt_value::pointer evaluate(string_ty *, string_ty *, string_ty *, 00155 struct stat *) const; 00156 00157 // See base class for documentation. 00158 tree::pointer optimize() const; 00159 00160 private: 00164 tree_or(); 00165 00169 tree_or(const tree_or &); 00170 00174 tree_or &operator=(const tree_or &); 00175 }; 00176 00177 00182 class tree_not: 00183 public tree_monadic 00184 { 00185 public: 00189 virtual ~tree_not(); 00190 00191 private: 00196 tree_not(const pointer &arg); 00197 00198 public: 00206 static pointer create(const pointer &arg); 00207 00215 static pointer create_l(const tree_list &args); 00216 00217 protected: 00218 // See base class for documentation. 00219 const char *name() const; 00220 00221 // See base class for documentation. 00222 rpt_value::pointer evaluate(string_ty *, string_ty *, string_ty *, 00223 struct stat *) const; 00224 00225 // See base class for documentation. 00226 tree::pointer optimize() const; 00227 00228 private: 00232 tree_not(); 00233 00237 tree_not(const tree_not &); 00238 00242 tree_not &operator=(const tree_not &); 00243 }; 00244 00245 00250 class tree_comma: 00251 public tree_diadic 00252 { 00253 public: 00257 virtual ~tree_comma(); 00258 00259 private: 00269 tree_comma(const pointer &left, const pointer &right); 00270 00271 public: 00281 static pointer create(const pointer &left, const pointer &right); 00282 00290 static pointer create_l(const tree_list &args); 00291 00292 protected: 00293 // See base class for documentation. 00294 const char *name() const; 00295 00296 // See base class for documentation. 00297 rpt_value::pointer evaluate(string_ty *, string_ty *, string_ty *, 00298 struct stat *) const; 00299 00300 // See base class for documentation. 00301 tree::pointer optimize() const; 00302 00303 private: 00307 tree_comma(); 00308 00312 tree_comma(const tree_comma &); 00313 00317 tree_comma &operator=(const tree_comma &); 00318 }; 00319 00320 00325 class tree_triadic: 00326 public tree 00327 { 00328 public: 00332 virtual ~tree_triadic(); 00333 00334 private: 00346 tree_triadic(const pointer &a1, const pointer &a2, const pointer &a3); 00347 00348 public: 00360 static pointer create(const pointer &a1, const pointer &a2, 00361 const pointer &a3); 00362 00363 protected: 00364 // See base class for documentation. 00365 const char *name() const; 00366 00367 // See base class for documentation. 00368 rpt_value::pointer evaluate(string_ty *, string_ty *, string_ty *, 00369 struct stat *) const; 00370 00371 // See base class for documentation. 00372 tree::pointer optimize() const; 00373 00374 // See base class for documentation. 00375 void print() const; 00376 00377 // See base class for documentation. 00378 bool useful() const; 00379 00380 // See base class for documentation. 00381 bool constant() const; 00382 00383 private: 00384 tree::pointer a1; 00385 tree::pointer a2; 00386 tree::pointer a3; 00387 00391 tree_triadic(); 00392 00396 tree_triadic(const tree_triadic &); 00397 00401 tree_triadic &operator=(const tree_triadic &); 00402 }; 00403 00404 #endif // AEFIND_TREE_LOGICAL_H 00405 // vim: set ts=8 sw=4 et :
1.7.6.1