Author: mkrueger
Date: 2008-02-08 11:01:15 -0500 (Fri, 08 Feb 2008)
New Revision: 95269

Added:
   
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/CompilationUnit.cs
Modified:
   trunk/monodevelop/main/src/core/MonoDevelop.Ide/ChangeLog
   trunk/monodevelop/main/src/core/MonoDevelop.Ide/Makefile.am
   
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom.Output/Ambience.cs
   
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom.Output/NetAmbience.cs
   
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/AbstractDomItem.cs
   
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/DomEvent.cs
   
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/DomField.cs
   
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/DomMethod.cs
   
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/DomProperty.cs
   
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/DomType.cs
   
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/IAttribute.cs
   
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/ICompilationUnit.cs
   
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/IDomItem.cs
   
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/IDomVisitor.cs
   trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/IEvent.cs
   trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/IField.cs
   
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/IMethod.cs
   
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/IParameter.cs
   
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/IProperty.cs
   
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/IReturnType.cs
   trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/IType.cs
   trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/IUsing.cs
   trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.mdp
Log:
* MonoDevelop.Ide.Dom.Output/Ambience.cs,
  MonoDevelop.Ide.Dom.Output/NetAmbience.cs,
  MonoDevelop.Ide.Dom/DomType.cs, MonoDevelop.Ide.Dom/IMethod.cs,
  MonoDevelop.Ide.Dom/IProperty.cs, MonoDevelop.Ide.Dom/IUsing.cs,
  MonoDevelop.Ide.Dom/IDomItem.cs,
  MonoDevelop.Ide.Dom/IDomVisitor.cs,
  MonoDevelop.Ide.Dom/IAttribute.cs,
  MonoDevelop.Ide.Dom/CompilationUnit.cs,
  MonoDevelop.Ide.Dom/DomMethod.cs, MonoDevelop.Ide.Dom/DomEvent.cs,
  MonoDevelop.Ide.Dom/AbstractDomItem.cs,
  MonoDevelop.Ide.Dom/DomField.cs,
  MonoDevelop.Ide.Dom/DomProperty.cs,
  MonoDevelop.Ide.Dom/ICompilationUnit.cs,
  MonoDevelop.Ide.Dom/IParameter.cs, MonoDevelop.Ide.Dom/IEvent.cs,
  MonoDevelop.Ide.Dom/IType.cs, MonoDevelop.Ide.Dom/IReturnType.cs,
  MonoDevelop.Ide.Dom/IField.cs: Worked on Dom, added some functions,
  ambiences now using the visitor pattern.

Modified: trunk/monodevelop/main/src/core/MonoDevelop.Ide/ChangeLog
===================================================================
--- trunk/monodevelop/main/src/core/MonoDevelop.Ide/ChangeLog   2008-02-08 
15:59:36 UTC (rev 95268)
+++ trunk/monodevelop/main/src/core/MonoDevelop.Ide/ChangeLog   2008-02-08 
16:01:15 UTC (rev 95269)
@@ -1,3 +1,21 @@
+2008-02-08  Mike Krüger <[EMAIL PROTECTED]> 
+
+       * MonoDevelop.Ide.Dom.Output/Ambience.cs,
+         MonoDevelop.Ide.Dom.Output/NetAmbience.cs,
+         MonoDevelop.Ide.Dom/DomType.cs, MonoDevelop.Ide.Dom/IMethod.cs,
+         MonoDevelop.Ide.Dom/IProperty.cs, MonoDevelop.Ide.Dom/IUsing.cs,
+         MonoDevelop.Ide.Dom/IDomItem.cs, MonoDevelop.Ide.Dom/IDomVisitor.cs,
+         MonoDevelop.Ide.Dom/IAttribute.cs,
+         MonoDevelop.Ide.Dom/CompilationUnit.cs,
+         MonoDevelop.Ide.Dom/DomMethod.cs, MonoDevelop.Ide.Dom/DomEvent.cs,
+         MonoDevelop.Ide.Dom/AbstractDomItem.cs, 
MonoDevelop.Ide.Dom/DomField.cs,
+         MonoDevelop.Ide.Dom/DomProperty.cs,
+         MonoDevelop.Ide.Dom/ICompilationUnit.cs,
+         MonoDevelop.Ide.Dom/IParameter.cs, MonoDevelop.Ide.Dom/IEvent.cs,
+         MonoDevelop.Ide.Dom/IType.cs, MonoDevelop.Ide.Dom/IReturnType.cs,
+         MonoDevelop.Ide.Dom/IField.cs: Worked on Dom, added some functions,
+         ambiences now using the visitor pattern.
+
 2008-02-07  Mike Krüger <[EMAIL PROTECTED]> 
 
        * MonoDevelop.Ide.Dom.Output/Ambience.cs: Fixed ambience format bug.

