Browse Source

delete directories Subversion didn't delete me on the first try

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@977 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 20 years ago
parent
commit
3a79ab57f4
  1. 51
      src/Libraries/NRefactory/Project/Src/Parser/AST/CSharp/Expressions/AnonymousMethodExpression.cs
  2. 43
      src/Libraries/NRefactory/Project/Src/Parser/AST/CSharp/Expressions/CheckedExpression.cs
  3. 67
      src/Libraries/NRefactory/Project/Src/Parser/AST/CSharp/Expressions/ConditionalExpression.cs
  4. 43
      src/Libraries/NRefactory/Project/Src/Parser/AST/CSharp/Expressions/DefaultValueExpression.cs
  5. 55
      src/Libraries/NRefactory/Project/Src/Parser/AST/CSharp/Expressions/DirectionExpression.cs
  6. 55
      src/Libraries/NRefactory/Project/Src/Parser/AST/CSharp/Expressions/IndexerExpression.cs
  7. 55
      src/Libraries/NRefactory/Project/Src/Parser/AST/CSharp/Expressions/PointerReferenceExpression.cs
  8. 43
      src/Libraries/NRefactory/Project/Src/Parser/AST/CSharp/Expressions/SizeOfExpression.cs
  9. 54
      src/Libraries/NRefactory/Project/Src/Parser/AST/CSharp/Expressions/StackAllocExpression.cs
  10. 43
      src/Libraries/NRefactory/Project/Src/Parser/AST/CSharp/Expressions/UncheckedExpression.cs
  11. 43
      src/Libraries/NRefactory/Project/Src/Parser/AST/CSharp/Statements/CheckedStatement.cs
  12. 25
      src/Libraries/NRefactory/Project/Src/Parser/AST/CSharp/Statements/EmptyStatement.cs
  13. 57
      src/Libraries/NRefactory/Project/Src/Parser/AST/CSharp/Statements/FixedStatement.cs
  14. 54
      src/Libraries/NRefactory/Project/Src/Parser/AST/CSharp/Statements/GotoCaseStatement.cs
  15. 43
      src/Libraries/NRefactory/Project/Src/Parser/AST/CSharp/Statements/UncheckedStatement.cs
  16. 43
      src/Libraries/NRefactory/Project/Src/Parser/AST/CSharp/Statements/UnsafeStatement.cs
  17. 45
      src/Libraries/NRefactory/Project/Src/Parser/AST/CSharp/Statements/UsingStatement.cs
  18. 53
      src/Libraries/NRefactory/Project/Src/Parser/AST/CSharp/Statements/YieldStatement.cs
  19. 56
      src/Libraries/NRefactory/Project/Src/Parser/AST/CSharp/TypeLevel/DestructorDeclaration.cs
  20. 143
      src/Libraries/NRefactory/Project/Src/Parser/AST/CSharp/TypeLevel/IndexerDeclaration.cs
  21. 79
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/Expressions/ArrayCreateExpression.cs
  22. 91
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/Expressions/ArrayInitializerExpression.cs
  23. 90
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/Expressions/AssignmentExpression.cs
  24. 25
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/Expressions/BaseReferenceExpression.cs
  25. 127
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/Expressions/BinaryOperatorExpression.cs
  26. 100
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/Expressions/CastExpression.cs
  27. 111
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/Expressions/Expression.cs
  28. 55
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/Expressions/FieldReferenceExpression.cs
  29. 43
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/Expressions/IdentifierExpression.cs
  30. 79
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/Expressions/InvocationExpression.cs
  31. 55
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/Expressions/ObjectCreateExpression.cs
  32. 43
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/Expressions/ParenthesizedExpression.cs
  33. 58
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/Expressions/PrimitiveExpression.cs
  34. 25
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/Expressions/ThisReferenceExpression.cs
  35. 43
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/Expressions/TypeOfExpression.cs
  36. 48
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/Expressions/TypeReferenceExpression.cs
  37. 79
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/Expressions/UnaryOperatorExpression.cs
  38. 56
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/GlobalScope/CompilationUnit.cs
  39. 79
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/GlobalScope/DelegateDeclaration.cs
  40. 46
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/GlobalScope/NamespaceDeclaration.cs
  41. 147
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/GlobalScope/TypeDeclaration.cs
  42. 106
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/GlobalScope/UsingDeclaration.cs
  43. 79
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/Statements/BlockStatement.cs
  44. 25
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/Statements/BreakStatement.cs
  45. 52
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/Statements/ContinueStatement.cs
  46. 84
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/Statements/DoLoopStatement.cs
  47. 64
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/Statements/ForStatement.cs
  48. 89
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/Statements/ForeachStatement.cs
  49. 45
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/Statements/GotoStatement.cs
  50. 134
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/Statements/IfElseStatement.cs
  51. 43
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/Statements/LabelStatement.cs
  52. 115
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/Statements/LocalVariableDeclaration.cs
  53. 45
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/Statements/LockStatement.cs
  54. 43
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/Statements/ReturnStatement.cs
  55. 92
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/Statements/Statement.cs
  56. 42
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/Statements/StatementExpression.cs
  57. 169
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/Statements/SwitchStatement.cs
  58. 43
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/Statements/ThrowStatement.cs
  59. 148
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/Statements/TryCatchStatement.cs
  60. 75
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/Statements/VariableDeclaration.cs
  61. 61
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/TypeLevel/ConstructorDeclaration.cs
  62. 98
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/TypeLevel/ConstructorInitializer.cs
  63. 217
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/TypeLevel/EventAddRemoveRegion.cs
  64. 135
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/TypeLevel/EventDeclaration.cs
  65. 89
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/TypeLevel/FieldDeclaration.cs
  66. 35
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/TypeLevel/InterfaceImplementation.cs
  67. 99
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/TypeLevel/MethodDeclaration.cs
  68. 160
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/TypeLevel/OperatorDeclaration.cs
  69. 110
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/TypeLevel/ParameterDeclarationExpression.cs
  70. 138
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/TypeLevel/PropertyDeclaration.cs
  71. 158
      src/Libraries/NRefactory/Project/Src/Parser/AST/General/TypeLevel/PropertyGetSetRegion.cs
  72. 43
      src/Libraries/NRefactory/Project/Src/Parser/AST/VBNet/Expressions/AddressOfExpression.cs
  73. 25
      src/Libraries/NRefactory/Project/Src/Parser/AST/VBNet/Expressions/ClassReferenceExpression.cs
  74. 56
      src/Libraries/NRefactory/Project/Src/Parser/AST/VBNet/Expressions/TypeOfIsExpression.cs
  75. 71
      src/Libraries/NRefactory/Project/Src/Parser/AST/VBNet/GlobalScope/OptionDeclaration.cs
  76. 54
      src/Libraries/NRefactory/Project/Src/Parser/AST/VBNet/Statements/AddHandlerStatement.cs
  77. 25
      src/Libraries/NRefactory/Project/Src/Parser/AST/VBNet/Statements/EndStatement.cs
  78. 43
      src/Libraries/NRefactory/Project/Src/Parser/AST/VBNet/Statements/EraseStatements.cs
  79. 42
      src/Libraries/NRefactory/Project/Src/Parser/AST/VBNet/Statements/ErrorStatement.cs
  80. 54
      src/Libraries/NRefactory/Project/Src/Parser/AST/VBNet/Statements/ExitStatement.cs
  81. 106
      src/Libraries/NRefactory/Project/Src/Parser/AST/VBNet/Statements/ForNextStatement.cs
  82. 32
      src/Libraries/NRefactory/Project/Src/Parser/AST/VBNet/Statements/OnErrorStatement.cs
  83. 57
      src/Libraries/NRefactory/Project/Src/Parser/AST/VBNet/Statements/RaiseEventStatement.cs
  84. 87
      src/Libraries/NRefactory/Project/Src/Parser/AST/VBNet/Statements/ReDimStatement.cs
  85. 54
      src/Libraries/NRefactory/Project/Src/Parser/AST/VBNet/Statements/RemoveHandlerStatement.cs
  86. 62
      src/Libraries/NRefactory/Project/Src/Parser/AST/VBNet/Statements/ResumeStatement.cs
  87. 25
      src/Libraries/NRefactory/Project/Src/Parser/AST/VBNet/Statements/StopStatement.cs
  88. 53
      src/Libraries/NRefactory/Project/Src/Parser/AST/VBNet/Statements/WithStatement.cs
  89. 97
      src/Libraries/NRefactory/Project/Src/Parser/AST/VBNet/TypeLevel/DeclareDeclaration.cs

51
src/Libraries/NRefactory/Project/Src/Parser/AST/CSharp/Expressions/AnonymousMethodExpression.cs

@ -1,51 +0,0 @@ @@ -1,51 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Collections.Generic;
using System.Diagnostics;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class AnonymousMethodExpression : Expression
{
List<ParameterDeclarationExpression> parameters = new List<ParameterDeclarationExpression>(1);
public List<ParameterDeclarationExpression> Parameters {
get {
return parameters;
}
set {
Debug.Assert(value != null);
parameters = value;
}
}
BlockStatement body = BlockStatement.Null;
public BlockStatement Body {
get {
return body;
}
set {
body = BlockStatement.CheckNull(value);
}
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[AnonymousMethodExpression: Parameters={0} Body={1}]",
GetCollectionString(Parameters),
Body);
}
}
}

43
src/Libraries/NRefactory/Project/Src/Parser/AST/CSharp/Expressions/CheckedExpression.cs

@ -1,43 +0,0 @@ @@ -1,43 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class CheckedExpression : Expression
{
Expression expression;
public Expression Expression {
get {
return expression;
}
set {
expression = Expression.CheckNull(value);
}
}
public CheckedExpression(Expression expression)
{
this.Expression = expression;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[CheckedExpression: Expression={0}]",
expression);
}
}
}

67
src/Libraries/NRefactory/Project/Src/Parser/AST/CSharp/Expressions/ConditionalExpression.cs

@ -1,67 +0,0 @@ @@ -1,67 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class ConditionalExpression : Expression
{
Expression condition;
Expression trueExpression;
Expression falseExpression;
public Expression Condition {
get {
return condition;
}
set {
condition = Expression.CheckNull(value);
}
}
public Expression TrueExpression {
get {
return trueExpression;
}
set {
trueExpression = Expression.CheckNull(value);
}
}
public Expression FalseExpression {
get {
return falseExpression;
}
set {
falseExpression = Expression.CheckNull(value);
}
}
public ConditionalExpression(Expression condition, Expression trueExpression, Expression falseExpression)
{
this.Condition = condition;
this.TrueExpression = trueExpression;
this.FalseExpression = falseExpression;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[ConditionalExpression: Condition={0}, TrueExpression={1}, FalseExpression={2}]",
condition,
trueExpression,
falseExpression);
}
}
}

43
src/Libraries/NRefactory/Project/Src/Parser/AST/CSharp/Expressions/DefaultValueExpression.cs

@ -1,43 +0,0 @@ @@ -1,43 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class DefaultValueExpression : Expression
{
TypeReference typeReference;
public TypeReference TypeReference {
get {
return typeReference;
}
set {
typeReference = TypeReference.CheckNull(value);
}
}
public DefaultValueExpression(TypeReference typeReference)
{
this.TypeReference = typeReference;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[DefaultValueExpression: TypeReference={0}]",
typeReference);
}
}
}

55
src/Libraries/NRefactory/Project/Src/Parser/AST/CSharp/Expressions/DirectionExpression.cs

@ -1,55 +0,0 @@ @@ -1,55 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class DirectionExpression : Expression
{
FieldDirection fieldDirection;
Expression expression;
public FieldDirection FieldDirection {
get {
return fieldDirection;
}
set {
fieldDirection = value;
}
}
public Expression Expression {
get {
return expression;
}
set {
expression = Expression.CheckNull(value);
}
}
public DirectionExpression(FieldDirection fieldDirection, Expression expression)
{
this.FieldDirection = fieldDirection;
this.Expression = expression;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[DirectionExpression: FieldDirection={0}, Expression={1}]",
fieldDirection,
expression);
}
}
}

55
src/Libraries/NRefactory/Project/Src/Parser/AST/CSharp/Expressions/IndexerExpression.cs

@ -1,55 +0,0 @@ @@ -1,55 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections.Generic;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class IndexerExpression : Expression
{
Expression targetObject;
List<Expression> indices;
public Expression TargetObject {
get {
return targetObject;
}
set {
targetObject = Expression.CheckNull(value);
}
}
public List<Expression> Indices {
get {
return indices;
}
set {
indices = value ?? new List<Expression>(1);
}
}
public IndexerExpression(Expression targetObject, List<Expression> indices)
{
this.TargetObject = targetObject;
this.Indices = indices;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[IndexerExpression: TargetObject={0}, Indices={1}]",
targetObject,
GetCollectionString(indices));
}
}
}

55
src/Libraries/NRefactory/Project/Src/Parser/AST/CSharp/Expressions/PointerReferenceExpression.cs

@ -1,55 +0,0 @@ @@ -1,55 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class PointerReferenceExpression : Expression
{
Expression targetObject;
string identifier;
public Expression TargetObject {
get {
return targetObject;
}
set {
targetObject = Expression.CheckNull(value);
}
}
public string Identifier {
get {
return identifier;
}
set {
identifier = value == null ? String.Empty : value;
}
}
public PointerReferenceExpression(Expression targetObject, string identifier)
{
this.TargetObject = targetObject;
this.Identifier = identifier;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[PointerReferenceExpression: TargetObject={0}, Identifier={1}]",
targetObject,
identifier);
}
}
}

43
src/Libraries/NRefactory/Project/Src/Parser/AST/CSharp/Expressions/SizeOfExpression.cs

@ -1,43 +0,0 @@ @@ -1,43 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class SizeOfExpression : Expression
{
TypeReference typeReference;
public TypeReference TypeReference {
get {
return typeReference;
}
set {
typeReference = TypeReference.CheckNull(value);
}
}
public SizeOfExpression(TypeReference typeReference)
{
this.TypeReference = typeReference;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[SizeOfExpression: TypeReference={0}]",
typeReference);
}
}
}

