예제 #1
0
파일: MathTree.cs 프로젝트: dorchard/mucell
        public MathTree(InnerNode root, MathNode child)
        {
            this.nodeStack = new Stack();
            this.root = root;

            ((InnerNode) this.root).AddNode(child);
        }
예제 #2
0
파일: MathTree.cs 프로젝트: dorchard/mucell
        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);
        }
예제 #3
0
파일: MathTree.cs 프로젝트: dorchard/mucell
 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;
     }
 }