Modified: trunk/monodevelop/main/src/core/MonoDevelop.Ide/Makefile.am
===================================================================
--- trunk/monodevelop/main/src/core/MonoDevelop.Ide/Makefile.am 2008-02-08 
15:59:36 UTC (rev 95268)
+++ trunk/monodevelop/main/src/core/MonoDevelop.Ide/Makefile.am 2008-02-08 
16:01:15 UTC (rev 95269)
@@ -110,6 +110,7 @@
        MonoDevelop.Ide.Dom/ClassType.cs \
        MonoDevelop.Ide.Dom/Comment.cs \
        MonoDevelop.Ide.Dom/CommentType.cs \
+       MonoDevelop.Ide.Dom/CompilationUnit.cs \
        MonoDevelop.Ide.Dom/DomAttribute.cs \
        MonoDevelop.Ide.Dom/DomEvent.cs \
        MonoDevelop.Ide.Dom/DomField.cs \

Modified: 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/AbstractDomItem.cs
===================================================================
--- 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/AbstractDomItem.cs
      2008-02-08 15:59:36 UTC (rev 95268)
+++ 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/AbstractDomItem.cs
      2008-02-08 16:01:15 UTC (rev 95269)
@@ -88,11 +88,143 @@
                                return attributes;
                        }
                }
-
-
+               
                public virtual int CompareTo (object obj)
                {
                        return 0;
                }