54
src/Libraries/NRefactory/Project/Src/Parser/AST/CSharp/Expressions/StackAllocExpression.cs

@ -1,54 +0,0 @@ @@ -1,54 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class StackAllocExpression : Expression
{
TypeReference typeReference;
Expression expression;
public TypeReference TypeReference {
get {
return typeReference;
}
set {
typeReference = TypeReference.CheckNull(value);
}
}
public Expression Expression {
get {
return expression;
}
set {
expression = Expression.CheckNull(value);
}
}
public StackAllocExpression(TypeReference typeReference, Expression expression)
{
this.TypeReference = typeReference;
this.Expression = expression;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[StackAllocExpression: TypeReference={0}, Expression={1}]",
typeReference,
expression);
}
}
}

43
src/Libraries/NRefactory/Project/Src/Parser/AST/CSharp/Expressions/UncheckedExpression.cs

@ -1,43 +0,0 @@ @@ -1,43 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class UncheckedExpression : Expression
{
Expression expression;
public Expression Expression {
get {
return expression;
}
set {
expression = Expression.CheckNull(value);
}
}
public UncheckedExpression(Expression expression)
{
this.Expression = expression;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[UncheckedExpression: Expression={0}]",
expression);
}
}
}

43
src/Libraries/NRefactory/Project/Src/Parser/AST/CSharp/Statements/CheckedStatement.cs

@ -1,43 +0,0 @@ @@ -1,43 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class CheckedStatement : Statement
{
Statement block;
public Statement Block {
get {
return block;
}
set {
block = Statement.CheckNull(value);
}
}
public CheckedStatement(Statement block)
{
this.Block = block;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[CheckedStatement: Block={0}]",
block);
}
}
}

25
src/Libraries/NRefactory/Project/Src/Parser/AST/CSharp/Statements/EmptyStatement.cs

@ -1,25 +0,0 @@ @@ -1,25 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Collections;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class EmptyStatement : Statement
{
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[EmptyStatement]");
}
}
}

57
src/Libraries/NRefactory/Project/Src/Parser/AST/CSharp/Statements/FixedStatement.cs

@ -1,57 +0,0 @@ @@ -1,57 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections.Generic;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class FixedStatement : StatementWithEmbeddedStatement
{
TypeReference typeReference;
List<VariableDeclaration> pointerDeclarators;
public TypeReference TypeReference {
get {
return typeReference;
}
set {
typeReference = TypeReference.CheckNull(value);
}
}
public List<VariableDeclaration> PointerDeclarators {
get {
return pointerDeclarators;
}
set {
pointerDeclarators = value ?? new List<VariableDeclaration>(1);
}
}
public FixedStatement(TypeReference typeReference, List<VariableDeclaration> pointerDeclarators, Statement embeddedStatement)
{
this.TypeReference = typeReference;
this.PointerDeclarators = pointerDeclarators;
this.EmbeddedStatement = embeddedStatement;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[FixedStatement: TypeReference={0}, PointerDeclarators={1}, EmbeddedStatement={2}]",
typeReference,
GetCollectionString(pointerDeclarators),
EmbeddedStatement);
}
}
}

54
src/Libraries/NRefactory/Project/Src/Parser/AST/CSharp/Statements/GotoCaseStatement.cs

@ -1,54 +0,0 @@ @@ -1,54 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Collections;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class GotoCaseStatement : Statement
{
Expression caseExpression;
public Expression Expression {
get {
return caseExpression;
}
set {
caseExpression = Expression.CheckNull(value);
}
}
public bool IsDefaultCase {
get {
return caseExpression.IsNull;
}
}
public GotoCaseStatement()
{
caseExpression = Expression.Null;
}
public GotoCaseStatement(Expression caseExpression)
{
this.Expression = caseExpression;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[GotoCaseStatement: Expression={0}, IsDefaultCase={1}]",
caseExpression,
IsDefaultCase);
}
}
}

43
src/Libraries/NRefactory/Project/Src/Parser/AST/CSharp/Statements/UncheckedStatement.cs

@ -1,43 +0,0 @@ @@ -1,43 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class UncheckedStatement : Statement
{
Statement block;
public Statement Block {
get {
return block;
}
set {
block = Statement.CheckNull(value);
}
}
public UncheckedStatement(Statement block)
{
this.Block = block;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[UncheckedStatement: Block={0}]",
block);
}
}
}

43
src/Libraries/NRefactory/Project/Src/Parser/AST/CSharp/Statements/UnsafeStatement.cs

@ -1,43 +0,0 @@ @@ -1,43 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class UnsafeStatement : Statement
{
Statement block;
public Statement Block {
get {
return block;
}
set {
block = Statement.CheckNull(value);
}
}
public UnsafeStatement(Statement block)
{
this.Block = block;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[UnsafeStatement: Block={0}]",
block);
}
}
}

45
src/Libraries/NRefactory/Project/Src/Parser/AST/CSharp/Statements/UsingStatement.cs

@ -1,45 +0,0 @@ @@ -1,45 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class UsingStatement : StatementWithEmbeddedStatement
{
Statement resourceAcquisition;
public Statement ResourceAcquisition {
get {
return resourceAcquisition;
}
set {
resourceAcquisition = Statement.CheckNull(value);
}
}
public UsingStatement(Statement resourceAcquisition, Statement embeddedStatement)
{
this.ResourceAcquisition = resourceAcquisition;
this.EmbeddedStatement = embeddedStatement;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[UsingStatement: ResourceAcquisition={0}, EmbeddedStatement={1}]",
resourceAcquisition,
EmbeddedStatement);
}
}
}

53
src/Libraries/NRefactory/Project/Src/Parser/AST/CSharp/Statements/YieldStatement.cs

@ -1,53 +0,0 @@ @@ -1,53 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class YieldStatement : Statement
{
Statement statement;
public Statement Statement {
get {
return statement;
}
set {
statement = Statement.CheckNull(value);
}
}
public bool IsYieldReturn()
{
return Statement is ReturnStatement;
}
public bool IsYieldBreak()
{
return Statement is BreakStatement;
}
public YieldStatement(Statement statement)
{
this.Statement = statement;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[YieldSatement: Statement={0}]",
statement);
}
}
}

56
src/Libraries/NRefactory/Project/Src/Parser/AST/CSharp/TypeLevel/DestructorDeclaration.cs

@ -1,56 +0,0 @@ @@ -1,56 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Mike Krüger" email="mike@icsharpcode.net"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections.Generic;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class DestructorDeclaration : AttributedNode
{
string name;
BlockStatement body;
public string Name {
get {
return name;
}
set {
name = value == null ? String.Empty : value;
}
}
public BlockStatement Body {
get {
return body;
}
set {
body = BlockStatement.CheckNull(value);;
}
}
public DestructorDeclaration(string name, Modifier modifier, List<AttributeSection> attributes) : base(modifier, attributes)
{
this.Name = name;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[DestructorDeclaration: Name = {0}, Attributes = {1}, Modifier = {2}, Body = {3}]",
Name,
GetCollectionString(Attributes),
Modifier,
Body);
}
}
}

143
src/Libraries/NRefactory/Project/Src/Parser/AST/CSharp/TypeLevel/IndexerDeclaration.cs

@ -1,143 +0,0 @@ @@ -1,143 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Mike Krüger" email="mike@icsharpcode.net"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Drawing;
using System.Diagnostics;
using System.Collections;
using System.Collections.Generic;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class IndexerDeclaration : AttributedNode
{
TypeReference type = TypeReference.Null;
List<InterfaceImplementation> interfaceImplementations = new List<InterfaceImplementation>(1);
Point bodyStart = new Point(-1, -1);
Point bodyEnd = new Point(-1, -1);
List<ParameterDeclarationExpression> parameters;
PropertyGetRegion propertyGetRegion = PropertyGetRegion.Null;
PropertySetRegion propertySetRegion = PropertySetRegion.Null;
public TypeReference TypeReference {
get {
return type;
}
set {
type = TypeReference.CheckNull(value);
}
}
public List<ParameterDeclarationExpression> Parameters {
get {
return parameters;
}
set {
parameters = value == null ? new List<ParameterDeclarationExpression>(1) : value;
}
}
public bool HasGetRegion {
get {
return !propertyGetRegion.IsNull;
}
}
public bool HasSetRegion {
get {
return !propertySetRegion.IsNull;
}
}
public bool IsReadOnly {
get {
return HasGetRegion && !HasSetRegion;
}
}
public bool IsWriteOnly {
get {
return !HasGetRegion && HasSetRegion;
}
}
public PropertyGetRegion GetRegion {
get {
return propertyGetRegion;
}
set {
propertyGetRegion = value == null ? PropertyGetRegion.Null : value;
}
}
public PropertySetRegion SetRegion {
get {
return propertySetRegion;
}
set {
propertySetRegion = value == null ? PropertySetRegion.Null : value;
}
}
public Point BodyStart {
get {
return bodyStart;
}
set {
bodyStart = value;
}
}
public Point BodyEnd {
get {
return bodyEnd;
}
set {
bodyEnd = value;
}
}
public List<InterfaceImplementation> InterfaceImplementations {
get {
return interfaceImplementations;
}
set {
interfaceImplementations = value ?? new List<InterfaceImplementation>();
}
}
public IndexerDeclaration(Modifier modifier, List<ParameterDeclarationExpression> parameters, List<AttributeSection> attributes) : base(modifier, attributes)
{
this.Parameters = parameters;
}
public IndexerDeclaration(TypeReference typeReference, List<ParameterDeclarationExpression> parameters, Modifier modifier, List<AttributeSection> attributes) : base(modifier, attributes)
{
this.TypeReference = typeReference;
this.Parameters = parameters;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[IndexerDeclaration: TypeReference = {0}, Modifier = {1}, Parameters = {2}, Attributes = {3}, NamespaceName = {4}, BodyStart = {5}, BodyEnd = {6}]",
TypeReference,
Modifier,
GetCollectionString(Parameters),
GetCollectionString(Attributes),
GetCollectionString(InterfaceImplementations),
BodyStart,
BodyEnd);
}
}
}

79
src/Libraries/NRefactory/Project/Src/Parser/AST/General/Expressions/ArrayCreateExpression.cs

@ -1,79 +0,0 @@ @@ -1,79 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections.Generic;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class ArrayCreateExpression : Expression
{
TypeReference createType;
List<Expression> arguments;
ArrayInitializerExpression arrayInitializer = null; // Array Initializer OR NULL
public TypeReference CreateType {
get {
return createType;
}
set {
createType = TypeReference.CheckNull(value);
}
}
public List<Expression> Arguments {
get {
return arguments;
}
set {
arguments = value ?? new List<Expression>(1);
}
}
public ArrayInitializerExpression ArrayInitializer {
get {
return arrayInitializer;
}
set {
arrayInitializer = ArrayInitializerExpression.CheckNull(value);
}
}
public ArrayCreateExpression(TypeReference createType) : this(createType, null, null)
{
}
public ArrayCreateExpression(TypeReference createType, List<Expression> parameters) : this (createType, parameters, null)
{
}
public ArrayCreateExpression(TypeReference createType, ArrayInitializerExpression arrayInitializer) : this(createType, null, arrayInitializer)
{
}
public ArrayCreateExpression(TypeReference createType, List<Expression> parameters, ArrayInitializerExpression arrayInitializer)
{
this.CreateType = createType;
this.Arguments = parameters;
this.ArrayInitializer = arrayInitializer;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[ArrayCreateExpression: CreateType={0}, Parameters={1}, ArrayInitializer={2}]",
createType,
GetCollectionString(arguments),
arrayInitializer);
}
}
}

91
src/Libraries/NRefactory/Project/Src/Parser/AST/General/Expressions/ArrayInitializerExpression.cs

@ -1,91 +0,0 @@ @@ -1,91 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections.Generic;
namespace ICSharpCode.NRefactory.Parser.AST {
public class ArrayInitializerExpression : Expression
{
List<Expression> createExpressions;
public new static ArrayInitializerExpression Null {
get {
return NullArrayInitializerExpression.Instance;
}
}
public static ArrayInitializerExpression CheckNull(ArrayInitializerExpression arrayInitializerExpression)
{
return arrayInitializerExpression ?? NullArrayInitializerExpression.Instance;
}
public List<Expression> CreateExpressions {
get {
return createExpressions;
}
set {
createExpressions = value ?? new List<Expression>(1);
}
}
public ArrayInitializerExpression()
{
createExpressions = new List<Expression>(1);
}
public ArrayInitializerExpression(List<Expression> createExpressions)
{
this.createExpressions = createExpressions;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[ArrayInitializerExpression: CreateExpressions={0}]",
GetCollectionString(createExpressions));
}
}
public class NullArrayInitializerExpression : ArrayInitializerExpression
{
static NullArrayInitializerExpression nullArrayInitializerExpression = new NullArrayInitializerExpression();
public override bool IsNull {
get {
return true;
}
}
public static NullArrayInitializerExpression Instance {
get {
return nullArrayInitializerExpression;
}
}
NullArrayInitializerExpression()
{
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return this;
}
public override string ToString()
{
return String.Format("[NullArrayInitializerExpression]");
}
}
}

90
src/Libraries/NRefactory/Project/Src/Parser/AST/General/Expressions/AssignmentExpression.cs

@ -1,90 +0,0 @@ @@ -1,90 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections;
namespace ICSharpCode.NRefactory.Parser.AST
{
public enum AssignmentOperatorType
{
None,
Assign,
Add,
Subtract,
Multiply,
Divide,
Modulus,
Power, // (VB only)
DivideInteger, // (VB only)
ConcatString, // (VB only)
ShiftLeft,
ShiftRight,
BitwiseAnd,
BitwiseOr,
ExclusiveOr,
}
public class AssignmentExpression : Expression
{
Expression left;
AssignmentOperatorType op;
Expression right;
public Expression Left {
get {
return left;
}
set {
left = Expression.CheckNull(value);
}
}
public AssignmentOperatorType Op {
get {
return op;
}
set {
op = value;
}
}
public Expression Right {
get {
return right;
}
set {
right = Expression.CheckNull(value);
}
}
public AssignmentExpression(Expression left, AssignmentOperatorType op, Expression right)
{
this.Left = left;
this.op = op;
this.Right = right;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[AssignmentExpression: Op={0}, Left={1}, Right={2}]",
op,
left,
right);
}
}
}

