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
{ {
if (annotation == null) if (annotation == null)
throw new ArgumentNullException("annotation"); throw new ArgumentNullException("annotation");
if (this.IsNull)
throw new InvalidOperationException("Cannot add annotations to the null node");
retry: // Retry until successful retry: // Retry until successful
object oldAnnotation = Interlocked.CompareExchange(ref this.annotations, annotation, null); object oldAnnotation = Interlocked.CompareExchange(ref this.annotations, annotation, null);
if (oldAnnotation == null) { if (oldAnnotation == null) {

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

@ -10,6 +10,9 @@ namespace ICSharpCode.NRefactory.CSharp
/// </summary> /// </summary>
public interface IOutputFormatter public interface IOutputFormatter
{ {
void StartNode(AstNode node);
void EndNode(AstNode node);
/// <summary> /// <summary>
/// Writes an identifier. /// Writes an identifier.
/// If the identifier conflicts with a keyword, the output visitor will /// 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
WriteSpecialsUpToNode(node); WriteSpecialsUpToNode(node);
currentContainerNode = node; currentContainerNode = node;
positionStack.Push(node.FirstChild); positionStack.Push(node.FirstChild);
formatter.StartNode(node);
} }
object EndNode(AstNode node) object EndNode(AstNode node)
@ -76,6 +77,7 @@ namespace ICSharpCode.NRefactory.CSharp
Debug.Assert(pos == null || pos.Parent == node); Debug.Assert(pos == null || pos.Parent == node);
WriteSpecials(pos, null); WriteSpecials(pos, null);
currentContainerNode = node.Parent; currentContainerNode = node.Parent;
formatter.EndNode(node);
return null; return null;
} }
#endregion #endregion

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

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

Loading…
Cancel
Save