Browse Source

Add some documentation comments.

pull/37/head
Daniel Grunwald 15 years ago
parent
commit
81e08ade79
  1. 3
      ICSharpCode.Decompiler/Ast/Transforms/ConvertConstructorCallIntoInitializer.cs
  2. 1
      ICSharpCode.Decompiler/Ast/Transforms/DelegateConstruction.cs
  3. 2
      ICSharpCode.Decompiler/Ast/Transforms/UsingStatementTransform.cs
  4. 13
      NRefactory/ICSharpCode.NRefactory/CSharp/Ast/AstNode.cs
  5. 3
      NRefactory/ICSharpCode.NRefactory/CSharp/Ast/PatternMatching/Backreference.cs
  6. 5
      NRefactory/ICSharpCode.NRefactory/CSharp/Ast/PatternMatching/Match.cs
  7. 3
      NRefactory/ICSharpCode.NRefactory/CSharp/Ast/PatternMatching/Pattern.cs

3
ICSharpCode.Decompiler/Ast/Transforms/ConvertConstructorCallIntoInitializer.cs

@ -8,6 +8,9 @@ using Mono.Cecil; @@ -8,6 +8,9 @@ using Mono.Cecil;
namespace Decompiler.Transforms
{
/// <summary>
/// If the first element of a constructor is a chained constructor call, convert it into a constructor initializer.
/// </summary>
public class ConvertConstructorCallIntoInitializer : DepthFirstAstVisitor<object, object>, IAstTransform
{
public override object VisitConstructorDeclaration(ConstructorDeclaration constructorDeclaration, object data)

1
ICSharpCode.Decompiler/Ast/Transforms/DelegateConstruction.cs

@ -14,6 +14,7 @@ namespace Decompiler.Transforms @@ -14,6 +14,7 @@ namespace Decompiler.Transforms
/// <summary>
/// Converts "new Action(obj, ldftn(func))" into "new Action(obj.func)".
/// For anonymous methods, creates an AnonymousMethodExpression.
/// Also gets rid of any "Display Classes" left over after inlining an anonymous method.
/// </summary>
public class DelegateConstruction : ContextTrackingVisitor
{

2
ICSharpCode.Decompiler/Ast/Transforms/UsingStatementTransform.cs

@ -10,7 +10,7 @@ using ICSharpCode.NRefactory.CSharp.PatternMatching; @@ -10,7 +10,7 @@ using ICSharpCode.NRefactory.CSharp.PatternMatching;
namespace Decompiler.Transforms
{
/// <summary>
/// Description of UsingStatementTransform.
/// Finds the expanded form of using statements using pattern matching and replaces it with a UsingStatement.
/// </summary>
public class UsingStatementTransform : IAstTransform
{

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

@ -578,6 +578,19 @@ namespace ICSharpCode.NRefactory.CSharp @@ -578,6 +578,19 @@ namespace ICSharpCode.NRefactory.CSharp
public abstract S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data);
#region Pattern Matching
/// <summary>
/// Performs a pattern matching operation.
/// <c>this</c> is the pattern, <paramref name="other"/> is the AST that is being matched.
/// </summary>
/// <returns>
/// If successful, a match object containing the matched groups.
/// If the match failed, returns <c>null</c>.
/// </returns>
/// <remarks>
/// Patterns are ASTs that contain special pattern nodes (from the PatternMatching namespace).
/// However, it is also possible to match two ASTs without any pattern nodes - doing so will produce an empty match object
/// if the two ASTs are structurally identical; or will return <c>null</c> if the ASTs are not identical.
/// </remarks>
public Match Match(AstNode other)
{
Match match = new Match();

3
NRefactory/ICSharpCode.NRefactory/CSharp/Ast/PatternMatching/Backreference.cs

@ -6,6 +6,9 @@ using System.Linq; @@ -6,6 +6,9 @@ using System.Linq;
namespace ICSharpCode.NRefactory.CSharp.PatternMatching
{
/// <summary>
/// Matches the last entry in the specified named group.
/// </summary>
public class Backreference : Pattern
{
readonly string referencedGroupName;

5
NRefactory/ICSharpCode.NRefactory/CSharp/Ast/PatternMatching/Match.cs

@ -7,7 +7,10 @@ using System.Linq; @@ -7,7 +7,10 @@ using System.Linq;
namespace ICSharpCode.NRefactory.CSharp.PatternMatching
{
public class Match
/// <summary>
/// Represents the result of a pattern matching operation.
/// </summary>
public sealed class Match
{
List<KeyValuePair<string, AstNode>> results = new List<KeyValuePair<string, AstNode>>();

3
NRefactory/ICSharpCode.NRefactory/CSharp/Ast/PatternMatching/Pattern.cs

@ -5,6 +5,9 @@ using System; @@ -5,6 +5,9 @@ using System;
namespace ICSharpCode.NRefactory.CSharp.PatternMatching
{
/// <summary>
/// Base class for all patterns.
/// </summary>
public abstract class Pattern : AstNode
{
public override NodeType NodeType {

Loading…
Cancel
Save