25
src/Libraries/NRefactory/Project/Src/Parser/AST/General/Expressions/BaseReferenceExpression.cs

@ -1,25 +0,0 @@ @@ -1,25 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Collections;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class BaseReferenceExpression : Expression
{
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[BaseReferenceExpression]");
}
}
}

127
src/Libraries/NRefactory/Project/Src/Parser/AST/General/Expressions/BinaryOperatorExpression.cs

@ -1,127 +0,0 @@ @@ -1,127 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections;
namespace ICSharpCode.NRefactory.Parser.AST
{
public enum BinaryOperatorType
{
None,
/// <summary>'&amp;' in C#, 'And' in VB.</summary>
BitwiseAnd,
/// <summary>'|' in C#, 'Or' in VB.</summary>
BitwiseOr,
/// <summary>'&amp;&amp;' in C#, 'AndAlso' in VB.</summary>
LogicalAnd,
/// <summary>'||' in C#, 'OrElse' in VB.</summary>
LogicalOr,
/// <summary>'^' in C#, 'Xor' in VB.</summary>
ExclusiveOr,
/// <summary>&gt;</summary>
GreaterThan,
/// <summary>&gt;=</summary>
GreaterThanOrEqual,
/// <summary>'==' in C#, '=' in VB.</summary>
Equality,
/// <summary>'!=' in C#, '&lt;&gt;' in VB.</summary>
InEquality,
/// <summary>&lt;</summary>
LessThan,
/// <summary>&lt;=</summary>
LessThanOrEqual,
/// <summary>+</summary>
Add,
/// <summary>-</summary>
Subtract,
/// <summary>*</summary>
Multiply,
/// <summary>/</summary>
Divide,
/// <summary>'%' in C#, 'Mod' in VB.</summary>
Modulus,
/// <summary>VB-only: \</summary>
DivideInteger,
/// <summary>VB-only: ^</summary>
Power,
/// <summary>VB-only: &amp;</summary>
Concat,
/// <summary>C#: &lt;&lt;</summary>
ShiftLeft,
/// <summary>C#: &gt;&gt;</summary>
ShiftRight,
/// <summary>VB-only: Is</summary>
ReferenceEquality,
/// <summary>VB-only: IsNot</summary>
ReferenceInequality,
/// <summary>VB-only: Like</summary>
Like,
/// <summary>C#: ??</summary>
NullCoalescing,
}
public class BinaryOperatorExpression : Expression
{
Expression left;
BinaryOperatorType op;
Expression right;
public Expression Left {
get {
return left;
}
set {
left = Expression.CheckNull(value);
}
}
public BinaryOperatorType Op {
get {
return op;
}
set {
op = value;
}
}
public Expression Right {
get {
return right;
}
set {
right = Expression.CheckNull(value);
}
}
public BinaryOperatorExpression(Expression left, BinaryOperatorType op, Expression right)
{
this.Left = left;
this.op = op;
this.Right = right;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[BinaryOperatorExpression: Op={0}, Left={1}, Right={2}]",
op,
left,
right);
}
}
}

100
src/Libraries/NRefactory/Project/Src/Parser/AST/General/Expressions/CastExpression.cs

@ -1,100 +0,0 @@ @@ -1,100 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections;
namespace ICSharpCode.NRefactory.Parser.AST
{
public enum CastType
{
/// <summary>
/// direct cast (C#, VB "DirectCast")
/// </summary>
Cast,
/// <summary>
/// try cast (C# "as", VB "TryCast")
/// </summary>
TryCast,
/// <summary>
/// converting cast (VB "CType")
/// </summary>
Conversion,
/// <summary>
/// primitive converting cast (VB "CString" etc.)
/// </summary>
PrimitiveConversion
}
public class CastExpression : Expression
{
TypeReference castTo;
Expression expression;
CastType castType;
public TypeReference CastTo {
get {
return castTo;
}
set {
castTo = TypeReference.CheckNull(value);
}
}
public Expression Expression {
get {
return expression;
}
set {
expression = Expression.CheckNull(value);
}
}
public CastType CastType {
get {
return castType;
}
set {
castType = value;
}
}
public CastExpression(TypeReference castTo)
{
this.CastTo = castTo;
this.expression = Expression.Null;
}
public CastExpression(TypeReference castTo, Expression expression)
{
this.CastTo = castTo;
this.Expression = expression;
}
public CastExpression(TypeReference castTo, Expression expression, CastType castType)
{
this.CastTo = castTo;
this.Expression = expression;
this.castType = castType;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[CastExpression: CastTo={0}, Expression={1} CastType={2}]",
castTo,
expression,
castType);
}
}
}

111
src/Libraries/NRefactory/Project/Src/Parser/AST/General/Expressions/Expression.cs

@ -1,111 +0,0 @@ @@ -1,111 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Mike Krüger" email="mike@icsharpcode.net"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Collections;
namespace ICSharpCode.NRefactory.Parser.AST
{
public abstract class Expression : AbstractNode, INullable
{
public static NullExpression Null {
get {
return NullExpression.Instance;
}
}
public virtual bool IsNull {
get {
return false;
}
}
public static Expression CheckNull(Expression expression)
{
return expression == null ? NullExpression.Instance : expression;
}
/// <summary>
/// Returns the existing expression plus the specified integer value.
/// WARNING: This method modifies <paramref name="expr"/> and possibly returns <paramref name="expr"/>
/// again, but it might also create a new expression around <paramref name="expr"/>.
/// </summary>
public static Expression AddInteger(Expression expr, int value)
{
PrimitiveExpression pe = expr as PrimitiveExpression;
if (pe != null && pe.Value is int) {
int newVal = (int)pe.Value + value;
return new PrimitiveExpression(newVal, newVal.ToString(System.Globalization.NumberFormatInfo.InvariantInfo));
}
BinaryOperatorExpression boe = expr as BinaryOperatorExpression;
if (boe != null && boe.Op == BinaryOperatorType.Add) {
boe.Right = AddInteger(boe.Right, value);
if (boe.Right is PrimitiveExpression && ((PrimitiveExpression)boe.Right).Value is int) {
int newVal = (int)((PrimitiveExpression)boe.Right).Value;
if (newVal == 0) {
return boe.Left;
} else if (newVal < 0) {
((PrimitiveExpression)boe.Right).Value = -newVal;
boe.Op = BinaryOperatorType.Subtract;
}
}
return boe;
}
if (boe != null && boe.Op == BinaryOperatorType.Subtract) {
pe = boe.Right as PrimitiveExpression;
if (pe != null && pe.Value is int) {
int newVal = (int)pe.Value - value;
if (newVal == 0)
return boe.Left;
if (newVal < 0) {
newVal = -newVal;
boe.Op = BinaryOperatorType.Add;
}
boe.Right = new PrimitiveExpression(newVal, newVal.ToString(System.Globalization.NumberFormatInfo.InvariantInfo));
return boe;
}
}
BinaryOperatorType opType = BinaryOperatorType.Add;
if (value < 0) {
value = -value;
opType = BinaryOperatorType.Subtract;
}
return new BinaryOperatorExpression(expr, opType, new PrimitiveExpression(value, value.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)));
}
}
public class NullExpression : Expression
{
static NullExpression nullExpression = new NullExpression();
public override bool IsNull {
get {
return true;
}
}
public static NullExpression Instance {
get {
return nullExpression;
}
}
NullExpression()
{
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return null;
}
public override string ToString()
{
return String.Format("[NullExpression]");
}
}
}

55
src/Libraries/NRefactory/Project/Src/Parser/AST/General/Expressions/FieldReferenceExpression.cs

@ -1,55 +0,0 @@ @@ -1,55 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections;
namespace ICSharpCode.NRefactory.Parser.AST {
public class FieldReferenceExpression : Expression
{
Expression targetObject;
string fieldName;
public Expression TargetObject {
get {
return targetObject;
}
set {
targetObject = Expression.CheckNull(value);
}
}
public string FieldName {
get {
return fieldName;
}
set {
fieldName = value == null ? String.Empty : value;
}
}
public FieldReferenceExpression(Expression targetObject, string fieldName)
{
this.TargetObject = targetObject;
this.FieldName = fieldName;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[FieldReferenceExpression: FieldName={0}, TargetObject={1}]",
fieldName,
targetObject);
}
}
}

43
src/Libraries/NRefactory/Project/Src/Parser/AST/General/Expressions/IdentifierExpression.cs

@ -1,43 +0,0 @@ @@ -1,43 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class IdentifierExpression : Expression
{
string identifier;
public string Identifier {
get {
return identifier;
}
set {
identifier = value == null ? String.Empty : value;
}
}
public IdentifierExpression(string identifier)
{
this.Identifier = identifier;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[IdentifierExpression: Identifier={0}]",
identifier);
}
}
}

79
src/Libraries/NRefactory/Project/Src/Parser/AST/General/Expressions/InvocationExpression.cs

@ -1,79 +0,0 @@ @@ -1,79 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections;
using System.Collections.Generic;
namespace ICSharpCode.NRefactory.Parser.AST {
public class InvocationExpression : Expression
{
Expression targetObject;
List<Expression> arguments;
List<TypeReference> typeArguments;
public Expression TargetObject {
get {
return targetObject;
}
set {
targetObject = Expression.CheckNull(value);
}
}
public List<Expression> Arguments {
get {
return arguments;
}
set {
arguments = value ?? new List<Expression>(1);
}
}
public List<TypeReference> TypeArguments {
get {
return typeArguments;
}
set {
typeArguments = value == null ? new List<TypeReference>(1) : value;
}
}
public InvocationExpression(Expression targetObject, List<Expression> parameters)
{
this.TargetObject = targetObject;
this.Arguments = parameters;
}
public InvocationExpression(Expression targetObject, List<Expression> parameters, List<TypeReference> typeParameters)
{
this.TargetObject = targetObject;
this.Arguments = parameters;
this.TypeArguments = typeParameters;
}
public InvocationExpression(Expression targetObject)
{
this.TargetObject = targetObject;
this.arguments = new List<Expression>(1);
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[InvocationExpression: TargetObject={0}, parameters={1}]",
TargetObject,
GetCollectionString(Arguments));
}
}
}

55
src/Libraries/NRefactory/Project/Src/Parser/AST/General/Expressions/ObjectCreateExpression.cs

@ -1,55 +0,0 @@ @@ -1,55 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections.Generic;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class ObjectCreateExpression : Expression
{
TypeReference createType;
List<Expression> parameters;
public TypeReference CreateType {
get {
return createType;
}
set {
createType = TypeReference.CheckNull(value);
}
}
public List<Expression> Parameters {
get {
return parameters;
}
set {
parameters = value ?? new List<Expression>(1);
}
}
public ObjectCreateExpression(TypeReference createType, List<Expression> parameters)
{
this.CreateType = createType;
this.Parameters = parameters;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[ObjectCreateExpression: CreateType={0}, Parameters={1}]",
createType,
GetCollectionString(parameters));
}
}
}

43
src/Libraries/NRefactory/Project/Src/Parser/AST/General/Expressions/ParenthesizedExpression.cs

@ -1,43 +0,0 @@ @@ -1,43 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class ParenthesizedExpression : Expression
{
Expression expression;
public Expression Expression {
get {
return expression;
}
set {
expression = Expression.CheckNull(value);
}
}
public ParenthesizedExpression(Expression expression)
{
this.Expression = expression;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[ParenthesizedExpression: Expression={0}]",
expression);
}
}
}

58
src/Libraries/NRefactory/Project/Src/Parser/AST/General/Expressions/PrimitiveExpression.cs

@ -1,58 +0,0 @@ @@ -1,58 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections;
using System.Globalization;
namespace ICSharpCode.NRefactory.Parser.AST {
public class PrimitiveExpression : Expression
{
object val;
string stringValue;
public object Value {
get {
return val;
}
set {
val = value;
}
}
public string StringValue {
get {
return stringValue;
}
set {
stringValue = value == null ? String.Empty : value;
}
}
public PrimitiveExpression(object val, string stringValue)
{
this.Value = val;
this.StringValue = stringValue;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[PrimitiveExpression: Value={1}, ValueType={2}, StringValue={0}]",
stringValue,
Value,
Value == null ? "null" : Value.GetType().FullName
);
}
}
}

25
src/Libraries/NRefactory/Project/Src/Parser/AST/General/Expressions/ThisReferenceExpression.cs

@ -1,25 +0,0 @@ @@ -1,25 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Collections;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class ThisReferenceExpression : Expression
{
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[ThisReferenceExpression]");
}
}
}

43
src/Libraries/NRefactory/Project/Src/Parser/AST/General/Expressions/TypeOfExpression.cs

@ -1,43 +0,0 @@ @@ -1,43 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class TypeOfExpression : Expression
{
TypeReference typeReference;
public TypeReference TypeReference {
get {
return typeReference;
}
set {
typeReference = TypeReference.CheckNull(value);
}
}
public TypeOfExpression(TypeReference typeReference)
{
this.TypeReference = typeReference;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[TypeOfExpression: TypeReference={0}]",
typeReference);
}
}
}

48
src/Libraries/NRefactory/Project/Src/Parser/AST/General/Expressions/TypeReferenceExpression.cs

@ -1,48 +0,0 @@ @@ -1,48 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections;
namespace ICSharpCode.NRefactory.Parser.AST {
public class TypeReferenceExpression : Expression
{
TypeReference typeReference = TypeReference.Null;
public TypeReference TypeReference {
get {
return typeReference;
}
set {
typeReference = TypeReference.CheckNull(value);
}
}
public TypeReferenceExpression(string type)
{
this.typeReference = new TypeReference(type == null ? String.Empty : type);
}
public TypeReferenceExpression(TypeReference typeReference)
{
this.TypeReference = typeReference;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[TypeReferenceExpression: TypeReference={0}]",
typeReference);
}
}
}

