/// <summary>
 /// Verify if the function need to be renewed
 /// </summary>
 /// <param name="converter">language converter</param>
 /// <param name="curProc">process</param>
 /// <param name="newFunc">new function</param>
 /// <returns>true or false</returns>
 public static bool CheckNewMethod(ICodeConverter converter, IProcess curProc, IFunction newFunc)
 {
     return(curProc.HasChanged || !converter.ImplementedFunctions.Exists(new Predicate <IFunction>(delegate(IFunction func)
     {
         return newFunc.Equals(func) && newFunc.InstanceNumber != func.InstanceNumber;
     })));
 }
Beispiel #2
0
        public static bool IsEqualOrDescendant(this IFunction function, IFunction toFind)
        {
            if (function.Equals(toFind))
            {
                return(true);
            }

            while (function.Parent != null)
            {
                function = function.Parent;
                if (function.Equals(toFind))
                {
                    return(true);
                }
            }
            return(false);
        }
Beispiel #3
0
        public override IFunction Bind(IList <IFunction> parameters)
        {
            IFunction newleft  = this.left.Bind(parameters);
            IFunction newright = this.right.Bind(parameters);

            if (newleft.Equals(this.left) && newright.Equals(this.right))
            {
                return(this);
            }

            return(newleft.Apply(newright));
        }
        public override IFunction Bind(IList <IFunction> parameters)
        {
            IFunction newfirst  = this.first.Bind(parameters);
            IFunction newsecond = this.second.Bind(parameters);

            if (newfirst.Equals(this.first) && newsecond.Equals(this.second))
            {
                return(this);
            }

            return(new ComposeFunction(newfirst, newsecond));
        }