private void ParseGrammar( ) { richTextBox.AllowPaint = false; treeBFSstructure.BeginUpdate(); listViewErrorBox.BeginUpdate(); IBfsErrorHandler errorHandler = new ListViewErrorHandler(listViewErrorBox); string source = richTextBox.Text; listViewErrorBox.Items.Clear(); treeBFSstructure.Nodes.Clear(); Stopwatch timer = new Stopwatch(); timer.Start(); BinaryFileSchema schema = BfsCompiler.ParseBfs(source, errorHandler); timer.Stop(); if (schema != null) { errorHandler.HandleMessage("Parsed and processed in " + timer.ElapsedMilliseconds + " milliseconds (" + timer.ElapsedTicks + " ticks)"); IterateSchema(schema); SchemaColorizer.ColorizeSchema(schema, richTextBox); toolGenerateCode.Enabled = true; lastSchema = schema; } else toolGenerateCode.Enabled = false; richTextBox.AllowPaint = true; treeBFSstructure.EndUpdate(); listViewErrorBox.EndUpdate(); }