79
src/Libraries/NRefactory/Project/Src/Parser/AST/General/Expressions/UnaryOperatorExpression.cs

@ -1,79 +0,0 @@ @@ -1,79 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections;
namespace ICSharpCode.NRefactory.Parser.AST
{
public enum UnaryOperatorType
{
None,
Not,
BitNot,
Minus,
Plus,
Increment,
Decrement,
PostIncrement,
PostDecrement,
Star,
BitWiseAnd
}
public class UnaryOperatorExpression : Expression
{
Expression expression;
UnaryOperatorType op;
public Expression Expression {
get {
return expression;
}
set {
expression = Expression.CheckNull(value);
}
}
public UnaryOperatorType Op {
get {
return op;
}
set {
op = value;
}
}
public UnaryOperatorExpression(UnaryOperatorType op)
{
this.expression = Expression.Null;
this.op = op;
}
public UnaryOperatorExpression(Expression expression, UnaryOperatorType op)
{
this.Expression = expression;
this.op = op;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[UnaryOperatorExpression: Op={0}, Expression={1}]",
op,
expression);
}
}
}

56
src/Libraries/NRefactory/Project/Src/Parser/AST/General/GlobalScope/CompilationUnit.cs

@ -1,56 +0,0 @@ @@ -1,56 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Mike Krüger" email="mike@icsharpcode.net"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Threading;
using System.Diagnostics;
using System.Collections;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class CompilationUnit : AbstractNode
{
// Children in C#: UsingAliasDeclaration, UsingDeclaration, AttributeSection, NamespaceDeclaration
// Children in VB: OptionStatements, ImportsStatement, AttributeSection, NamespaceDeclaration
Stack blockStack = new Stack();
public CompilationUnit()
{
blockStack.Push(this);
}
public void BlockStart(INode block)
{
blockStack.Push(block);
}
public void BlockEnd()
{
blockStack.Pop();
}
public override void AddChild(INode childNode)
{
if (childNode != null) {
INode parent = (INode)blockStack.Peek();
parent.Children.Add(childNode);
childNode.Parent = parent;
}
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[CompilationUnit]");
}
}
}

79
src/Libraries/NRefactory/Project/Src/Parser/AST/General/GlobalScope/DelegateDeclaration.cs

@ -1,79 +0,0 @@ @@ -1,79 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Mike Krüger" email="mike@icsharpcode.net"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections.Generic;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class DelegateDeclaration : AttributedNode
{
string name = "";
TypeReference returnType = TypeReference.Null;
List<ParameterDeclarationExpression> parameters = new List<ParameterDeclarationExpression>(1);
List<TemplateDefinition> templates = new List<TemplateDefinition>();
public string Name {
get {
return name;
}
set {
name = (value != null) ? value : "?";
}
}
public TypeReference ReturnType {
get {
return returnType;
}
set {
Debug.Assert(value != null);
returnType = value;
}
}
public List<ParameterDeclarationExpression> Parameters {
get {
return parameters;
}
set {
Debug.Assert(value != null);
parameters = value;
}
}
public List<TemplateDefinition> Templates {
get {
return templates;
}
set {
Debug.Assert(value != null);
templates = value;
}
}
public DelegateDeclaration(Modifier modifier, List<AttributeSection> attributes) : base(modifier, attributes)
{
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[DelegateDeclaration: Name={0}, Modifier={1}, ReturnType={2}, parameters={3}, attributes={4}]",
name,
modifier,
returnType,
GetCollectionString(parameters),
GetCollectionString(attributes));
}
}
}

46
src/Libraries/NRefactory/Project/Src/Parser/AST/General/GlobalScope/NamespaceDeclaration.cs

@ -1,46 +0,0 @@ @@ -1,46 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Mike Krüger" email="mike@icsharpcode.net"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class NamespaceDeclaration : AbstractNode
{
string name;
// Children in C#: UsingAliasDeclaration, UsingDeclaration, NamespaceDeclaration,
// AttributeSection, TypeDeclaration, DelegateDeclaration
// Children in BV: TypeDeclaration, DelegateDeclaration
public string Name {
get {
return name;
}
set {
name = value == null ? String.Empty : value;
}
}
public NamespaceDeclaration(string name)
{
this.Name = name;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[NamespaceDeclaration: Name={0}]", name);
}
}
}

147
src/Libraries/NRefactory/Project/Src/Parser/AST/General/GlobalScope/TypeDeclaration.cs

@ -1,147 +0,0 @@ @@ -1,147 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Mike Krüger" email="mike@icsharpcode.net"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class TypeDeclaration : AttributedNode
{
// Children of Struct: FieldDeclaration, MethodDeclaration, EventDeclaration, ConstructorDeclaration,
// OperatorDeclaration, TypeDeclaration, IndexerDeclaration, PropertyDeclaration, in VB: DeclareDeclaration
// Childrean of class: children of struct, DestructorDeclaration
// Children of Interface: MethodDeclaration, PropertyDeclaration, IndexerDeclaration, EventDeclaration, in VB: TypeDeclaration(Enum) too
// Children of Enum: FieldDeclaration
string name = "";
ClassType type = ClassType.Class; // Class | Interface | Struct | Enum
List<TypeReference> baseTypes = new List<TypeReference>();
List<TemplateDefinition> templates = new List<TemplateDefinition>();
public string Name {
get {
return name;
}
set {
name = (value != null) ? value : "?";
}
}
public ClassType Type {
get {
return type;
}
set {
type = value;
}
}
public List<TypeReference> BaseTypes {
get {
return baseTypes;
}
set {
Debug.Assert(value != null);
baseTypes = value;
}
}
public List<TemplateDefinition> Templates {
get {
return templates;
}
set {
Debug.Assert(value != null);
templates = value;
}
}
public TemplateDefinition this[string name] {
get {
foreach (TemplateDefinition td in templates) {
if (td.Name == name) {
return td;
}
}
return null;
}
}
public TypeDeclaration(Modifier modifier, List<AttributeSection> attributes) : base(modifier, attributes)
{
}
// public TypeDeclaration(string name, Modifier modifier, Types type, ArrayList bases, ArrayList attributes)
// {
// Debug.Assert(name != null);
// this.name = name;
// this.modifier = modifier;
// this.type = type;
// Debug.Assert(bases != null);
// this.bases = bases;
// Debug.Assert(attributes != null);
// this.attributes = attributes;
// }
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[TypeDeclaration: Name={0}, Modifier={1}, Type={2}, BaseTypes={3}, Attributes={4}, Children={5}]",
name,
modifier,
type,
GetCollectionString(baseTypes),
GetCollectionString(attributes),
GetCollectionString(Children));
}
}
public class TemplateDefinition : AttributedNode
{
string name = "";
List<TypeReference> bases = new List<TypeReference>();
public string Name {
get {
return name;
}
}
public List<TypeReference> Bases {
get {
return bases;
}
}
public TemplateDefinition(string name, List<AttributeSection> attributes) : base(attributes)
{
if (name == null || name.Length == 0)
name = "?";
this.name = name;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[TypeDeclaration: Name={0}, BaseTypes={1}]",
name,
GetCollectionString(bases));
}
}
}

106
src/Libraries/NRefactory/Project/Src/Parser/AST/General/GlobalScope/UsingDeclaration.cs

@ -1,106 +0,0 @@ @@ -1,106 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Mike Krüger" email="mike@icsharpcode.net"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections.Generic;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class Using : AbstractNode
{
string name;
TypeReference alias;
public string Name {
get {
return name;
}
set {
name = value == null ? String.Empty : value;
}
}
public TypeReference Alias {
get {
return alias;
}
set {
alias = TypeReference.CheckNull(value);
}
}
public bool IsAlias {
get {
return !alias.IsNull;
}
}
public Using(string name, TypeReference alias)
{
this.Name = name;
this.Alias = alias;
}
public Using(string name) : this(name, null)
{
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString() {
return String.Format("[Using: name = {0}, alias = {1}]",
name,
alias);
}
}
public class UsingDeclaration : AbstractNode
{
List<Using> usings;
public List<Using> Usings {
get {
return usings;
}
set {
usings = value == null ? new List<Using>(1) : value;
}
}
public UsingDeclaration(string nameSpace) : this(nameSpace, null)
{
}
public UsingDeclaration(string nameSpace, TypeReference alias)
{
Debug.Assert(nameSpace != null);
usings = new List<Using>(1);
usings.Add(new Using(nameSpace, alias));
}
public UsingDeclaration(List<Using> usings)
{
this.Usings = usings;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[UsingDeclaration: Usings={0}]",
GetCollectionString(usings));
}
}
}

79
src/Libraries/NRefactory/Project/Src/Parser/AST/General/Statements/BlockStatement.cs

@ -1,79 +0,0 @@ @@ -1,79 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Collections;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class BlockStatement : Statement
{
// Children in C#: LabelStatement, LocalVariableDeclaration, Statement
// Children in VB: LabelStatement, EndStatement, Statement
public static new NullBlockStatement Null {
get {
return NullBlockStatement.Instance;
}
}
public static BlockStatement CheckNull(BlockStatement blockStatement)
{
return blockStatement == null ? NullBlockStatement.Instance : blockStatement;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[BlockStatement: Children={0}]",
GetCollectionString(base.Children));
}
}
public class NullBlockStatement : BlockStatement
{
static NullBlockStatement nullBlockStatement = new NullBlockStatement();
public override bool IsNull {
get {
return true;
}
}
public static NullBlockStatement Instance {
get {
return nullBlockStatement;
}
}
NullBlockStatement()
{
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return data;
}
public override object AcceptChildren(IASTVisitor visitor, object data)
{
return data;
}
public override void AddChild(INode childNode)
{
throw new InvalidOperationException();
}
public override string ToString()
{
return String.Format("[NullBlockStatement]");
}
}
}

25
src/Libraries/NRefactory/Project/Src/Parser/AST/General/Statements/BreakStatement.cs

@ -1,25 +0,0 @@ @@ -1,25 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Collections;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class BreakStatement : Statement
{
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[BreakStatement]");
}
}
}

52
src/Libraries/NRefactory/Project/Src/Parser/AST/General/Statements/ContinueStatement.cs

@ -1,52 +0,0 @@ @@ -1,52 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Collections;
namespace ICSharpCode.NRefactory.Parser.AST
{
public enum ContinueType {
None,
Do,
For,
While
}
public class ContinueStatement : Statement
{
ContinueType continueType;
public ContinueType ContinueType {
get {
return continueType;
}
set {
continueType = value;
}
}
public ContinueStatement() : this(ContinueType.None)
{
}
public ContinueStatement(ContinueType continueType)
{
this.continueType = continueType;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[ContinueStatement]");
}
}
}

84
src/Libraries/NRefactory/Project/Src/Parser/AST/General/Statements/DoLoopStatement.cs

@ -1,84 +0,0 @@ @@ -1,84 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections;
namespace ICSharpCode.NRefactory.Parser.AST
{
public enum ConditionType
{
None,
Until,
While,
DoWhile
}
public enum ConditionPosition
{
None,
Start,
End
}
public class DoLoopStatement : StatementWithEmbeddedStatement
{
Expression condition;
ConditionType conditionType;
ConditionPosition conditionPosition;
public ConditionPosition ConditionPosition {
get {
return conditionPosition;
}
set {
conditionPosition = value;
}
}
public ConditionType ConditionType {
get {
return conditionType;
}
set {
conditionType = value;
}
}
public Expression Condition {
get {
return condition;
}
set {
condition = Expression.CheckNull(value);
}
}
public DoLoopStatement(Expression condition, Statement embeddedStatement, ConditionType conditionType, ConditionPosition conditionPosition)
{
this.Condition = condition;
this.EmbeddedStatement = embeddedStatement;
this.ConditionType = conditionType;
this.ConditionPosition = conditionPosition;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[DoLoopStatement: ConditionPosition = {0}, ConditionType = {1}, Condition = {2}, EmbeddedStatement = {3}]",
ConditionPosition,
ConditionType,
Condition,
EmbeddedStatement);
}
}
}

64
src/Libraries/NRefactory/Project/Src/Parser/AST/General/Statements/ForStatement.cs

@ -1,64 +0,0 @@ @@ -1,64 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections.Generic;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class ForStatement : StatementWithEmbeddedStatement
{
List<Statement> initializers; // EmbeddedStatement OR list of StatmentExpressions
Expression condition;
List<Statement> iterator; // [Statement]
public List<Statement> Initializers {
get {
return initializers;
}
}
public List<Statement> Iterator {
get {
return iterator;
}
}
public Expression Condition {
get {
return condition;
}
set {
condition = Expression.CheckNull(value);
}
}
public ForStatement(List<Statement> initializers, Expression condition, List<Statement> iterator, Statement embeddedStatement)
{
this.initializers = initializers ?? new List<Statement>(1);
this.iterator = iterator ?? new List<Statement>(1);
this.Condition = condition;
this.EmbeddedStatement = embeddedStatement;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[ForStatement: Initializers{0}, Condition={1}, iterator{2}, EmbeddedStatement={3}]",
GetCollectionString(initializers),
condition,
GetCollectionString(iterator),
EmbeddedStatement);
}
}
}

89
src/Libraries/NRefactory/Project/Src/Parser/AST/General/Statements/ForeachStatement.cs

