Aegis  4.25.D505
aefind/tree.h
Go to the documentation of this file.
00001 //
00002 //      aegis - project change supervisor
00003 //      Copyright (C) 1997, 2002, 2004-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 AEFIND_TREE_H
00021 #define AEFIND_TREE_H
00022 
00023 #include <common/ac/shared_ptr.h>
00024 #include <libaegis/aer/value.h>
00025 
00026 struct string_ty; // existence
00027 struct stat; // existence
00028 
00033 class tree
00034 {
00035 public:
00036     typedef aegis_shared_ptr<tree> pointer;
00037 
00038     virtual ~tree();
00039 
00040 protected:
00044     tree();
00045 
00046 public:
00047     virtual const char *name() const = 0;
00048     virtual void print() const = 0;
00049     virtual rpt_value::pointer evaluate(string_ty *, string_ty *, string_ty *,
00050         struct stat *) const = 0;
00051     virtual bool useful() const = 0;
00052     virtual bool constant() const = 0;
00053     virtual tree::pointer optimize() const = 0;
00054 
00055     rpt_value::pointer evaluate_constant() const;
00056     tree::pointer optimize_constant() const;
00057 
00058 private:
00062     tree(const tree &);
00063 
00067     tree &operator=(const tree &);
00068 };
00069 
00070 
00071 #endif // AEFIND_TREE_H