public LanguageConverter_VisualPascalABCPlugin(IWorkbench Workbench)
 {
     Languages       = LoadLanguages();
     currentLanguage = Languages[0];
     this.VisualEnvironmentCompiler = Workbench.VisualEnvironmentCompiler;
     //TextFormatter = new TextFormatter();
     TextFormatterForm        = new TextFormatterForm();
     TextFormatterForm.Plugin = this;
     TextFormatterForm.Init();
     VisualEnvironmentCompiler.StandartCompiler.OnChangeCompilerState += new PascalABCCompiler.ChangeCompilerStateEventDelegate(Compiler_OnChangeCompilerState);
 }
 public LanguageConverter_VisualPascalABCPlugin(IWorkbench Workbench)
 {
     Languages = LoadLanguages();
     currentLanguage = Languages[0];
     this.VisualEnvironmentCompiler = Workbench.VisualEnvironmentCompiler;
     //TextFormatter = new TextFormatter();
     TextFormatterForm = new TextFormatterForm();
     TextFormatterForm.Plugin = this;
     TextFormatterForm.Init();
     VisualEnvironmentCompiler.StandartCompiler.OnChangeCompilerState += new PascalABCCompiler.ChangeCompilerStateEventDelegate(Compiler_OnChangeCompilerState);
 }
        // стырено
        private List <ISemanticNodeConverter> LoadLanguages()
        {
            List <ISemanticNodeConverter> Langs = new List <ISemanticNodeConverter>();
            // директория этого плагина
            string        dir = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.FullyQualifiedName);
            DirectoryInfo di  = new DirectoryInfo(dir);

            FileInfo[] dllfiles = di.GetFiles("*LanguageConverter.dll");
            System.Reflection.Assembly asssembly = null;
            Type constr = null;
            ISemanticNodeConverter pc = null;

            foreach (FileInfo fi in dllfiles)
            {
                asssembly = System.Reflection.Assembly.LoadFile(fi.FullName);
                try
                {
                    if (asssembly != null && asssembly.FullName != System.Reflection.Assembly.GetExecutingAssembly().FullName)
                    {
                        Type[] types = asssembly.GetTypes();
                        foreach (Type type in types)
                        {
                            if (type.Name.IndexOf("SemanticNodeConverter") >= 0)
                            {
                                Object obj = Activator.CreateInstance(type);
                                if (obj is ISemanticNodeConverter)
                                {
                                    Langs.Add(obj as ISemanticNodeConverter);
                                }
                            }
                        }
                    }
                }
                catch (Exception e)
                {
                }
            }
            return(Langs);
        }
Ejemplo n.º 4
0
 public SemanticTreeVisitor(ISemanticNodeConverter _semanticNodeConverter)
 {
     ISemanticNodeConverter = _semanticNodeConverter;
 }