@ -1,89 +0,0 @@ @@ -1,89 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class ForeachStatement : StatementWithEmbeddedStatement
{
TypeReference typeReference;
string variableName;
Expression expression;
Expression nextExpression;
public TypeReference TypeReference {
get {
return typeReference;
}
set {
typeReference = TypeReference.CheckNull(value);
}
}
public string VariableName {
get {
return variableName;
}
set {
variableName = value == null ? String.Empty : value;
}
}
public Expression Expression {
get {
return expression;
}
set {
expression = Expression.CheckNull(value);
}
}
public Expression NextExpression {
get {
return nextExpression;
}
set {
nextExpression = Expression.CheckNull(value);
}
}
public ForeachStatement(TypeReference typeReference, string variableName, Expression expression, Statement embeddedStatement)
{
this.TypeReference = typeReference;
this.VariableName = variableName;
this.Expression = expression;
this.EmbeddedStatement = embeddedStatement;
this.NextExpression = null;
}
public ForeachStatement(TypeReference typeReference, string variableName, Expression expression, Statement embeddedStatement, Expression nextExpression)
{
this.typeReference = typeReference;
this.variableName = variableName;
this.expression = expression;
this.nextExpression = nextExpression;
this.EmbeddedStatement = embeddedStatement;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString() {
return String.Format("[ForeachStatement: embeddedStatement = {0}, expression = {1}, nextExpression = {2}, typeReference = {3}, variableName = {4}]",
EmbeddedStatement,
expression,
nextExpression,
typeReference,
variableName);
}
}
}

45
src/Libraries/NRefactory/Project/Src/Parser/AST/General/Statements/GotoStatement.cs

@ -1,45 +0,0 @@ @@ -1,45 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class GotoStatement : Statement
{
string label = "";
public string Label {
get {
return label;
}
set {
Debug.Assert(value != null);
label = value;
}
}
public GotoStatement(string label)
{
Debug.Assert(label != null);
this.label = label;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[GotoStatement: Label={0}]",
label);
}
}
}

134
src/Libraries/NRefactory/Project/Src/Parser/AST/General/Statements/IfElseStatement.cs

@ -1,134 +0,0 @@ @@ -1,134 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections.Generic;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class IfElseStatement : Statement
{
Expression condition;
List<Statement> trueStatement; // List for stmt : stmt : stmt ... in VB.NET
List<Statement> falseStatement; // [Statement]
List<Statement> elseIfSections = new List<Statement>(1); // VB.NET only, [ElseIfSection]
public bool HasElseStatements {
get {
return falseStatement.Count > 0;
}
}
public bool HasElseIfSections {
get {
return elseIfSections.Count > 0;
}
}
public Expression Condition {
get {
return condition;
}
set {
condition = Expression.CheckNull(value);
}
}
public List<Statement> ElseIfSections {
get {
return elseIfSections;
}
set {
elseIfSections = value ?? new List<Statement>(1);
}
}
public List<Statement> TrueStatement {
get {
return trueStatement;
}
set {
trueStatement = value ?? new List<Statement>(1);
}
}
public List<Statement> FalseStatement {
get {
return falseStatement;
}
set {
falseStatement = value ?? new List<Statement>(1);
}
}
public IfElseStatement(Expression condition, Statement trueStatement)
{
this.Condition = condition;
this.trueStatement = new List<Statement>(1);
this.falseStatement = new List<Statement>(1);
this.trueStatement.Add(Statement.CheckNull(trueStatement));
}
public IfElseStatement(Expression condition, Statement trueStatement, Statement falseStatement)
{
this.Condition = condition;
this.trueStatement = new List<Statement>(1);
this.falseStatement = new List<Statement>(1);
this.trueStatement.Add(Statement.CheckNull(trueStatement));
this.falseStatement.Add(Statement.CheckNull(falseStatement));
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[IfElseStatement: Condition={0}, TrueStatement={1}, FalseStatement={2}]",
condition,
trueStatement,
falseStatement
);
}
}
public class ElseIfSection : StatementWithEmbeddedStatement
{
Expression condition;
public Expression Condition {
get {
return condition;
}
set {
condition = Expression.CheckNull(value);
}
}
public ElseIfSection(Expression condition, Statement embeddedStatement)
{
this.Condition = condition;
this.EmbeddedStatement = embeddedStatement;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[ElseIfStatement: Condition={0}, EmbeddedStatement={1}]",
condition,
EmbeddedStatement
);
}
}
}

43
src/Libraries/NRefactory/Project/Src/Parser/AST/General/Statements/LabelStatement.cs

@ -1,43 +0,0 @@ @@ -1,43 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class LabelStatement : Statement
{
string label;
public string Label {
get {
return label;
}
set {
label = value == null ? String.Empty : value;
}
}
public LabelStatement(string label)
{
this.Label = label;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[LabelStatement: Label={0}]",
label);
}
}
}

115
src/Libraries/NRefactory/Project/Src/Parser/AST/General/Statements/LocalVariableDeclaration.cs

@ -1,115 +0,0 @@ @@ -1,115 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections;
using System.Collections.Generic;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class LocalVariableDeclaration : Statement
{
TypeReference typeReference;
Modifier modifier = Modifier.None;
List<VariableDeclaration> variables = new List<VariableDeclaration>(1);
BlockStatement block = BlockStatement.Null; // the block in witch the variable is declared; needed for the LookupTable
public TypeReference TypeReference {
get {
return typeReference;
}
set {
typeReference = TypeReference.CheckNull(value);
}
}
public Modifier Modifier {
get {
return modifier;
}
set {
modifier = value;
}
}
public List<VariableDeclaration> Variables {
get {
return variables;
}
}
public BlockStatement Block {
get {
return block;
}
set {
Debug.Assert(value != null);
block = value;
}
}
public TypeReference GetTypeForVariable(int variableIndex)
{
if (!typeReference.IsNull) {
return typeReference;
}
for (int i = variableIndex; i < Variables.Count;++i) {
if (!((VariableDeclaration)Variables[i]).TypeReference.IsNull) {
return ((VariableDeclaration)Variables[i]).TypeReference;
}
}
return null;
}
public LocalVariableDeclaration(VariableDeclaration declaration) : this(TypeReference.Null)
{
Variables.Add(declaration);
}
public LocalVariableDeclaration(TypeReference typeReference)
{
this.TypeReference = typeReference;
}
public LocalVariableDeclaration(TypeReference typeReference, Modifier modifier)
{
this.TypeReference = typeReference;
this.modifier = modifier;
}
public LocalVariableDeclaration(Modifier modifier)
{
this.typeReference = TypeReference.Null;
this.modifier = modifier;
}
public VariableDeclaration GetVariableDeclaration(string variableName)
{
foreach (VariableDeclaration variableDeclaration in variables) {
if (variableDeclaration.Name == variableName) {
return variableDeclaration;
}
}
return null;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[LocalVariableDeclaration: Type={0}, Modifier ={1} Variables={2}]",
typeReference,
modifier,
GetCollectionString(variables));
}
}
}

45
src/Libraries/NRefactory/Project/Src/Parser/AST/General/Statements/LockStatement.cs

@ -1,45 +0,0 @@ @@ -1,45 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class LockStatement : StatementWithEmbeddedStatement
{
Expression lockExpression;
public Expression LockExpression {
get {
return lockExpression;
}
set {
lockExpression = Expression.CheckNull(value);
}
}
public LockStatement(Expression lockExpression, Statement embeddedStatement)
{
this.LockExpression = lockExpression;
this.EmbeddedStatement = embeddedStatement;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[LockStatement: LockExpression={0}, EmbeddedStatement={1}]",
lockExpression,
EmbeddedStatement);
}
}
}

43
src/Libraries/NRefactory/Project/Src/Parser/AST/General/Statements/ReturnStatement.cs

@ -1,43 +0,0 @@ @@ -1,43 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class ReturnStatement : Statement
{
Expression expression;
public Expression Expression {
get {
return expression;
}
set {
expression = Expression.CheckNull(value);
}
}
public ReturnStatement(Expression expression)
{
this.Expression = expression;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[ReturnStatement: Expression={0}]",
expression);
}
}
}

92
src/Libraries/NRefactory/Project/Src/Parser/AST/General/Statements/Statement.cs

@ -1,92 +0,0 @@ @@ -1,92 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Mike Krüger" email="mike@icsharpcode.net"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Collections;
namespace ICSharpCode.NRefactory.Parser.AST
{
public abstract class Statement : AbstractNode, INullable
{
public static NullStatement Null {
get {
return NullStatement.Instance;
}
}
public virtual bool IsNull {
get {
return false;
}
}
public static Statement CheckNull(Statement statement)
{
return statement == null ? NullStatement.Instance : statement;
}
public static void Replace(Statement oldStatement, Statement newStatement)
{
INode parent = oldStatement.Parent;
StatementWithEmbeddedStatement parentStmt = parent as StatementWithEmbeddedStatement;
if (parentStmt != null && parentStmt.EmbeddedStatement == oldStatement)
parentStmt.EmbeddedStatement = newStatement;
int index = parent.Children.IndexOf(oldStatement);
if (index >= 0) {
parent.Children[index] = newStatement;
newStatement.Parent = parent;
}
}
}
public abstract class StatementWithEmbeddedStatement : Statement
{
Statement embeddedStatement;
public Statement EmbeddedStatement {
get {
return embeddedStatement;
}
set {
embeddedStatement = Statement.CheckNull(value);
if (value != null)
value.Parent = this;
}
}
}
public class NullStatement : Statement
{
static NullStatement nullStatement = new NullStatement();
public override bool IsNull {
get {
return true;
}
}
public static NullStatement Instance {
get {
return nullStatement;
}
}
NullStatement()
{
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return data;
}
public override string ToString()
{
return String.Format("[NullStatement]");
}
}
}

42
src/Libraries/NRefactory/Project/Src/Parser/AST/General/Statements/StatementExpression.cs

@ -1,42 +0,0 @@ @@ -1,42 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Mike Krüger" email="mike@icsharpcode.net"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class StatementExpression : Statement
{
Expression expression;
public Expression Expression {
get {
return expression;
}
set {
expression = Expression.CheckNull(value);
}
}
public StatementExpression(Expression expression)
{
this.Expression = expression;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[StatementExpression: Expression={0}]", expression);
}
}
}

169
src/Libraries/NRefactory/Project/Src/Parser/AST/General/Statements/SwitchStatement.cs

@ -1,169 +0,0 @@ @@ -1,169 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections.Generic;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class SwitchStatement : Statement
{
Expression switchExpression;
List<SwitchSection> switchSections;
public Expression SwitchExpression {
get {
return switchExpression;
}
set {
switchExpression = Expression.CheckNull(value);
}
}
public List<SwitchSection> SwitchSections {
get {
return switchSections;
}
set {
switchSections = value ?? new List<SwitchSection>(1);
}
}
public SwitchStatement(Expression switchExpression, List<SwitchSection> switchSections)
{
this.SwitchExpression = switchExpression;
this.SwitchSections = switchSections;
}
public SwitchStatement(Expression switchExpression)
{
this.SwitchExpression = switchExpression;
this.switchSections = new List<SwitchSection>(1);
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[SwitchStatement: SwitchExpression={0}, SwitchSections={1}]",
SwitchExpression,
GetCollectionString(SwitchSections));
}
}
public class SwitchSection : BlockStatement
{
List<CaseLabel> switchLabels;
public List<CaseLabel> SwitchLabels {
get {
return switchLabels;
}
set {
switchLabels = value ?? new List<CaseLabel>(1);
}
}
public SwitchSection()
{
switchLabels = new List<CaseLabel>(1);
}
public SwitchSection(List<CaseLabel> switchLabels)
{
SwitchLabels = switchLabels;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[SwitchSection: SwitchLabels={0}]",
GetCollectionString(SwitchLabels));
}
}
public class CaseLabel : AbstractNode
{
Expression label = Expression.Null;
BinaryOperatorType bOp = BinaryOperatorType.None;
Expression toExpression = Expression.Null;
/// <value>null means default case</value>
public Expression Label {
get {
return label;
}
set {
label = Expression.CheckNull(value);
}
}
public bool IsDefault {
get {
return label.IsNull;
}
}
public BinaryOperatorType BinaryOperatorType {
get {
return bOp;
}
set {
bOp = value;
}
}
public Expression ToExpression {
get {
return toExpression;
}
set {
toExpression = Expression.CheckNull(value);
}
}
public CaseLabel(BinaryOperatorType bOp, Expression label)
{
this.BinaryOperatorType = bOp;
this.Label = label;
}
public CaseLabel(Expression label)
{
this.Label = label;
}
public CaseLabel(Expression label, Expression toExpression)
{
this.Label = label;
this.ToExpression = toExpression;
}
public CaseLabel()
{
this.label = Expression.Null;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[CaseLabel: Label = {0}]",
Label);
}
}
}

43
src/Libraries/NRefactory/Project/Src/Parser/AST/General/Statements/ThrowStatement.cs

@ -1,43 +0,0 @@ @@ -1,43 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class ThrowStatement : Statement
{
Expression expression;
public Expression Expression {
get {
return expression;
}
set {
expression = Expression.CheckNull(value);
}
}
public ThrowStatement(Expression expression)
{
this.Expression = expression;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[ThrowStatement: Expression={0}]",
expression);
}
}
}

148
src/Libraries/NRefactory/Project/Src/Parser/AST/General/Statements/TryCatchStatement.cs

