Exemplo n.º 1
0
        public MathTree(InnerNode root, MathNode child)
        {
            this.nodeStack = new Stack();
            this.root = root;

            ((InnerNode) this.root).AddNode(child);
        }
Exemplo n.º 2
0
        public MathTree(InnerNode root, MathNode left, MathNode right)
        {
            this.nodeStack = new Stack();
            this.root = root;

            ((InnerNode)this.root).AddNode(left);
            ((InnerNode)this.root).AddNode(right);
        }
Exemplo n.º 3
0
 public MathNode getCurrentNode()
 {
     try
     {
         return (MathNode)nodeStack.Peek();
     }
     catch
     {
         // empty stack, create empty root node
         this.root = new InnerNode();
         this.nodeStack.Push(this.root);
         return this.root;
     }
 }