Author: atsushi
Date: 2005-03-06 02:08:30 -0500 (Sun, 06 Mar 2005)
New Revision: 41479

Modified:
   trunk/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Nvdl/ChangeLog
   trunk/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Nvdl/NvdlCompileContext.cs
   trunk/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Nvdl/NvdlConfig.cs
   trunk/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Nvdl/NvdlFilteredXmlReader.cs
   trunk/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Nvdl/NvdlSimplified.cs
   trunk/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Nvdl/NvdlValidatingReader.cs
   trunk/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Nvdl/NvdlValidator.cs
Log:
2005-03-06  Atsushi Enomoto <[EMAIL PROTECTED]>

        * NvdlFilteredXmlReader.cs : code refactory.
        * NvdlCompileContext.cs, NvdlConfig.cs, NvdlSimplified.cs,
          NvdlValidatingReader.cs : Simplified objects are now all internal.
        * NvdlValidator.cs : don't output debug.



Modified: trunk/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Nvdl/ChangeLog
===================================================================
--- trunk/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Nvdl/ChangeLog      
2005-03-06 06:44:06 UTC (rev 41478)
+++ trunk/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Nvdl/ChangeLog      
2005-03-06 07:08:30 UTC (rev 41479)
@@ -1,5 +1,12 @@
 2005-03-06  Atsushi Enomoto <[EMAIL PROTECTED]>
 
+       * NvdlFilteredXmlReader.cs : code refactory.
+       * NvdlCompileContext.cs, NvdlConfig.cs, NvdlSimplified.cs,
+         NvdlValidatingReader.cs : Simplified objects are now all internal.
+       * NvdlValidator.cs : don't output debug.
+
+2005-03-06  Atsushi Enomoto <[EMAIL PROTECTED]>
+
        * NvdlFilteredXmlReader.cs : New file. Supports createPlaceHolder()
          and attBubble[I].
        * NvdlValidator.cs : support for attachPlaceHolder.

Modified: 
trunk/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Nvdl/NvdlCompileContext.cs
===================================================================
--- trunk/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Nvdl/NvdlCompileContext.cs  
2005-03-06 06:44:06 UTC (rev 41478)
+++ trunk/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Nvdl/NvdlCompileContext.cs  
2005-03-06 07:08:30 UTC (rev 41479)
@@ -2,7 +2,6 @@
 using System.Collections;
 using System.Collections.Specialized;
 using System.Xml;
-using Commons.Xml.Nvdl.Simplified;
 using Commons.Xml;
 
 namespace Commons.Xml.Nvdl

Modified: trunk/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Nvdl/NvdlConfig.cs
===================================================================
--- trunk/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Nvdl/NvdlConfig.cs  
2005-03-06 06:44:06 UTC (rev 41478)
+++ trunk/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Nvdl/NvdlConfig.cs  
2005-03-06 07:08:30 UTC (rev 41479)
@@ -2,7 +2,6 @@
 using System.Collections;
 using System.Collections.Specialized;
 using System.Xml;
-using Commons.Xml.Nvdl.Simplified;
 using Commons.Xml;
 
 namespace Commons.Xml.Nvdl

Modified: 
trunk/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Nvdl/NvdlFilteredXmlReader.cs
===================================================================
--- 
trunk/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Nvdl/NvdlFilteredXmlReader.cs   
    2005-03-06 06:44:06 UTC (rev 41478)
+++ 
trunk/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Nvdl/NvdlFilteredXmlReader.cs   
    2005-03-06 07:08:30 UTC (rev 41479)
@@ -2,11 +2,10 @@
 using System.Collections;
 using System.IO;
 using System.Xml;
