Beispiel #1
0
        public override MocTransformManager GenerateMocTransformManager(
            CompileSpecification compileSpecification,
            DfirRoot sourceDfir,
            CompileCancellationToken cancellationToken)
        {
            var semanticAnalysisTransforms = new List <IDfirTransformBase>()
            {
                new CreateTypeDiagramNodeFacadesTransform(),
                new UnifyTypesAcrossWiresTransform(),
                new ValidateTypeUsagesTransform(),
                new ReflectVariablesToTerminalsTransform(),
                new StandardTypeReflectionTransform()
            };

            ReflectErrorsTransform.AddErrorReflection(semanticAnalysisTransforms, CompilePhase.SemanticAnalysis);

            var toTargetDfirTransforms = new List <IDfirTransformBase>()
            {
            };

            return(new StandardMocTransformManager(
                       compileSpecification,
                       sourceDfir,
                       semanticAnalysisTransforms,
                       toTargetDfirTransforms,
                       _host.GetSharedExportedValue <ScheduledActivityManager>()));
        }
Beispiel #2
0
        public override MocTransformManager GenerateMocTransformManager(
            CompileSpecification compileSpecification,
            DfirRoot sourceDfir,
            CompileCancellationToken cancellationToken)
        {
            TerminalTypeUnificationResults unificationResults          = new TerminalTypeUnificationResults();
            LifetimeVariableAssociation    lifetimeVariableAssociation = new LifetimeVariableAssociation();
            List <IDfirTransformBase>      semanticAnalysisTransforms  = new List <IDfirTransformBase>()
            {
                new CreateNodeFacadesTransform(),
                new MergeVariablesAcrossWiresTransform(lifetimeVariableAssociation, unificationResults),
                new FinalizeAutoBorrowsTransform(),
                new MarkConsumedVariablesTransform(lifetimeVariableAssociation),
                new ValidateVariableUsagesTransform(unificationResults),
                new ReflectVariablesToTerminalsTransform(),
            };

            if (RebarFeatureToggles.IsRebarTargetEnabled)
            {
                semanticAnalysisTransforms.Add(new RebarSupportedTargetTransform(SemanticAnalysisTargetInfo));
            }
            semanticAnalysisTransforms.Add(new StandardTypeReflectionTransform());
            ReflectErrorsTransform.AddErrorReflection(semanticAnalysisTransforms, CompilePhase.SemanticAnalysis);
            if (!RebarFeatureToggles.IsRebarTargetEnabled)
            {
                semanticAnalysisTransforms.Add(new EmptyTargetDfirTransform());
            }

            var nodeInsertionTypeUnificationResultFactory    = new NodeInsertionTypeUnificationResultFactory();
            List <IDfirTransformBase> toTargetDfirTransforms = new List <IDfirTransformBase>()
            {
                new AutoBorrowTransform(lifetimeVariableAssociation),
                new InsertTerminateLifetimeTransform(lifetimeVariableAssociation, nodeInsertionTypeUnificationResultFactory),
                new InsertDropTransform(lifetimeVariableAssociation, nodeInsertionTypeUnificationResultFactory),
            };

            return(new StandardMocTransformManager(
                       compileSpecification,
                       sourceDfir,
                       semanticAnalysisTransforms,
                       toTargetDfirTransforms,
                       _host.GetSharedExportedValue <ScheduledActivityManager>()));
        }