@ -1,148 +0,0 @@ @@ -1,148 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections.Generic;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class TryCatchStatement : Statement
{
Statement statementBlock;
List<CatchClause> catchClauses;
Statement finallyBlock;
public Statement StatementBlock {
get {
return statementBlock;
}
set {
statementBlock = Statement.CheckNull(value);
}
}
public List<CatchClause> CatchClauses {
get {
return catchClauses;
}
set {
catchClauses = value ?? new List<CatchClause>(1);
}
}
public Statement FinallyBlock {
get {
return finallyBlock;
}
set {
finallyBlock = Statement.CheckNull(value);
}
}
public TryCatchStatement(Statement statementBlock, List<CatchClause> catchClauses, Statement finallyBlock)
{
this.StatementBlock = statementBlock;
this.CatchClauses = catchClauses;
this.FinallyBlock = finallyBlock;
}
public TryCatchStatement(Statement statementBlock, List<CatchClause> catchClauses) : this(statementBlock, catchClauses, null)
{
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[TryCatchStatement: StatementBlock={0}, CatchClauses={1}, FinallyBlock={2}]",
statementBlock,
GetCollectionString(catchClauses),
finallyBlock);
}
}
public class CatchClause : AbstractNode
{
TypeReference typeReference = TypeReference.Null;
string variableName = "";
Statement statementBlock = Statement.Null;
Expression condition = Expression.Null;
public TypeReference TypeReference {
get {
return typeReference;
}
set {
typeReference = TypeReference.CheckNull(value);
}
}
public Expression Condition {
get {
return condition;
}
set {
condition = Expression.CheckNull(value);
}
}
public string VariableName {
get {
return variableName;
}
set {
variableName = value == null ? String.Empty : value;
}
}
public Statement StatementBlock {
get {
return statementBlock;
}
set {
statementBlock = Statement.CheckNull(value);
}
}
public CatchClause(TypeReference typeReference, string variableName, Statement statementBlock)
{
this.TypeReference = typeReference;
this.VariableName = variableName;
this.StatementBlock = statementBlock;
}
public CatchClause(TypeReference typeReference, string variableName, Statement statementBlock, Expression condition)
{
this.TypeReference = typeReference;
this.VariableName = variableName;
this.StatementBlock = statementBlock;
this.Condition = condition;
}
public CatchClause(Statement statementBlock)
{
this.StatementBlock = statementBlock;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[CatchClause: TypeReference={0}, VariableName={1}, StatementBlock={2}]",
TypeReference,
variableName,
statementBlock);
}
}
}

75
src/Libraries/NRefactory/Project/Src/Parser/AST/General/Statements/VariableDeclaration.cs

@ -1,75 +0,0 @@ @@ -1,75 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Mike Krüger" email="mike@icsharpcode.net"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class VariableDeclaration : AbstractNode
{
// TODO: move to TypeLevel (used from FieldDeclaration)
string name;
Expression initializer;
TypeReference typeReference; // VB.NET only
public string Name {
get {
return name;
}
set {
name = value == null ? String.Empty : value;
}
}
public Expression Initializer {
get {
return initializer;
}
set {
initializer = Expression.CheckNull(value);
}
}
public TypeReference TypeReference {
get {
return typeReference;
}
set {
typeReference = TypeReference.CheckNull(value);
}
}
public VariableDeclaration(string name) : this(name, null)
{
}
public VariableDeclaration(string name, Expression initializer) : this(name, initializer, null)
{
}
public VariableDeclaration(string name, Expression initializer, TypeReference typeReference)
{
this.Name = name;
this.Initializer = initializer;
this.TypeReference = typeReference;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[VariableDeclaration: Name={0}, Initializer={1}, TypeReference={2}]", name, initializer, typeReference);
}
}
}

61
src/Libraries/NRefactory/Project/Src/Parser/AST/General/TypeLevel/ConstructorDeclaration.cs

@ -1,61 +0,0 @@ @@ -1,61 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Mike Krüger" email="mike@icsharpcode.net"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections;
using System.Collections.Generic;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class ConstructorDeclaration : ParametrizedNode
{
ConstructorInitializer constructorInitializer = ConstructorInitializer.Null; // only for C#, can be null if no initializer is present
BlockStatement blockStatement = BlockStatement.Null;
public ConstructorInitializer ConstructorInitializer {
get {
return constructorInitializer;
}
set {
constructorInitializer = value == null ? ConstructorInitializer.Null : value;
}
}
public BlockStatement Body {
get {
return blockStatement;
}
set {
blockStatement = BlockStatement.CheckNull(value);;
}
}
public ConstructorDeclaration(string name, Modifier modifier, List<ParameterDeclarationExpression> parameters, List<AttributeSection> attributes) : base(modifier, attributes, name, parameters)
{
}
public ConstructorDeclaration(string name, Modifier modifier, List<ParameterDeclarationExpression> parameters, ConstructorInitializer constructorInitializer, List<AttributeSection> attributes) : base(modifier, attributes, name, parameters)
{
this.ConstructorInitializer = constructorInitializer;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[ConstructorDeclaration: Name={0}, Modifier={1}, Parameters={2}, Attributes={3}, Body={4}]",
Name,
Modifier,
GetCollectionString(Parameters),
GetCollectionString(Attributes),
Body);
}
}
}

98
src/Libraries/NRefactory/Project/Src/Parser/AST/General/TypeLevel/ConstructorInitializer.cs

@ -1,98 +0,0 @@ @@ -1,98 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Andrea Paatz" email="andrea@icsharpcode.net"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Collections.Generic;
using System.Diagnostics;
namespace ICSharpCode.NRefactory.Parser.AST
{
public enum ConstructorInitializerType {
None,
Base,
This
}
public class ConstructorInitializer : AbstractNode, INullable
{
ConstructorInitializerType constructorInitializerType = ConstructorInitializerType.None;
List<Expression> arguments = new List<Expression>(1);
public ConstructorInitializerType ConstructorInitializerType {
get {
return constructorInitializerType;
}
set {
constructorInitializerType = value;
}
}
public List<Expression> Arguments {
get {
return arguments;
}
set {
arguments = value ?? new List<Expression>(1);
}
}
public virtual bool IsNull {
get {
return false;
}
}
public static NullConstructorInitializer Null {
get {
return NullConstructorInitializer.Instance;
}
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[ConstructorInitializer: ConstructorInitializerType = {0}, Arguments = {1}]",
ConstructorInitializerType,
GetCollectionString(arguments));
}
}
public class NullConstructorInitializer : ConstructorInitializer
{
static NullConstructorInitializer nullConstructorInitializer = new NullConstructorInitializer();
public static NullConstructorInitializer Instance {
get {
return nullConstructorInitializer;
}
}
public override bool IsNull {
get {
return true;
}
}
NullConstructorInitializer()
{
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return data;
}
public override string ToString()
{
return String.Format("[NullConstructorInitializer]");
}
}
}

217
src/Libraries/NRefactory/Project/Src/Parser/AST/General/TypeLevel/EventAddRemoveRegion.cs

@ -1,217 +0,0 @@ @@ -1,217 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Mike Krüger" email="mike@icsharpcode.net"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections;
using System.Collections.Generic;
namespace ICSharpCode.NRefactory.Parser.AST
{
public abstract class EventAddRemoveRegion : AttributedNode, INullable
{
BlockStatement block = BlockStatement.Null;
List<ParameterDeclarationExpression> parameters;
public BlockStatement Block {
get {
return block;
}
set {
Debug.Assert(value != null);
block = value;
}
}
public List<ParameterDeclarationExpression> Parameters {
get {
return parameters;
}
set {
parameters = value == null ? new List<ParameterDeclarationExpression>(1) : value;
}
}
public virtual bool IsNull {
get {
return false;
}
}
public EventAddRemoveRegion(List<AttributeSection> attributes) : base(attributes)
{
Parameters = null;
}
protected EventAddRemoveRegion() : base(null)
{
Parameters = null;
}
}
public class EventAddRegion : EventAddRemoveRegion
{
public static EventAddRegion Null {
get {
return NullEventAddRegion.Instance;
}
}
public EventAddRegion(List<AttributeSection> attributes) : base (attributes)
{}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[EventAddRegion: Attributes = {0}, Block = {1}]",
GetCollectionString(Attributes),
Block);
}
}
public class EventRemoveRegion : EventAddRemoveRegion
{
public static EventRemoveRegion Null {
get {
return NullEventRemoveRegion.Instance;
}
}
public EventRemoveRegion(List<AttributeSection> attributes) : base (attributes)
{}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[EventRemoveRegion: Attributes = {0}, Block = {1}]",
GetCollectionString(Attributes),
Block);
}
}
public class EventRaiseRegion : EventAddRemoveRegion
{
public static EventRaiseRegion Null {
get {
return NullEventRaiseRegion.Instance;
}
}
public EventRaiseRegion(List<AttributeSection> attributes) : base (attributes)
{}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[EventRaiseRegion: Attributes = {0}, Block = {1}]",
GetCollectionString(Attributes),
Block);
}
}
public class NullEventAddRegion : EventAddRegion
{
static NullEventAddRegion nullEventAddRegion = new NullEventAddRegion();
public static NullEventAddRegion Instance {
get {
return nullEventAddRegion;
}
}
NullEventAddRegion() : base(new List<AttributeSection>(1))
{
}
public override bool IsNull {
get {
return true;
}
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return data;
}
public override string ToString()
{
return String.Format("[NullEventRemoveRegion]");
}
}
public class NullEventRemoveRegion : EventRemoveRegion
{
static NullEventRemoveRegion nullEventRemoveRegion = new NullEventRemoveRegion();
public static NullEventRemoveRegion Instance {
get {
return nullEventRemoveRegion;
}
}
NullEventRemoveRegion() : base(new List<AttributeSection>(1))
{
}
public override bool IsNull {
get {
return true;
}
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return data;
}
public override string ToString()
{
return String.Format("[NullEventRemoveRegion]");
}
}
public class NullEventRaiseRegion : EventRaiseRegion
{
static NullEventRaiseRegion nullEventRaiseRegion = new NullEventRaiseRegion();
public static NullEventRaiseRegion Instance {
get {
return nullEventRaiseRegion;
}
}
NullEventRaiseRegion() : base(new List<AttributeSection>(1))
{
}
public override bool IsNull {
get {
return true;
}
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return data;
}
public override string ToString()
{
return String.Format("[NullEventRaiseRegion]");
}
}
}

135
src/Libraries/NRefactory/Project/Src/Parser/AST/General/TypeLevel/EventDeclaration.cs

@ -1,135 +0,0 @@ @@ -1,135 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Mike Krüger" email="mike@icsharpcode.net"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Drawing;
using System.Diagnostics;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class EventDeclaration : ParametrizedNode
{
TypeReference typeReference = TypeReference.Null;
List<InterfaceImplementation> interfaceImplementations = new List<InterfaceImplementation>(1);
EventAddRegion addRegion = EventAddRegion.Null;
EventRemoveRegion removeRegion = EventRemoveRegion.Null;
EventRaiseRegion raiseRegion = EventRaiseRegion.Null;
Point bodyStart = new Point(-1, -1);
Point bodyEnd = new Point(-1, -1);
public TypeReference TypeReference {
get {
return typeReference;
}
set {
typeReference = TypeReference.CheckNull(value);
}
}
public EventAddRegion AddRegion {
get {
return addRegion;
}
set {
addRegion = value == null ? EventAddRegion.Null : value;
}
}
public EventRemoveRegion RemoveRegion {
get {
return removeRegion;
}
set {
removeRegion = value == null ? EventRemoveRegion.Null : value;
}
}
public EventRaiseRegion RaiseRegion {
get {
return raiseRegion;
}
set {
raiseRegion = value == null ? EventRaiseRegion.Null : value;
}
}
public bool HasAddRegion {
get {
return !addRegion.IsNull;
}
}
public bool HasRemoveRegion {
get {
return !removeRegion.IsNull;
}
}
public bool HasRaiseRegion {
get {
return !raiseRegion.IsNull;
}
}
public Point BodyStart {
get {
return bodyStart;
}
set {
bodyStart = value;
}
}
public Point BodyEnd {
get {
return bodyEnd;
}
set {
bodyEnd = value;
}
}
public List<InterfaceImplementation> InterfaceImplementations {
get {
return interfaceImplementations;
}
set {
interfaceImplementations = value ?? new List<InterfaceImplementation>();
}
}
public EventDeclaration(Modifier modifier, List<AttributeSection> attributes) : base(modifier, attributes)
{
}
public EventDeclaration(TypeReference typeReference, string name, Modifier modifier, List<AttributeSection> attributes) : base(modifier, attributes, name)
{
this.TypeReference = typeReference;
}
// for VB:
public EventDeclaration(TypeReference typeReference, Modifier modifier, List<ParameterDeclarationExpression> parameters, List<AttributeSection> attributes, string name, List<InterfaceImplementation> interfaceImplementations) : base(modifier, attributes, name, parameters)
{
this.TypeReference = typeReference;
this.InterfaceImplementations = interfaceImplementations;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[EventDeclaration: TypeReference={0}, Modifier={1}, Attributes={2}, Name={3}, BodyStart={4}, BodyEnd={5}]",
TypeReference,
Modifier,
GetCollectionString(Attributes),
Name,
BodyStart,
BodyEnd);
}
}
}

89
src/Libraries/NRefactory/Project/Src/Parser/AST/General/TypeLevel/FieldDeclaration.cs

@ -1,89 +0,0 @@ @@ -1,89 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Mike Krüger" email="mike@icsharpcode.net"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections;
using System.Collections.Generic;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class FieldDeclaration : AttributedNode
{
TypeReference typeReference = TypeReference.Null;
List<VariableDeclaration> fields = new List<VariableDeclaration>(1);
public TypeReference TypeReference {
get {
return typeReference;
}
set {
typeReference = TypeReference.CheckNull(value);
}
}
public List<VariableDeclaration> Fields {
get {
return fields;
}
set {
Debug.Assert(fields != null);
fields = value;
}
}
public TypeReference GetTypeForField(int fieldIndex)
{
if (!typeReference.IsNull) {
return typeReference;
}
for (int i = fieldIndex; i < Fields.Count;++i) {
if (!((VariableDeclaration)Fields[i]).TypeReference.IsNull) {
return ((VariableDeclaration)Fields[i]).TypeReference;
}
}
return TypeReference.Null;
}
// for enum members
public FieldDeclaration(List<AttributeSection> attributes) : base(attributes)
{
Debug.Assert(attributes != null);
}
// for all other cases
public FieldDeclaration(List<AttributeSection> attributes, TypeReference typeReference, Modifier modifier) : base(modifier, attributes)
{
this.TypeReference = typeReference;
}
public VariableDeclaration GetVariableDeclaration(string variableName)
{
foreach (VariableDeclaration variableDeclaration in Fields) {
if (variableDeclaration.Name == variableName) {
return variableDeclaration;
}
}
return null;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[FieldDeclaration: Attributes={0}, TypeReference={1}, Modifier={2}, Fields={3}]",
GetCollectionString(Attributes),
TypeReference,
Modifier,
GetCollectionString(Fields));
}
}
}

35
src/Libraries/NRefactory/Project/Src/Parser/AST/General/TypeLevel/InterfaceImplementation.cs

