#include <iostream.h>
#include <assert.h>
#include<strstrea.h>
#include<string.h>
#include<stddef.h>

const unsigned int MAX_EXP_SIZE = 80;

struct Data {
    char token;
    double val;
};

struct TLNode;
class Tree;

class TreeNode {
private:
    TreeNode* parent;
    TLNode* children;
    unsigned int numc;
public:
    Data* data;
    TreeNode();
    TreeNode( TreeNode&);
    TreeNode( TreeNode&, TreeNode*);
    TreeNode( char *);
    void TreeNode1( char *, unsigned int);
    ~TreeNode() {;};
	 TreeNode& operator[]( unsigned int);
    unsigned int numChild() {return numc;};
    friend Tree;
     double eval();
    unsigned int addChild(TreeNode&);
};

struct TLNode {
	TreeNode* TNp;
    TLNode* next;
};

class Tree {
private:
	TreeNode* root;
public:
    Tree() {root=new TreeNode;};
    Tree(TreeNode& rt) {root=new TreeNode(rt);};
    Tree( Tree& other) {root=new TreeNode(*other.root);};
    ~Tree() {;};
    Tree& operator=( Tree& other) {root=new TreeNode(*other.root);return *this;};
     double eval();
};

