コード例 #1
0
 public ElementOfTree Process(ElementOfTree element, IContext context)
 {
     element.Right = element.Copy();
     element.Type  = NodeType.Multiply;
     element.Left  = context.Process(element.Right?.Left.Copy());
     element.Value = "*";
     return(element);
 }
コード例 #2
0
        public ElementOfTree Process(ElementOfTree element, IContext context)
        {
            var tempElem = element.Copy();

            element.Right = new ElementOfTree
            {
                Type  = NodeType.Cos,
                Value = element.Value.Replace("[", "]"),
                Left  = element.Left
            };
            element.Left  = context.Process(tempElem.Left);
            element.Type  = NodeType.Multiply;
            element.Value = "*";
            return(element);
        }
コード例 #3
0
        public ElementOfTree Process(ElementOfTree element, IContext context)
        {
            var tempElem = element.Copy();

            tempElem.Type  = NodeType.Sin;
            tempElem.Value = tempElem.Value.Replace("]", "[");
            element.Left   = context.Process(element.Left.Copy());
            element.Right  = new ElementOfTree
            {
                Value = "-",
                Type  = NodeType.MinusU,
                Left  = tempElem
            };
            element.Value = "*";
            element.Type  = NodeType.Multiply;
            return(element);
        }