@ -1,35 +0,0 @@ @@ -1,35 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>
// <version>$Revision$</version>
// </file>
using System;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class InterfaceImplementation
{
TypeReference interfaceType;
string memberName;
public TypeReference InterfaceType {
get {
return interfaceType;
}
}
public string MemberName {
get {
return memberName;
}
}
public InterfaceImplementation(TypeReference interfaceType, string memberName)
{
this.interfaceType = interfaceType ?? TypeReference.Null;
this.memberName = memberName ?? "?";
}
}
}

99
src/Libraries/NRefactory/Project/Src/Parser/AST/General/TypeLevel/MethodDeclaration.cs

@ -1,99 +0,0 @@ @@ -1,99 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Mike Krüger" email="mike@icsharpcode.net"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class MethodDeclaration : ParametrizedNode
{
TypeReference typeReference = TypeReference.Null;
BlockStatement body = BlockStatement.Null;
ArrayList handlesClause = new ArrayList(); // VB only
List<InterfaceImplementation> interfaceImplementations = new List<InterfaceImplementation>(1);
AttributeSection returnTypeAttributeSection = AttributeSection.Null;
List<TemplateDefinition> templates = new List<TemplateDefinition>(1);
public List<TemplateDefinition> Templates {
get {
return templates;
}
set {
templates = value;
}
}
public AttributeSection ReturnTypeAttributeSection {
get {
return returnTypeAttributeSection;
}
set {
returnTypeAttributeSection = AttributeSection.CheckNull(value);
}
}
public BlockStatement Body {
get {
return body;
}
set {
body = BlockStatement.CheckNull(value);
}
}
public TypeReference TypeReference {
get {
return typeReference;
}
set {
typeReference = TypeReference.CheckNull(value);
}
}
public ArrayList HandlesClause {
get {
return handlesClause;
}
set {
handlesClause = value == null ? new ArrayList() : value;
}
}
public List<InterfaceImplementation> InterfaceImplementations {
get {
return interfaceImplementations;
}
set {
interfaceImplementations = value ?? new List<InterfaceImplementation>();
}
}
public MethodDeclaration(string name, Modifier modifier, TypeReference typeReference, List<ParameterDeclarationExpression> parameters, List<AttributeSection> attributes) : base(modifier, attributes, name, parameters)
{
this.TypeReference = typeReference;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[MethodDeclaration: Name = {0}, Body = {1}, Modifier = {2}, TypeReference = {3}, Parameters = {4}, Attributes = {5}]",
Name,
Body,
Modifier,
TypeReference,
GetCollectionString(Parameters),
GetCollectionString(Attributes));
}
}
}

160
src/Libraries/NRefactory/Project/Src/Parser/AST/General/TypeLevel/OperatorDeclaration.cs

@ -1,160 +0,0 @@ @@ -1,160 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Mike Krüger" email="mike@icsharpcode.net"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections;
using System.Collections.Generic;
namespace ICSharpCode.NRefactory.Parser.AST
{
public enum ConversionType {
None,
Implicit,
Explicit
}
public enum OverloadableOperatorType {
None,
Add,
Subtract,
Multiply,
Divide,
Modulus,
Concat,
Not,
BitNot,
BitwiseAnd,
BitwiseOr,
ExclusiveOr,
ShiftLeft,
ShiftRight,
GreaterThan,
GreaterThanOrEqual,
Equality,
InEquality,
LessThan,
LessThanOrEqual,
Increment,
Decrement,
True,
False,
// VB specific
IsTrue,
IsFalse,
Like,
Power,
CType,
DivideInteger
}
public class OperatorDeclaration : MethodDeclaration
{
ConversionType conversionType = ConversionType.None;
TypeReference convertToType;
List<AttributeSection> returnTypeAttributes = new List<AttributeSection>();
OverloadableOperatorType overloadableOperator = OverloadableOperatorType.None;
public ConversionType ConversionType {
get {
return conversionType;
}
set {
conversionType = value;
}
}
public List<AttributeSection> ReturnTypeAttributes
{
get {
return returnTypeAttributes;
}
set {
returnTypeAttributes = value;
}
}
public TypeReference ConvertToType {
get {
return convertToType;
}
set {
convertToType = TypeReference.CheckNull(value);
}
}
public OverloadableOperatorType OverloadableOperator {
get {
return overloadableOperator;
}
set {
overloadableOperator = value;
}
}
public bool IsConversionOperator {
get {
return conversionType != ConversionType.None;
}
}
/// <summary>
/// Constructor for conversion type operators
/// </summary>
/// <param name="modifier"></param>
/// <param name="List"></param>
public OperatorDeclaration(Modifier modifier,
List<AttributeSection> attributes,
List<ParameterDeclarationExpression> parameters,
TypeReference convertToType,
ConversionType conversionType
) : base(null, modifier, TypeReference.Null, parameters, attributes)
{
this.ConversionType = conversionType;
this.ConvertToType = convertToType;
}
/// <summary>
/// Constructor for operator type operators
/// </summary>
/// <param name="modifier"></param>
/// <param name="List"></param>
public OperatorDeclaration(Modifier modifier,
List<AttributeSection> attributes,
List<ParameterDeclarationExpression> parameters,
TypeReference typeReference,
OverloadableOperatorType overloadableOperator
) : base(null, modifier, typeReference, parameters, attributes)
{
this.overloadableOperator = overloadableOperator;
convertToType = TypeReference.Null;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[OperatorDeclaration: conversionType = {0}, convertToType = {1}, operator ={2}, BASE={3}]",
conversionType,
convertToType,
this.overloadableOperator,
base.ToString()
);
}
}
}

110
src/Libraries/NRefactory/Project/Src/Parser/AST/General/TypeLevel/ParameterDeclarationExpression.cs

@ -1,110 +0,0 @@ @@ -1,110 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections.Generic;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class ParameterDeclarationExpression : Expression
{
TypeReference typeReference = TypeReference.Null;
string parameterName = "";
ParamModifier paramModifier = ParamModifier.In;
List<AttributeSection> attributes = new List<AttributeSection>(1);
Expression defaultValue = Expression.Null;
public Expression DefaultValue {
get {
return defaultValue;
}
set {
defaultValue = Expression.CheckNull(defaultValue);
}
}
public TypeReference TypeReference {
get {
return typeReference;
}
set {
typeReference = value ?? TypeReference.Null;
}
}
public string ParameterName {
get {
return parameterName;
}
set {
Debug.Assert(value != null);
parameterName = value;
}
}
public ParamModifier ParamModifier {
get {
return paramModifier;
}
set {
paramModifier = value;
}
}
public List<AttributeSection> Attributes {
get {
return attributes;
}
set {
Debug.Assert(value != null);
attributes = value;
}
}
public ParameterDeclarationExpression(TypeReference typeReference, string parameterName)
{
this.TypeReference = typeReference;
if (parameterName == null || parameterName.Length == 0)
parameterName = "?";
this.parameterName = parameterName;
this.paramModifier = ParamModifier.In;
}
public ParameterDeclarationExpression(TypeReference typeReference, string parameterName, ParamModifier paramModifier)
{
this.typeReference = typeReference;
if (parameterName == null || parameterName.Length == 0)
parameterName = "?";
this.parameterName = parameterName;
this.paramModifier = paramModifier;
}
public ParameterDeclarationExpression(TypeReference typeReference, string parameterName, ParamModifier paramModifier, Expression defaultValue)
{
this.typeReference = typeReference;
if (parameterName == null || parameterName.Length == 0)
parameterName = "?";
this.parameterName = parameterName;
this.paramModifier = paramModifier;
this.DefaultValue = defaultValue;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[ParameterDeclarationExpression: TypeReference={0}, ParameterName={1}, ParamModifier={2}, Attributes={3}]",
TypeReference,
ParameterName,
ParamModifier,
GetCollectionString(Attributes));
}
}
}

138
src/Libraries/NRefactory/Project/Src/Parser/AST/General/TypeLevel/PropertyDeclaration.cs

@ -1,138 +0,0 @@ @@ -1,138 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Mike Krüger" email="mike@icsharpcode.net"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Drawing;
using System.Diagnostics;
using System.Collections;
using System.Collections.Generic;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class PropertyDeclaration : ParametrizedNode
{
TypeReference typeReference = TypeReference.Null;
Point bodyStart = new Point(-1, -1);
Point bodyEnd = new Point(-1, -1);
List<InterfaceImplementation> interfaceImplementations = new List<InterfaceImplementation>();
PropertyGetRegion propertyGetRegion = PropertyGetRegion.Null;
PropertySetRegion propertySetRegion = PropertySetRegion.Null;
public TypeReference TypeReference {
get {
return typeReference;
}
set {
Debug.Assert(value != null);
typeReference = value;
}
}
public PropertyGetRegion GetRegion {
get {
return propertyGetRegion;
}
set {
if (value == null) {
propertyGetRegion = PropertyGetRegion.Null;
} else {
propertyGetRegion = value;
}
}
}
public PropertySetRegion SetRegion {
get {
return propertySetRegion;
}
set {
if (value == null) {
propertySetRegion = PropertySetRegion.Null;
} else {
propertySetRegion = value;
}
}
}
public bool HasGetRegion {
get {
return !propertyGetRegion.IsNull;
}
}
public bool HasSetRegion {
get {
return !propertySetRegion.IsNull;
}
}
public bool IsReadOnly {
get {
return HasGetRegion && !HasSetRegion;
}
}
public bool IsWriteOnly {
get {
return !HasGetRegion && HasSetRegion;
}
}
public Point BodyStart {
get {
return bodyStart;
}
set {
bodyStart = value;
}
}
public Point BodyEnd {
get {
return bodyEnd;
}
set {
bodyEnd = value;
}
}
public List<InterfaceImplementation> InterfaceImplementations {
get {
return interfaceImplementations;
}
set {
interfaceImplementations = value ?? new List<InterfaceImplementation>();
}
}
public PropertyDeclaration(string name, TypeReference typeReference, Modifier modifier, List<AttributeSection> attributes) : base(modifier, attributes, name)
{
Debug.Assert(typeReference != null);
this.typeReference = typeReference;
if ((modifier & Modifier.ReadOnly) == Modifier.ReadOnly) {
this.GetRegion = new PropertyGetRegion(null, null);
} else if ((modifier & Modifier.WriteOnly) == Modifier.WriteOnly) {
this.SetRegion = new PropertySetRegion(null, null);
}
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[PropertyDeclaration: Name = {0}, Modifier = {1}, TypeReference = {2}, Attributes = {3}, GetRegion = {4}, SetRegion = {5}]",
Name,
Modifier,
TypeReference,
GetCollectionString(Attributes),
GetRegion,
SetRegion);
}
}
}

158
src/Libraries/NRefactory/Project/Src/Parser/AST/General/TypeLevel/PropertyGetSetRegion.cs

@ -1,158 +0,0 @@ @@ -1,158 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Mike Krüger" email="mike@icsharpcode.net"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections.Generic;
namespace ICSharpCode.NRefactory.Parser.AST
{
/// <summary>
/// Base class for PropertyGetRegion and PropertySetRegion.
/// </summary>
public abstract class PropertyGetSetRegion : AttributedNode, INullable
{
BlockStatement block = BlockStatement.Null; // can be null if only the definition is there (interface declaration)
public BlockStatement Block {
get {
return block;
}
set {
block = BlockStatement.CheckNull(value); ;
}
}
public virtual bool IsNull {
get {
return false;
}
}
public PropertyGetSetRegion(BlockStatement block, List<AttributeSection> attributes) : base(attributes)
{
this.Block = block;
}
}
public class PropertyGetRegion : PropertyGetSetRegion
{
public static NullPropertyGetRegion Null {
get {
return NullPropertyGetRegion.Instance;
}
}
public PropertyGetRegion(BlockStatement block, List<AttributeSection> attributes) : base(block, attributes)
{}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[PropertyGetRegion: Block={0}, Attributes={1}]",
Block,
GetCollectionString(Attributes));
}
}
public class PropertySetRegion : PropertyGetSetRegion
{
List<ParameterDeclarationExpression> parameters = new List<ParameterDeclarationExpression>(1);
public List<ParameterDeclarationExpression> Parameters {
get {
return parameters;
}
set {
parameters = value == null ? new List<ParameterDeclarationExpression>(1) : value;
}
}
public static NullPropertySetRegion Null {
get {
return NullPropertySetRegion.Instance;
}
}
public PropertySetRegion(BlockStatement block, List<AttributeSection> attributes) : base(block, attributes)
{}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[PropertySetRegion: Block={0}, Attributes={1}]",
Block,
GetCollectionString(Attributes));
}
}
public class NullPropertyGetRegion : PropertyGetRegion
{
static NullPropertyGetRegion nullPropertyGetRegion = new NullPropertyGetRegion();
public static NullPropertyGetRegion Instance {
get {
return nullPropertyGetRegion;
}
}
NullPropertyGetRegion() : base(null, null)
{
}
public override bool IsNull {
get {
return true;
}
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return data;
}
public override string ToString()
{
return String.Format("[NullPropertyGetSetRegion]");
}
}
public class NullPropertySetRegion : PropertySetRegion
{
static NullPropertySetRegion nullPropertySetRegion = new NullPropertySetRegion();
public static NullPropertySetRegion Instance {
get {
return nullPropertySetRegion;
}
}
NullPropertySetRegion() : base(null, null)
{
}
public override bool IsNull {
get {
return true;
}
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return data;
}
public override string ToString()
{
return String.Format("[NullPropertyGetSetRegion]");
}
}
}

43
src/Libraries/NRefactory/Project/Src/Parser/AST/VBNet/Expressions/AddressOfExpression.cs

@ -1,43 +0,0 @@ @@ -1,43 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class AddressOfExpression : Expression
{
Expression expression;
public Expression Expression {
get {
return expression;
}
set {
expression = Expression.CheckNull(value);
}
}
public AddressOfExpression(Expression expression)
{
this.Expression = expression;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[AddressOfExpression: Expression = {0}]",
expression);
}
}
}

