コード例 #1
0
            public IResolvelizeScope <WeakImplementationDefinition, ISetUpMethod> Run(IDefineMembers scope, IPopulateScopeContext context)
            {
                var outer = context.TypeProblem.CreateMethod(scope);

                var inner = context.TypeProblem.CreateMethod(outer);

                var realizeContext    = contextDefinition.Run(outer, context);
                var outerResultMember = context.TypeProblem.CreateMember(new ImplicitKey());
                var outerMethod       = outer.SetInputOutput(realizeContext.SetUpSideNode, outerResultMember);

                var parameter      = parameterDefinition.Run(scope, context);
                var outputResolves = output.Run(scope, context);

                var innerMethod = inner.SetInputOutput(parameter.SetUpSideNode, outputResolves.SetUpSideNode);

                outerMethod.AssignToReturns(innerMethod);

                return(new ImplementationDefinitionFinalizeScope(
                           outerMethod,
                           realizeContext,
                           parameter,
                           elements.Select(y => y.Run(innerMethod, context)).ToArray(),
                           outputResolves
                           ));
            }
コード例 #2
0
            public IResolvelizeScope <WeakAssignOperation> Run(IPopulatableScope scope, IPopulateScopeContext context)
            {
                left.GetReturnedType().AcceptsType(right.GetReturnedType());

                return(new WeakAssignOperationFinalizeScope(
                           left.Run(scope, context),
                           right.Run(scope, context)));
            }
コード例 #3
0
            public IResolvelizeScope <WeakPathOperation> Run(IPopulatableScope scope, IPopulateScopeContext context)
            {
                left.GetReturnedType().HasMember(new NameKey(name));

                return(new WeakPathOperationFinalizeScope(
                           left.Run(scope, context),
                           name));
            }
コード例 #4
0
ファイル: AbstractOperation.cs プロジェクト: rauldoblem/Tac
 public IResolvelizeScope <TFrontendCodeElement, ISetUpValue> Run(IDefineMembers scope, IPopulateScopeContext context)
 {
     context.TypeProblem.CreateValue();
     return(new BinaryFinalizeScope(
                left.Run(scope, context),
                right.Run(scope, context),
                make));
 }
コード例 #5
0
            public IResolvelizeScope <WeakMethodDefinition, ISetUpMethod> Run(IDefineMembers scope, IPopulateScopeContext context)
            {
                var methodBuilder = context.TypeProblem.CreateMethod(scope);

                var parameterResolve = parameterDefinition.Run(methodBuilder, context);

                methodBuilder.Member(parameterResolve.SetUpSideNode);
                var outputResolve = parameterDefinition.Run(methodBuilder, context);

                methodBuilder.Member(outputResolve.SetUpSideNode);
                var method = methodBuilder.SetInputOutput(parameterResolve.SetUpSideNode, outputResolve.SetUpSideNode);

                return(new MethodDefinitionFinalizeScope(
                           method,
                           parameterResolve,
                           elements.Select(x => x.Run(method, context)).ToArray(),
                           outputResolve,
                           isEntryPoint));
            }
コード例 #6
0
ファイル: AbstractOperation.cs プロジェクト: rauldoblem/Tac
            public IResolvelizeScope <IWeakTypeReference> Run(IPopulatableScope scope, IPopulateScopeContext context)
            {
                // TODO
                // this is something I don't much like
                // right runs first because of assign
                // in assign you might have something like
                // method [int;int] input { input < ? 2 if { 1 return; } else { input - 1 > fac * input return; } } =: fac
                // if the left runs first than fac will not be found
                // and so it will add it to the scope
                // but if the right is run first
                // fac works
                // if I add an assign that goes the other way...
                // this will break

                // part of me just thinks
                // force 'var' on member definition

                return(new BinaryFinalizeScope(
                           left.Run(scope, context),
                           right.Run(scope, context),
                           make));
            }
コード例 #7
0
 public IResolvelizeScope <TFrontendCodeElement> Run(IPopulatableScope scope, IPopulateScopeContext context)
 {
     return(new TrailingFinalizeScope(left.Run(scope, context), make));
 }