diff options
author | Miguel de Icaza <miguel@gnome.org> | 2001-06-21 09:17:07 +0400 |
---|---|---|
committer | Miguel de Icaza <miguel@gnome.org> | 2001-06-21 09:17:07 +0400 |
commit | 848b7aa0f53ae250e0d33d8a7ff3ae1f8249a73c (patch) | |
tree | 8394d7610be9c31a76fc42597d179e577c49ffdc /mcs/class/System/System.CodeDom | |
parent | aceaacc0abe56540c7f93bcf8d5050d087573a23 (diff) |
Add CodeDom implementation
svn path=/trunk/mcs/; revision=20
Diffstat (limited to 'mcs/class/System/System.CodeDom')
63 files changed, 4408 insertions, 0 deletions
diff --git a/mcs/class/System/System.CodeDom/AssemblyInfo.cs b/mcs/class/System/System.CodeDom/AssemblyInfo.cs new file mode 100755 index 00000000000..bd38af4bfeb --- /dev/null +++ b/mcs/class/System/System.CodeDom/AssemblyInfo.cs @@ -0,0 +1,51 @@ +using System.Reflection;
+using System.Runtime.CompilerServices;
+
+//
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+//
+[assembly: AssemblyTitle("")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("")]
+[assembly: AssemblyCopyright("")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+//
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Revision
+// Build Number
+//
+// You can specify all the value or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+
+[assembly: AssemblyVersion("1.0.*")]
+
+//
+// In order to sign your assembly you must specify a key to use. Refer to the
+// Microsoft .NET Framework documentation for more information on assembly signing.
+//
+// Use the attributes below to control which key is used for signing.
+//
+// Notes:
+// (*) If no key is specified - the assembly cannot be signed.
+// (*) KeyName refers to a key that has been installed in the Crypto Service
+// Provider (CSP) on your machine.
+// (*) If the key file and a key name attributes are both specified, the
+// following processing occurs:
+// (1) If the KeyName can be found in the CSP - that key is used.
+// (2) If the KeyName does not exist and the KeyFile does exist, the key
+// in the file is installed into the CSP and used.
+// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
+// documentation for more information on this.
+//
+[assembly: AssemblyDelaySign(false)]
+[assembly: AssemblyKeyFile("")]
+[assembly: AssemblyKeyName("")]
diff --git a/mcs/class/System/System.CodeDom/Code-X-Collection.cs b/mcs/class/System/System.CodeDom/Code-X-Collection.cs new file mode 100755 index 00000000000..8e4731656b4 --- /dev/null +++ b/mcs/class/System/System.CodeDom/Code-X-Collection.cs @@ -0,0 +1,159 @@ +// +// System.CodeDOM Code@CONTAINEE@Collection Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// + +namespace System.CodeDOM { + + using System.Collections; + + public class Code@CONTAINEE@Collection : IList, ICollection, IEnumerable { + + ArrayList @arrayname@; + + // + // Constructors + // + public Code@CONTAINEE@Collection () + { + @arrayname@ = new ArrayList (); + } + + // + // Properties + // + public int Count { + get { + return @arrayname@.Count; + } + } + + // + // Methods + // + public void Add (Code@CONTAINEE@ value) + { + @arrayname@.Add (value); + } + + public void AddRange (Code@CONTAINEE@ [] values) + { + foreach (Code@CONTAINEE@ ca in values) + @arrayname@.Add (ca); + + } + + public void Clear () + { + @arrayname@.Clear (); + } + + private class Enumerator : IEnumerator { + private Code@CONTAINEE@Collection collection; + private int currentIndex = -1; + + internal Enumerator (Code@CONTAINEE@Collection collection) + { + this.collection = collection; + } + + public object Current { + get { + if (currentIndex == collection.Count) + throw new InvalidOperationException (); + return collection [currentIndex]; + } + } + + public bool MoveNext () + { + if (currentIndex > collection.Count) + throw new InvalidOperationException (); + return ++currentIndex < collection.Count; + } + + public void Reset () + { + currentIndex = -1; + } + } + + public IEnumerator GetEnumerator () + { + return new Code@CONTAINEE@Collection.Enumerator (this); + } + + // + // IList method implementations + // + public int Add (object value) + { + return @arrayname@.Add (value); + } + + public bool Contains (Object value) + { + return @arrayname@.Contains (value); + } + + public int IndexOf (Object value) + { + return @arrayname@.IndexOf (value); + } + + public void Insert (int index, Object value) + { + @arrayname@ [index] = value; + } + + public object this[int index] { + get { + return @arrayname@ [index]; + } + + set { + @arrayname@ [index] = value; + } + } + + public void Remove (object value) + { + @arrayname@.Remove (value); + } + + public void RemoveAt (int index) + { + @arrayname@.RemoveAt (index); + } + + // + // ICollection method implementations + // + public void CopyTo (Array array, int index) + { + @arrayname@.CopyTo (array, index); + } + + public object SyncRoot { + get { + return @arrayname@.SyncRoot; + } + } + + public bool IsReadOnly { + get { + return false; + } + } + + public bool IsSynchronized { + get { + return @arrayname@.IsSynchronized; + } + } + } +} diff --git a/mcs/class/System/System.CodeDom/CodeArrayCreateExpression.cs b/mcs/class/System/System.CodeDom/CodeArrayCreateExpression.cs new file mode 100755 index 00000000000..41f1364abe4 --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeArrayCreateExpression.cs @@ -0,0 +1,89 @@ +// +// System.CodeDOM CodeArrayCreateExpression Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// +namespace System.CodeDOM { + + public class CodeArrayCreateExpression : CodeExpression { + string createType; + CodeExpressionCollection initializers; + CodeExpression sizeExpression; + int size; + + // + // Constructors + // + public CodeArrayCreateExpression () + { + + } + + public CodeArrayCreateExpression (string createType, CodeExpression size) + { + this.createType = createType; + this.sizeExpression = size; + } + + public CodeArrayCreateExpression (string createType, int size) + { + this.createType = createType; + this.size = size; + } + + public CodeArrayCreateExpression (string createType, CodeExpression [] initializers) + { + this.createType = createType; + this.initializers = new CodeExpressionCollection (); + + this.initializers.AddRange (initializers); + } + + // + // Properties + // + public CodeExpression SizeExpression { + get { + return sizeExpression; + } + + set { + sizeExpression = value; + } + } + + public int Size { + get { + return size; + } + + set { + size = value; + } + } + + public CodeExpressionCollection Initializers { + get { + return initializers; + } + + set { + initializers = value; + } + } + + public string CreateType { + get { + return createType; + } + + set { + createType = value; + } + } + } +} + diff --git a/mcs/class/System/System.CodeDom/CodeAssignStatement.cs b/mcs/class/System/System.CodeDom/CodeAssignStatement.cs new file mode 100755 index 00000000000..0d5d16b3965 --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeAssignStatement.cs @@ -0,0 +1,52 @@ +// +// System.CodeDOM CodeArrayCreateExpression Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// + +namespace System.CodeDOM { + + public class CodeAssignStatement : CodeStatement { + + CodeExpression left, right; + + // + // Constructors + // + public CodeAssignStatement () + { + } + + public CodeAssignStatement (CodeExpression left, CodeExpression right) + { + this.left = left; + this.right = right; + } + + // + // Properties + // + public CodeExpression Left { + get { + return left; + } + + set { + left = value; + } + } + + public CodeExpression Right { + get { + return right; + } + + set { + right = value; + } + } + } +} diff --git a/mcs/class/System/System.CodeDom/CodeAttachEventStatement.cs b/mcs/class/System/System.CodeDom/CodeAttachEventStatement.cs new file mode 100755 index 00000000000..03fcf7dc0f9 --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeAttachEventStatement.cs @@ -0,0 +1,62 @@ +// +// System.CodeDOM CodeAttachEventStatement Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// +namespace System.CodeDOM { + + public class CodeAttachEventStatement : CodeStatement { + CodeExpression targetObject; + string eventName; + CodeExpression newListener; + + public CodeAttachEventStatement () + { + } + + public CodeAttachEventStatement (CodeExpression targetObject, + string eventName, + CodeExpression newListener) + { + this.targetObject = targetObject; + this.eventName = eventName; + this.newListener = newListener; + } + + // + // Properties + // + public string EventName { + get { + return eventName; + } + + set { + eventName = value; + } + } + + public CodeExpression NewListener { + get { + return newListener; + } + + set { + newListener = value; + } + } + + public CodeExpression TargetObject { + get { + return targetObject; + } + + set { + targetObject = value; + } + } + } +} diff --git a/mcs/class/System/System.CodeDom/CodeAttributeArgument.cs b/mcs/class/System/System.CodeDom/CodeAttributeArgument.cs new file mode 100755 index 00000000000..d3debc9c16f --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeAttributeArgument.cs @@ -0,0 +1,60 @@ +// +// System.CodeDOM CodeAttributeArgument Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// + +namespace System.CodeDOM { + + public class CodeAttributeArgument { + string name; + CodeExpression val; + + // + // Constructors + // + public CodeAttributeArgument () + { + } + + public CodeAttributeArgument (CodeExpression value) + { + } + + public CodeAttributeArgument (string name, CodeExpression val) + { + this.name = name; + this.val = val; + } + + // + // Properties + // + + public string Name { + get { + return name; + } + + set { + name = value; + } + } + + public CodeExpression Value { + get { + return val; + } + + set { + val = value; + } + } + + + } + +} diff --git a/mcs/class/System/System.CodeDom/CodeAttributeArgumentCollection.cs b/mcs/class/System/System.CodeDom/CodeAttributeArgumentCollection.cs new file mode 100755 index 00000000000..b259f02ac39 --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeAttributeArgumentCollection.cs @@ -0,0 +1,159 @@ +// +// System.CodeDOM CodeAttributeArgumentCollection Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// + +namespace System.CodeDOM { + + using System.Collections; + + public class CodeAttributeArgumentCollection : IList, ICollection, IEnumerable { + + ArrayList attributeArgs; + + // + // Constructors + // + public CodeAttributeArgumentCollection () + { + attributeArgs = new ArrayList (); + } + + // + // Properties + // + public int Count { + get { + return attributeArgs.Count; + } + } + + // + // Methods + // + public void Add (CodeAttributeArgument value) + { + attributeArgs.Add (value); + } + + public void AddRange (CodeAttributeArgument [] values) + { + foreach (CodeAttributeArgument ca in values) + attributeArgs.Add (ca); + + } + + public void Clear () + { + attributeArgs.Clear (); + } + + private class Enumerator : IEnumerator { + private CodeAttributeArgumentCollection collection; + private int currentIndex = -1; + + internal Enumerator (CodeAttributeArgumentCollection collection) + { + this.collection = collection; + } + + public object Current { + get { + if (currentIndex == collection.Count) + throw new InvalidOperationException (); + return collection [currentIndex]; + } + } + + public bool MoveNext () + { + if (currentIndex > collection.Count) + throw new InvalidOperationException (); + return ++currentIndex < collection.Count; + } + + public void Reset () + { + currentIndex = -1; + } + } + + public IEnumerator GetEnumerator () + { + return new CodeAttributeArgumentCollection.Enumerator (this); + } + + // + // IList method implementations + // + public int Add (object value) + { + return attributeArgs.Add (value); + } + + public bool Contains (Object value) + { + return attributeArgs.Contains (value); + } + + public int IndexOf (Object value) + { + return attributeArgs.IndexOf (value); + } + + public void Insert (int index, Object value) + { + attributeArgs [index] = value; + } + + public object this[int index] { + get { + return attributeArgs [index]; + } + + set { + attributeArgs [index] = value; + } + } + + public void Remove (object value) + { + attributeArgs.Remove (value); + } + + public void RemoveAt (int index) + { + attributeArgs.RemoveAt (index); + } + + // + // ICollection method implementations + // + public void CopyTo (Array array, int index) + { + attributeArgs.CopyTo (array, index); + } + + public object SyncRoot { + get { + return attributeArgs.SyncRoot; + } + } + + public bool IsReadOnly { + get { + return false; + } + } + + public bool IsSynchronized { + get { + return attributeArgs.IsSynchronized; + } + } + } +} diff --git a/mcs/class/System/System.CodeDom/CodeAttributeBlock.cs b/mcs/class/System/System.CodeDom/CodeAttributeBlock.cs new file mode 100755 index 00000000000..5e0a5d704ea --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeAttributeBlock.cs @@ -0,0 +1,42 @@ +// +// System.CodeDOM CodeAttributeBlock Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// + +namespace System.CodeDOM { + + public class CodeAttributeBlock { + + CodeAttributeDeclarationCollection attributes; + + // + // Constructors + // + public CodeAttributeBlock () + { + } + + public CodeAttributeBlock (CodeAttributeDeclaration [] attributes) + { + this.attributes = new CodeAttributeDeclarationCollection (); + this.attributes.AddRange (attributes); + } + + // + // Prpoperties + // + public CodeAttributeDeclarationCollection Attributes { + get { + return attributes; + } + + set { + attributes = value; + } + } + } +} diff --git a/mcs/class/System/System.CodeDom/CodeAttributeDeclaration.cs b/mcs/class/System/System.CodeDom/CodeAttributeDeclaration.cs new file mode 100755 index 00000000000..a6f28de16c0 --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeAttributeDeclaration.cs @@ -0,0 +1,60 @@ +// +// System.CodeDOM CodeAttributeDeclaration Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// + +namespace System.CodeDOM { + + public class CodeAttributeDeclaration { + + string name; + CodeAttributeArgumentCollection arguments; + + // + // Constructors + // + public CodeAttributeDeclaration () + { + } + + public CodeAttributeDeclaration (string name) + { + this.name = name; + } + + public CodeAttributeDeclaration (string name, CodeAttributeArgument [] arguments) + { + this.name = name; + this.arguments = new CodeAttributeArgumentCollection (); + this.arguments.AddRange (arguments); + } + + // + // Properties + // + public CodeAttributeArgumentCollection Arguments { + get { + return arguments; + } + + set { + arguments = value; + } + } + + public string Name { + get { + return name; + } + + set { + name = value; + } + } + } +} + diff --git a/mcs/class/System/System.CodeDom/CodeAttributeDeclarationCollection.cs b/mcs/class/System/System.CodeDom/CodeAttributeDeclarationCollection.cs new file mode 100755 index 00000000000..5de7742f393 --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeAttributeDeclarationCollection.cs @@ -0,0 +1,159 @@ +// +// System.CodeDOM CodeAttributeDeclarationCollection Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// + +namespace System.CodeDOM { + + using System.Collections; + + public class CodeAttributeDeclarationCollection : IList, ICollection, IEnumerable { + + ArrayList attributeDecls; + + // + // Constructors + // + public CodeAttributeDeclarationCollection () + { + attributeDecls = new ArrayList (); + } + + // + // Properties + // + public int Count { + get { + return attributeDecls.Count; + } + } + + // + // Methods + // + public void Add (CodeAttributeDeclaration value) + { + attributeDecls.Add (value); + } + + public void AddRange (CodeAttributeDeclaration [] values) + { + foreach (CodeAttributeDeclaration ca in values) + attributeDecls.Add (ca); + + } + + public void Clear () + { + attributeDecls.Clear (); + } + + private class Enumerator : IEnumerator { + private CodeAttributeDeclarationCollection collection; + private int currentIndex = -1; + + internal Enumerator (CodeAttributeDeclarationCollection collection) + { + this.collection = collection; + } + + public object Current { + get { + if (currentIndex == collection.Count) + throw new InvalidOperationException (); + return collection [currentIndex]; + } + } + + public bool MoveNext () + { + if (currentIndex > collection.Count) + throw new InvalidOperationException (); + return ++currentIndex < collection.Count; + } + + public void Reset () + { + currentIndex = -1; + } + } + + public IEnumerator GetEnumerator () + { + return new CodeAttributeDeclarationCollection.Enumerator (this); + } + + // + // IList method implementations + // + public int Add (object value) + { + return attributeDecls.Add (value); + } + + public bool Contains (Object value) + { + return attributeDecls.Contains (value); + } + + public int IndexOf (Object value) + { + return attributeDecls.IndexOf (value); + } + + public void Insert (int index, Object value) + { + attributeDecls [index] = value; + } + + public object this[int index] { + get { + return attributeDecls [index]; + } + + set { + attributeDecls [index] = value; + } + } + + public void Remove (object value) + { + attributeDecls.Remove (value); + } + + public void RemoveAt (int index) + { + attributeDecls.RemoveAt (index); + } + + // + // ICollection method implementations + // + public void CopyTo (Array array, int index) + { + attributeDecls.CopyTo (array, index); + } + + public object SyncRoot { + get { + return attributeDecls.SyncRoot; + } + } + + public bool IsReadOnly { + get { + return false; + } + } + + public bool IsSynchronized { + get { + return attributeDecls.IsSynchronized; + } + } + } +} diff --git a/mcs/class/System/System.CodeDom/CodeBaseReferenceExpression.cs b/mcs/class/System/System.CodeDom/CodeBaseReferenceExpression.cs new file mode 100755 index 00000000000..cb777f6c480 --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeBaseReferenceExpression.cs @@ -0,0 +1,15 @@ +// +// System.CodeDOM CodeBaseReferenceExpression Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// + +namespace System.CodeDOM { + + public class CodeBaseReferenceExpression : CodeExpression { + public CodeBaseReferenceExpression () {} + } +} diff --git a/mcs/class/System/System.CodeDom/CodeBinaryOperatorExpression.cs b/mcs/class/System/System.CodeDom/CodeBinaryOperatorExpression.cs new file mode 100755 index 00000000000..692cb409016 --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeBinaryOperatorExpression.cs @@ -0,0 +1,88 @@ +// +// System.CodeDOM CodeBinaryOperatorExpression Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// + +namespace System.CodeDOM { + + public class CodeBinaryOperatorExpression : CodeExpression { + + CodeExpression left, right; + CodeBinaryOperatorType oper; + + public enum CodeBinaryOperatorType { + Add, + Substract, + Multiply, + Divide, + Modulus, + Assign, + IdentityInequality, + IdentityEquality, + ValueEquality, + BitwiseOr, + BitwiseAnd, + BooleanOr, + BooleanAnd, + LessThan, + LessThanOrEqual, + GreatherThan, + GreatherThanOrEqual, + } + + // + // Constructors + // + public CodeBinaryOperatorExpression () + { + } + + + public CodeBinaryOperatorExpression (CodeExpression left, + CodeBinaryOperatorType oper, + CodeExpression right) + { + this.left = left; + this.oper = oper; + this.right = right; + } + + // + // Properties + // + public CodeExpression Left { + get { + return left; + } + + set { + left = value; + } + } + + public CodeExpression Right { + get { + return right; + } + + set { + right = value; + } + } + + public CodeBinaryOperatorType Operator { + get { + return oper; + } + + set { + oper = value; + } + } + } +} + diff --git a/mcs/class/System/System.CodeDom/CodeCastExpression.cs b/mcs/class/System/System.CodeDom/CodeCastExpression.cs new file mode 100755 index 00000000000..db18bcdd457 --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeCastExpression.cs @@ -0,0 +1,52 @@ +// +// System.CodeDOM CodeCastExpression Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// + +namespace System.CodeDOM { + + public class CodeCastExpression : CodeExpression { + string targetType; + CodeExpression expression; + + // + // Constructors + // + public CodeCastExpression () + { + } + + public CodeCastExpression (string targetType, CodeExpression expression) + { + this.targetType = targetType; + this.expression = expression; + } + + // + // Properties + // + public CodeExpression Expression { + get { + return expression; + } + + set { + expression = value; + } + } + + public string TargetType { + get { + return targetType; + } + + set { + targetType = value; + } + } + } +} diff --git a/mcs/class/System/System.CodeDom/CodeCatchClause.cs b/mcs/class/System/System.CodeDom/CodeCatchClause.cs new file mode 100755 index 00000000000..5f3f8fb3ced --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeCatchClause.cs @@ -0,0 +1,46 @@ +// +// System.CodeDOM CodeCatchClaus Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// + +namespace System.CodeDOM { + + public class CodeCatchClause { + + CodeParameterDeclarationExpression condition; + CodeStatementCollection statements; + + public CodeCatchClause () + { + this.statements = new CodeStatementCollection (); + } + + public CodeCatchClause (CodeParameterDeclarationExpression condition, + CodeStatement [] statements) + { + this.condition = condition; + this.statements = new CodeStatementCollection (); + this.statements.AddRange (statements); + } + + public CodeStatementCollection Statements { + get { + return statements; + } + } + + public CodeParameterDeclarationExpression Condition { + get { + return condition; + } + + set { + condition = value; + } + } + } +} diff --git a/mcs/class/System/System.CodeDom/CodeCatchClauseCollection.cs b/mcs/class/System/System.CodeDom/CodeCatchClauseCollection.cs new file mode 100755 index 00000000000..d44dbe2267f --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeCatchClauseCollection.cs @@ -0,0 +1,159 @@ +// +// System.CodeDOM CodeCatchClauseCollection Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// + +namespace System.CodeDOM { + + using System.Collections; + + public class CodeCatchClauseCollection : IList, ICollection, IEnumerable { + + ArrayList catchClauses; + + // + // Constructors + // + public CodeCatchClauseCollection () + { + catchClauses = new ArrayList (); + } + + // + // Properties + // + public int Count { + get { + return catchClauses.Count; + } + } + + // + // Methods + // + public void Add (CodeCatchClause value) + { + catchClauses.Add (value); + } + + public void AddRange (CodeCatchClause [] values) + { + foreach (CodeCatchClause ca in values) + catchClauses.Add (ca); + + } + + public void Clear () + { + catchClauses.Clear (); + } + + private class Enumerator : IEnumerator { + private CodeCatchClauseCollection collection; + private int currentIndex = -1; + + internal Enumerator (CodeCatchClauseCollection collection) + { + this.collection = collection; + } + + public object Current { + get { + if (currentIndex == collection.Count) + throw new InvalidOperationException (); + return collection [currentIndex]; + } + } + + public bool MoveNext () + { + if (currentIndex > collection.Count) + throw new InvalidOperationException (); + return ++currentIndex < collection.Count; + } + + public void Reset () + { + currentIndex = -1; + } + } + + public IEnumerator GetEnumerator () + { + return new CodeCatchClauseCollection.Enumerator (this); + } + + // + // IList method implementations + // + public int Add (object value) + { + return catchClauses.Add (value); + } + + public bool Contains (Object value) + { + return catchClauses.Contains (value); + } + + public int IndexOf (Object value) + { + return catchClauses.IndexOf (value); + } + + public void Insert (int index, Object value) + { + catchClauses [index] = value; + } + + public object this[int index] { + get { + return catchClauses [index]; + } + + set { + catchClauses [index] = value; + } + } + + public void Remove (object value) + { + catchClauses.Remove (value); + } + + public void RemoveAt (int index) + { + catchClauses.RemoveAt (index); + } + + // + // ICollection method implementations + // + public void CopyTo (Array array, int index) + { + catchClauses.CopyTo (array, index); + } + + public object SyncRoot { + get { + return catchClauses.SyncRoot; + } + } + + public bool IsReadOnly { + get { + return false; + } + } + + public bool IsSynchronized { + get { + return catchClauses.IsSynchronized; + } + } + } +} diff --git a/mcs/class/System/System.CodeDom/CodeClass.cs b/mcs/class/System/System.CodeDom/CodeClass.cs new file mode 100755 index 00000000000..a86c2db7da1 --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeClass.cs @@ -0,0 +1,105 @@ +// +// System.CodeDOM CodeClass Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// + +namespace System.CodeDOM { + using System.Reflection; + using System.Collections; + + public class CodeClass : CodeClassMember { + CodeClassMemberCollection members; + TypeAttributes attrs; + StringCollection baseTypes; + bool isClass, isEnum, isInterface, isStruct; + + string name; + + // + // Constructors + // + public CodeClass () + { + } + + public CodeClass (string name) + { + this.name = name; + } + + // + // Properties + // + public TypeAttributes attributes { + get { + return attrs; + } + + set { + attrs = value; + } + } + + public StringCollection BaseTypes { + get { + return baseTypes; + } + + set { + baseTypes = value; + } + } + + public bool IsClass { + get { + return isClass; + } + + set { + isClass = value; + } + } + public bool IsEnum { + get { + return isEnum; + } + + set { + isEnum = value; + } + } + + public bool IsInterface { + get { + return isInterface; + } + + set { + isInterface = value; + } + } + public bool IsStruct { + get { + return isStruct; + } + + set { + isStruct = value; + } + } + + public CodeClassMemberCollection Members { + get { + return members; + } + + set { + members = value; + } + } + } +} diff --git a/mcs/class/System/System.CodeDom/CodeClassCollection.cs b/mcs/class/System/System.CodeDom/CodeClassCollection.cs new file mode 100755 index 00000000000..4a43f737ab1 --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeClassCollection.cs @@ -0,0 +1,159 @@ +// +// System.CodeDOM CodeClassCollection Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// + +namespace System.CodeDOM { + + using System.Collections; + + public class CodeClassCollection : IList, ICollection, IEnumerable { + + ArrayList classes; + + // + // Constructors + // + public CodeClassCollection () + { + classes = new ArrayList (); + } + + // + // Properties + // + public int Count { + get { + return classes.Count; + } + } + + // + // Methods + // + public void Add (CodeClass value) + { + classes.Add (value); + } + + public void AddRange (CodeClass [] values) + { + foreach (CodeClass ca in values) + classes.Add (ca); + + } + + public void Clear () + { + classes.Clear (); + } + + private class Enumerator : IEnumerator { + private CodeClassCollection collection; + private int currentIndex = -1; + + internal Enumerator (CodeClassCollection collection) + { + this.collection = collection; + } + + public object Current { + get { + if (currentIndex == collection.Count) + throw new InvalidOperationException (); + return collection [currentIndex]; + } + } + + public bool MoveNext () + { + if (currentIndex > collection.Count) + throw new InvalidOperationException (); + return ++currentIndex < collection.Count; + } + + public void Reset () + { + currentIndex = -1; + } + } + + public IEnumerator GetEnumerator () + { + return new CodeClassCollection.Enumerator (this); + } + + // + // IList method implementations + // + public int Add (object value) + { + return classes.Add (value); + } + + public bool Contains (Object value) + { + return classes.Contains (value); + } + + public int IndexOf (Object value) + { + return classes.IndexOf (value); + } + + public void Insert (int index, Object value) + { + classes [index] = value; + } + + public object this[int index] { + get { + return classes [index]; + } + + set { + classes [index] = value; + } + } + + public void Remove (object value) + { + classes.Remove (value); + } + + public void RemoveAt (int index) + { + classes.RemoveAt (index); + } + + // + // ICollection method implementations + // + public void CopyTo (Array array, int index) + { + classes.CopyTo (array, index); + } + + public object SyncRoot { + get { + return classes.SyncRoot; + } + } + + public bool IsReadOnly { + get { + return false; + } + } + + public bool IsSynchronized { + get { + return classes.IsSynchronized; + } + } + } +} diff --git a/mcs/class/System/System.CodeDom/CodeClassConstructor.cs b/mcs/class/System/System.CodeDom/CodeClassConstructor.cs new file mode 100755 index 00000000000..ab04f5a5828 --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeClassConstructor.cs @@ -0,0 +1,17 @@ +// +// System.CodeDOM CodeClassConstructor Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// + +namespace System.CodeDOM { + public class CodeClassConstructor : CodeMemberMethod { + + public CodeClassConstructor () + { + } + } +} diff --git a/mcs/class/System/System.CodeDom/CodeClassDelegate.cs b/mcs/class/System/System.CodeDom/CodeClassDelegate.cs new file mode 100755 index 00000000000..1ddbf62b24c --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeClassDelegate.cs @@ -0,0 +1,52 @@ +// +// System.CodeDOM CodeClassDelegate Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// + +namespace System.CodeDOM { + + public class CodeClassDelegate : CodeClass { + CodeParameterDeclarationExpressionCollection parameters; + string returnType; + string name; + + // + // Constructors + // + public CodeClassDelegate () + { + } + + public CodeClassDelegate (string name) + { + this.name = name; + } + + // + // Properties + // + public CodeParameterDeclarationExpressionCollection Parameters { + get { + return parameters; + } + + set { + parameters = value; + } + } + + public string ReturnType { + get { + return returnType; + } + + set { + returnType = value; + } + } + } +} diff --git a/mcs/class/System/System.CodeDom/CodeClassMember.cs b/mcs/class/System/System.CodeDom/CodeClassMember.cs new file mode 100755 index 00000000000..b186b2f96f7 --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeClassMember.cs @@ -0,0 +1,80 @@ +// +// System.CodeDOM CodeClassMember Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// + +namespace System.CodeDOM { + + public class CodeClassMember : CodeStatement { + MemberAttributes attributes; + CodeAttributeBlock customAttributes; + + string name; + + // + // Yeah, this is a strange way of defining this + // + public enum MemberAttributes { + Abstract = 0x0001, + Final = 0x0002, + Override = 0x0004, + Const = 0x0005, + Assembly = 0x1000, + AccessMask = 0xf000, + FamANDAssem = 0x2000, + Family = 0x3000, + FamORAssem = 0x4000, + New = 0x0010, + Private = 0x5000, + Public = 0x6000, + ScopeMask = 0x000f, + Static = 0x0003, + VTableMask = 0x00f0 + } + + // + // Constructors + // + public CodeClassMember () + { + } + + // + // Properties + // + + public MemberAttributes Attributes { + get { + return attributes; + } + + set { + attributes = value; + } + } + + public CodeAttributeBlock CustomAttributes { + get { + return customAttributes; + } + + set { + customAttributes = value; + } + } + + public string Name { + get { + return name; + } + + set { + name = value; + } + } + } +} diff --git a/mcs/class/System/System.CodeDom/CodeClassMemberCollection.cs b/mcs/class/System/System.CodeDom/CodeClassMemberCollection.cs new file mode 100755 index 00000000000..315dd60dd33 --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeClassMemberCollection.cs @@ -0,0 +1,159 @@ +// +// System.CodeDOM CodeClassMemberCollection Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// + +namespace System.CodeDOM { + + using System.Collections; + + public class CodeClassMemberCollection : IList, ICollection, IEnumerable { + + ArrayList classMembers; + + // + // Constructors + // + public CodeClassMemberCollection () + { + classMembers = new ArrayList (); + } + + // + // Properties + // + public int Count { + get { + return classMembers.Count; + } + } + + // + // Methods + // + public void Add (CodeClassMember value) + { + classMembers.Add (value); + } + + public void AddRange (CodeClassMember [] values) + { + foreach (CodeClassMember ca in values) + classMembers.Add (ca); + + } + + public void Clear () + { + classMembers.Clear (); + } + + private class Enumerator : IEnumerator { + private CodeClassMemberCollection collection; + private int currentIndex = -1; + + internal Enumerator (CodeClassMemberCollection collection) + { + this.collection = collection; + } + + public object Current { + get { + if (currentIndex == collection.Count) + throw new InvalidOperationException (); + return collection [currentIndex]; + } + } + + public bool MoveNext () + { + if (currentIndex > collection.Count) + throw new InvalidOperationException (); + return ++currentIndex < collection.Count; + } + + public void Reset () + { + currentIndex = -1; + } + } + + public IEnumerator GetEnumerator () + { + return new CodeClassMemberCollection.Enumerator (this); + } + + // + // IList method implementations + // + public int Add (object value) + { + return classMembers.Add (value); + } + + public bool Contains (Object value) + { + return classMembers.Contains (value); + } + + public int IndexOf (Object value) + { + return classMembers.IndexOf (value); + } + + public void Insert (int index, Object value) + { + classMembers [index] = value; + } + + public object this[int index] { + get { + return classMembers [index]; + } + + set { + classMembers [index] = value; + } + } + + public void Remove (object value) + { + classMembers.Remove (value); + } + + public void RemoveAt (int index) + { + classMembers.RemoveAt (index); + } + + // + // ICollection method implementations + // + public void CopyTo (Array array, int index) + { + classMembers.CopyTo (array, index); + } + + public object SyncRoot { + get { + return classMembers.SyncRoot; + } + } + + public bool IsReadOnly { + get { + return false; + } + } + + public bool IsSynchronized { + get { + return classMembers.IsSynchronized; + } + } + } +} diff --git a/mcs/class/System/System.CodeDom/CodeCommentStatement.cs b/mcs/class/System/System.CodeDom/CodeCommentStatement.cs new file mode 100755 index 00000000000..fef7c6c6184 --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeCommentStatement.cs @@ -0,0 +1,39 @@ +// +// System.CodeDOM CodeCommentStatement Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// + +namespace System.CodeDOM { + + public class CodeCommentStatement : CodeStatement { + string text; + + // + // Constructors + // + public CodeCommentStatement () + { + } + + public CodeCommentStatement (string text) + { + this.text = text; + } + + string Text { + get { + return text; + } + + set { + text = value; + } + } + } +} + + diff --git a/mcs/class/System/System.CodeDom/CodeConstructor.cs b/mcs/class/System/System.CodeDom/CodeConstructor.cs new file mode 100755 index 00000000000..699fdba07c2 --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeConstructor.cs @@ -0,0 +1,43 @@ +// +// System.CodeDOM CodeConstructor Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// + +namespace System.CodeDOM { + + public class CodeConstructor : CodeMemberMethod { + CodeExpressionCollection baseConstructorArgs; + CodeExpressionCollection chainedConstructorArgs; + + // + // Constructors + // + public CodeConstructor () + { + } + + public CodeExpressionCollection BaseConstructorArgs { + get { + return baseConstructorArgs; + } + + set { + baseConstructorArgs = value; + } + } + + public CodeExpressionCollection ChainedConstructorArgs { + get { + return chainedConstructorArgs; + } + + set { + chainedConstructorArgs = value; + } + } + } +} diff --git a/mcs/class/System/System.CodeDom/CodeDelegateCreateExpression.cs b/mcs/class/System/System.CodeDom/CodeDelegateCreateExpression.cs new file mode 100755 index 00000000000..fe522726443 --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeDelegateCreateExpression.cs @@ -0,0 +1,66 @@ +// +// System.CodeDOM CodeDelegateCreateExpression Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// + +namespace System.CodeDOM { + + public class CodeDelegateCreateExpression : CodeExpression { + string delegateType, methodName; + CodeExpression targetObject; + + // + // Constructors + // + public CodeDelegateCreateExpression (string delegateType, + CodeExpression targetObject, + string methodName) + { + this.delegateType = delegateType; + this.targetObject = targetObject; + this.methodName = methodName; + } + + public CodeDelegateCreateExpression () + { + } + + // + // Properties + // + + string DelegateType { + get { + return delegateType; + } + + set { + delegateType = value; + } + } + + string MethodName { + get { + return methodName; + } + + set { + methodName = value; + } + } + + CodeExpression TargetObject { + get { + return targetObject; + } + + set { + targetObject = value; + } + } + } +} diff --git a/mcs/class/System/System.CodeDom/CodeDelegateInvokeExpression.cs b/mcs/class/System/System.CodeDom/CodeDelegateInvokeExpression.cs new file mode 100755 index 00000000000..218cd988d38 --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeDelegateInvokeExpression.cs @@ -0,0 +1,59 @@ +// +// System.CodeDOM CodeDelegateInvokeExpression Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// + +namespace System.CodeDOM { + + public class CodeDelegateInvokeExpression : CodeExpression { + CodeExpressionCollection parameters; + CodeExpression targetObject; + + // + // Constructors + // + public CodeDelegateInvokeExpression () + { + } + + public CodeDelegateInvokeExpression (CodeExpression targetObject, + CodeExpression [] parameters) + { + this.targetObject = targetObject; + this.parameters = new CodeExpressionCollection (); + this.parameters.AddRange (parameters); + } + + public CodeDelegateInvokeExpression (CodeExpression targetObject) + { + this.targetObject = targetObject; + } + + // + // Properties + // + public CodeExpression TargetObject { + get { + return targetObject; + } + + set { + targetObject = value; + } + } + + public CodeExpressionCollection Parameters { + get { + return parameters; + } + + set { + parameters = value; + } + } + } +} diff --git a/mcs/class/System/System.CodeDom/CodeDelegateInvokeStatement.cs b/mcs/class/System/System.CodeDom/CodeDelegateInvokeStatement.cs new file mode 100755 index 00000000000..1cdf3eab103 --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeDelegateInvokeStatement.cs @@ -0,0 +1,55 @@ +// +// System.CodeDOM CodeDelegateInvokeStatement Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// + +namespace System.CodeDOM { + + public class CodeDelegateInvokeStatement : CodeStatement { + CodeStatementCollection parameters; + CodeStatement targetObject; + CodeDelegateInvokeExpression delegateInvoke; + + // + // Constructors + // + public CodeDelegateInvokeStatement () + { + } + + public CodeDelegateInvokeStatement (CodeStatement targetObject) + { + this.targetObject = targetObject; + } + + public CodeDelegateInvokeStatement (CodeDelegateInvokeExpression delegateInvoke) + { + this.delegateInvoke = delegateInvoke; + } + + public CodeDelegateInvokeStatement (CodeStatement targetObject, + CodeStatement [] parameters) + { + this.targetObject = targetObject; + this.parameters = new CodeStatementCollection (); + this.parameters.AddRange (parameters); + } + + // + // Properties + // + public CodeDelegateInvokeExpression DelegateInvoke { + get { + return delegateInvoke; + } + + set { + delegateInvoke = value; + } + } + } +} diff --git a/mcs/class/System/System.CodeDom/CodeDetachEventStatement.cs b/mcs/class/System/System.CodeDom/CodeDetachEventStatement.cs new file mode 100755 index 00000000000..ea0990836bb --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeDetachEventStatement.cs @@ -0,0 +1,62 @@ +// +// System.CodeDOM CodeDetachEventStatement Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// + +namespace System.CodeDOM { + + public class CodeDetachEventStatement : CodeStatement { + string eventName; + CodeExpression targetObject, newListener; + + // + // Constructors + // + public CodeDetachEventStatement () + { + } + + public CodeDetachEventStatement (CodeExpression targetObject, + string eventName, + CodeExpression newListener) + { + this.targetObject = targetObject; + this.eventName = eventName; + this.newListener = newListener; + } + + public string EventName { + get { + return eventName; + } + + set { + eventName = value; + } + } + + public CodeExpression TargetObject { + get { + return targetObject; + } + + set { + targetObject = value; + } + } + + public CodeExpression NewListener { + get { + return newListener; + } + + set { + newListener = value; + } + } + } +} diff --git a/mcs/class/System/System.CodeDom/CodeExpression.cs b/mcs/class/System/System.CodeDom/CodeExpression.cs new file mode 100755 index 00000000000..64a3856afa0 --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeExpression.cs @@ -0,0 +1,35 @@ +// +// System.CodeDOM CodeExpression Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// + +namespace System.CodeDOM { + + public class CodeExpression { + object userData; + + // + // Constructors + // + public CodeExpression () + { + } + + // + // Properties + // + public object UserData { + get { + return userData; + } + + set { + userData = value; + } + } + } +} diff --git a/mcs/class/System/System.CodeDom/CodeExpressionCollection.cs b/mcs/class/System/System.CodeDom/CodeExpressionCollection.cs new file mode 100755 index 00000000000..9abf4895046 --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeExpressionCollection.cs @@ -0,0 +1,159 @@ +// +// System.CodeDOM CodeExpressionCollection Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// + +namespace System.CodeDOM { + + using System.Collections; + + public class CodeExpressionCollection : IList, ICollection, IEnumerable { + + ArrayList expressions; + + // + // Constructors + // + public CodeExpressionCollection () + { + expressions = new ArrayList (); + } + + // + // Properties + // + public int Count { + get { + return expressions.Count; + } + } + + // + // Methods + // + public void Add (CodeExpression value) + { + expressions.Add (value); + } + + public void AddRange (CodeExpression [] values) + { + foreach (CodeExpression ca in values) + expressions.Add (ca); + + } + + public void Clear () + { + expressions.Clear (); + } + + private class Enumerator : IEnumerator { + private CodeExpressionCollection collection; + private int currentIndex = -1; + + internal Enumerator (CodeExpressionCollection collection) + { + this.collection = collection; + } + + public object Current { + get { + if (currentIndex == collection.Count) + throw new InvalidOperationException (); + return collection [currentIndex]; + } + } + + public bool MoveNext () + { + if (currentIndex > collection.Count) + throw new InvalidOperationException (); + return ++currentIndex < collection.Count; + } + + public void Reset () + { + currentIndex = -1; + } + } + + public IEnumerator GetEnumerator () + { + return new CodeExpressionCollection.Enumerator (this); + } + + // + // IList method implementations + // + public int Add (object value) + { + return expressions.Add (value); + } + + public bool Contains (Object value) + { + return expressions.Contains (value); + } + + public int IndexOf (Object value) + { + return expressions.IndexOf (value); + } + + public void Insert (int index, Object value) + { + expressions [index] = value; + } + + public object this[int index] { + get { + return expressions [index]; + } + + set { + expressions [index] = value; + } + } + + public void Remove (object value) + { + expressions.Remove (value); + } + + public void RemoveAt (int index) + { + expressions.RemoveAt (index); + } + + // + // ICollection method implementations + // + public void CopyTo (Array array, int index) + { + expressions.CopyTo (array, index); + } + + public object SyncRoot { + get { + return expressions.SyncRoot; + } + } + + public bool IsReadOnly { + get { + return false; + } + } + + public bool IsSynchronized { + get { + return expressions.IsSynchronized; + } + } + } +} diff --git a/mcs/class/System/System.CodeDom/CodeFieldReferenceExpression.cs b/mcs/class/System/System.CodeDom/CodeFieldReferenceExpression.cs new file mode 100755 index 00000000000..159399aea2e --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeFieldReferenceExpression.cs @@ -0,0 +1,71 @@ +// +// System.CodeDOM CodeFieldReferenceExpression Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// + +namespace System.CodeDOM { + + public class CodeFieldReferenceExpression : CodeExpression { + CodeExpression targetObject; + string fieldName; + FieldDirection direction; + + public enum FieldDirection { + In, + Out, + Ref + } + + // + // Constructors + // + public CodeFieldReferenceExpression () + { + } + + public CodeFieldReferenceExpression (CodeExpression targetObject, + string fieldName) + { + this.targetObject = targetObject; + this.fieldName = fieldName; + } + + // + // Properties + // + public FieldDirection Direction { + get { + return direction; + } + + set { + direction = value; + } + } + + public string FieldName { + get { + return fieldName; + } + + set { + fieldName = value; + } + } + + public CodeExpression TargetObject { + get { + return targetObject; + } + + set { + targetObject = value; + } + } + + } +} diff --git a/mcs/class/System/System.CodeDom/CodeForLoopStatement.cs b/mcs/class/System/System.CodeDom/CodeForLoopStatement.cs new file mode 100755 index 00000000000..d7b7cac4a86 --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeForLoopStatement.cs @@ -0,0 +1,78 @@ +// +// System.CodeDOM CodeForLoopStatement Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// + +namespace System.CodeDOM { + + public class CodeForLoopStatement : CodeExpression { + CodeStatement initStatement, incrementStatement; + CodeExpression testExpression; + CodeStatementCollection statements; + + // + // Constructors + // + public CodeForLoopStatement () + { + statements = new CodeStatementCollection (); + } + + public CodeForLoopStatement (CodeStatement initStatement, + CodeExpression testExpression, + CodeStatement incrementStatement, + CodeStatement [] statements) + { + this.initStatement = initStatement; + this.testExpression = testExpression; + this.incrementStatement = incrementStatement; + this.statements = new CodeStatementCollection (); + this.statements.AddRange (statements); + } + + // + // Properties + // + + public CodeStatement InitStatement { + get { + return initStatement; + } + + set { + initStatement = value; + } + } + + public CodeStatement IncrementStatement { + get { + return incrementStatement; + } + + set { + incrementStatement = value; + } + } + + public CodeStatementCollection Statements { + get { + return statements; + } + } + + public CodeExpression TestExpression { + get { + return testExpression; + } + + set { + testExpression = value; + } + } + } +} + diff --git a/mcs/class/System/System.CodeDom/CodeIfStatement.cs b/mcs/class/System/System.CodeDom/CodeIfStatement.cs new file mode 100755 index 00000000000..aa2a556e9fe --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeIfStatement.cs @@ -0,0 +1,73 @@ +// +// System.CodeDOM CodeIfStatement Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// + +namespace System.CodeDOM { + + public class CodeIfStatement : CodeStatement { + + CodeExpression condition; + CodeStatementCollection trueStatements; + CodeStatementCollection falseStatements; + + // + // Constructors + // + public CodeIfStatement () + { + trueStatements = new CodeStatementCollection (); + falseStatements = new CodeStatementCollection (); + } + + public CodeIfStatement (CodeExpression condition, CodeStatement [] trueStatements) + { + this.condition = condition; + this.trueStatements = new CodeStatementCollection (); + this.trueStatements.AddRange (trueStatements); + this.falseStatements = new CodeStatementCollection (); + } + + public CodeIfStatement (CodeExpression condition, + CodeStatement [] trueStatements, + CodeStatement [] falseStatements) + { + this.condition = condition; + + this.trueStatements = new CodeStatementCollection (); + this.trueStatements.AddRange (trueStatements); + + this.falseStatements = new CodeStatementCollection (); + this.falseStatements.AddRange (falseStatements); + } + + // + // Properties + // + public CodeExpression Condition { + get { + return condition; + } + + set { + condition = value; + } + } + + public CodeStatementCollection FalseStatements { + get { + return falseStatements; + } + } + + public CodeStatementCollection TrueStatements { + get { + return trueStatements; + } + } + } +} diff --git a/mcs/class/System/System.CodeDom/CodeIndexerExpression.cs b/mcs/class/System/System.CodeDom/CodeIndexerExpression.cs new file mode 100755 index 00000000000..d2fe8f16954 --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeIndexerExpression.cs @@ -0,0 +1,34 @@ +// +// System.CodeDOM CodeFieldReferenceExpression Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// + +namespace System.CodeDOM { + + public class CodeIndexerExpression : CodeExpression { + CodeExpression targetObject; + CodeExpression index; + + // + // Constructors + // + public CodeIndexerExpression () + { + } + + public CodeIndexerExpression (CodeExpression targetObject, CodeExpression index) + { + this.index = index; + this.targetObject = targetObject; + } + + // + // Properties + // + } +} + diff --git a/mcs/class/System/System.CodeDom/CodeLinePragma.cs b/mcs/class/System/System.CodeDom/CodeLinePragma.cs new file mode 100755 index 00000000000..41e446110ca --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeLinePragma.cs @@ -0,0 +1,50 @@ +// +// System.CodeDOM CodeLinePragma Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// +using System; + +namespace System.CodeDOM { + + // <summary> + // Use objects of this class to keep track of locations where + // statements are defined + // </summary> + public class CodeLinePragma { + string fileName; + int lineNumber; + + public CodeLinePragma (string fileName, int lineNumber) + { + this.fileName = fileName; + this.lineNumber = lineNumber; + } + + // + // Properties + // + public string FileName { + get { + return fileName; + } + + set { + fileName = value; + } + } + + public int LineNumber { + get { + return lineNumber; + } + + set { + lineNumber = value; + } + } + } +} diff --git a/mcs/class/System/System.CodeDom/CodeLiteralClassMember.cs b/mcs/class/System/System.CodeDom/CodeLiteralClassMember.cs new file mode 100755 index 00000000000..6bccca20c0e --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeLiteralClassMember.cs @@ -0,0 +1,40 @@ +// +// System.CodeDOM CodeLiteralClassMember Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// + +namespace System.CodeDOM { + + public class CodeLiteralClassMember : CodeClassMember { + string text; + + // + // Constructors + // + public CodeLiteralClassMember () + { + } + + public CodeLiteralClassMember (string text) + { + this.text = text; + } + + // + // Properties + // + string Text { + get { + return text; + } + + set { + text = value; + } + } + } +} diff --git a/mcs/class/System/System.CodeDom/CodeLiteralExpression.cs b/mcs/class/System/System.CodeDom/CodeLiteralExpression.cs new file mode 100755 index 00000000000..7d2bd776de5 --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeLiteralExpression.cs @@ -0,0 +1,40 @@ +// +// System.CodeDOM CodeLiteralExpression Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// + +namespace System.CodeDOM { + + public class CodeLiteralExpression : CodeExpression { + string val; + + // + // Constructors + // + public CodeLiteralExpression () + { + } + + public CodeLiteralExpression (string value) + { + val = value; + } + + // + // Properties + // + string Value { + get { + return val; + } + + set { + val = value; + } + } + } +} diff --git a/mcs/class/System/System.CodeDom/CodeLiteralNamespace.cs b/mcs/class/System/System.CodeDom/CodeLiteralNamespace.cs new file mode 100755 index 00000000000..e3cb691f042 --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeLiteralNamespace.cs @@ -0,0 +1,48 @@ +// +// System.CodeDOM CodeLiteralNamespace Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// + +namespace System.CodeDOM { + + public class CodeLiteralNamespace : CodeNamespace { + CodeLinePragma linePragma; + string value; + + // + // Constructors + // + public CodeLiteralNamespace (string value) + { + this.value = value; + } + + // + // Properties + // + string Value { + get { + return value; + } + + set { + this.value = value; + } + } + + CodeLinePragma LinePragma { + get { + return linePragma; + } + + set { + linePragma = value; + } + } + } +} + diff --git a/mcs/class/System/System.CodeDom/CodeLiteralStatement.cs b/mcs/class/System/System.CodeDom/CodeLiteralStatement.cs new file mode 100755 index 00000000000..d08597a7e90 --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeLiteralStatement.cs @@ -0,0 +1,36 @@ +// +// System.CodeDOM CodeLiteralStatement Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// + +namespace System.CodeDOM { + + public class CodeLiteralStatement : CodeStatement { + string value; + + // + // Constructors + // + public CodeLiteralStatement (string value) + { + this.value = value; + } + + // + // Properties + // + string Value { + get { + return value; + } + + set { + this.value = value; + } + } + } +} diff --git a/mcs/class/System/System.CodeDom/CodeMemberEvent.cs b/mcs/class/System/System.CodeDom/CodeMemberEvent.cs new file mode 100755 index 00000000000..efbe5236dee --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeMemberEvent.cs @@ -0,0 +1,50 @@ +// +// System.CodeDOM CodeMemberEvent Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// + +namespace System.CodeDOM { + + public class CodeMemberEvent : CodeClassMember { + string implementsType, type; + bool privateImplements; + + public CodeMemberEvent () + { + } + + public string ImplementsType { + get { + return implementsType; + } + + set { + implementsType = value; + } + } + + public bool PrivateImplements { + get { + return privateImplements; + } + + set { + privateImplements = value; + } + } + + public string Type { + get { + return type; + } + + set { + type = value; + } + } + } +} diff --git a/mcs/class/System/System.CodeDom/CodeMemberField.cs b/mcs/class/System/System.CodeDom/CodeMemberField.cs new file mode 100755 index 00000000000..94ac4f2e78c --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeMemberField.cs @@ -0,0 +1,49 @@ +// +// System.CodeDOM CodeMemberField Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// + +namespace System.CodeDOM { + + public class CodeMemberField : CodeClassMember { + CodeExpression initExpression; + string type, name; + + public CodeMemberField () + { + } + + public CodeMemberField (string type, string name) + { + this.type = type; + this.name = name; + } + + // + // Properties + // + public CodeExpression InitExpression { + get { + return initExpression; + } + + set { + initExpression = value; + } + } + + public string Type { + get { + return type; + } + + set { + type = name; + } + } + } +} diff --git a/mcs/class/System/System.CodeDom/CodeMemberMethod.cs b/mcs/class/System/System.CodeDom/CodeMemberMethod.cs new file mode 100755 index 00000000000..40a8ae38299 --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeMemberMethod.cs @@ -0,0 +1,73 @@ +// +// System.CodeDOM CodeMemberMethod Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// + +namespace System.CodeDOM { + + public class CodeMemberMethod : CodeClassMember { + CodeParameterDeclarationExpressionCollection parameters; + CodeStatementCollection statements; + string implementsType; + string returnType; + bool privateImplements; + + public CodeMemberMethod () + { + } + + public string ImplementsType { + get { + return implementsType; + } + + set { + implementsType = value; + } + } + + public bool PrivateImplements { + get { + return privateImplements; + } + + set { + privateImplements = value; + } + } + + public string ReturnType { + get { + return returnType; + } + + set { + returnType = value; + } + } + + public CodeParameterDeclarationExpressionCollection Parameters { + get { + return parameters; + } + + set { + parameters = value; + } + } + + public CodeStatementCollection Statements { + get { + return statements; + } + + set { + statements = value; + } + } + } +} diff --git a/mcs/class/System/System.CodeDom/CodeMemberProperty.cs b/mcs/class/System/System.CodeDom/CodeMemberProperty.cs new file mode 100755 index 00000000000..29912dd4a2d --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeMemberProperty.cs @@ -0,0 +1,108 @@ +// +// System.CodeDOM CodeMemberProperty Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// + +namespace System.CodeDOM { + + public class CodeMemberProperty : CodeClassMember { + CodeParameterDeclarationExpressionCollection parameters; + CodeStatementCollection getStatements, setStatements; + bool hasGet, hasSet; + string implementsType, type; + bool privateImplements; + + public CodeMemberProperty () + { + } + + // + // Properties + // + + public string ImplementsType { + get { + return implementsType; + } + + set { + implementsType = value; + } + } + + public bool PrivateImplements { + get { + return privateImplements; + } + + set { + privateImplements = value; + } + } + + public CodeParameterDeclarationExpressionCollection Parameters { + get { + return parameters; + } + + set { + parameters = value; + } + } + + public CodeStatementCollection SetStatements { + get { + return setStatements; + } + + set { + setStatements = value; + } + } + + public CodeStatementCollection GetStatements { + get { + return getStatements; + } + + set { + getStatements = value; + } + } + + public string Type { + get { + return type; + } + + set { + type = value; + } + } + + public bool HasGet { + get { + return hasGet; + } + + set { + hasGet = value; + } + } + + public bool HasSet { + get { + return hasSet; + } + + set { + hasSet = value; + } + } + } +} + diff --git a/mcs/class/System/System.CodeDom/CodeMethodInvokeExpression.cs b/mcs/class/System/System.CodeDom/CodeMethodInvokeExpression.cs new file mode 100755 index 00000000000..54247650c4f --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeMethodInvokeExpression.cs @@ -0,0 +1,68 @@ +// +// System.CodeDOM CodeMethodInvokeExpression Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// + +namespace System.CodeDOM { + + public class CodeMethodInvokeExpression : CodeExpression { + string methodName; + CodeExpression targetObject; + CodeExpressionCollection parameters; + + // + // Constructors + // + public CodeMethodInvokeExpression () {} + + public CodeMethodInvokeExpression (CodeExpression targetObject, string methodName) + { + this.targetObject = targetObject; + this.methodName = methodName; + } + + public CodeMethodInvokeExpression (CodeExpression targetObject, + string methodName, + CodeExpression [] parameters) + { + this.targetObject = targetObject; + this.methodName = methodName; + this.parameters = new CodeExpressionCollection (); + this.parameters.AddRange (parameters); + } + + public string MethodName { + get { + return methodName; + } + + set { + methodName = value; + } + } + + public CodeExpressionCollection Parameters { + get { + return parameters; + } + + set { + parameters = value; + } + } + + public CodeExpression TargetObject { + get { + return targetObject; + } + + set { + targetObject = value; + } + } + } +} diff --git a/mcs/class/System/System.CodeDom/CodeMethodInvokeStatement.cs b/mcs/class/System/System.CodeDom/CodeMethodInvokeStatement.cs new file mode 100755 index 00000000000..e963b8fef35 --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeMethodInvokeStatement.cs @@ -0,0 +1,84 @@ +// +// System.CodeDOM CodeMethodInvokeStatement Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// + +namespace System.CodeDOM { + + public class CodeMethodInvokeStatement : CodeStatement { + string methodName; + CodeExpression targetObject; + CodeExpressionCollection parameters; + CodeMethodInvokeExpression methodInvoke; + + // + // Constructors + // + public CodeMethodInvokeStatement () {} + + public CodeMethodInvokeStatement (CodeMethodInvokeExpression methodInvoke) + { + this.methodInvoke = methodInvoke; + } + + public CodeMethodInvokeStatement (CodeExpression targetObject, string methodName) + { + this.targetObject = targetObject; + this.methodName = methodName; + } + + public CodeMethodInvokeStatement (CodeExpression targetObject, + string methodName, + CodeExpression [] parameters) + { + this.targetObject = targetObject; + this.methodName = methodName; + this.parameters = new CodeExpressionCollection (); + this.parameters.AddRange (parameters); + } + + public string MethodName { + get { + return methodName; + } + + set { + methodName = value; + } + } + + public CodeExpressionCollection Parameters { + get { + return parameters; + } + + set { + parameters = value; + } + } + + public CodeExpression TargetObject { + get { + return targetObject; + } + + set { + targetObject = value; + } + } + + public CodeMethodInvokeExpression MethodInvoke { + get { + return methodInvoke; + } + + set { + methodInvoke = value; + } + } + } +} diff --git a/mcs/class/System/System.CodeDom/CodeMethodReturnStatement.cs b/mcs/class/System/System.CodeDom/CodeMethodReturnStatement.cs new file mode 100755 index 00000000000..32600e6f25a --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeMethodReturnStatement.cs @@ -0,0 +1,37 @@ +// +// System.CodeDOM CodeReturnStatement Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// + +namespace System.CodeDOM { + + public class CodeReturnStatement : CodeStatement { + CodeExpression expression; + + public CodeReturnStatement () + { + } + + public CodeReturnStatement (CodeExpression expression) + { + this.expression = expression; + } + + // + // Properties + // + CodeExpression Expression { + get { + return expression; + } + + set { + expression = value; + } + } + } +} diff --git a/mcs/class/System/System.CodeDom/CodeNamespace.cs b/mcs/class/System/System.CodeDom/CodeNamespace.cs new file mode 100755 index 00000000000..309ff77f74c --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeNamespace.cs @@ -0,0 +1,92 @@ +// +// System.CodeDOM CodeNamespace Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// + +namespace System.CodeDOM { + + public class CodeNamespace { + CodeClassCollection classes; + CodeNamespaceImportCollection imports; + bool allowLateBound, requireVariableDeclaration; + string name; + object userData; + + public CodeNamespace () + { + } + + public CodeNamespace (string name) + { + this.name = name; + } + + // + // Properties + // + + public bool AllowLateBound { + get { + return allowLateBound; + } + + set { + allowLateBound = value; + } + } + + public CodeClassCollection Classes { + get { + return classes; + } + + set { + classes = value; + } + } + + public CodeNamespaceImportCollection Imports { + get { + return imports; + } + + set { + imports = value; + } + } + + public string Name { + get { + return name; + } + + set { + name = value; + } + } + + public bool RequireVariableDeclaration { + get { + return requireVariableDeclaration; + } + + set { + requireVariableDeclaration = value; + } + } + + public object UserData { + get { + return userData; + } + + set { + userData = value; + } + } + } +} diff --git a/mcs/class/System/System.CodeDom/CodeNamespaceImport.cs b/mcs/class/System/System.CodeDom/CodeNamespaceImport.cs new file mode 100755 index 00000000000..f01130ccfc4 --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeNamespaceImport.cs @@ -0,0 +1,36 @@ +// +// System.CodeDOM CodeNamespaceImport Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// + +namespace System.CodeDOM { + + public class CodeNamespaceImport : CodeStatement { + string nameSpace; + + public CodeNamespaceImport () {} + + public CodeNamespaceImport (string nameSpace) + { + this.nameSpace = nameSpace; + } + + // + // Properties + // + + public string Namespace { + get { + return nameSpace; + } + + set { + nameSpace = value; + } + } + } +} diff --git a/mcs/class/System/System.CodeDom/CodeNamespaceImportCollection.cs b/mcs/class/System/System.CodeDom/CodeNamespaceImportCollection.cs new file mode 100755 index 00000000000..0ed0eb8d8f6 --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeNamespaceImportCollection.cs @@ -0,0 +1,159 @@ +// +// System.CodeDOM CodeNamespaceImportCollection Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// + +namespace System.CodeDOM { + + using System.Collections; + + public class CodeNamespaceImportCollection : IList, ICollection, IEnumerable { + + ArrayList namespaceImports; + + // + // Constructors + // + public CodeNamespaceImportCollection () + { + namespaceImports = new ArrayList (); + } + + // + // Properties + // + public int Count { + get { + return namespaceImports.Count; + } + } + + // + // Methods + // + public void Add (CodeNamespaceImport value) + { + namespaceImports.Add (value); + } + + public void AddRange (CodeNamespaceImport [] values) + { + foreach (CodeNamespaceImport ca in values) + namespaceImports.Add (ca); + + } + + public void Clear () + { + namespaceImports.Clear (); + } + + private class Enumerator : IEnumerator { + private CodeNamespaceImportCollection collection; + private int currentIndex = -1; + + internal Enumerator (CodeNamespaceImportCollection collection) + { + this.collection = collection; + } + + public object Current { + get { + if (currentIndex == collection.Count) + throw new InvalidOperationException (); + return collection [currentIndex]; + } + } + + public bool MoveNext () + { + if (currentIndex > collection.Count) + throw new InvalidOperationException (); + return ++currentIndex < collection.Count; + } + + public void Reset () + { + currentIndex = -1; + } + } + + public IEnumerator GetEnumerator () + { + return new CodeNamespaceImportCollection.Enumerator (this); + } + + // + // IList method implementations + // + public int Add (object value) + { + return namespaceImports.Add (value); + } + + public bool Contains (Object value) + { + return namespaceImports.Contains (value); + } + + public int IndexOf (Object value) + { + return namespaceImports.IndexOf (value); + } + + public void Insert (int index, Object value) + { + namespaceImports [index] = value; + } + + public object this[int index] { + get { + return namespaceImports [index]; + } + + set { + namespaceImports [index] = value; + } + } + + public void Remove (object value) + { + namespaceImports.Remove (value); + } + + public void RemoveAt (int index) + { + namespaceImports.RemoveAt (index); + } + + // + // ICollection method implementations + // + public void CopyTo (Array array, int index) + { + namespaceImports.CopyTo (array, index); + } + + public object SyncRoot { + get { + return namespaceImports.SyncRoot; + } + } + + public bool IsReadOnly { + get { + return false; + } + } + + public bool IsSynchronized { + get { + return namespaceImports.IsSynchronized; + } + } + } +} diff --git a/mcs/class/System/System.CodeDom/CodeObjectCreateExpression.cs b/mcs/class/System/System.CodeDom/CodeObjectCreateExpression.cs new file mode 100755 index 00000000000..f3f495bf864 --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeObjectCreateExpression.cs @@ -0,0 +1,54 @@ +// +// System.CodeDOM CodeObjectCreateExpression Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// + +namespace System.CodeDOM { + + public class CodeObjectCreateExpression : CodeExpression { + string createType; + CodeExpressionCollection parameters; + + public CodeObjectCreateExpression () {} + + public CodeObjectCreateExpression (string createType) + { + this.createType = createType; + } + + public CodeObjectCreateExpression (string createType, CodeExpression [] parameters) + { + this.createType = createType; + this.parameters = new CodeExpressionCollection (); + this.parameters.AddRange (parameters); + } + + // + // Properties + // + public string CreateType { + get { + return createType; + } + + set { + createType = value; + } + } + + public CodeExpressionCollection Parameters { + get { + return parameters; + } + + set { + parameters = value; + } + } + + } +} diff --git a/mcs/class/System/System.CodeDom/CodeParameterDeclarationExpression.cs b/mcs/class/System/System.CodeDom/CodeParameterDeclarationExpression.cs new file mode 100755 index 00000000000..72497d3b253 --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeParameterDeclarationExpression.cs @@ -0,0 +1,68 @@ +// +// System.CodeDOM CodeParameterDeclarationExpression Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// + +namespace System.CodeDOM { + + public class CodeParameterDeclarationExpression : CodeExpression { + FieldDirection direction; + CodeAttributeBlock customAttributes; + string type, name; + + public CodeParameterDeclarationExpression () + { + } + + public CodeParameterDeclarationExpression (string type, string name) + { + this.type = type; + this.name = name; + } + + public string Type { + get { + return type; + } + + set { + type = value; + } + } + + public string Name { + get { + return name; + } + + set { + name = value; + } + } + + public CodeAttributeBlock CustomAttributes { + get { + return customAttributes; + } + + set { + customAttributes = value; + } + } + + public FieldDirection Direction { + get { + return direction; + } + + set { + direction = value; + } + } + } +} + diff --git a/mcs/class/System/System.CodeDom/CodeParameterDeclarationExpressionCollection.cs b/mcs/class/System/System.CodeDom/CodeParameterDeclarationExpressionCollection.cs new file mode 100755 index 00000000000..44ae219852c --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeParameterDeclarationExpressionCollection.cs @@ -0,0 +1,159 @@ +// +// System.CodeDOM CodeParameterDeclarationExpressionCollection Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// + +namespace System.CodeDOM { + + using System.Collections; + + public class CodeParameterDeclarationExpressionCollection : IList, ICollection, IEnumerable { + + ArrayList parameterDeclExprs; + + // + // Constructors + // + public CodeParameterDeclarationExpressionCollection () + { + parameterDeclExprs = new ArrayList (); + } + + // + // Properties + // + public int Count { + get { + return parameterDeclExprs.Count; + } + } + + // + // Methods + // + public void Add (CodeParameterDeclarationExpression value) + { + parameterDeclExprs.Add (value); + } + + public void AddRange (CodeParameterDeclarationExpression [] values) + { + foreach (CodeParameterDeclarationExpression ca in values) + parameterDeclExprs.Add (ca); + + } + + public void Clear () + { + parameterDeclExprs.Clear (); + } + + private class Enumerator : IEnumerator { + private CodeParameterDeclarationExpressionCollection collection; + private int currentIndex = -1; + + internal Enumerator (CodeParameterDeclarationExpressionCollection collection) + { + this.collection = collection; + } + + public object Current { + get { + if (currentIndex == collection.Count) + throw new InvalidOperationException (); + return collection [currentIndex]; + } + } + + public bool MoveNext () + { + if (currentIndex > collection.Count) + throw new InvalidOperationException (); + return ++currentIndex < collection.Count; + } + + public void Reset () + { + currentIndex = -1; + } + } + + public IEnumerator GetEnumerator () + { + return new CodeParameterDeclarationExpressionCollection.Enumerator (this); + } + + // + // IList method implementations + // + public int Add (object value) + { + return parameterDeclExprs.Add (value); + } + + public bool Contains (Object value) + { + return parameterDeclExprs.Contains (value); + } + + public int IndexOf (Object value) + { + return parameterDeclExprs.IndexOf (value); + } + + public void Insert (int index, Object value) + { + parameterDeclExprs [index] = value; + } + + public object this[int index] { + get { + return parameterDeclExprs [index]; + } + + set { + parameterDeclExprs [index] = value; + } + } + + public void Remove (object value) + { + parameterDeclExprs.Remove (value); + } + + public void RemoveAt (int index) + { + parameterDeclExprs.RemoveAt (index); + } + + // + // ICollection method implementations + // + public void CopyTo (Array array, int index) + { + parameterDeclExprs.CopyTo (array, index); + } + + public object SyncRoot { + get { + return parameterDeclExprs.SyncRoot; + } + } + + public bool IsReadOnly { + get { + return false; + } + } + + public bool IsSynchronized { + get { + return parameterDeclExprs.IsSynchronized; + } + } + } +} diff --git a/mcs/class/System/System.CodeDom/CodePrimitiveExpression.cs b/mcs/class/System/System.CodeDom/CodePrimitiveExpression.cs new file mode 100755 index 00000000000..7edbbfc3090 --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodePrimitiveExpression.cs @@ -0,0 +1,33 @@ +// +// System.CodeDOM CodePrimitiveExpression Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// + +namespace System.CodeDOM { + + public class CodePrimitiveExpression : CodeExpression { + object value; + + public CodePrimitiveExpression () {} + + public CodePrimitiveExpression (Object value) + { + this.value = value; + } + + public object Value { + get { + return value; + } + + set { + this.value = value; + } + } + } +} + diff --git a/mcs/class/System/System.CodeDom/CodePropertyReferenceExpression.cs b/mcs/class/System/System.CodeDom/CodePropertyReferenceExpression.cs new file mode 100755 index 00000000000..8248f196d9d --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodePropertyReferenceExpression.cs @@ -0,0 +1,59 @@ +// +// System.CodeDOM CodePropertyReferenceExpression Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// + +namespace System.CodeDOM { + + public class CodePropertyReferenceExpression : CodeExpression { + CodeExpressionCollection parameters; + CodeExpression targetObject; + string propertyName; + + public CodePropertyReferenceExpression () {} + + public CodePropertyReferenceExpression (CodeExpression targetObject, + string propertyName) + { + this.targetObject = targetObject; + this.propertyName = propertyName; + } + + // + // Properties + // + public CodeExpressionCollection Parameter { + get { + return parameters; + } + + set { + parameters = value; + } + } + + public string PropertyName { + get { + return propertyName; + } + + set { + propertyName = value; + } + } + + public CodeExpression TargetObject { + get { + return targetObject; + } + + set { + targetObject = value; + } + } + } +} diff --git a/mcs/class/System/System.CodeDom/CodeStatement.cs b/mcs/class/System/System.CodeDom/CodeStatement.cs new file mode 100755 index 00000000000..f53806f322d --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeStatement.cs @@ -0,0 +1,47 @@ +// +// System.CodeDOM CodeStatement Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// + +namespace System.CodeDOM { + + public class CodeStatement { + + CodeLinePragma codeLinePragma; + object userData; + + // + // Constructors + // + public CodeStatement () + { + } + + // + // Properties + // + public CodeLinePragma LinePragma { + get { + return codeLinePragma; + } + + set { + codeLinePragma = value; + } + } + + public object UserData { + get { + return userData; + } + + set { + userData = value; + } + } + } +} diff --git a/mcs/class/System/System.CodeDom/CodeStatementCollection.cs b/mcs/class/System/System.CodeDom/CodeStatementCollection.cs new file mode 100755 index 00000000000..3ebd86bfa1c --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeStatementCollection.cs @@ -0,0 +1,159 @@ +// +// System.CodeDOM CodeStatementCollection Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// + +namespace System.CodeDOM { + + using System.Collections; + + public class CodeStatementCollection : IList, ICollection, IEnumerable { + + ArrayList statements; + + // + // Constructors + // + public CodeStatementCollection () + { + statements = new ArrayList (); + } + + // + // Properties + // + public int Count { + get { + return statements.Count; + } + } + + // + // Methods + // + public void Add (CodeStatement value) + { + statements.Add (value); + } + + public void AddRange (CodeStatement [] values) + { + foreach (CodeStatement ca in values) + statements.Add (ca); + + } + + public void Clear () + { + statements.Clear (); + } + + private class Enumerator : IEnumerator { + private CodeStatementCollection collection; + private int currentIndex = -1; + + internal Enumerator (CodeStatementCollection collection) + { + this.collection = collection; + } + + public object Current { + get { + if (currentIndex == collection.Count) + throw new InvalidOperationException (); + return collection [currentIndex]; + } + } + + public bool MoveNext () + { + if (currentIndex > collection.Count) + throw new InvalidOperationException (); + return ++currentIndex < collection.Count; + } + + public void Reset () + { + currentIndex = -1; + } + } + + public IEnumerator GetEnumerator () + { + return new CodeStatementCollection.Enumerator (this); + } + + // + // IList method implementations + // + public int Add (object value) + { + return statements.Add (value); + } + + public bool Contains (Object value) + { + return statements.Contains (value); + } + + public int IndexOf (Object value) + { + return statements.IndexOf (value); + } + + public void Insert (int index, Object value) + { + statements [index] = value; + } + + public object this[int index] { + get { + return statements [index]; + } + + set { + statements [index] = value; + } + } + + public void Remove (object value) + { + statements.Remove (value); + } + + public void RemoveAt (int index) + { + statements.RemoveAt (index); + } + + // + // ICollection method implementations + // + public void CopyTo (Array array, int index) + { + statements.CopyTo (array, index); + } + + public object SyncRoot { + get { + return statements.SyncRoot; + } + } + + public bool IsReadOnly { + get { + return false; + } + } + + public bool IsSynchronized { + get { + return statements.IsSynchronized; + } + } + } +} diff --git a/mcs/class/System/System.CodeDom/CodeThisReferenceExpression.cs b/mcs/class/System/System.CodeDom/CodeThisReferenceExpression.cs new file mode 100755 index 00000000000..ef46fb709c7 --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeThisReferenceExpression.cs @@ -0,0 +1,16 @@ +// +// System.CodeDOM CodeParameterDeclarationExpression Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// + +namespace System.CodeDOM { + + public class CodeThisReferenceExpression : CodeExpression { + public CodeThisReferenceExpression () { } + } +} + diff --git a/mcs/class/System/System.CodeDom/CodeThrowExceptionStatement.cs b/mcs/class/System/System.CodeDom/CodeThrowExceptionStatement.cs new file mode 100755 index 00000000000..b2967fcb888 --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeThrowExceptionStatement.cs @@ -0,0 +1,31 @@ +// +// System.CodeDOM CodeThrowExceptionStatement Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// + +namespace System.CodeDOM { + + public class CodeThrowExceptionStatement : CodeStatement { + CodeExpression toThrow; + + public CodeThrowExceptionStatement () {} + public CodeThrowExceptionStatement (CodeExpression toThrow) + { + this.toThrow = toThrow; + } + + public CodeExpression ToThrow { + get { + return toThrow; + } + + set { + toThrow = value; + } + } + } +} diff --git a/mcs/class/System/System.CodeDom/CodeTryCatchFinallyStatement.cs b/mcs/class/System/System.CodeDom/CodeTryCatchFinallyStatement.cs new file mode 100755 index 00000000000..81a2a400371 --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeTryCatchFinallyStatement.cs @@ -0,0 +1,70 @@ +// +// System.CodeDOM CodeTryCatchFinallyStatement Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// + +namespace System.CodeDOM { + + public class CodeTryCatchFinallyStatement : CodeStatement { + CodeStatementCollection tryStatements, finallyStatements; + CodeCatchClauseCollection catchClauses; + + public CodeTryCatchFinallyStatement () {} + + public CodeTryCatchFinallyStatement (CodeStatement [] tryStatements, + CodeCatchClause [] catchClauses) + { + this.tryStatements = new CodeStatementCollection (); + this.catchClauses = new CodeCatchClauseCollection (); + + this.tryStatements.AddRange (tryStatements); + this.catchClauses.AddRange (catchClauses); + } + + public CodeTryCatchFinallyStatement (CodeStatement [] tryStatements, + CodeCatchClause [] catchClauses, + CodeStatement [] finallyStatements) + { + this.tryStatements = new CodeStatementCollection (); + this.catchClauses = new CodeCatchClauseCollection (); + this.finallyStatements = new CodeStatementCollection (); + + this.tryStatements.AddRange (tryStatements); + this.catchClauses.AddRange (catchClauses); + this.finallyStatements.AddRange (finallyStatements); + } + + public CodeStatementCollection FinallyStatements{ + get { + return finallyStatements; + } + + set { + finallyStatements = value; + } + } + + public CodeStatementCollection TryStatements { + get { + return tryStatements; + } + + set { + tryStatements = value; + } + } + public CodeCatchClauseCollection CatchClauses { + get { + return catchClauses; + } + + set { + catchClauses = value; + } + } + } +} diff --git a/mcs/class/System/System.CodeDom/CodeTypeOfExpression.cs b/mcs/class/System/System.CodeDom/CodeTypeOfExpression.cs new file mode 100755 index 00000000000..d39eb2f5bfa --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeTypeOfExpression.cs @@ -0,0 +1,32 @@ +// +// System.CodeDOM CodeTypeOfExpression Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// + +namespace System.CodeDOM { + + public class CodeTypeOfExpression : CodeExpression { + string type; + + public CodeTypeOfExpression () {} + + public CodeTypeOfExpression (string type) + { + this.type = type; + } + + public string Type { + get { + return type; + } + + set { + type = value; + } + } + } +} diff --git a/mcs/class/System/System.CodeDom/CodeTypeReferenceExpression.cs b/mcs/class/System/System.CodeDom/CodeTypeReferenceExpression.cs new file mode 100755 index 00000000000..340f1fb7521 --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeTypeReferenceExpression.cs @@ -0,0 +1,32 @@ +// +// System.CodeDOM CodeTypeReferenceExpression Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// + +namespace System.CodeDOM { + + public class CodeTypeReferenceExpression : CodeExpression { + string type; + + public CodeTypeReferenceExpression () {} + + public CodeTypeReferenceExpression (string type) + { + this.type = type; + } + + public string Type { + get { + return type; + } + + set { + type = value; + } + } + } +} diff --git a/mcs/class/System/System.CodeDom/CodeVariableDeclarationStatement.cs b/mcs/class/System/System.CodeDom/CodeVariableDeclarationStatement.cs new file mode 100755 index 00000000000..0a8e8329628 --- /dev/null +++ b/mcs/class/System/System.CodeDom/CodeVariableDeclarationStatement.cs @@ -0,0 +1,62 @@ +// +// System.CodeDOM CodeVariableDeclarationStatement Class implementation +// +// Author: +// Miguel de Icaza (miguel@ximian.com) +// +// (C) 2001 Ximian, Inc. +// + +namespace System.CodeDOM { + + public class CodeVariableDeclarationStatement : CodeStatement { + CodeExpression initExpression; + string type, name; + + public CodeVariableDeclarationStatement () {} + + public CodeVariableDeclarationStatement (string type, string name) + { + this.type = type; + this.name = name; + } + + public CodeVariableDeclarationStatement (string type, string name, + CodeExpression initExpression) + { + this.type = type; + this.name = name; + this.initExpression = initExpression; + } + + public CodeExpression InitExpression { + get { + return initExpression; + } + + set { + initExpression = value; + } + } + + public string Name { + get { + return name; + } + + set { + name = value; + } + } + + public string Type { + get { + return type; + } + + set { + type = value; + } + } + } +} diff --git a/mcs/class/System/System.CodeDom/makefile b/mcs/class/System/System.CodeDom/makefile new file mode 100755 index 00000000000..58af6697c82 --- /dev/null +++ b/mcs/class/System/System.CodeDom/makefile @@ -0,0 +1,2 @@ +CodeClassCollection.cs: Code-X-Collection.cs + sed -e 's/@CONTAINEE@/Class/g' -e 's/@arrayname@/classes/g' < Code-X-Collection.cs > CodeClassCollection.cs
\ No newline at end of file diff --git a/mcs/class/System/System.CodeDom/makeit b/mcs/class/System/System.CodeDom/makeit new file mode 100755 index 00000000000..07dcc7f61de --- /dev/null +++ b/mcs/class/System/System.CodeDom/makeit @@ -0,0 +1,15 @@ +#!/bin/sh +dx () +{ + sed -e "s/@CONTAINEE@/$1/g" -e "s/@arrayname@/$2/g" < Code-X-Collection.cs > Code$1Collection.cs +} + +dx AttributeArgument attributeArgs +dx AttributeDeclaration attributeDecls +dx CatchClause catchClauses +dx Class classes +dx ClassMember classMembers +dx Expression expressions +dx NamespaceImport namespaceImports +dx ParameterDeclarationExpression parameterDeclExprs +dx Statement statements
\ No newline at end of file |