#ifndef DIFFERENTIATORNODES #define DIFFERENTIATORNODES #include #include #include "node.h" #include "binaryNode.h" #include "unaryNode.h" #include "bFuncNode.h" /** *A Node represents any item which can be part of an expression. *This includes constants, and binary operators. Node is a abstract base *class, while both constant and binary operators are subclasses.The binary *operators will become internal nodes, as will the unary operators, *while the constants will be external nodes. * * Written by Jessica Smith from code created by rcd. */ /** *The key class is a subclass of node which allows constants to be *created as nodes */ class Key : public Node { public: /** *Makes a key node from the given value */ Key (string key); /** *Virtual destructor for key */ virtual ~Key(); /** *Evaluates value of the key node */ virtual double evaluate () const; /** *Prints out the value of the constant node */ virtual void print (ostream & out) const; /** *Copies the node */ virtual Node * copy () const; /** *Returns the precedebce of the node */ virtual int precedence()const; /* *Returns the value of the int in string form */ virtual string description()const;//returns double value private: string myKey; int myPrecedence; double myValue; }; #endif