node.hpp

Go to the documentation of this file.
00001 #ifndef NODE_HPP_
00002 #define NODE_HPP_
00003 
00004 #include <iosfwd>
00005 #include <string>
00006 #include <vector>
00007 
00009 class node_impl;
00010 
00012 class node;
00013 
00015 typedef std::vector<node> node_list;
00016 
00018 typedef std::vector<std::string> identifier_list;
00019 
00025 class node {
00026 public:
00028   node();
00032   node(double number);
00036   node(std::string const& identifier);
00041   node(char op, node operand);
00047   node(node left, char op, node right);
00052   node(identifier_list const& parameters, node definition);
00057   node(std::string const& name, node_list const& arguments);
00062   node(node const& n);
00066   ~node();
00067 
00071   node& operator=(node const& n);
00072 
00079   void print(std::ostream& stream, int indent = 0) const;
00083   double evaluate() const;
00088   std::string to_string() const;
00093   identifier_list const& get_parameters() const;
00094 
00095 private:
00097   static node_impl* make_binary_operator(node, char, node);
00098 
00099   node_impl* pimpl_;
00100 };
00101 
00102 #endif

Generated on Sun Nov 30 10:05:26 2008 for Calculator by  doxygen 1.5.3