Ejemplo n.º 1
0
        EditorViewAdapterList _viewsCopy; //copy used in refresh loop; set to null when views are added/removed

        #endregion Fields

        #region Constructors

        public EditorAdapter(Compiler compiler)
        {
            _compiler = compiler;
              _context = new CompilerContext(_compiler);
              _scanner = compiler.Parser.Scanner;
              _scanner.BeginScan(_context);
              _parseTree = new ParseTree(String.Empty, "Source");
              _colorizerThread = new Thread(ColorizerLoop);
              _colorizerThread.IsBackground = true;
              _parserThread = new Thread(ParserLoop);
              _parserThread.IsBackground = true;
        }
Ejemplo n.º 2
0
 //Note: we don't actually parse in current version, only scan. Will implement full parsing in the future,
 // to support all intellisense operations
 private void ParseSource(String newText)
 {
     //Explicitly catch the case when new text is empty
       if (newText != string.Empty) {
     _parseTree = _compiler.ScanOnly(newText, "Source");
       }
       //notify views
       var views = GetViews();
       foreach (var view in views)
     view.UpdateParsedSource(_parseTree);
 }