+               
+               #region ModifierAccessors
+               public bool IsPrivate { 
+                       get {
+                               return (this.Modifiers & Modifiers.Private) == 
Modifiers.Private;
+                       }
+               }
+               public bool IsInternal { 
+                       get {
+                               return (this.Modifiers & Modifiers.Internal) == 
Modifiers.Internal;
+                       }
+               }
+               public bool IsProtected { 
+                       get {
+                               return (this.Modifiers & Modifiers.Protected) 
== Modifiers.Protected;
+                       }
+               }
+               public bool IsPublic { 
+                       get {
+                               return (this.Modifiers & Modifiers.Public) == 
Modifiers.Public;
+                       }
+               }
+               public bool IsProtectedAndInternal { 
+                       get {
+                               return (this.Modifiers & 
Modifiers.ProtectedAndInternal) == Modifiers.ProtectedAndInternal;
+                       }
+               }
+               public bool IsProtectedOrInternal { 
+                       get {
+                               return (this.Modifiers & 
Modifiers.ProtectedOrInternal) == Modifiers.ProtectedOrInternal;
+                       }
+               }
+               
+               public bool IsAbstract { 
+                       get {
+                               return (this.Modifiers & Modifiers.Abstract) == 
Modifiers.Abstract;
+                       }
+               }
+               public bool IsVirtual { 
+                       get {
+                               return (this.Modifiers & Modifiers.Virtual) == 
Modifiers.Virtual;
+                       }
+               }
+               public bool IsSealed { 
+                       get {
+                               return (this.Modifiers & Modifiers.Sealed) == 
Modifiers.Sealed;
+                       }
+               }
+               public bool IsStatic { 
+                       get {
+                               return (this.Modifiers & Modifiers.Static) == 
Modifiers.Static;
+                       }
+               }
+               public bool IsOverride { 
+                       get {
+                               return (this.Modifiers & Modifiers.Override) == 
Modifiers.Override;
+                       }
+               }
+               public bool IsReadonly { 
+                       get {
+                               return (this.Modifiers & Modifiers.Readonly) == 
Modifiers.Readonly;
+                       }
+               }
+               public bool IsConst { 
+                       get {
+                               return (this.Modifiers & Modifiers.Const) == 
Modifiers.Const;
+                       }
+               }
+               public bool IsNew { 
+                       get {
+                               return (this.Modifiers & Modifiers.New) == 
Modifiers.New;
+                       }
+               }
+               public bool IsPartial { 
+                       get {
+                               return (this.Modifiers & Modifiers.Partial) == 
Modifiers.Partial;
+                       }
+               }
+               
+               public bool IsExtern { 
+                       get {
+                               return (this.Modifiers & Modifiers.Extern) == 
Modifiers.Extern;
+                       }
+               }
+               public bool IsVolatile { 
+                       get {
+                               return (this.Modifiers & Modifiers.Volatile) == 
Modifiers.Volatile;
+                       }
+               }
+               public bool IsUnsafe { 
+                       get {
+                               return (this.Modifiers & Modifiers.Unsafe) == 
Modifiers.Unsafe;
+                       }
+               }
+               public bool IsOverloads { 
+                       get {
+                               return (this.Modifiers & Modifiers.Overloads) 
== Modifiers.Overloads;
+                       }
+               }
+               public bool IsWithEvents { 
+                       get {
+                               return (this.Modifiers & Modifiers.WithEvents) 
== Modifiers.WithEvents;
+                       }
+               }
+               public bool IsDefault { 
+                       get {
+                               return (this.Modifiers & Modifiers.Default) == 
Modifiers.Default;
+                       }
+               }
+               public bool IsFixed { 
+                       get {
+                               return (this.Modifiers & Modifiers.Fixed) == 
Modifiers.Fixed;
+                       }
+               }
+               
+               public bool IsSpecialName { 
+                       get {
+                               return (this.Modifiers & Modifiers.SpecialName) 
== Modifiers.SpecialName;
+                       }
+               }
+               public bool IsFinal { 
+                       get {
+                               return (this.Modifiers & Modifiers.Final) == 
Modifiers.Final;
+                       }
+               }
+               public bool IsLiteral { 
+                       get {
+                               return (this.Modifiers & Modifiers.Literal) == 
Modifiers.Literal;
+                       }
+               }
+               #endregion
+               
+               public abstract object AcceptVisitior (IDomVisitor visitor, 
object data);
        }
 }

Added: 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/CompilationUnit.cs
===================================================================
--- 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/CompilationUnit.cs
      2008-02-08 15:59:36 UTC (rev 95268)
+++ 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/CompilationUnit.cs
      2008-02-08 16:01:15 UTC (rev 95269)