25
src/Libraries/NRefactory/Project/Src/Parser/AST/VBNet/Expressions/ClassReferenceExpression.cs

@ -1,25 +0,0 @@ @@ -1,25 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Collections;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class ClassReferenceExpression : Expression
{
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[ClassReferenceExpression]");
}
}
}

56
src/Libraries/NRefactory/Project/Src/Parser/AST/VBNet/Expressions/TypeOfIsExpression.cs

@ -1,56 +0,0 @@ @@ -1,56 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class TypeOfIsExpression : Expression
{
TypeReference typeReference;
public TypeReference TypeReference {
get {
return typeReference;
}
set {
typeReference = TypeReference.CheckNull(value);
}
}
Expression expression;
public Expression Expression {
get {
return expression;
}
set {
expression = Expression.CheckNull(value);
}
}
public TypeOfIsExpression(Expression expression, TypeReference typeReference)
{
this.Expression = expression;
this.TypeReference = typeReference;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[TypeOfIsExpression: Expression={0}, TypeReference={1}]",
Expression,
TypeReference);
}
}
}

71
src/Libraries/NRefactory/Project/Src/Parser/AST/VBNet/GlobalScope/OptionDeclaration.cs

@ -1,71 +0,0 @@ @@ -1,71 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Mike Krüger" email="mike@icsharpcode.net"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Collections;
namespace ICSharpCode.NRefactory.Parser.AST
{
///<summary>
/// Compare type, used in the <c>Option Compare</c>
/// pragma (VB only).
///</summary>
public enum OptionType
{
None,
Explicit,
Strict,
CompareBinary,
CompareText
}
public class OptionDeclaration : AbstractNode
{
OptionType optionType;
bool optionvalue;
public OptionType OptionType {
get {
return optionType;
}
set {
optionType = value;
}
}
public bool OptionValue {
get {
return optionvalue;
}
set {
optionvalue = value;
}
}
public OptionDeclaration(OptionType optionType) : this(optionType, true)
{
}
public OptionDeclaration(OptionType optionType, bool optionvalue)
{
this.optionType = optionType;
this.optionvalue = optionvalue;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[OptionCompareDeclaration: OptionType = {0}, OptionValue = {1}]",
OptionType,
OptionValue);
}
}
}

54
src/Libraries/NRefactory/Project/Src/Parser/AST/VBNet/Statements/AddHandlerStatement.cs

@ -1,54 +0,0 @@ @@ -1,54 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class AddHandlerStatement : Statement
{
Expression eventExpression;
Expression handlerExpression;
public Expression EventExpression {
get {
return eventExpression;
}
set {
eventExpression = Expression.CheckNull(value);
}
}
public Expression HandlerExpression {
get {
return handlerExpression;
}
set {
handlerExpression = Expression.CheckNull(value);
}
}
public AddHandlerStatement(Expression eventExpression, Expression handlerExpression)
{
this.EventExpression = eventExpression;
this.HandlerExpression = handlerExpression;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[AddHandlerStatement: EventExpression = {0}, HandlerExpression = {1}]",
EventExpression,
HandlerExpression);
}
}
}

25
src/Libraries/NRefactory/Project/Src/Parser/AST/VBNet/Statements/EndStatement.cs

@ -1,25 +0,0 @@ @@ -1,25 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Collections;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class EndStatement : Statement
{
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[EndStatement]");
}
}
}

43
src/Libraries/NRefactory/Project/Src/Parser/AST/VBNet/Statements/EraseStatements.cs

@ -1,43 +0,0 @@ @@ -1,43 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class EraseStatement : Statement
{
// List<Expression> expressions;
ArrayList expressions;
public ArrayList Expressions {
get {
return expressions;
} set {
expressions = value == null ? new ArrayList(1) : value;
}
}
public EraseStatement(ArrayList expressions)
{
this.Expressions = expressions;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[EraseStatement: Expressions = {0}]",
Expressions);
}
}
}

42
src/Libraries/NRefactory/Project/Src/Parser/AST/VBNet/Statements/ErrorStatement.cs

@ -1,42 +0,0 @@ @@ -1,42 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class ErrorStatement : Statement
{
Expression expression;
public Expression Expression {
get {
return expression;
} set {
expression = Expression.CheckNull(value);
}
}
public ErrorStatement(Expression expression)
{
this.Expression = expression;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[ErrorStatement: Expression = {0}]",
Expression);
}
}
}

54
src/Libraries/NRefactory/Project/Src/Parser/AST/VBNet/Statements/ExitStatement.cs

@ -1,54 +0,0 @@ @@ -1,54 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Collections;
namespace ICSharpCode.NRefactory.Parser.AST
{
public enum ExitType
{
None,
Sub,
Function,
Property,
Do,
For,
While,
Select,
Try
}
public class ExitStatement : Statement
{
ExitType exitType;
public ExitType ExitType {
get {
return exitType;
}
set {
exitType = value;
}
}
public ExitStatement(ExitType exitType)
{
this.exitType = exitType;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[ExitStatement]");
}
}
}

106
src/Libraries/NRefactory/Project/Src/Parser/AST/VBNet/Statements/ForNextStatement.cs

@ -1,106 +0,0 @@ @@ -1,106 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Collections.Generic;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class ForNextStatement : StatementWithEmbeddedStatement
{
Expression start;
Expression end;
Expression step;
List<Expression> nextExpressions;
TypeReference typeReference;
string variableName;
public TypeReference TypeReference {
get {
return typeReference;
}
set {
typeReference = TypeReference.CheckNull(value);
}
}
public string VariableName {
get {
return variableName;
}
set {
variableName = value == null ? String.Empty : value;
}
}
public List<Expression> NextExpressions {
get {
return nextExpressions;
}
set {
nextExpressions = value ?? new List<Expression>(1);
}
}
public Expression Start {
get {
return start;
}
set {
start = Expression.CheckNull(value);
}
}
public Expression End {
get {
return end;
}
set {
end = Expression.CheckNull(value);
}
}
public Expression Step {
get {
return step;
}
set {
step = Expression.CheckNull(value);
}
}
public ForNextStatement(TypeReference typeReference, string variableName, Expression start, Expression end, Expression step, Statement embeddedStatement, List<Expression> nextExpressions)
{
this.TypeReference = typeReference;
this.VariableName = variableName;
this.Start = start;
this.NextExpressions = nextExpressions;
this.End = end;
this.Step = step;
this.EmbeddedStatement = embeddedStatement;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[ForNextStatement: start = {0}, end = {1}, step = {2}, embeddedStatement = {3}, nextExpressions={4}, name={5}, typeRef={6}]",
start,
end,
step,
EmbeddedStatement,
GetCollectionString(nextExpressions),
VariableName,
TypeReference
);
}
}
}

32
src/Libraries/NRefactory/Project/Src/Parser/AST/VBNet/Statements/OnErrorStatement.cs

@ -1,32 +0,0 @@ @@ -1,32 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class OnErrorStatement : StatementWithEmbeddedStatement
{
public OnErrorStatement(Statement embeddedStatement)
{
this.EmbeddedStatement = embeddedStatement;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[OnErrorStatement: EmbeddedStatement = {0}]",
EmbeddedStatement);
}
}
}

57
src/Libraries/NRefactory/Project/Src/Parser/AST/VBNet/Statements/RaiseEventStatement.cs

@ -1,57 +0,0 @@ @@ -1,57 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections.Generic;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class RaiseEventStatement : Statement
{
string eventName = "";
List<Expression> arguments = new List<Expression>(1);
public string EventName {
get {
return eventName;
}
set {
Debug.Assert(value != null);
eventName = value;
}
}
public List<Expression> Arguments {
get {
return arguments;
}
set {
Debug.Assert(value != null);
arguments = value;
}
}
public RaiseEventStatement(string eventName, List<Expression> arguments)
{
Debug.Assert(eventName != null);
this.eventName = eventName;
this.arguments = arguments ?? new List<Expression>();
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[RaiseEventStatement: EventName={0}, Parameters={1}]",
EventName,
GetCollectionString(arguments));
}
}
}

87
src/Libraries/NRefactory/Project/Src/Parser/AST/VBNet/Statements/ReDimStatement.cs

@ -1,87 +0,0 @@ @@ -1,87 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections.Generic;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class ReDimStatement : Statement
{
List<InvocationExpression> reDimClauses = new List<InvocationExpression>(1);
bool isPreserve = false;
public bool IsPreserve {
get {
return isPreserve;
}
set {
isPreserve = value;
}
}
public List<InvocationExpression> ReDimClauses {
get {
return reDimClauses;
}
}
public ReDimStatement(bool isPreserve)
{
this.isPreserve = isPreserve;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[ReDimStatement: ReDimClauses = {0}]",
GetCollectionString(ReDimClauses));
}
}
// public class ReDimClause : AbstractNode
// {
// string name;
// List<Expression> initializers = new List<Expression>(1);
//
// public string Name {
// get {
// return name;
// }
// set {
// name = value == null ? String.Empty : value;
// }
// }
//
// public List<Expression> Initializers {
// get {
// return initializers;
// }
// }
//
// public ReDimClause(string name)
// {
// this.Name = name;
// }
//
// public override object AcceptVisitor(IASTVisitor visitor, object data)
// {
// return visitor.Visit(this, data);
// }
//
// public override string ToString()
// {
// return String.Format("[ReDimClause: Initializers = {0}, Name = {1}]",
// GetCollectionString(Initializers),
// Name);
// }
// }
}

54
src/Libraries/NRefactory/Project/Src/Parser/AST/VBNet/Statements/RemoveHandlerStatement.cs

@ -1,54 +0,0 @@ @@ -1,54 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class RemoveHandlerStatement : Statement
{
Expression eventExpression;
Expression handlerExpression;
public Expression EventExpression {
get {
return eventExpression;
}
set {
eventExpression = Expression.CheckNull(value);
}
}
public Expression HandlerExpression {
get {
return handlerExpression;
}
set {
handlerExpression = Expression.CheckNull(value);
}
}
public RemoveHandlerStatement(Expression eventExpression, Expression handlerExpression)
{
this.EventExpression = eventExpression;
this.HandlerExpression = handlerExpression;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[RemoveHandlerStatement: EventExpression = {0}, HandlerExpression = {1}]",
EventExpression,
HandlerExpression);
}
}
}

62
src/Libraries/NRefactory/Project/Src/Parser/AST/VBNet/Statements/ResumeStatement.cs

@ -1,62 +0,0 @@ @@ -1,62 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class ResumeStatement : Statement
{
string labelName = "";
bool next;
public string LabelName
{
get {
return labelName;
}
set {
Debug.Assert(value != null);
labelName = value;
}
}
public bool IsResumeNext {
get {
return next;
}
set {
next = value;
}
}
public ResumeStatement(bool next)
{
this.next = next;
}
public ResumeStatement(string labelName)
{
Debug.Assert(labelName != null);
this.labelName = labelName;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[ResumeStatement: LabelName = {0}, IsResumeNext = {1}]",
LabelName,
IsResumeNext);
}
}
}

25
src/Libraries/NRefactory/Project/Src/Parser/AST/VBNet/Statements/StopStatement.cs

@ -1,25 +0,0 @@ @@ -1,25 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Collections;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class StopStatement : Statement
{
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[StopStatement]");
}
}
}

53
src/Libraries/NRefactory/Project/Src/Parser/AST/VBNet/Statements/WithStatement.cs

@ -1,53 +0,0 @@ @@ -1,53 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="none" email=""/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections;
namespace ICSharpCode.NRefactory.Parser.AST
{
public class WithStatement : Statement
{
Expression expression;
BlockStatement body = BlockStatement.Null;
public Expression Expression {
get {
return expression;
}
set {
expression = Expression.CheckNull(value);
}
}
public BlockStatement Body {
get {
return body;
}
set {
body = BlockStatement.CheckNull(value);;
}
}
public WithStatement(Expression expression)
{
this.Expression = expression;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[WithStatment: Expression={0}, Body={1}]",
expression,
body);
}
}
}

97
src/Libraries/NRefactory/Project/Src/Parser/AST/VBNet/TypeLevel/DeclareDeclaration.cs

@ -1,97 +0,0 @@ @@ -1,97 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Markus Palme" email="MarkusPalme@gmx.de"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Diagnostics;
using System.Collections;
using System.Collections.Generic;
namespace ICSharpCode.NRefactory.Parser.AST
{
///<summary>
/// Charset types, used in external methods
/// declarations (VB only).
///</summary>
public enum CharsetModifier
{
None,
Auto,
Unicode,
ANSI
}
public class DeclareDeclaration : ParametrizedNode
{
string alias = "";
string library = "";
CharsetModifier charset = CharsetModifier.None;
TypeReference returnType = TypeReference.Null;
public TypeReference TypeReference {
get {
return returnType;
}
set {
returnType = TypeReference.CheckNull(value);
}
}
public CharsetModifier Charset {
get {
return charset;
}
set {
charset = value;
}
}
public string Alias {
get {
return alias;
}
set {
alias = value == null ? String.Empty : value;
}
}
public string Library {
get {
return library;
}
set {
library = value == null ? String.Empty : value;
}
}
public DeclareDeclaration(string name, Modifier modifier, TypeReference returnType, List<ParameterDeclarationExpression> parameters, List<AttributeSection> attributes, string library, string alias, CharsetModifier charset) : base(modifier, attributes, name, parameters)
{
this.TypeReference = returnType;
this.Library = library;
this.Alias = alias;
this.Charset = charset;
}
public override object AcceptVisitor(IASTVisitor visitor, object data)
{
return visitor.Visit(this, data);
}
public override string ToString()
{
return String.Format("[DeclareDeclaration: Name = {0}, Modifier = {1}, ReturnType = {2}, Parameters = {3}, Charset = {4}, Alias = {5}, Library = {6}, Attributes = {7}]",
Name,
Modifier,
TypeReference,
GetCollectionString(Parameters),
Charset,
Alias,
Library,
GetCollectionString(Attributes));
}
}
}
Loading…
Cancel
Save