1 // 2 // aegis - project change supervisor 3 // Copyright (C) 1997, 2002, 2004-2008 Peter Miller 4 // 5 // This program is free software; you can redistribute it and/or modify 6 // it under the terms of the GNU General Public License as published by 7 // the Free Software Foundation; either version 3 of the License, or 8 // (at your option) any later version. 9 // 10 // This program is distributed in the hope that it will be useful, 11 // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 // GNU General Public License for more details. 14 // 15 // You should have received a copy of the GNU General Public License 16 // along with this program. If not, see 17 // <http://www.gnu.org/licenses/>. 18 // 19 20 #ifndef AEFIND_TREE_MONADIC_H 21 #define AEFIND_TREE_MONADIC_H 22 23 #include <aefind/tree.h> 24 25 /** 26 * The tree_monadic class is used to represent an abstract tree one with 27 * a single argument. 28 */ 29 class tree_monadic: 30 public tree 31 { 32 public: 33 /** 34 * The destructor. 35 */ 36 virtual ~tree_monadic(); 37 38 protected: 39 /** 40 * The constructor. 41 * 42 * @param arg 43 * The single argument to the function. 44 */ 45 tree_monadic(const pointer &arg); 46 47 // See base class for documentation. 48 void print() const; 49 50 // See base class for documentation. 51 bool useful() const; 52 53 // See base class for documentation. 54 bool constant() const; 55 get_arg()56 tree::pointer get_arg() const { return arg; } 57 58 private: 59 /** 60 * The arg instance variable is used to remember the argument to 61 * this single-argument function. 62 */ 63 tree::pointer arg; 64 65 /** 66 * The default constructor. Do not use. 67 */ 68 tree_monadic(); 69 70 /** 71 * The copy constructor. Do not use. 72 */ 73 tree_monadic(const tree_monadic &); 74 75 /** 76 * The assignment operator. Do not use. 77 */ 78 tree_monadic &operator=(const tree_monadic &); 79 }; 80 81 #endif // AEFIND_TREE_MONADIC_H 82