@@ -0,0 +1,133 @@
+//
+// CompilationUnit.cs
+//
+// Author:
+//   Mike Krüger <[EMAIL PROTECTED]>
+//
+// Copyright (C) 2008 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+
+namespace MonoDevelop.Ide.Dom
+{
+       public class CompilationUnit : ICompilationUnit
+       {
+               string fileName;
+               
+               List<IUsing>     usings         = new List<IUsing> ();
+               List<IAttribute> attributes     = new List<IAttribute> ();
+               List<IType>      types          = new List<IType> ();
+               List<Comment>    comments       = new List<Comment> ();
+               List<DomRegion>  foldingRegions = new List<DomRegion> ();
+               List<Error>      errors         = new List<Error> ();
+               
+               public CompilationUnit (string fileName)
+               {
+                       this.fileName = fileName;
+               }
+               
+               #region ICompilationUnit
+               string ICompilationUnit.FileName {
+                       get {
+                               return fileName;
+                       }
+               }
+               
+               IEnumerable<IUsing> ICompilationUnit.Usings {
+                       get {
+                               return usings;
+                       }
+               }
+               
+               IEnumerable<IAttribute> ICompilationUnit.Attributes {
+                       get {
+                               return attributes;
+                       }
+               }
+               
+               IEnumerable<IType> ICompilationUnit.Types {
+                       get {
+                               return types;
+                       }
+               }
+               
+               IEnumerable<Comment> ICompilationUnit.Comments {
+                       get {
+                               return comments;
+                       }
+               }
+               
+               IEnumerable<DomRegion> ICompilationUnit.FoldingRegions {
+                       get {
+                               return foldingRegions;
+                       }
+               }
+               
+               IEnumerable<Error> ICompilationUnit.Errors {
+                       get {
+                               return errors;
+                       }
+               }
+               
+               object IDomVisitable.AcceptVisitior (IDomVisitor visitor, 
object data)
+               {
+                       return visitor.Visit (this, data);
+               }
+               #endregion
+               
+               public virtual void Dispose ()
+               {
+               }
+               
+               public void Add (IUsing newUsing)
+               {
+                       usings.Add (newUsing);
+               }
+               
+               public void Add (IAttribute newAttribute)
+               {
+                       attributes.Add (newAttribute);
+               }
+               
+               public void Add (IType newType)
+               {
+                       types.Add (newType);
+               }
+               
+               public void Add (Comment comment)
+               {
+                       comments.Add (comment);
+               }
+               
+               public void Add (DomRegion domRegion)
+               {
+                       foldingRegions.Add (domRegion);
+               }
+               
+               public void Add (Error error)
+               {
+                       errors.Add (error);
+               }
+       }
+}

Modified: 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/DomEvent.cs
===================================================================
--- 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/DomEvent.cs 
    2008-02-08 15:59:36 UTC (rev 95268)
+++ 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/DomEvent.cs 
    2008-02-08 16:01:15 UTC (rev 95269)
@@ -55,7 +55,7 @@
                        }
                }
                
-               public object AcceptVisitior (IDomVisitor visitor, object data)
+               public override object AcceptVisitior (IDomVisitor visitor, 
object data)
                {
                        return visitor.Visit (this, data);
                }

Modified: 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/DomField.cs
===================================================================
--- 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/DomField.cs 
    2008-02-08 15:59:36 UTC (rev 95268)
+++ 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/DomField.cs 
    2008-02-08 16:01:15 UTC (rev 95269)
@@ -32,7 +32,7 @@
 {
        public class DomField : AbstractMember, IField
        {
-               public object AcceptVisitior (IDomVisitor visitor, object data)
+               public override object AcceptVisitior (IDomVisitor visitor, 
object data)
                {
                        return visitor.Visit (this, data);
                }

Modified: 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/DomMethod.cs
===================================================================
--- 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/DomMethod.cs
    2008-02-08 15:59:36 UTC (rev 95268)
+++ 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/DomMethod.cs
    2008-02-08 16:01:15 UTC (rev 95269)
@@ -48,7 +48,7 @@
                        }
                }
                
-               public object AcceptVisitior (IDomVisitor visitor, object data)
+               public override object AcceptVisitior (IDomVisitor visitor, 
object data)
                {
                        return visitor.Visit (this, data);
                }

Modified: 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/DomProperty.cs
===================================================================
--- 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/DomProperty.cs
  2008-02-08 15:59:36 UTC (rev 95268)
+++ 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/DomProperty.cs
  2008-02-08 16:01:15 UTC (rev 95269)
@@ -40,7 +40,7 @@
                        }
                }
                
-               public object AcceptVisitior (IDomVisitor visitor, object data)
+               public override object AcceptVisitior (IDomVisitor visitor, 
object data)
                {
                        return visitor.Visit (this, data);
                }

Modified: 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/DomType.cs
===================================================================
--- 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/DomType.cs  
    2008-02-08 15:59:36 UTC (rev 95268)
+++ 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/DomType.cs  
    2008-02-08 16:01:15 UTC (rev 95269)
@@ -124,7 +124,7 @@
                        }
                }
                