-using Commons.Xml.Nvdl.Simplified;
 
 namespace Commons.Xml.Nvdl
 {
-       internal class NvdlFilteredXmlReader : XmlDefaultReader
+       internal class NvdlFilteredXmlReader : XmlReader
        {
                int placeHolderDepth = -1;
                XmlNodeType nextPlaceHolder;
@@ -25,8 +24,8 @@
                        public string NamespaceURI;
                }
 
-               public NvdlFilteredXmlReader (XmlReader reader, 
NvdlValidateInterp validate)
-                       : base (reader)
+               public NvdlFilteredXmlReader (XmlReader reader,
+                       NvdlValidateInterp validate)
                {
                        this.reader = reader;
                        this.validate = validate;
@@ -101,25 +100,29 @@
                        MoveToElement ();
                        attributeCount = 0;
 
-                       if (reader.MoveToFirstAttribute ()) {
-                               do {
-                                       if (reader.NamespaceURI == 
String.Empty) {
+                       if (!reader.MoveToFirstAttribute ())
+                               return true;
+                       do {
+                               if (reader.NamespaceURI == String.Empty) {
+                                       AddAttribute ();
+                                       continue;
+                               }
+                               SimpleRule rule = FindAttributeRule (
+                                       reader.NamespaceURI,
+                                       validate.CreatedMode);
+                               foreach (SimpleAction a in rule.Actions) {
+                                       SimpleResultAction ra =
+                                               a as SimpleResultAction;
+                                       if (ra != null &&
+                                               ra.ResultType == 
NvdlResultType.Attach)
                                                AddAttribute ();
+                                       if (ra != null)
                                                continue;
-                                       }
-                                       SimpleRule rule = FindAttributeRule 
(reader.NamespaceURI, validate.CreatedMode);
-                                       foreach (SimpleAction a in 
rule.Actions) {
-                                               SimpleResultAction ra = a as 
SimpleResultAction;
-                                               if (ra != null && ra.ResultType 
== NvdlResultType.Attach)
-                                                       AddAttribute ();
-                                               if (ra != null)
-                                                       continue;
-                                               // FIXME: validate global 
attribute.
-                                               SimpleValidate v = a as 
SimpleValidate;
-                                       }
-                               } while (reader.MoveToNextAttribute ());
-                               reader.MoveToElement ();
-                       }
+                                       // FIXME: validate global attribute 
(PlanAtt).
+                                       SimpleValidate v = a as SimpleValidate;
+                               }
+                       } while (reader.MoveToNextAttribute ());
+                       reader.MoveToElement ();
                        return true;
                }
 
@@ -178,11 +181,17 @@
                }
 
                public override bool IsDefault {
-                       get { return placeHolder == XmlNodeType.None && 
reader.IsDefault; }
+                       get {
+                               return placeHolder == XmlNodeType.None &&
+                                       reader.IsDefault;
+                       }
                }
 
                public override bool IsEmptyElement {
-                       get { return placeHolder == XmlNodeType.None && 
reader.IsEmptyElement; }
+                       get {
+                               return placeHolder == XmlNodeType.None &&
+                                       reader.IsEmptyElement; 
+                       }
                }
 
                public override string LocalName {
@@ -241,11 +250,17 @@
                }
 
                public override XmlNodeType NodeType {
-                       get { return placeHolder != XmlNodeType.None ? 
placeHolder : reader.NodeType; }
+                       get {
+                               return placeHolder != XmlNodeType.None ?
+                                       placeHolder : reader.NodeType; 
+                       }
                }
 
                public override string Prefix {
-                       get { return placeHolder != XmlNodeType.None ? 
String.Empty : reader.Name; }
+                       get {
+                               return placeHolder != XmlNodeType.None ?
+                                       String.Empty : reader.Name; 
+                       }
                }
 
                public override char QuoteChar {
@@ -253,7 +268,12 @@
                }
 
                public override ReadState ReadState {
-                       get { return placeHolder != XmlNodeType.None && 
reader.ReadState != ReadState.Error ? ReadState.Interactive : reader.ReadState; 
}
+                       get { 
+                               return placeHolder != XmlNodeType.None &&
+                                       reader.ReadState != ReadState.Error ? 
+                                       ReadState.Interactive :
+                                       reader.ReadState; 
+                       }
                }
 
                public override string Value {
@@ -409,7 +429,8 @@
                                if (reader.NodeType == XmlNodeType.Element)
                                        return false;
                                for (int i = 0; i < attributeCount - 1; i++) {
-                                       if (attributes [i].LocalName != 
reader.LocalName || attributes [i].NamespaceURI != reader.NamespaceURI)
+                                       if (attributes [i].LocalName != 
reader.LocalName ||
+                                               attributes [i].NamespaceURI != 
reader.NamespaceURI)
                                                continue;
                                        reader.MoveToAttribute (
                                                attributes [i + 1].LocalName,

Modified: trunk/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Nvdl/NvdlSimplified.cs
===================================================================
--- trunk/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Nvdl/NvdlSimplified.cs      
2005-03-06 06:44:06 UTC (rev 41478)
+++ trunk/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Nvdl/NvdlSimplified.cs      
2005-03-06 07:08:30 UTC (rev 41479)
@@ -3,9 +3,9 @@
 using System.Collections.Specialized;
 using System.Xml;
 
-namespace Commons.Xml.Nvdl.Simplified
+namespace Commons.Xml.Nvdl
 {
-       public class SimplifiedItem : IXmlLineInfo
+       internal class SimplifiedItem : IXmlLineInfo
        {
                int line;
                int column;
@@ -43,7 +43,7 @@
                }
        }
 
-       public class SimpleRules : SimplifiedItem
+       internal class SimpleRules : SimplifiedItem
        {
                SimpleMode startMode;
                XmlQualifiedName [] triggers;
@@ -148,7 +148,7 @@
                #endregion
        }
 
-       public class SimpleMode : SimplifiedItem
+       internal class SimpleMode : SimplifiedItem
        {
                string name;
                SimpleRule [] rules;
@@ -340,7 +340,7 @@
                }
        }
 
-       public class SimpleRule : SimplifiedItem
+       internal class SimpleRule : SimplifiedItem
        {
                bool matchAttributes;
                SimpleAction [] actions;
@@ -454,7 +454,7 @@
                }
        }
 
-       public abstract class SimpleAction : SimplifiedItem
+       internal abstract class SimpleAction : SimplifiedItem
        {
                readonly ListDictionary messages;
                readonly SimpleModeUsage modeUsage;
@@ -498,7 +498,7 @@
                }
        }
 
