Browse Source

Add hyperlink support to decompiler.

newNRvisualizers
Daniel Grunwald 15 years ago
parent
commit
a33009d98b
  1. 2
      ICSharpCode.NRefactory/CSharp/Ast/AstNode.cs
  2. 3
      ICSharpCode.NRefactory/CSharp/OutputVisitor/IOutputFormatter.cs
  3. 2
      ICSharpCode.NRefactory/CSharp/OutputVisitor/OutputVisitor.cs
  4. 8
      ICSharpCode.NRefactory/CSharp/OutputVisitor/TextWriterOutputFormatter.cs

2
ICSharpCode.NRefactory/CSharp/Ast/AstNode.cs

@ -448,6 +448,8 @@ namespace ICSharpCode.NRefactory.CSharp @@ -448,6 +448,8 @@ namespace ICSharpCode.NRefactory.CSharp
{
if (annotation == null)
throw new ArgumentNullException("annotation");
if (this.IsNull)
throw new InvalidOperationException("Cannot add annotations to the null node");
retry: // Retry until successful
object oldAnnotation = Interlocked.CompareExchange(ref this.annotations, annotation, null);
if (oldAnnotation == null) {

3
ICSharpCode.NRefactory/CSharp/OutputVisitor/IOutputFormatter.cs

@ -10,6 +10,9 @@ namespace ICSharpCode.NRefactory.CSharp @@ -10,6 +10,9 @@ namespace ICSharpCode.NRefactory.CSharp
/// </summary>
public interface IOutputFormatter
{
void StartNode(AstNode node);
void EndNode(AstNode node);
/// <summary>
/// Writes an identifier.
/// If the identifier conflicts with a keyword, the output visitor will

2
ICSharpCode.NRefactory/CSharp/OutputVisitor/OutputVisitor.cs

@ -67,6 +67,7 @@ namespace ICSharpCode.NRefactory.CSharp @@ -67,6 +67,7 @@ namespace ICSharpCode.NRefactory.CSharp
WriteSpecialsUpToNode(node);
currentContainerNode = node;
positionStack.Push(node.FirstChild);
formatter.StartNode(node);
}
object EndNode(AstNode node)
@ -76,6 +77,7 @@ namespace ICSharpCode.NRefactory.CSharp @@ -76,6 +77,7 @@ namespace ICSharpCode.NRefactory.CSharp
Debug.Assert(pos == null || pos.Parent == node);
WriteSpecials(pos, null);
currentContainerNode = node.Parent;
formatter.EndNode(node);
return null;
}
#endregion

8
ICSharpCode.NRefactory/CSharp/OutputVisitor/TextWriterOutputFormatter.cs

@ -107,5 +107,13 @@ namespace ICSharpCode.NRefactory.CSharp @@ -107,5 +107,13 @@ namespace ICSharpCode.NRefactory.CSharp
break;
}
}
public virtual void StartNode(AstNode node)
{
}
public virtual void EndNode(AstNode node)
{
}
}
}

Loading…
Cancel
Save