Exemple #1
0
        public static AbstractRenderer Get(string language, AbstractCompiler compiler, IRendererExtension rendererExtension)
        {
            switch (language.ToLower())
            {
            case "c#": return(null);   //new CSharpRenderer(compiler, renderPlugin);

            case "php": return(null);  //new PhpRenderer(compiler, renderPlugin);

            default: return(null);
            }
        }
Exemple #2
0
 protected AbstractRenderer(AbstractCompiler compiler, IRendererExtension rendererExtension)
 {
     _indentLevel       = 0;
     _compiler          = compiler;
     _rendererExtension = rendererExtension;
 }
Exemple #3
0
 public CSharpRenderer(AbstractCompiler compiler, IRendererExtension rendererExtension) : base(compiler, rendererExtension)
 {
 }
 public PhpClass(AbstractNamespace ns, T root, AbstractCompiler compiler) : base(ns, root, compiler)
 {
 }
Exemple #5
0
        /// <summary>
        /// Выполнение инициализации компилятора
        /// </summary>
        /// <param name="ModelingLanguage"></param>
        private void LoadCompiler(ModelingLanguage ModelingLanguage)
        {
            switch (ModelingLanguage)
            {
            case ModelingLanguage.VHDL_GHDL:
                compiler = new GHDLCompiler();
                break;

            case ModelingLanguage.VHDL:
            {
                Schematix.Core.UserControls.ProgressWindow.Window.RunProcess(
                    new MyBackgroundWorker(
                        new Action(() =>
                    {
                        try
                        {
                            // Start process
                            compiler = new VHDLCompiler(SchematixCore.ProcessDirectory);
                            compiler.CollectionChangedEvent += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(messages_CollectionChanged);
                            PrepareCompilator();
                            UpdateFileList();
                        }
                        catch (Exception ex)
                        {
                            Schematix.Core.Logger.Log.Error("Load compile error.", ex);
                            MessageBox.Show(string.Format("Load compile error. Message: {0}", ex.Message), "Error :(", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        }
                        catch
                        {
                            MessageBox.Show("Some Error");
                        }
                    }),
                        new Action(() =>
                    {
                    }), "Initializing Compiler for VHDL..."));
            }
            break;

            case ModelingLanguage.VHDL_Combined:
            {
                Schematix.Core.UserControls.ProgressWindow.Window.RunProcess(
                    new MyBackgroundWorker(
                        new Action(() =>
                    {
                        try
                        {
                            // Start process
                            compiler = new CombinedCompiler(SchematixCore.ProcessDirectory);
                            compiler.CollectionChangedEvent += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(messages_CollectionChanged);
                            PrepareCompilator();
                            UpdateFileList();
                        }
                        catch (Exception ex)
                        {
                            Schematix.Core.Logger.Log.Error("Load compile error.", ex);
                            MessageBox.Show(string.Format("Load compile error. Message: {0}", ex.Message), "Error :(", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        }
                        catch
                        {
                            MessageBox.Show("Some Error");
                        }
                    }),
                        new Action(() =>
                    {
                    }), "Initializing Compiler for VHDL..."));
            }
            break;

            case ModelingLanguage.Verilog:
                throw new Exception("This Compiler Doe's not support yet");

            case ModelingLanguage.SystemC:
                throw new Exception("This Compiler Doe's not support yet");
            }
        }
 public AbstractRenderer GetRenderer(AbstractCompiler compiler, IRendererExtension rendererExtension)
 {
     return(new PhpRenderer(compiler, rendererExtension));
 }