-               public object AcceptVisitior (IDomVisitor visitor, object data)
+               public override object AcceptVisitior (IDomVisitor visitor, 
object data)
                {
                        return visitor.Visit (this, data);
                }

Modified: 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/IAttribute.cs
===================================================================
--- 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/IAttribute.cs
   2008-02-08 15:59:36 UTC (rev 95268)
+++ 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/IAttribute.cs
   2008-02-08 16:01:15 UTC (rev 95269)
@@ -31,7 +31,7 @@
 
 namespace MonoDevelop.Ide.Dom
 {
-       public interface IAttribute
+       public interface IAttribute : IDomVisitable
        {
                DomRegion Region {
                        get;
@@ -52,8 +52,6 @@
                IDictionary<string, object> NamedArguments {
                        get;
                }
-               
-               object AcceptVisitior (IDomVisitor visitor, object data);
        }
        
 }

Modified: 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/ICompilationUnit.cs
===================================================================
--- 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/ICompilationUnit.cs
     2008-02-08 15:59:36 UTC (rev 95268)
+++ 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/ICompilationUnit.cs
     2008-02-08 16:01:15 UTC (rev 95269)
@@ -31,7 +31,7 @@
 
 namespace MonoDevelop.Ide.Dom
 {
-       public interface ICompilationUnit : IDisposable
+       public interface ICompilationUnit : IDisposable, IDomVisitable
        {
                string FileName {
                        get;
@@ -60,7 +60,5 @@
                IEnumerable<Error> Errors {
                        get;
                }
-               
-               object AcceptVisitior (IDomVisitor visitor, object data);
        }
 }

Modified: 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/IDomItem.cs
===================================================================
--- 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/IDomItem.cs 
    2008-02-08 15:59:36 UTC (rev 95268)
+++ 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/IDomItem.cs 
    2008-02-08 16:01:15 UTC (rev 95269)
@@ -31,7 +31,7 @@
 
 namespace MonoDevelop.Ide.Dom
 {
-       public interface IDomItem : IComparable
+       public interface IDomItem : IComparable, IDomVisitable
        {
                string FullName {
                        get;
@@ -62,5 +62,35 @@
                        get;
                }
                
+               #region ModifierAccessors
+               bool IsPrivate   { get; }
+               bool IsInternal  { get; }
+               bool IsProtected { get; }
+               bool IsPublic    { get; }
+               bool IsProtectedAndInternal { get; }
+               bool IsProtectedOrInternal { get; }
+               
+               bool IsAbstract  { get; }
+               bool IsVirtual   { get; }
+               bool IsSealed    { get; }
+               bool IsStatic    { get; }
+               bool IsOverride  { get; }
+               bool IsReadonly  { get; }
+               bool IsConst     { get; }
+               bool IsNew       { get; }
+               bool IsPartial   { get; }
+               
+               bool IsExtern    { get; }
+               bool IsVolatile  { get; }
+               bool IsUnsafe    { get; }
+               bool IsOverloads  { get; }
+               bool IsWithEvents { get; }
+               bool IsDefault    { get; }
+               bool IsFixed      { get; }
+               
+               bool IsSpecialName { get; }
+               bool IsFinal       { get; }
+               bool IsLiteral     { get; }
+               #endregion
        }
 }

Modified: 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/IDomVisitor.cs
===================================================================
--- 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/IDomVisitor.cs
  2008-02-08 15:59:36 UTC (rev 95268)
+++ 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/IDomVisitor.cs
  2008-02-08 16:01:15 UTC (rev 95269)
@@ -30,20 +30,25 @@
 
 namespace MonoDevelop.Ide.Dom
 {
+       public interface IDomVisitable
+       {
+               object AcceptVisitior (IDomVisitor visitor, object data);
+       }
+       
        public interface IDomVisitor
        {
                object Visit (ICompilationUnit unit, object data);
                
-               object Visit (IAttribute attr, object data);
+               object Visit (IAttribute attribute, object data);
                
                object Visit (IType type, object data);
                
                object Visit (IField field, object data);
                object Visit (IMethod method, object data);
                object Visit (IProperty property, object data);
-               object Visit (IEvent e, object data);
+               object Visit (IEvent evt, object data);
                
-               object Visit (IReturnType type, object data);
+               object Visit (IReturnType returnType, object data);
                object Visit (IParameter parameter, object data);
                object Visit (IUsing u, object data);
        }

Modified: 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/IEvent.cs
===================================================================
--- 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/IEvent.cs   
    2008-02-08 15:59:36 UTC (rev 95268)
+++ 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/IEvent.cs   
    2008-02-08 16:01:15 UTC (rev 95269)
@@ -41,6 +41,5 @@
                IMethod RaiseMethod {
                        get;
                }
-               object AcceptVisitior (IDomVisitor visitor, object data);
        }
 }

Modified: 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/IField.cs
===================================================================
--- 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/IField.cs   
    2008-02-08 15:59:36 UTC (rev 95268)
+++ 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/IField.cs   
    2008-02-08 16:01:15 UTC (rev 95269)
@@ -32,6 +32,5 @@
 {
        public interface IField : IMember
        {
-               object AcceptVisitior (IDomVisitor visitor, object data);
        }
 }

Modified: 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/IMethod.cs
===================================================================
--- 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/IMethod.cs  
    2008-02-08 15:59:36 UTC (rev 95268)
+++ 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/IMethod.cs  
    2008-02-08 16:01:15 UTC (rev 95269)
@@ -40,6 +40,5 @@
                IEnumerable<IParameter> Parameters {
                        get;
                }
-               object AcceptVisitior (IDomVisitor visitor, object data);
        }
 }

