Example #1
0
        private static ETree F(Queue <string> s)
        {
            var t = P(s);

            if (s.Count > 0 && s.Peek() == "^")
            {
                s.Dequeue();
                var t1 = F(s);
                return(new EBinary(EBinary.GetBinaryOpperator("^"), t, t1));
            }
            return(t);
        }
Example #2
0
        private static ETree T(Queue <string> s)
        {
            var t = F(s);

            while (s.Count > 0 && (s.Peek() == "*" || s.Peek() == "/" || s.Peek() == "%"))
            {
                var op = EBinary.GetBinaryOpperator(s.Dequeue());
                var t1 = F(s);
                t = new EBinary(op, t, t1);
            }
            return(t);
        }