Пример #1
0
        public static RankOperator RankOperator(Token opToken)
        {
            RankOperator op = new RankOperator(null, null);

            op.OperatorToken = opToken;
            return(op);
        }
Пример #2
0
        private static string ToDot(string parent, RankOperator node)
        {
            string name    = String.Format("RankOP{0}", counter++);
            string funcDot = ToDot(name, node.Function);

            text.AppendFormat(" {0} -> {1};\n", name, funcDot);

            if (node.isDyadic)
            {
                string leftArg = ToDot(name, node.LeftArgument);
                text.AppendFormat("  {0} -> {1};\n", name, leftArg);
            }
            string conditionArg = ToDot(name, node.Condition);

            text.AppendFormat("  {0} -> {1};\n", name, conditionArg);

            if (node.RightArgument != null)
            {
                string rightArg = ToDot(name, node.RightArgument);
                text.AppendFormat(" {0} -> {1};\n", name, rightArg);
                text.AppendFormat(" {0} [label=\"{1} Rank\"]", name, node.Function);
            }

            return(name);
        }
Пример #3
0
        public override bool Equals(object obj)
        {
            if (obj is RankOperator)
            {
                RankOperator other  = (RankOperator)obj;
                bool         result = (this.function == other.function) && (this.rightarg == other.rightarg) && (this.condition == other.condition);
                if (isDyadic)
                {
                    result = result && (this.leftarg == other.leftarg);
                }
                return(result);
            }

            return(false);
        }
Пример #4
0
 public static RankOperator RankOperator(Token opToken)
 {
     RankOperator op = new RankOperator(null, null);
     op.OperatorToken = opToken;
     return op;
 }
Пример #5
0
        private static string ToDot(string parent, RankOperator node)
        {
            string name = String.Format("RankOP{0}", counter++);
            string funcDot = ToDot(name, node.Function);
            text.AppendFormat(" {0} -> {1};\n", name, funcDot);

            if (node.isDyadic)
            {
                string leftArg = ToDot(name, node.LeftArgument);
                text.AppendFormat("  {0} -> {1};\n", name, leftArg);
            }
            string conditionArg = ToDot(name, node.Condition);
            text.AppendFormat("  {0} -> {1};\n", name, conditionArg);

            if (node.RightArgument != null)
            {
                string rightArg = ToDot(name, node.RightArgument);
                text.AppendFormat(" {0} -> {1};\n", name, rightArg);
                text.AppendFormat(" {0} [label=\"{1} Rank\"]", name, node.Function);
            }

            return name;
        }