|
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_ARITHMETIC_H 00021 #define AEFIND_TREE_ARITHMETIC_H 00022 00023 #include <aefind/tree/diadic.h> 00024 #include <aefind/tree/monadic.h> 00025 00026 class tree_list; // forward 00027 00032 class tree_divide: 00033 public tree_diadic 00034 { 00035 public: 00039 virtual ~tree_divide(); 00040 00041 private: 00051 tree_divide(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_divide(); 00090 00094 tree_divide(const tree_divide &); 00095 00099 tree_divide &operator=(const tree_divide &); 00100 }; 00101 00102 00107 class tree_join: 00108 public tree_diadic 00109 { 00110 public: 00114 virtual ~tree_join(); 00115 00116 private: 00126 tree_join(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_join(); 00165 00169 tree_join(const tree_join &); 00170 00174 tree_join &operator=(const tree_join &); 00175 }; 00176 00177 00182 class tree_subtract: 00183 public tree_diadic 00184 { 00185 public: 00189 virtual ~tree_subtract(); 00190 00191 private: 00201 tree_subtract(const pointer &left, const pointer &right); 00202 00203 public: 00213 static pointer create(const pointer &left, const pointer &right); 00214 00222 static pointer create_l(const tree_list &args); 00223 00224 protected: 00225 // See base class for documentation. 00226 const char *name() const; 00227 00228 // See base class for documentation. 00229 rpt_value::pointer evaluate(string_ty *, string_ty *, string_ty *, 00230 struct stat *) const; 00231 00232 // See base class for documentation. 00233 tree::pointer optimize() const; 00234 00235 private: 00239 tree_subtract(); 00240 00244 tree_subtract(const tree_subtract &); 00245 00249 tree_subtract &operator=(const tree_subtract &); 00250 }; 00251 00252 00257 class tree_mod: 00258 public tree_diadic 00259 { 00260 public: 00264 virtual ~tree_mod(); 00265 00266 private: 00276 tree_mod(const pointer &left, const pointer &right); 00277 00278 public: 00288 static pointer create(const pointer &left, const pointer &right); 00289 00297 static pointer create_l(const tree_list &args); 00298 00299 protected: 00300 // See base class for documentation. 00301 const char *name() const; 00302 00303 // See base class for documentation. 00304 rpt_value::pointer evaluate(string_ty *, string_ty *, string_ty *, 00305 struct stat *) const; 00306 00307 // See base class for documentation. 00308 tree::pointer optimize() const; 00309 00310 private: 00314 tree_mod(); 00315 00319 tree_mod(const tree_mod &); 00320 00324 tree_mod &operator=(const tree_mod &); 00325 }; 00326 00327 00332 class tree_mul: 00333 public tree_diadic 00334 { 00335 public: 00339 virtual ~tree_mul(); 00340 00341 private: 00351 tree_mul(const pointer &left, const pointer &right); 00352 00353 public: 00363 static pointer create(const pointer &left, const pointer &right); 00364 00372 static pointer create_l(const tree_list &args); 00373 00374 protected: 00375 // See base class for documentation. 00376 const char *name() const; 00377 00378 // See base class for documentation. 00379 rpt_value::pointer evaluate(string_ty *, string_ty *, string_ty *, 00380 struct stat *) const; 00381 00382 // See base class for documentation. 00383 tree::pointer optimize() const; 00384 00385 private: 00389 tree_mul(); 00390 00394 tree_mul(const tree_mul &); 00395 00399 tree_mul &operator=(const tree_mul &); 00400 }; 00401 00402 00407 class tree_neg: 00408 public tree_monadic 00409 { 00410 public: 00414 virtual ~tree_neg(); 00415 00416 private: 00421 tree_neg(const pointer &arg); 00422 00423 public: 00431 static pointer create(const pointer &arg); 00432 00440 static pointer create_l(const tree_list &args); 00441 00442 protected: 00443 // See base class for documentation. 00444 const char *name() const; 00445 00446 // See base class for documentation. 00447 rpt_value::pointer evaluate(string_ty *, string_ty *, string_ty *, 00448 struct stat *) const; 00449 00450 // See base class for documentation. 00451 tree::pointer optimize() const; 00452 00453 private: 00457 tree_neg(); 00458 00462 tree_neg(const tree_neg &); 00463 00467 tree_neg &operator=(const tree_neg &); 00468 }; 00469 00470 00475 class tree_plus: 00476 public tree_diadic 00477 { 00478 public: 00482 virtual ~tree_plus(); 00483 00484 private: 00494 tree_plus(const pointer &left, const pointer &right); 00495 00496 public: 00506 static pointer create(const pointer &left, const pointer &right); 00507 00515 static pointer create_l(const tree_list &args); 00516 00517 protected: 00518 // See base class for documentation. 00519 const char *name() const; 00520 00521 // See base class for documentation. 00522 rpt_value::pointer evaluate(string_ty *, string_ty *, string_ty *, 00523 struct stat *) const; 00524 00525 // See base class for documentation. 00526 tree::pointer optimize() const; 00527 00528 private: 00532 tree_plus(); 00533 00537 tree_plus(const tree_plus &); 00538 00542 tree_plus &operator=(const tree_plus &); 00543 }; 00544 00549 class tree_pos: 00550 public tree_monadic 00551 { 00552 public: 00556 virtual ~tree_pos(); 00557 00558 private: 00563 tree_pos(const pointer &arg); 00564 00565 public: 00573 static pointer create(const pointer &arg); 00574 00582 static pointer create_l(const tree_list &args); 00583 00584 protected: 00585 // See base class for documentation. 00586 const char *name() const; 00587 00588 // See base class for documentation. 00589 rpt_value::pointer evaluate(string_ty *, string_ty *, string_ty *, 00590 struct stat *) const; 00591 00592 // See base class for documentation. 00593 tree::pointer optimize() const; 00594 00595 private: 00599 tree_pos(); 00600 00604 tree_pos(const tree_pos &); 00605 00609 tree_pos &operator=(const tree_pos &); 00610 }; 00611 00612 #endif // AEFIND_TREE_ARITHMETIC_H 00613 // vim: set ts=8 sw=4 et :
1.7.6.1