Beispiel #1
0
 public static ScopeBlock GetInstance()
 {
     if (instance == null)
     {
         instance = new ScopeBlock();
     }
     return(instance);
 }
Beispiel #2
0
 private static void AddPlugins()
 {
     mPlugins.Clear();
     mPlugins.Add(new ImportExportPlugin());
     mPlugins.Add(new TemplateInstantiationPlugin());
     mPlugins.Add(new CodeReplicationPlugin());
     mPlugins.Add(new ImportExportGroupsPlugin());
     mPlugins.Add(ScopeBlock.GetInstance());
 }
Beispiel #3
0
 public override void CacheForProcessing()
 {
     if (LoopDetection == true)
     {
         mError = true;
         Console.WriteLine("ERROR: Circular Reference detected within ScopeBlocks");
         return;
     }
     mLabels.CacheForProcessing();
     mTypes.CacheForProcessing();
     LoopDetection = true;
     foreach (var lTag in mScopes)
     {
         mScopeBodies.Add(ScopeBlock.GetInstance().GetScopeFromTag(lTag));
     }
     LoopDetection = false;
 }
Beispiel #4
0
        public void ImportSubScopes()
        {
            ScopeBlock lAllScopes = ScopeBlock.GetInstance();

            foreach (string lSubScope in mScopes)
            {
                lAllScopes.GetScopeFromTag(lSubScope).ImportSubScopes();
                var currScope = lAllScopes.GetScopeFromTag(lSubScope);
                foreach (var ltemptype in currScope.mTypes.templateType)
                {
                    if (!mTypes.templateType.Contains(ltemptype))
                    {
                        mTypes.templateType.Add(ltemptype);
                    }
                }
                if (mLabels.templateLabels == null)
                {
                    mLabels.templateLabels = new List <string>();
                }
                if (currScope.mLabels.templateLabels != null)
                {
                    foreach (var lTempLabel in currScope.mLabels.templateLabels)
                    {
                        if (!mLabels.templateLabels.Contains(lTempLabel))
                        {
                            mLabels.templateLabels.Add(lTempLabel);
                        }
                        foreach (var lLabelsets in currScope.mLabels.templateLabelSets)
                        {
                            if (!mLabels.templateLabelSets.Contains(lLabelsets))
                            {
                                mLabels.templateLabelSets.Add(lLabelsets);
                            }
                        }
                    }
                }
            }
        }