|
|
|
@ -4,9 +4,9 @@ using System.Collections.Generic; |
|
|
|
namespace CppSharp.AST |
|
|
|
namespace CppSharp.AST |
|
|
|
{ |
|
|
|
{ |
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Raw comment kind.
|
|
|
|
/// Comment kind.
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
public enum RawCommentKind |
|
|
|
public enum CommentKind |
|
|
|
{ |
|
|
|
{ |
|
|
|
// Invalid comment.
|
|
|
|
// Invalid comment.
|
|
|
|
Invalid, |
|
|
|
Invalid, |
|
|
|
@ -53,7 +53,7 @@ namespace CppSharp.AST |
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Kind of the comment.
|
|
|
|
/// Kind of the comment.
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
public RawCommentKind Kind; |
|
|
|
public CommentKind Kind; |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Raw text of the comment.
|
|
|
|
/// Raw text of the comment.
|
|
|
|
@ -70,7 +70,7 @@ namespace CppSharp.AST |
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|
public bool IsInvalid |
|
|
|
public bool IsInvalid |
|
|
|
{ |
|
|
|
{ |
|
|
|
get { return Kind == RawCommentKind.Invalid; } |
|
|
|
get { return Kind == CommentKind.Invalid; } |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
@ -80,8 +80,8 @@ namespace CppSharp.AST |
|
|
|
{ |
|
|
|
{ |
|
|
|
get |
|
|
|
get |
|
|
|
{ |
|
|
|
{ |
|
|
|
return Kind == RawCommentKind.OrdinaryBCPL || |
|
|
|
return Kind == CommentKind.OrdinaryBCPL || |
|
|
|
Kind == RawCommentKind.OrdinaryC; |
|
|
|
Kind == CommentKind.OrdinaryC; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -127,55 +127,55 @@ namespace CppSharp.AST |
|
|
|
|
|
|
|
|
|
|
|
public abstract void Visit<T>(ICommentVisitor<T> visitor); |
|
|
|
public abstract void Visit<T>(ICommentVisitor<T> visitor); |
|
|
|
|
|
|
|
|
|
|
|
public static string GetMultiLineCommentPrologue(RawCommentKind kind) |
|
|
|
public static string GetMultiLineCommentPrologue(CommentKind kind) |
|
|
|
{ |
|
|
|
{ |
|
|
|
switch (kind) |
|
|
|
switch (kind) |
|
|
|
{ |
|
|
|
{ |
|
|
|
case RawCommentKind.OrdinaryBCPL: |
|
|
|
case CommentKind.OrdinaryBCPL: |
|
|
|
case RawCommentKind.BCPLExcl: |
|
|
|
case CommentKind.BCPLExcl: |
|
|
|
return "//"; |
|
|
|
return "//"; |
|
|
|
case RawCommentKind.OrdinaryC: |
|
|
|
case CommentKind.OrdinaryC: |
|
|
|
case RawCommentKind.JavaDoc: |
|
|
|
case CommentKind.JavaDoc: |
|
|
|
case RawCommentKind.Qt: |
|
|
|
case CommentKind.Qt: |
|
|
|
return " *"; |
|
|
|
return " *"; |
|
|
|
case RawCommentKind.BCPLSlash: |
|
|
|
case CommentKind.BCPLSlash: |
|
|
|
return "///"; |
|
|
|
return "///"; |
|
|
|
default: |
|
|
|
default: |
|
|
|
throw new ArgumentOutOfRangeException(); |
|
|
|
throw new ArgumentOutOfRangeException(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static string GetLineCommentPrologue(RawCommentKind kind) |
|
|
|
public static string GetLineCommentPrologue(CommentKind kind) |
|
|
|
{ |
|
|
|
{ |
|
|
|
switch (kind) |
|
|
|
switch (kind) |
|
|
|
{ |
|
|
|
{ |
|
|
|
case RawCommentKind.OrdinaryBCPL: |
|
|
|
case CommentKind.OrdinaryBCPL: |
|
|
|
case RawCommentKind.BCPLSlash: |
|
|
|
case CommentKind.BCPLSlash: |
|
|
|
return string.Empty; |
|
|
|
return string.Empty; |
|
|
|
case RawCommentKind.OrdinaryC: |
|
|
|
case CommentKind.OrdinaryC: |
|
|
|
return "/*"; |
|
|
|
return "/*"; |
|
|
|
case RawCommentKind.BCPLExcl: |
|
|
|
case CommentKind.BCPLExcl: |
|
|
|
return "//!"; |
|
|
|
return "//!"; |
|
|
|
case RawCommentKind.JavaDoc: |
|
|
|
case CommentKind.JavaDoc: |
|
|
|
return "/**"; |
|
|
|
return "/**"; |
|
|
|
case RawCommentKind.Qt: |
|
|
|
case CommentKind.Qt: |
|
|
|
return "/*!"; |
|
|
|
return "/*!"; |
|
|
|
default: |
|
|
|
default: |
|
|
|
throw new ArgumentOutOfRangeException(); |
|
|
|
throw new ArgumentOutOfRangeException(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static string GetLineCommentEpilogue(RawCommentKind kind) |
|
|
|
public static string GetLineCommentEpilogue(CommentKind kind) |
|
|
|
{ |
|
|
|
{ |
|
|
|
switch (kind) |
|
|
|
switch (kind) |
|
|
|
{ |
|
|
|
{ |
|
|
|
case RawCommentKind.OrdinaryBCPL: |
|
|
|
case CommentKind.OrdinaryBCPL: |
|
|
|
case RawCommentKind.BCPLSlash: |
|
|
|
case CommentKind.BCPLSlash: |
|
|
|
case RawCommentKind.BCPLExcl: |
|
|
|
case CommentKind.BCPLExcl: |
|
|
|
return string.Empty; |
|
|
|
return string.Empty; |
|
|
|
case RawCommentKind.OrdinaryC: |
|
|
|
case CommentKind.OrdinaryC: |
|
|
|
case RawCommentKind.JavaDoc: |
|
|
|
case CommentKind.JavaDoc: |
|
|
|
case RawCommentKind.Qt: |
|
|
|
case CommentKind.Qt: |
|
|
|
return " */"; |
|
|
|
return " */"; |
|
|
|
default: |
|
|
|
default: |
|
|
|
throw new ArgumentOutOfRangeException(); |
|
|
|
throw new ArgumentOutOfRangeException(); |
|
|
|
|