Esempio n. 1
0
        private static string ToDot(string parent, DyadicFunction node)
        {
            string name      = String.Format("Dyadic{0}", counter++);
            string leftName  = ToDot(name, node.Left);
            string rightName = ToDot(name, node.Right);

            text.AppendFormat("  {0} [label=\"{1} ({2})\"];\n", name, node.Token.Text, node.Token.Type);
            text.AppendFormat("  {0} -> {1};\n", name, leftName);
            text.AppendFormat("  {0} -> {1};\n", name, rightName);

            return(name);
        }
Esempio n. 2
0
        public override bool Equals(object obj)
        {
            if (obj is DyadicFunction)
            {
                DyadicFunction other   = (DyadicFunction)obj;
                var            tokenOk = this.token.Equals(other.token);
                var            leftOk  = this.leftExpression.Equals(other.leftExpression);
                var            rightOK = this.rightExpression.Equals(other.rightExpression);

                return(tokenOk && leftOk && rightOK);
            }

            return(false);
        }
Esempio n. 3
0
        private static string ToDot(string parent, DyadicFunction node)
        {
            string name = String.Format("Dyadic{0}", counter++);
            string leftName = ToDot(name, node.Left);
            string rightName = ToDot(name, node.Right);

            text.AppendFormat("  {0} [label=\"{1} ({2})\"];\n", name, node.Token.Text, node.Token.Type);
            text.AppendFormat("  {0} -> {1};\n", name, leftName);
            text.AppendFormat("  {0} -> {1};\n", name, rightName);

            return name;
        }