Example #1
0
        public static OneNode NewNode(ref string st, ref int pos)
        {
            OneNode res = null;

            while (pos < st.Length && st[pos] == ' ')
            {
                ++pos;
            }
            //MessageBox.Show("In ONENODE, '" + st[pos] + "'");
            if (pos < st.Length)
            {
                if (Char.IsLower(st[pos]))
                {
                    res = new VarNode("");
                }
                else
                if (Char.IsDigit(st[pos]))
                {
                    res = new IntNode(0);
                }
                else
                if (st[pos] == '(')
                {
                    res = new SignNode(Sign.empty);
                }
            }
            if (res != null && !res.LoadNodeFromString(ref st, ref pos))
            {
                res = null;
            }
            return(res);
        }
Example #2
0
        public override OneNode Copy()
        {
            SignNode sign = new SignNode(this.sign);

            return(sign);
        }