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)
7
namespace ICSharpCode.NRefactory.VB.Ast
9
public class SelectStatement : Statement
11
public Expression Expression {
12
get { return GetChildByRole(Roles.Expression); }
13
set { SetChildByRole(Roles.Expression, value); }
16
public AstNodeCollection<CaseStatement> Cases {
17
get { return GetChildrenByRole(CaseStatement.CaseStatementRole); }
20
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match)
22
throw new NotImplementedException();
25
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data)
27
return visitor.VisitSelectStatement(this, data);
31
public class CaseStatement : Statement
33
public static readonly Role<CaseStatement> CaseStatementRole = new Role<CaseStatement>("CaseStatement");
35
public AstNodeCollection<CaseClause> Clauses {
36
get { return GetChildrenByRole(CaseClause.CaseClauseRole); }
39
public BlockStatement Body {
40
get { return GetChildByRole(Roles.Body); }
41
set { SetChildByRole(Roles.Body, value); }
44
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match)
46
throw new NotImplementedException();
49
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data)
51
return visitor.VisitCaseStatement(this, data);
55
public abstract class CaseClause : AstNode
58
public new static readonly CaseClause Null = new NullCaseClause();
60
sealed class NullCaseClause : CaseClause
62
public override bool IsNull {
68
public override S AcceptVisitor<T, S> (IAstVisitor<T, S> visitor, T data)
73
protected internal override bool DoMatch(AstNode other, PatternMatching.Match match)
75
return other == null || other.IsNull;
80
public static readonly Role<CaseClause> CaseClauseRole = new Role<CaseClause>("CaseClause", CaseClause.Null);
82
public Expression Expression {
83
get { return GetChildByRole(Roles.Expression); }
84
set { SetChildByRole(Roles.Expression, value); }
88
public class SimpleCaseClause : CaseClause
90
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match)
92
throw new NotImplementedException();
95
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data)
97
return visitor.VisitSimpleCaseClause(this, data);
101
public class RangeCaseClause : CaseClause
103
public static readonly Role<Expression> ToExpressionRole = ForStatement.ToExpressionRole;
105
public Expression ToExpression {
106
get { return GetChildByRole(ToExpressionRole); }
107
set { SetChildByRole(ToExpressionRole, value); }
110
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match)
112
throw new NotImplementedException();
115
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data)
117
return visitor.VisitRangeCaseClause(this, data);
121
public class ComparisonCaseClause : CaseClause
123
public static readonly Role<VBTokenNode> OperatorRole = BinaryOperatorExpression.OperatorRole;
125
public ComparisonOperator Operator { get; set; }
127
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match)
129
throw new NotImplementedException();
132
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data)
134
return visitor.VisitComparisonCaseClause(this, data);
138
public enum ComparisonOperator
140
Equality = BinaryOperatorType.Equality,
141
InEquality = BinaryOperatorType.InEquality,
142
LessThan = BinaryOperatorType.LessThan,
143
GreaterThan = BinaryOperatorType.GreaterThan,
144
LessThanOrEqual = BinaryOperatorType.LessThanOrEqual,
145
GreaterThanOrEqual = BinaryOperatorType.GreaterThanOrEqual