protected override void AddRealChunk(Chunk chunk)
            {
                var document       = csharpSyntaxMode.guiDocument;
                var parsedDocument = document != null ? document.ParsedDocument : null;

                if (parsedDocument != null && csharpSyntaxMode.SemanticHighlightingEnabled && csharpSyntaxMode.resolver != null)
                {
                    int    endLoc        = -1;
                    string semanticStyle = null;
                    if (spanParser.CurSpan != null && (spanParser.CurSpan.Rule == "Comment" || spanParser.CurSpan.Rule == "PreProcessorComment"))
                    {
                        base.AddRealChunk(chunk);
                        return;
                    }

                    try {
                        HighlightingVisitior visitor;
                        if (!csharpSyntaxMode.lineSegments.TryGetValue(line, out visitor))
                        {
                            var resolver = csharpSyntaxMode.resolver;
                            visitor = new HighlightingVisitior(resolver, default(CancellationToken), lineNumber, base.line.Offset, line.Length);
                            visitor.tree.InstallListener(doc);
                            resolver.RootNode.AcceptVisitor(visitor);
                            csharpSyntaxMode.lineSegments[line] = visitor;
                        }
                        string style;
                        if (visitor.tree.GetStyle(chunk, ref endLoc, out style))
                        {
                            semanticStyle = style;
                        }
                    } catch (Exception e) {
                        Console.WriteLine("Error in semantic highlighting: " + e);
                    }
                    if (semanticStyle != null)
                    {
                        if (endLoc < chunk.EndOffset)
                        {
                            base.AddRealChunk(new Chunk(chunk.Offset, endLoc - chunk.Offset, semanticStyle));
                            base.AddRealChunk(new Chunk(endLoc, chunk.EndOffset - endLoc, chunk.Style));
                            return;
                        }
                        chunk.Style = semanticStyle;
                    }
                }

                base.AddRealChunk(chunk);
            }