public void GetValue() { if (Operation == ' ') { return; } if (Operation == '+') { Left.GetValue(); Right.GetValue(); Value = Left.Value + Right.Value; } if (Operation == '-') { Left.GetValue(); Right.GetValue(); Value = Right.Value - Left.Value; } }
public int Inter(string s) { PointError = new List <int>(); Root = null; FormTree(s); Root.GetValue(); if (PointError.Count != 0) { throw new InputError(); } return(Root.Value); }