-       public class SimpleValidate : SimpleAction
+       internal class SimpleValidate : SimpleAction
        {
                readonly NvdlValidatorGenerator generator;
                XmlResolver resolver;
@@ -611,7 +611,7 @@
                }
        }
 
-       public class SimpleResultAction : SimpleAction
+       internal class SimpleResultAction : SimpleAction
        {
                readonly NvdlResultType resultType;
 
@@ -631,7 +631,7 @@
                }
        }
 
-       public class SimpleModeUsage : SimplifiedItem
+       internal class SimpleModeUsage : SimplifiedItem
        {
                // It will never be used in validation.
                NvdlModeUsage source; // FIXME: put this into CompileContext
@@ -709,7 +709,7 @@
                }
        }
 
-       public class SimpleContext : SimplifiedItem
+       internal class SimpleContext : SimplifiedItem
        {
                readonly string useModeName; // It is never used in validation.
                SimpleMode useMode;
@@ -780,29 +780,4 @@
                                        useModeName), this);
                }
        }
-
-/*
-       // After simplification, each mode name "shall be different from any
-       // other mode name" (6.4.8)
-       public class SimpleModeTable : DictionaryBase
-       {
-               public SimpleModeTable (SimpleMode [] modes)
-               {
-                       foreach (SimpleMode mode in modes)
-                               Dictionary.Add (mode.Name, mode);
-               }
-
-               public SimpleMode this [string name] {
-                       get { return (SimpleMode) Dictionary [name]; }
-               }
-
-               public ICollection Keys {
-                       get { return Dictionary.Keys; }
-               }
-
-               public ICollection Values {
-                       get { return Dictionary.Values; }
-               }
-       }
-*/
 }

Modified: 
trunk/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Nvdl/NvdlValidatingReader.cs
===================================================================
--- 
trunk/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Nvdl/NvdlValidatingReader.cs    
    2005-03-06 06:44:06 UTC (rev 41478)
+++ 
trunk/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Nvdl/NvdlValidatingReader.cs    
    2005-03-06 07:08:30 UTC (rev 41479)
@@ -3,7 +3,6 @@
 using System.Collections.Specialized;
 using System.Threading;
 using System.Xml;
-using Commons.Xml.Nvdl.Simplified;
 using Commons.Xml;
 
 namespace Commons.Xml.Nvdl
@@ -31,7 +30,7 @@
                                rules, config, resolver)), this);
                }
 
-               public NvdlValidatingReader (XmlReader reader, SimpleRules 
rules)
+               internal NvdlValidatingReader (XmlReader reader, SimpleRules 
rules)
                        : base (reader)
                {
                        dispatcher = new NvdlDispatcher (rules, this);

Modified: trunk/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Nvdl/NvdlValidator.cs
===================================================================
--- trunk/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Nvdl/NvdlValidator.cs       
2005-03-06 06:44:06 UTC (rev 41478)
+++ trunk/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Nvdl/NvdlValidator.cs       
2005-03-06 07:08:30 UTC (rev 41479)
@@ -2,14 +2,13 @@
 using System.Collections;
 using System.IO;
 using System.Xml;
-using Commons.Xml.Nvdl.Simplified;
 
 namespace Commons.Xml.Nvdl
 {
        internal class NvdlDebug
        {
-//             public static TextWriter Writer = TextWriter.Null;
-               public static TextWriter Writer = Console.Out;
+               public static TextWriter Writer = TextWriter.Null;
+//             public static TextWriter Writer = Console.Out;
        }
 
        internal class NvdlDispatcher

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

Reply via email to