|
|
|
|
@ -1586,15 +1586,15 @@ namespace ICSharpCode.NRefactory.Ast {
@@ -1586,15 +1586,15 @@ namespace ICSharpCode.NRefactory.Ast {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public bool HasRemoveRegion { |
|
|
|
|
public bool HasAddRegion { |
|
|
|
|
get { |
|
|
|
|
return !removeRegion.IsNull; |
|
|
|
|
return !addRegion.IsNull; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public bool HasAddRegion { |
|
|
|
|
public bool HasRemoveRegion { |
|
|
|
|
get { |
|
|
|
|
return !addRegion.IsNull; |
|
|
|
|
return !removeRegion.IsNull; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -2250,18 +2250,18 @@ namespace ICSharpCode.NRefactory.Ast {
@@ -2250,18 +2250,18 @@ namespace ICSharpCode.NRefactory.Ast {
|
|
|
|
|
elseIfSections = new List<ElseIfSection>(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public bool HasElseIfSections { |
|
|
|
|
get { |
|
|
|
|
return elseIfSections.Count > 0; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public IfElseStatement(Expression condition, Statement trueStatement) |
|
|
|
|
: this(condition) { |
|
|
|
|
this.trueStatement.Add(Statement.CheckNull(trueStatement)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public bool HasElseIfSections { |
|
|
|
|
get { |
|
|
|
|
return elseIfSections.Count > 0; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public IfElseStatement(Expression condition, Statement trueStatement, Statement falseStatement) |
|
|
|
|
: this(condition) { |
|
|
|
|
@ -2388,12 +2388,6 @@ namespace ICSharpCode.NRefactory.Ast {
@@ -2388,12 +2388,6 @@ namespace ICSharpCode.NRefactory.Ast {
|
|
|
|
|
setRegion = PropertySetRegion.Null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public bool IsWriteOnly { |
|
|
|
|
get { |
|
|
|
|
return !HasGetRegion && HasSetRegion; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public bool IsReadOnly { |
|
|
|
|
get { |
|
|
|
|
return HasGetRegion && !HasSetRegion; |
|
|
|
|
@ -2406,6 +2400,12 @@ namespace ICSharpCode.NRefactory.Ast {
@@ -2406,6 +2400,12 @@ namespace ICSharpCode.NRefactory.Ast {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public bool IsWriteOnly { |
|
|
|
|
get { |
|
|
|
|
return !HasGetRegion && HasSetRegion; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public bool HasSetRegion { |
|
|
|
|
get { |
|
|
|
|
return !setRegion.IsNull; |
|
|
|
|
@ -3272,15 +3272,21 @@ namespace ICSharpCode.NRefactory.Ast {
@@ -3272,15 +3272,21 @@ namespace ICSharpCode.NRefactory.Ast {
|
|
|
|
|
setRegion = PropertySetRegion.Null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public bool HasGetRegion { |
|
|
|
|
public bool IsWriteOnly { |
|
|
|
|
get { |
|
|
|
|
return !getRegion.IsNull; |
|
|
|
|
return !HasGetRegion && HasSetRegion; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public bool HasSetRegion { |
|
|
|
|
get { |
|
|
|
|
return !setRegion.IsNull; |
|
|
|
|
|
|
|
|
|
internal PropertyDeclaration(string name, TypeReference typeReference, Modifiers modifier, List<AttributeSection> attributes) : this(modifier, attributes, name, null) |
|
|
|
|
{ |
|
|
|
|
this.TypeReference = typeReference; |
|
|
|
|
if ((modifier & Modifiers.ReadOnly) != Modifiers.ReadOnly) { |
|
|
|
|
this.SetRegion = new PropertySetRegion(null, null); |
|
|
|
|
} |
|
|
|
|
if ((modifier & Modifiers.WriteOnly) != Modifiers.WriteOnly) { |
|
|
|
|
this.GetRegion = new PropertyGetRegion(null, null); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -3290,21 +3296,15 @@ namespace ICSharpCode.NRefactory.Ast {
@@ -3290,21 +3296,15 @@ namespace ICSharpCode.NRefactory.Ast {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public bool IsWriteOnly { |
|
|
|
|
public bool HasGetRegion { |
|
|
|
|
get { |
|
|
|
|
return !HasGetRegion && HasSetRegion; |
|
|
|
|
return !getRegion.IsNull; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
internal PropertyDeclaration(string name, TypeReference typeReference, Modifiers modifier, List<AttributeSection> attributes) : this(modifier, attributes, name, null) |
|
|
|
|
{ |
|
|
|
|
this.TypeReference = typeReference; |
|
|
|
|
if ((modifier & Modifiers.ReadOnly) != Modifiers.ReadOnly) { |
|
|
|
|
this.SetRegion = new PropertySetRegion(null, null); |
|
|
|
|
} |
|
|
|
|
if ((modifier & Modifiers.WriteOnly) != Modifiers.WriteOnly) { |
|
|
|
|
this.GetRegion = new PropertyGetRegion(null, null); |
|
|
|
|
public bool HasSetRegion { |
|
|
|
|
get { |
|
|
|
|
return !setRegion.IsNull; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -3449,7 +3449,7 @@ namespace ICSharpCode.NRefactory.Ast {
@@ -3449,7 +3449,7 @@ namespace ICSharpCode.NRefactory.Ast {
|
|
|
|
|
|
|
|
|
|
QueryExpressionFromClause fromClause; |
|
|
|
|
|
|
|
|
|
List<QueryExpressionClause> fromOrWhereClauses; |
|
|
|
|
List<QueryExpressionClause> fromLetWhereClauses; |
|
|
|
|
|
|
|
|
|
List<QueryExpressionOrdering> orderings; |
|
|
|
|
|
|
|
|
|
@ -3467,12 +3467,12 @@ namespace ICSharpCode.NRefactory.Ast {
@@ -3467,12 +3467,12 @@ namespace ICSharpCode.NRefactory.Ast {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public List<QueryExpressionClause> FromOrWhereClauses { |
|
|
|
|
public List<QueryExpressionClause> FromLetWhereClauses { |
|
|
|
|
get { |
|
|
|
|
return fromOrWhereClauses; |
|
|
|
|
return fromLetWhereClauses; |
|
|
|
|
} |
|
|
|
|
set { |
|
|
|
|
fromOrWhereClauses = value ?? new List<QueryExpressionClause>(); |
|
|
|
|
fromLetWhereClauses = value ?? new List<QueryExpressionClause>(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -3507,7 +3507,7 @@ namespace ICSharpCode.NRefactory.Ast {
@@ -3507,7 +3507,7 @@ namespace ICSharpCode.NRefactory.Ast {
|
|
|
|
|
|
|
|
|
|
public QueryExpression() { |
|
|
|
|
fromClause = QueryExpressionFromClause.Null; |
|
|
|
|
fromOrWhereClauses = new List<QueryExpressionClause>(); |
|
|
|
|
fromLetWhereClauses = new List<QueryExpressionClause>(); |
|
|
|
|
orderings = new List<QueryExpressionOrdering>(); |
|
|
|
|
selectOrGroupClause = QueryExpressionClause.Null; |
|
|
|
|
intoClause = QueryExpressionIntoClause.Null; |
|
|
|
|
@ -3524,8 +3524,8 @@ namespace ICSharpCode.NRefactory.Ast {
@@ -3524,8 +3524,8 @@ namespace ICSharpCode.NRefactory.Ast {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public override string ToString() { |
|
|
|
|
return string.Format("[QueryExpression FromClause={0} FromOrWhereClauses={1} Orderings={2} SelectOrGrou" + |
|
|
|
|
"pClause={3} IntoClause={4}]", FromClause, GetCollectionString(FromOrWhereClauses), GetCollectionString(Orderings), SelectOrGroupClause, IntoClause); |
|
|
|
|
return string.Format("[QueryExpression FromClause={0} FromLetWhereClauses={1} Orderings={2} SelectOrGro" + |
|
|
|
|
"upClause={3} IntoClause={4}]", FromClause, GetCollectionString(FromLetWhereClauses), GetCollectionString(Orderings), SelectOrGroupClause, IntoClause); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -3582,21 +3582,9 @@ namespace ICSharpCode.NRefactory.Ast {
@@ -3582,21 +3582,9 @@ namespace ICSharpCode.NRefactory.Ast {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public class QueryExpressionFromClause : QueryExpressionClause { |
|
|
|
|
|
|
|
|
|
List<QueryExpressionFromGenerator> generators; |
|
|
|
|
|
|
|
|
|
public List<QueryExpressionFromGenerator> Generators { |
|
|
|
|
get { |
|
|
|
|
return generators; |
|
|
|
|
} |
|
|
|
|
set { |
|
|
|
|
generators = value ?? new List<QueryExpressionFromGenerator>(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
public class QueryExpressionFromClause : QueryExpressionFromOrJoinClause { |
|
|
|
|
|
|
|
|
|
public QueryExpressionFromClause() { |
|
|
|
|
generators = new List<QueryExpressionFromGenerator>(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public new static QueryExpressionFromClause Null { |
|
|
|
|
@ -3610,7 +3598,7 @@ namespace ICSharpCode.NRefactory.Ast {
@@ -3610,7 +3598,7 @@ namespace ICSharpCode.NRefactory.Ast {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public override string ToString() { |
|
|
|
|
return string.Format("[QueryExpressionFromClause Generators={0}]", GetCollectionString(Generators)); |
|
|
|
|
return string.Format("[QueryExpressionFromClause Type={0} Identifier={1} InExpression={2}]", Type, Identifier, InExpression); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -3633,12 +3621,23 @@ namespace ICSharpCode.NRefactory.Ast {
@@ -3633,12 +3621,23 @@ namespace ICSharpCode.NRefactory.Ast {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public class QueryExpressionFromGenerator : AbstractNode { |
|
|
|
|
public abstract class QueryExpressionFromOrJoinClause : QueryExpressionClause { |
|
|
|
|
|
|
|
|
|
TypeReference type; |
|
|
|
|
|
|
|
|
|
string identifier; |
|
|
|
|
|
|
|
|
|
Expression inExpression; |
|
|
|
|
|
|
|
|
|
public TypeReference Type { |
|
|
|
|
get { |
|
|
|
|
return type; |
|
|
|
|
} |
|
|
|
|
set { |
|
|
|
|
type = value ?? TypeReference.Null; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public string Identifier { |
|
|
|
|
get { |
|
|
|
|
return identifier; |
|
|
|
|
@ -3657,19 +3656,6 @@ namespace ICSharpCode.NRefactory.Ast {
@@ -3657,19 +3656,6 @@ namespace ICSharpCode.NRefactory.Ast {
|
|
|
|
|
if (!inExpression.IsNull) inExpression.Parent = this; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public QueryExpressionFromGenerator() { |
|
|
|
|
identifier = "?"; |
|
|
|
|
inExpression = Expression.Null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public override object AcceptVisitor(IAstVisitor visitor, object data) { |
|
|
|
|
return visitor.VisitQueryExpressionFromGenerator(this, data); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public override string ToString() { |
|
|
|
|
return string.Format("[QueryExpressionFromGenerator Identifier={0} InExpression={1}]", Identifier, InExpression); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public class QueryExpressionGroupClause : QueryExpressionClause { |
|
|
|
|
@ -3776,6 +3762,98 @@ namespace ICSharpCode.NRefactory.Ast {
@@ -3776,6 +3762,98 @@ namespace ICSharpCode.NRefactory.Ast {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public class QueryExpressionJoinClause : QueryExpressionFromOrJoinClause { |
|
|
|
|
|
|
|
|
|
Expression onExpression; |
|
|
|
|
|
|
|
|
|
Expression equalsExpression; |
|
|
|
|
|
|
|
|
|
string intoIdentifier; |
|
|
|
|
|
|
|
|
|
public Expression OnExpression { |
|
|
|
|
get { |
|
|
|
|
return onExpression; |
|
|
|
|
} |
|
|
|
|
set { |
|
|
|
|
onExpression = value ?? Expression.Null; |
|
|
|
|
if (!onExpression.IsNull) onExpression.Parent = this; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public Expression EqualsExpression { |
|
|
|
|
get { |
|
|
|
|
return equalsExpression; |
|
|
|
|
} |
|
|
|
|
set { |
|
|
|
|
equalsExpression = value ?? Expression.Null; |
|
|
|
|
if (!equalsExpression.IsNull) equalsExpression.Parent = this; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public string IntoIdentifier { |
|
|
|
|
get { |
|
|
|
|
return intoIdentifier; |
|
|
|
|
} |
|
|
|
|
set { |
|
|
|
|
intoIdentifier = value ?? ""; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public QueryExpressionJoinClause() { |
|
|
|
|
onExpression = Expression.Null; |
|
|
|
|
equalsExpression = Expression.Null; |
|
|
|
|
intoIdentifier = ""; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public override object AcceptVisitor(IAstVisitor visitor, object data) { |
|
|
|
|
return visitor.VisitQueryExpressionJoinClause(this, data); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public override string ToString() { |
|
|
|
|
return string.Format("[QueryExpressionJoinClause OnExpression={0} EqualsExpression={1} IntoIdentifier={" + |
|
|
|
|
"2} Type={3} Identifier={4} InExpression={5}]", OnExpression, EqualsExpression, IntoIdentifier, Type, Identifier, InExpression); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public class QueryExpressionLetClause : QueryExpressionClause { |
|
|
|
|
|
|
|
|
|
string identifier; |
|
|
|
|
|
|
|
|
|
Expression expression; |
|
|
|
|
|
|
|
|
|
public string Identifier { |
|
|
|
|
get { |
|
|
|
|
return identifier; |
|
|
|
|
} |
|
|
|
|
set { |
|
|
|
|
identifier = string.IsNullOrEmpty(value) ? "?" : value; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public Expression Expression { |
|
|
|
|
get { |
|
|
|
|
return expression; |
|
|
|
|
} |
|
|
|
|
set { |
|
|
|
|
expression = value ?? Expression.Null; |
|
|
|
|
if (!expression.IsNull) expression.Parent = this; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public QueryExpressionLetClause() { |
|
|
|
|
identifier = "?"; |
|
|
|
|
expression = Expression.Null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public override object AcceptVisitor(IAstVisitor visitor, object data) { |
|
|
|
|
return visitor.VisitQueryExpressionLetClause(this, data); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public override string ToString() { |
|
|
|
|
return string.Format("[QueryExpressionLetClause Identifier={0} Expression={1}]", Identifier, Expression); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public class QueryExpressionOrdering : AbstractNode { |
|
|
|
|
|
|
|
|
|
Expression criteria; |
|
|
|
|
@ -4693,10 +4771,10 @@ public TypeReferenceExpression(string typeName) : this(new TypeReference(typeNam
@@ -4693,10 +4771,10 @@ public TypeReferenceExpression(string typeName) : this(new TypeReference(typeNam
|
|
|
|
|
Usings = usings; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public UsingDeclaration(string @namespace, TypeReference alias) { usings = new List<Using>(1); usings.Add(new Using(@namespace, alias)); } |
|
|
|
|
|
|
|
|
|
public UsingDeclaration(string @namespace) : this(@namespace, null) {} |
|
|
|
|
|
|
|
|
|
public UsingDeclaration(string @namespace, TypeReference alias) { usings = new List<Using>(1); usings.Add(new Using(@namespace, alias)); } |
|
|
|
|
|
|
|
|
|
public override object AcceptVisitor(IAstVisitor visitor, object data) { |
|
|
|
|
return visitor.VisitUsingDeclaration(this, data); |
|
|
|
|
} |
|
|
|
|
@ -4871,15 +4949,15 @@ public UsingDeclaration(string @namespace) : this(@namespace, null) {}
@@ -4871,15 +4949,15 @@ public UsingDeclaration(string @namespace) : this(@namespace, null) {}
|
|
|
|
|
Statement = statement; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public bool IsYieldBreak { |
|
|
|
|
public bool IsYieldReturn { |
|
|
|
|
get { |
|
|
|
|
return statement is BreakStatement; |
|
|
|
|
return statement is ReturnStatement; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public bool IsYieldReturn { |
|
|
|
|
public bool IsYieldBreak { |
|
|
|
|
get { |
|
|
|
|
return statement is ReturnStatement; |
|
|
|
|
return statement is BreakStatement; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|