- Main Page
- Classes
- Files

# 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
    00008 class node_impl;
    00009
    00015 class node {
    00016 public:
    00018   node();
    00022   node(double number);
    00026   node(std::string const& identifier);
    00031   node(node identifier, node number);
    00036   node(char op, node operand);
    00042   node(node left, char op, node right);
    00047   node(node const& n);
    00051   ~node();
    00052
    00056   node& operator=(node const& n);
    00057
    00064   void print(std::ostream& stream, int indent = 0) const;
    00068   double evaluate() const;
    00073   std::string to_string() const;
    00074
    00075 private:
    00077   static node_impl* make_binary_operator(node, char, node);
    00078
    00079   node_impl* pimpl_;
    00080 };
    00081
    00082 #endif