コード例 #1
0
        private static IWorkshopTree CallInlineRecursive(MethodBuilder builder, DefinedMethod method, MethodCall call, ActionSet callerSet)
        {
            RecursiveStack lastCall = RecursiveStack.GetRecursiveCall(callerSet.Translate.MethodStack, method);

            if (lastCall == null)
            {
                RecursiveStack parser = new RecursiveStack(builder);
                callerSet.Translate.MethodStack.Add(parser);
                parser.ParseCall(call);
                callerSet.Translate.MethodStack.Remove(parser);

                return(builder.ReturnHandler.GetReturnedValue());
            }
            else
            {
                lastCall.RecursiveCall(call, callerSet);
                return(lastCall.Builder.ReturnHandler.GetReturnedValue());
            }
        }
コード例 #2
0
        public static IWorkshopTree Call(DefinedMethod method, MethodCall call, ActionSet actionSet)
        {
            RecursiveStack lastCall = actionSet.Translate.MethodStack.FirstOrDefault(ms => ms.Function == method) as RecursiveStack;

            if (lastCall == null)
            {
                RecursiveStack parser = new RecursiveStack(method);

                actionSet.Translate.MethodStack.Add(parser);
                var result = parser.ParseCall(actionSet, call);
                actionSet.Translate.MethodStack.Remove(parser);

                return(result);
            }
            else
            {
                return(lastCall.RecursiveCall(actionSet, call));
            }
        }