예제 #1
0
            public IResolvelizeScope <WeakConstantBool, ISetUpValue> Run(IDefineMembers scope, IPopulateScopeContext context)
            {
                var boolType = context.TypeProblem.CreateTypeReference(new NameKey("bool"));
                var value    = context.TypeProblem.CreateValue(boolType);

                return(new ConstantBoolFinalizeScope(dub, value));
            }
예제 #2
0
            public IResolvelizeScope <WeakBlockDefinition, ISetUpScope> Run(IDefineMembers scope, IPopulateScopeContext context)
            {
                var myScope = context.TypeProblem.CreateScope(scope);

                return(new FinalizeScopeBlockDefinition(
                           myScope,
                           Elements.Select(x => x.Run(myScope, context)).ToArray()));
            }
예제 #3
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)));
            }
예제 #4
0
파일: NewEmpty.cs 프로젝트: rauldoblem/Tac
            public IResolvelizeScope <WeakEmptyInstance, ISetUpValue> Run(IDefineMembers scope, IPopulateScopeContext context)
            {
                var emptyType = context.TypeProblem.CreateTypeReference(new NameKey("empty"));
                var value     = context.TypeProblem.CreateValue(emptyType);

                return(new EmptyInstanceFinalizeScope(value));
            }
예제 #5
0
            public IResolvelizeScope <WeakMemberReference, ISetUpMember> Run(IDefineMembers scope, IPopulateScopeContext context)
            {
                var type   = this.type.Run(scope, context);
                var member = context.TypeProblem.CreateMember(memberName, type.SetUpSideNode.Key);


                return(new MemberDefinitionFinalizeScope(
                           memberName,
                           isReadonly,
                           type,
                           memberDefinitionBox, member));
            }
예제 #6
0
            public IResolvelizeScope <IWeakTypeReference, ISetUpType> Run(IDefineMembers scope, IPopulateScopeContext context)
            {
                var type = context.TypeProblem.CreateType(scope, key);

                scope.Type(type);
                // what the heck? these are not passed anywhere?
                elements.Select(x => x.Run(type, context)).ToArray();
                return(new TypeDefinitionFinalizeScope(
                           type,
                           definitionBox,
                           typeReferance,
                           key));
            }
예제 #7
0
 public IResolvelizeScope <TFrontendCodeElement> Run(IPopulatableScope scope, IPopulateScopeContext context)
 {
     return(new TrailingFinalizeScope(left.Run(scope, context), make));
 }
예제 #8
0
            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));
            }
예제 #9
0
            public IResolvelizeScope <WeakPathOperation> Run(IPopulatableScope scope, IPopulateScopeContext context)
            {
                left.GetReturnedType().HasMember(new NameKey(name));

                return(new WeakPathOperationFinalizeScope(
                           left.Run(scope, context),
                           name));
            }
예제 #10
0
파일: Member.cs 프로젝트: rauldoblem/Tac
            public IResolvelizeScope <WeakMemberReference, ISetUpMember> Run(IDefineMembers scope, IPopulateScopeContext context)
            {
                var nameKey = new NameKey(memberName);
                var member  = context.TypeProblem.CreateMember(nameKey);

                scope.Cast <ISetUpScope>().MightHaveMember(member);

                return(new MemberFinalizeScope(nameKey, member));
            }
예제 #11
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
                           ));
            }
예제 #12
0
            public IResolvelizeScope <WeakTypeReference, ISetUpTypeReference> Run(IDefineMembers scope, IPopulateScopeContext context)
            {
                var type = context.TypeProblem.CreateTypeReference(key);

                return(new TypeReferanceFinalizeScope(
                           key, type));
            }
예제 #13
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));
            }
예제 #14
0
            public IResolvelizeScope <WeakConstantString, ISetUpValue> Run(IDefineMembers scope, IPopulateScopeContext context)
            {
                var stringType = context.TypeProblem.CreateTypeReference(new NameKey("string"));
                var value      = context.TypeProblem.CreateValue(stringType);

                return(new ConstantStringFinalizeScope(str, value));
            }
예제 #15
0
            public IResolvelizeScope <WeakGenericTypeDefinition, ISetUpType> Run(IDefineMembers scope, IPopulateScopeContext context)
            {
                var myScope   = context.TypeProblem.CreateGenericType(scope, nameKey, genericParameters.Select(x => x.Key).ToArray());
                var nextLines = lines.Select(x => x.Run(myScope, context)).ToArray();

                return(new GenericTypeDefinitionFinalizeScope(nameKey, myScope, box, genericParameters, nextLines));
            }
예제 #16
0
            public IResolvelizeScope <WeakModuleDefinition, ISetUpObject> Run(IDefineMembers scope, IPopulateScopeContext context)
            {
                var myScope = context.TypeProblem.CreateObject(scope);

                return(new ModuleDefinitionFinalizeScope(
                           myScope,
                           elements.Select(x => x.Run(myScope, context)).ToArray(),
                           nameKey));
            }
예제 #17
0
 public IResolvelizeScope <TFrontendCodeElement, ISetUpValue> Run(IDefineMembers scope, IPopulateScopeContext context)
 {
     context.TypeProblem.CreateValue();
     return(new BinaryFinalizeScope(
                left.Run(scope, context),
                right.Run(scope, context),
                make));
 }