Exemplo n.º 1
0
        /// <summary>
        /// Devuelve true si el llamado es a una funcion hija.Es decir definidas a partir de la funcion actual
        /// </summary>
        /// <param name="code"></param>
        /// <returns></returns>
        private bool IsCallToMethodChild(ILCode code)
        {
            string       funCodeName  = _functionInvocation.CurrentScope.CurrentFunction.CodeName;
            TypeCodeInfo typeCodeInfo = code.GetWrapperAsociatteTo(funCodeName);

            return(typeCodeInfo.ContainMethodInLevel1(FunctionCodeName()));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Devuelve true si el llamado es a una funcion definida al mismo nivel del la funcion actual
        /// </summary>
        /// <param name="code"></param>
        /// <returns></returns>
        private bool IsCallRecursiveOrMethodBrother(ILCode code)
        {
            string       funParentCodeName = _functionInvocation.CurrentScope.CurrentFunction.FunctionParent.CodeName;
            TypeCodeInfo typeCodeInfo      = code.GetWrapperAsociatteTo(funParentCodeName);

            return(typeCodeInfo.ContainMethodInLevel1(FunctionCodeName()));
        }
Exemplo n.º 3
0
        private void GenerateCodeForCallMethodParent(ILCode code)
        {
            ILGenerator il = code.Method.GetILGenerator();

            string       parentOfCurrentFunction = _functionInvocation.CurrentScope.CurrentFunction.FunctionParent.CodeName;
            TypeCodeInfo parentWrapper           = code.GetWrapperAsociatteTo(parentOfCurrentFunction);

            il.Emit(OpCodes.Ldarg_0);
            while (parentWrapper != null && !parentWrapper.ContainMethodInLevel1(FunctionCodeName()))
            {
                il.Emit(OpCodes.Ldfld, parentWrapper.GetField(parentWrapper.FieldNameOfParent));
                parentWrapper = parentWrapper.Parent;
            }
            //lo proximo seria llamar al metodo
        }