Modified: 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/IParameter.cs
===================================================================
--- 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/IParameter.cs
   2008-02-08 15:59:36 UTC (rev 95268)
+++ 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/IParameter.cs
   2008-02-08 16:01:15 UTC (rev 95269)
@@ -31,7 +31,7 @@
 
 namespace MonoDevelop.Ide.Dom
 {
-       public interface IParameter
+       public interface IParameter : IDomVisitable
        {
                string Name {
                        get;
@@ -52,6 +52,5 @@
                DomRegion Region {
                        get;
                }
-               object AcceptVisitior (IDomVisitor visitor, object data);
        }
 }

Modified: 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/IProperty.cs
===================================================================
--- 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/IProperty.cs
    2008-02-08 15:59:36 UTC (rev 95268)
+++ 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/IProperty.cs
    2008-02-08 16:01:15 UTC (rev 95269)
@@ -34,6 +34,5 @@
                bool IsIndexer {
                        get;
                }
-               object AcceptVisitior (IDomVisitor visitor, object data);
        }
 }

Modified: 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/IReturnType.cs
===================================================================
--- 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/IReturnType.cs
  2008-02-08 15:59:36 UTC (rev 95268)
+++ 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/IReturnType.cs
  2008-02-08 16:01:15 UTC (rev 95269)
@@ -31,7 +31,7 @@
 
 namespace MonoDevelop.Ide.Dom
 {
-       public interface IReturnType
+       public interface IReturnType : IDomVisitable
        {
                string FullName {
                        get;
@@ -53,6 +53,5 @@
                IEnumerable<IReturnType> TypeParameters {
                        get;
                }
-               object AcceptVisitior (IDomVisitor visitor, object data);
        }
 }

Modified: 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/IType.cs
===================================================================
--- 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/IType.cs    
    2008-02-08 15:59:36 UTC (rev 95268)
+++ 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/IType.cs    
    2008-02-08 16:01:15 UTC (rev 95269)
@@ -79,7 +79,6 @@
 
                IEnumerable<IEvent> Events {
                        get;
-               }
-               object AcceptVisitior (IDomVisitor visitor, object data);
+               }
        }
 }

Modified: 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/IUsing.cs
===================================================================
--- 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/IUsing.cs   
    2008-02-08 15:59:36 UTC (rev 95268)
+++ 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom/IUsing.cs   
    2008-02-08 16:01:15 UTC (rev 95269)
