Browse Source

Add some documentation comments.

newNRvisualizers
Daniel Grunwald 15 years ago
parent
commit
13c64178db
  1. 13
      ICSharpCode.NRefactory/CSharp/Ast/AstNode.cs
  2. 3
      ICSharpCode.NRefactory/CSharp/Ast/PatternMatching/Backreference.cs
  3. 5
      ICSharpCode.NRefactory/CSharp/Ast/PatternMatching/Match.cs
  4. 3
      ICSharpCode.NRefactory/CSharp/Ast/PatternMatching/Pattern.cs

13
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
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
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
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