2
namespace ICSharpCode.NRefactory.CSharp
4
public enum NewLineType {
11
/// A New line node represents a line break in the text.
13
public abstract class NewLineNode : AstNode
15
public override NodeType NodeType {
17
return NodeType.Whitespace;
21
public abstract NewLineType NewLineType {
25
TextLocation startLocation;
26
public override TextLocation StartLocation {
32
public override TextLocation EndLocation {
34
return new TextLocation (startLocation.Line + 1, 1);
38
public NewLineNode() : this (TextLocation.Empty)
42
public NewLineNode(TextLocation startLocation)
44
this.startLocation = startLocation;
47
public override void AcceptVisitor(IAstVisitor visitor)
49
visitor.VisitNewLine (this);
52
public override T AcceptVisitor<T>(IAstVisitor<T> visitor)
54
return visitor.VisitNewLine (this);
57
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data)
59
return visitor.VisitNewLine (this, data);
63
public class UnixNewLine : NewLineNode
65
public override NewLineType NewLineType {
67
return NewLineType.Unix;
75
public UnixNewLine(TextLocation startLocation) : base (startLocation)
79
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match)
81
var o = other as UnixNewLine;
86
public class WindowsNewLine : NewLineNode
88
public override NewLineType NewLineType {
90
return NewLineType.Windows;
94
public WindowsNewLine()
98
public WindowsNewLine(TextLocation startLocation) : base (startLocation)
102
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match)
104
var o = other as WindowsNewLine;
109
public class MacNewLine : NewLineNode
111
public override NewLineType NewLineType {
113
return NewLineType.Mac;
121
public MacNewLine(TextLocation startLocation) : base (startLocation)
125
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match)
127
var o = other as MacNewLine;