Пример #1
0
        /// <summary>
        ///     Performs a synchronous compilation
        /// </summary>
        /// <param name="rebuild"></param>
        /// <param name="silent"></param>
        public void Compile_Synchronous(bool rebuild, bool silent = false)
        {
            Options = new CompilationOptions(rebuild, silent);
            ModelElement.DontRaiseError(Options.SilentCompile, () =>
            {
                try
                {
                    // Clears all caches
                    FinderRepository.INSTANCE.ClearCache();

                    // Initialises the declared elements
                    // ReSharper disable once UnusedVariable
                    CleanBeforeCompilation clean_before_compilation = new CleanBeforeCompilation(Options, true);

                    // Create the update information
                    // ReSharper disable once UnusedVariable
                    FindUpdates find_updates = new FindUpdates();

                    // Unifies the state machines and structure according to the update information
                    // ReSharper disable once UnusedVariable
                    Unify unify = new Unify();

                    // Compiles each expression and each statement encountered in the nodes
                    foreach (Dictionary dictionary in EfsSystem.Instance.Dictionaries)
                    {
                        visit(dictionary, true);
                    }

                    if (Options.Rebuild)
                    {
                        CreateDependancy create_dependancy = new CreateDependancy();
                        if (create_dependancy.DependancyChange)
                        {
                            // ReSharper disable once UnusedVariable
                            FlattenDependancy flatten_dependancy = new FlattenDependancy();
                        }
                    }
                }
                catch (ThreadAbortException)
                {
                    EfsSystem.Instance.ShouldRebuild = true;
                }
                catch (Exception e)
                {
                    // TODO : I don't know what to do.
                    // Please, at least, don't remove this
                    Debugger.Break();
                    Console.WriteLine();
                    Console.WriteLine(e.Message);
                    Console.WriteLine(e.StackTrace);
                    Console.WriteLine();
                    EfsSystem.Instance.ShouldRebuild = true;
                }
            });
        }
Пример #2
0
        /// <summary>
        ///     Compiles or recompiles everything
        /// </summary>
        private void PerformCompile(CompilationOptions options)
        {
            ModelElement.DontRaiseError(options.SilentCompile, () =>
            {
                try
                {
                    // Clears all caches
                    FinderRepository.INSTANCE.ClearCache();

                    // Initialises the declared elements
                    CleanBeforeCompilation cleanBeforeCompilation = new CleanBeforeCompilation(options, true);

                    // Create the update information
                    FindUpdates findUpdates = new FindUpdates();

                    // Unifies the state machines and structure according to the update information
                    Unify unify = new Unify();

                    // Compiles each expression and each statement encountered in the nodes
                    foreach (Dictionary dictionary in EfsSystem.Instance.Dictionaries)
                    {
                        visit(dictionary, true);
                    }

                    if (options.Rebuild)
                    {
                        CreateDependancy createDependancy = new CreateDependancy();
                        if (createDependancy.DependancyChange)
                        {
                            FlattenDependancy flattenDependancy = new FlattenDependancy();
                        }
                    }
                }
                catch (Exception)
                {
                    // TODO : I don't know what to do.
                    // Please, at least, don't remove this
                    Debugger.Break();
                }
            });
        }
Пример #3
0
        /// <summary>
        ///     Performs a synchronous compilation
        /// </summary>
        /// <param name="rebuild"></param>
        /// <param name="silent"></param>
        public void Compile_Synchronous(bool rebuild, bool silent = false)
        {
            Options = new CompilationOptions (rebuild, silent);
            ModelElement.DontRaiseError(Options.SilentCompile, () =>
            {
                try
                {
                    // Clears all caches
                    FinderRepository.INSTANCE.ClearCache();

                    // Initialises the declared elements
                    // ReSharper disable once UnusedVariable
                    CleanBeforeCompilation clean_before_compilation = new CleanBeforeCompilation(Options, true);

                    // Create the update information
                    // ReSharper disable once UnusedVariable
                    FindUpdates find_updates = new FindUpdates();

                    // Unifies the state machines and structure according to the update information
                    // ReSharper disable once UnusedVariable
                    Unify unify = new Unify();

                    // Compiles each expression and each statement encountered in the nodes
                    foreach (Dictionary dictionary in EfsSystem.Instance.Dictionaries)
                    {
                        visit(dictionary, true);
                    }

                    if (Options.Rebuild)
                    {
                        CreateDependancy create_dependancy = new CreateDependancy();
                        if (create_dependancy.DependancyChange)
                        {
                            // ReSharper disable once UnusedVariable
                            FlattenDependancy flatten_dependancy = new FlattenDependancy();
                        }
                    }
                }
                catch (ThreadAbortException)
                {
                    EfsSystem.Instance.ShouldRebuild = true;
                }
                catch (Exception e)
                {
                    // TODO : I don't know what to do.
                    // Please, at least, don't remove this
                    Debugger.Break();
                    Console.WriteLine();
                    Console.WriteLine(e.Message);
                    Console.WriteLine(e.StackTrace);
                    Console.WriteLine();
                    EfsSystem.Instance.ShouldRebuild = true;
                }
            });
        }