00001 // 00002 // aegis - project change supervisor 00003 // Copyright (C) 1994, 2002, 2005-2008 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 AEGIS_AER_STMT_WHILE_H 00021 #define AEGIS_AER_STMT_WHILE_H 00022 00023 #include <libaegis/aer/expr.h> 00024 #include <libaegis/aer/stmt.h> 00025 00030 class rpt_stmt_while: 00031 public rpt_stmt 00032 { 00033 public: 00037 virtual ~rpt_stmt_while(); 00038 00039 private: 00049 rpt_stmt_while(const rpt_expr::pointer &ep, const rpt_stmt::pointer &body); 00050 00051 public: 00061 static pointer create(const rpt_expr::pointer &ep, 00062 const rpt_stmt::pointer &body); 00063 00064 protected: 00065 // See base class for documentation. 00066 void run(rpt_stmt_result_ty *) const; 00067 00068 private: 00073 rpt_expr::pointer condition; 00074 00078 rpt_stmt_while(); 00079 00083 rpt_stmt_while(const rpt_stmt_while &); 00084 00088 rpt_stmt_while &operator=(const rpt_stmt_while &); 00089 }; 00090 00095 class rpt_stmt_do: 00096 public rpt_stmt 00097 { 00098 public: 00102 virtual ~rpt_stmt_do(); 00103 00104 private: 00114 rpt_stmt_do(const rpt_stmt::pointer &body, const rpt_expr::pointer &ep); 00115 00116 public: 00126 static pointer create(const rpt_stmt::pointer &body, 00127 const rpt_expr::pointer &ep); 00128 00129 protected: 00130 // See base class for documentation. 00131 void run(rpt_stmt_result_ty *) const; 00132 00133 private: 00138 rpt_expr::pointer condition; 00139 00143 rpt_stmt_do(); 00144 00148 rpt_stmt_do(const rpt_stmt_do &); 00149 00153 rpt_stmt_do &operator=(const rpt_stmt_do &); 00154 }; 00155 00156 #endif // AEGIS_AER_STMT_WHILE_H