~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to external/nrefactory/ICSharpCode.NRefactory.VB/Ast/Comment.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
Import upstream version 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
 
2
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
 
3
 
 
4
using System;
 
5
using System.Collections;
 
6
using System.Collections.Generic;
 
7
using System.Diagnostics;
 
8
using System.Linq;
 
9
using System.Threading;
 
10
using ICSharpCode.NRefactory.PatternMatching;
 
11
using ICSharpCode.NRefactory.VB.Ast;
 
12
 
 
13
namespace ICSharpCode.NRefactory.VB
 
14
{
 
15
        public class Comment : AstNode
 
16
        {
 
17
                public bool IsDocumentationComment { get; set; }
 
18
                
 
19
                public bool StartsLine {
 
20
                        get;
 
21
                        set;
 
22
                }
 
23
                
 
24
                public string Content {
 
25
                        get;
 
26
                        set;
 
27
                }
 
28
                
 
29
                TextLocation startLocation;
 
30
                public override TextLocation StartLocation {
 
31
                        get { 
 
32
                                return startLocation;
 
33
                        }
 
34
                }
 
35
                
 
36
                TextLocation endLocation;
 
37
                public override TextLocation EndLocation {
 
38
                        get {
 
39
                                return endLocation;
 
40
                        }
 
41
                }
 
42
                
 
43
                public Comment (string content, bool isDocumentation = false)
 
44
                {
 
45
                        this.IsDocumentationComment = isDocumentation;
 
46
                        this.Content = content;
 
47
                }
 
48
                
 
49
                public Comment (bool isDocumentation, TextLocation startLocation, TextLocation endLocation)
 
50
                {
 
51
                        this.IsDocumentationComment = isDocumentation;
 
52
                        this.startLocation = startLocation;
 
53
                        this.endLocation = endLocation;
 
54
                }
 
55
        
 
56
                public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)
 
57
                {
 
58
                        return visitor.VisitComment(this, data);
 
59
                }
 
60
                
 
61
                protected internal override bool DoMatch(AstNode other, PatternMatching.Match match)
 
62
                {
 
63
                        Comment o = other as Comment;
 
64
                        return o != null && this.IsDocumentationComment == o.IsDocumentationComment && MatchString(this.Content, o.Content);
 
65
                }
 
66
        }
 
67
}