|
|
|
@ -1665,9 +1665,9 @@ namespace ICSharpCode.NRefactory.Ast {
@@ -1665,9 +1665,9 @@ namespace ICSharpCode.NRefactory.Ast {
|
|
|
|
|
initializer = Expression.Null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public bool HasRaiseRegion { |
|
|
|
|
public bool HasAddRegion { |
|
|
|
|
get { |
|
|
|
|
return !raiseRegion.IsNull; |
|
|
|
|
return !addRegion.IsNull; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1677,9 +1677,9 @@ namespace ICSharpCode.NRefactory.Ast {
@@ -1677,9 +1677,9 @@ namespace ICSharpCode.NRefactory.Ast {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public bool HasAddRegion { |
|
|
|
|
public bool HasRaiseRegion { |
|
|
|
|
get { |
|
|
|
|
return !addRegion.IsNull; |
|
|
|
|
return !raiseRegion.IsNull; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1983,6 +1983,15 @@ namespace ICSharpCode.NRefactory.Ast {
@@ -1983,6 +1983,15 @@ namespace ICSharpCode.NRefactory.Ast {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public TypeReference GetTypeForField(int fieldIndex) |
|
|
|
|
{ |
|
|
|
|
if (!typeReference.IsNull) { |
|
|
|
|
return typeReference; |
|
|
|
|
} |
|
|
|
|
return ((VariableDeclaration)Fields[fieldIndex]).TypeReference; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public VariableDeclaration GetVariableDeclaration(string variableName) |
|
|
|
|
{ |
|
|
|
|
foreach (VariableDeclaration variableDeclaration in Fields) { |
|
|
|
@ -1993,15 +2002,6 @@ namespace ICSharpCode.NRefactory.Ast {
@@ -1993,15 +2002,6 @@ namespace ICSharpCode.NRefactory.Ast {
|
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public TypeReference GetTypeForField(int fieldIndex) |
|
|
|
|
{ |
|
|
|
|
if (!typeReference.IsNull) { |
|
|
|
|
return typeReference; |
|
|
|
|
} |
|
|
|
|
return ((VariableDeclaration)Fields[fieldIndex]).TypeReference; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public override object AcceptVisitor(IAstVisitor visitor, object data) { |
|
|
|
|
return visitor.VisitFieldDeclaration(this, data); |
|
|
|
|
} |
|
|
|
@ -2459,147 +2459,6 @@ namespace ICSharpCode.NRefactory.Ast {
@@ -2459,147 +2459,6 @@ namespace ICSharpCode.NRefactory.Ast {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public class IndexerDeclaration : AttributedNode { |
|
|
|
|
|
|
|
|
|
List<ParameterDeclarationExpression> parameters; |
|
|
|
|
|
|
|
|
|
List<InterfaceImplementation> interfaceImplementations; |
|
|
|
|
|
|
|
|
|
TypeReference typeReference; |
|
|
|
|
|
|
|
|
|
Location bodyStart; |
|
|
|
|
|
|
|
|
|
Location bodyEnd; |
|
|
|
|
|
|
|
|
|
PropertyGetRegion getRegion; |
|
|
|
|
|
|
|
|
|
PropertySetRegion setRegion; |
|
|
|
|
|
|
|
|
|
public List<ParameterDeclarationExpression> Parameters { |
|
|
|
|
get { |
|
|
|
|
return parameters; |
|
|
|
|
} |
|
|
|
|
set { |
|
|
|
|
parameters = value ?? new List<ParameterDeclarationExpression>(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public List<InterfaceImplementation> InterfaceImplementations { |
|
|
|
|
get { |
|
|
|
|
return interfaceImplementations; |
|
|
|
|
} |
|
|
|
|
set { |
|
|
|
|
interfaceImplementations = value ?? new List<InterfaceImplementation>(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public TypeReference TypeReference { |
|
|
|
|
get { |
|
|
|
|
return typeReference; |
|
|
|
|
} |
|
|
|
|
set { |
|
|
|
|
typeReference = value ?? TypeReference.Null; |
|
|
|
|
if (!typeReference.IsNull) typeReference.Parent = this; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public Location BodyStart { |
|
|
|
|
get { |
|
|
|
|
return bodyStart; |
|
|
|
|
} |
|
|
|
|
set { |
|
|
|
|
bodyStart = value; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public Location BodyEnd { |
|
|
|
|
get { |
|
|
|
|
return bodyEnd; |
|
|
|
|
} |
|
|
|
|
set { |
|
|
|
|
bodyEnd = value; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public PropertyGetRegion GetRegion { |
|
|
|
|
get { |
|
|
|
|
return getRegion; |
|
|
|
|
} |
|
|
|
|
set { |
|
|
|
|
getRegion = value ?? PropertyGetRegion.Null; |
|
|
|
|
if (!getRegion.IsNull) getRegion.Parent = this; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public PropertySetRegion SetRegion { |
|
|
|
|
get { |
|
|
|
|
return setRegion; |
|
|
|
|
} |
|
|
|
|
set { |
|
|
|
|
setRegion = value ?? PropertySetRegion.Null; |
|
|
|
|
if (!setRegion.IsNull) setRegion.Parent = this; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public IndexerDeclaration(Modifiers modifier, List<ParameterDeclarationExpression> parameters, List<AttributeSection> attributes) { |
|
|
|
|
Modifier = modifier; |
|
|
|
|
Parameters = parameters; |
|
|
|
|
Attributes = attributes; |
|
|
|
|
interfaceImplementations = new List<InterfaceImplementation>(); |
|
|
|
|
typeReference = TypeReference.Null; |
|
|
|
|
bodyStart = Location.Empty; |
|
|
|
|
bodyEnd = Location.Empty; |
|
|
|
|
getRegion = PropertyGetRegion.Null; |
|
|
|
|
setRegion = PropertySetRegion.Null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public IndexerDeclaration(TypeReference typeReference, List<ParameterDeclarationExpression> parameters, Modifiers modifier, List<AttributeSection> attributes) { |
|
|
|
|
TypeReference = typeReference; |
|
|
|
|
Parameters = parameters; |
|
|
|
|
Modifier = modifier; |
|
|
|
|
Attributes = attributes; |
|
|
|
|
interfaceImplementations = new List<InterfaceImplementation>(); |
|
|
|
|
bodyStart = Location.Empty; |
|
|
|
|
bodyEnd = Location.Empty; |
|
|
|
|
getRegion = PropertyGetRegion.Null; |
|
|
|
|
setRegion = PropertySetRegion.Null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public bool HasSetRegion { |
|
|
|
|
get { |
|
|
|
|
return !setRegion.IsNull; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public bool IsReadOnly { |
|
|
|
|
get { |
|
|
|
|
return HasGetRegion && !HasSetRegion; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public bool IsWriteOnly { |
|
|
|
|
get { |
|
|
|
|
return !HasGetRegion && HasSetRegion; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public bool HasGetRegion { |
|
|
|
|
get { |
|
|
|
|
return !getRegion.IsNull; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public override object AcceptVisitor(IAstVisitor visitor, object data) { |
|
|
|
|
return visitor.VisitIndexerDeclaration(this, data); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public override string ToString() { |
|
|
|
|
return string.Format("[IndexerDeclaration Parameters={0} InterfaceImplementations={1} TypeReference={2}" + |
|
|
|
|
" BodyStart={3} BodyEnd={4} GetRegion={5} SetRegion={6} Attributes={7} Modifier={" + |
|
|
|
|
"8}]", GetCollectionString(Parameters), GetCollectionString(InterfaceImplementations), TypeReference, BodyStart, BodyEnd, GetRegion, SetRegion, GetCollectionString(Attributes), Modifier); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public class IndexerExpression : Expression { |
|
|
|
|
|
|
|
|
|
Expression targetObject; |
|
|
|
@ -3489,9 +3348,9 @@ public Location ExtendedEndLocation { get; set; }
@@ -3489,9 +3348,9 @@ public Location ExtendedEndLocation { get; set; }
|
|
|
|
|
setRegion = PropertySetRegion.Null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public bool IsReadOnly { |
|
|
|
|
public bool HasGetRegion { |
|
|
|
|
get { |
|
|
|
|
return HasGetRegion && !HasSetRegion; |
|
|
|
|
return !getRegion.IsNull; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -3501,12 +3360,24 @@ public Location ExtendedEndLocation { get; set; }
@@ -3501,12 +3360,24 @@ public Location ExtendedEndLocation { get; set; }
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public bool IsReadOnly { |
|
|
|
|
get { |
|
|
|
|
return HasGetRegion && !HasSetRegion; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public bool IsWriteOnly { |
|
|
|
|
get { |
|
|
|
|
return !HasGetRegion && HasSetRegion; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public bool IsIndexer { |
|
|
|
|
get { |
|
|
|
|
return (Modifier & Modifiers.Default) != 0; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
internal PropertyDeclaration(string name, TypeReference typeReference, Modifiers modifier, List<AttributeSection> attributes) : this(modifier, attributes, name, null) |
|
|
|
|
{ |
|
|
|
@ -3519,12 +3390,6 @@ public Location ExtendedEndLocation { get; set; }
@@ -3519,12 +3390,6 @@ public Location ExtendedEndLocation { get; set; }
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public bool HasGetRegion { |
|
|
|
|
get { |
|
|
|
|
return !getRegion.IsNull; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public override object AcceptVisitor(IAstVisitor visitor, object data) { |
|
|
|
|
return visitor.VisitPropertyDeclaration(this, data); |
|
|
|
|
} |
|
|
|
@ -5336,10 +5201,10 @@ public Location ExtendedEndLocation { get; set; }
@@ -5336,10 +5201,10 @@ public Location ExtendedEndLocation { get; set; }
|
|
|
|
|
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); |
|
|
|
|
} |
|
|
|
@ -5497,6 +5362,43 @@ public UsingDeclaration(string @namespace) : this(@namespace, null) {}
@@ -5497,6 +5362,43 @@ public UsingDeclaration(string @namespace) : this(@namespace, null) {}
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public abstract class XmlLiteralExpression : AbstractNode, INullable { |
|
|
|
|
|
|
|
|
|
protected XmlLiteralExpression() { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public virtual bool IsNull { |
|
|
|
|
get { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static XmlLiteralExpression Null { |
|
|
|
|
get { |
|
|
|
|
return NullXmlLiteralExpression.Instance; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
internal sealed class NullXmlLiteralExpression : XmlLiteralExpression { |
|
|
|
|
|
|
|
|
|
internal static NullXmlLiteralExpression Instance = new NullXmlLiteralExpression(); |
|
|
|
|
|
|
|
|
|
public override bool IsNull { |
|
|
|
|
get { |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public override object AcceptVisitor(IAstVisitor visitor, object data) { |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public override string ToString() { |
|
|
|
|
return "[NullXmlLiteralExpression]"; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public class YieldStatement : Statement { |
|
|
|
|
|
|
|
|
|
Statement statement; |
|
|
|
|