@@ -31,7 +31,7 @@
 
 namespace MonoDevelop.Ide.Dom
 {
-       public interface IUsing
+       public interface IUsing : IDomVisitable
        {
                DomRegion DomRegion {
                        get;
@@ -43,6 +43,5 @@
                IDictionary<string, IReturnType> Aliases {
                        get;
                }
-               object AcceptVisitior (IDomVisitor visitor, object data);
        }
 }

Modified: 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom.Output/Ambience.cs
===================================================================
--- 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom.Output/Ambience.cs
      2008-02-08 15:59:36 UTC (rev 95268)
+++ 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom.Output/Ambience.cs
      2008-02-08 16:01:15 UTC (rev 95269)
@@ -40,7 +40,12 @@
                protected Dictionary<ClassType, string> classTypes = new 
Dictionary<ClassType, string> ();
                protected Dictionary<ParameterModifiers, string> 
parameterModifiers = new Dictionary<ParameterModifiers, string> ();
                protected Dictionary<string, string> constructs = new 
Dictionary<string, string> ();
+               protected string nullString = "null";
                
+               protected abstract IDomVisitor OutputVisitor {
+                       get;
+               }
+               
                public Ambience (string name)
                {
                        this.name = name;
@@ -126,16 +131,13 @@
                }
                
                public abstract string SingleLineComment (string text);
-               
                public abstract string GetString (string nameSpace, OutputFlags 
flags);
-               public abstract string GetString (IField field, OutputFlags 
flags);
-               public abstract string GetString (IProperty property, 
OutputFlags flags);
-               public abstract string GetString (IReturnType returnType, 
OutputFlags flags);
-               public abstract string GetString (IMethod method, OutputFlags 
flags);
-               public abstract string GetString (IParameter parameter, 
OutputFlags flags);
-               public abstract string GetString (IType type, OutputFlags 
flags);
-               public abstract string GetString (IEvent evt, OutputFlags 
flags);
-               public abstract string GetString (IAttribute attribute, 
OutputFlags flags);
                
+               public string GetString (IDomVisitable domVisitable, 
OutputFlags flags)
+               {
+                       if (domVisitable == null)
+                               return nullString;
+                       return (string)domVisitable.AcceptVisitior 
(OutputVisitor, flags);
+               }
        }
 }

Modified: 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom.Output/NetAmbience.cs
===================================================================
--- 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom.Output/NetAmbience.cs
   2008-02-08 15:59:36 UTC (rev 95268)
+++ 
trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Dom.Output/NetAmbience.cs
   2008-02-08 16:01:15 UTC (rev 95269)
