Exemple #1
0
        public static string GetDescription(int pos, string content, int line, int col, string FileName, DomConverter dc, PascalABCCompiler.Parsers.Controller controller)
        {
            string expr_without_brackets = null;

            PascalABCCompiler.Parsers.KeywordKind keyw;
            var expr = CodeCompletion.CodeCompletionController.CurrentParser.LanguageInformation.FindExpressionFromAnyPosition(pos, content, line, col, out keyw, out expr_without_brackets);

            if (expr == null)
            {
                expr = expr_without_brackets;
            }
            var errors   = new List <PascalABCCompiler.Errors.Error>();
            var warnings = new List <CompilerWarning>();
            var tree     = controller.GetExpression("test" + Path.GetExtension(FileName), expr, errors, warnings);
            var desc     = dc.GetDescription(tree, FileName, expr_without_brackets, controller, line, col, keyw, false);

            return(desc);
        }
        public void Reload()
        {
            OnChangeCompilerState(this, CompilerState.Reloading, null);

            //А это что?
            TreeRealization.type_node tn = SystemLibrary.SystemLibrary.void_type;

            ClearAll();
            errorsList.Clear();
            Warnings.Clear();
            InternalDebug = new CompilerInternalDebug();
            ParsersController = new Parsers.Controller();
            ParsersController.ParserConnected += new PascalABCCompiler.Parsers.Controller.ParserConnectedDeleagte(ParsersController_ParserConnected);
            ParsersController.SourceFilesProvider = sourceFilesProvider;
            ParsersController.Reload();
            SyntaxTreeToSemanticTreeConverter = new TreeConverter.SyntaxTreeToSemanticTreeConverter();
            CodeGeneratorsController = new CodeGenerators.Controller();
            //PABCToCppCodeGeneratorsController = new PascalToCppConverter.Controller();
            SetSupportedSourceFiles();
            SetSupportedProjectFiles();

            syntaxTreeConvertersController = new SyntaxTreeConvertersController(this);
            syntaxTreeConvertersController.ChangeState += syntaxTreeConvertersController_ChangeState;
            syntaxTreeConvertersController.AddConverters();

            semanticTreeConvertersController = new SemanticTreeConvertersController(this);
            semanticTreeConvertersController.ChangeState += semanticTreeConvertersController_ChangeState;
            semanticTreeConvertersController.AddConverters();

            OnChangeCompilerState(this, CompilerState.Ready, null);    
        }