@@ -31,9 +31,16 @@
 
 namespace MonoDevelop.Ide.Dom.Output
 {
-       public class NetAmbience : Ambience
+       public class NetAmbience : Ambience, IDomVisitor
        {
                const string nullString = "Null";
+               
+               protected override IDomVisitor OutputVisitor {
+                       get {
+                               return this;
+                       }
+               }
+               
                public NetAmbience () : base ("NET")
                {
                        classTypes[ClassType.Class]     = "Class";
@@ -90,10 +97,19 @@
                        return result.ToString ();
                }
                
-               public override string GetString (IProperty property, 
OutputFlags flags)
+               object IDomVisitor.Visit (ICompilationUnit unit, object data)
                {
-                       if (property == null)
-                               return nullString;
+                       return "TODO";
+               }
+               
+               object IDomVisitor.Visit (IUsing u, object data)
+               {
+                       return "TODO";
+               }
+               
+               object IDomVisitor.Visit (IProperty property, object data)
+               {
+                       OutputFlags flags = (OutputFlags)data;
                        StringBuilder result = new StringBuilder ();
                        if (IncludeModifiers (flags)) {
                                if (EmitMarkup (flags))
@@ -123,10 +139,9 @@
                        return result.ToString ();
                }
                
-               public override string GetString (IField field, OutputFlags 
flags)
+               object IDomVisitor.Visit (IField field, object data)
                {
-                       if (field == null)
-                               return nullString;
+                       OutputFlags flags = (OutputFlags)data;
                        StringBuilder result = new StringBuilder ();
                        
                        if (IncludeModifiers (flags)) {
@@ -158,10 +173,9 @@
                        return result.ToString ();
                }
                
-               public override string GetString (IReturnType returnType, 
OutputFlags flags)
+               object IDomVisitor.Visit (IReturnType returnType, object data)
                {
-                       if (returnType == null)
-                               return nullString;
+                       OutputFlags flags = (OutputFlags)data;
                        StringBuilder result = new StringBuilder ();
                        if (UseFullName (flags)) {
                                result.Append (Format (returnType.FullName));
@@ -171,10 +185,9 @@
                        return result.ToString ();
                }
                
-               public override string GetString (IMethod method, OutputFlags 
flags)
+               object IDomVisitor.Visit (IMethod method, object data)
                {
-                       if (method == null)
-                               return nullString;
+                       OutputFlags flags = (OutputFlags)data;
                        StringBuilder result = new StringBuilder ();
                        
                        if (IncludeModifiers (flags)) {
@@ -220,10 +233,9 @@
                        return result.ToString ();
                }
                
-               public override string GetString (IParameter parameter, 
OutputFlags flags)
+               object IDomVisitor.Visit (IParameter parameter, object data)
                {
-                       if (parameter == null)
-                               return nullString;
+                       OutputFlags flags = (OutputFlags)data;
                        StringBuilder result = new StringBuilder ();
                        if (IncludeParameterName (flags)) {
                                result.Append (Format (parameter.Name));
@@ -237,10 +249,9 @@
                        return result.ToString ();
                }
                
-               public override string GetString (IType type, OutputFlags flags)
+               object IDomVisitor.Visit (IType type, object data)
                {
-                       if (type == null)
-                               return nullString;
+                       OutputFlags flags = (OutputFlags)data;
                        StringBuilder result = new StringBuilder ();
                        if (IncludeModifiers (flags)) {
                                if (EmitMarkup (flags))
@@ -268,8 +279,9 @@
                        return result.ToString ();
                }
                
-               public override string GetString (IAttribute attribute, 
OutputFlags flags)
+               object IDomVisitor.Visit (IAttribute attribute, object data)
                {
+                       OutputFlags flags = (OutputFlags)data;
                        StringBuilder result = new StringBuilder ();
                        result.Append ('[');
                        result.Append (GetString (attribute.AttributeType, 
flags));
@@ -295,10 +307,9 @@
                        return result.ToString ();
                }
                
-               public override string GetString (IEvent evt, OutputFlags flags)
+               object IDomVisitor.Visit (IEvent evt, object data)
                {
-                       if (evt == null)
-                               return nullString;
+                       OutputFlags flags = (OutputFlags)data;
                        StringBuilder result = new StringBuilder ();
                        if (IncludeModifiers (flags)) {
                                if (EmitMarkup (flags))
@@ -316,11 +327,10 @@
                                if (EmitMarkup (flags))
                                        result.Append ("</b>");
                        }
-                                               
+                       
                        result.Append (Format (evt.Name));
                        
                        return result.ToString ();
                }
-               
        }
 }

Modified: trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.mdp
===================================================================
--- trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.mdp 
2008-02-08 15:59:36 UTC (rev 95268)
+++ trunk/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.mdp 
2008-02-08 16:01:15 UTC (rev 95269)
@@ -379,6 +379,7 @@
     <File name="MonoDevelop.Ide.Gui/MonoDevelopTreeView.cs" subtype="Code" 
buildaction="Compile" />
     <File name="MonoDevelop.Ide.Dom.Output/OutputFlags.cs" subtype="Code" 
buildaction="Compile" />
     <File name="MonoDevelop.Ide.Dom.Output/AmbienceService.cs" subtype="Code" 
buildaction="Compile" />
+    <File name="MonoDevelop.Ide.Dom/CompilationUnit.cs" subtype="Code" 
buildaction="Compile" />
   </Contents>
   <References>
     <ProjectReference type="Gac" localcopy="False" refto="System, 
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to