private void ReadModeCommon(NvdlModeBase el) { FillForeignAttribute(el); if (reader.IsEmptyElement) { reader.Skip(); return; } reader.Read(); do { reader.MoveToContent(); if (reader.NodeType == XmlNodeType.EndElement) { break; } if (reader.NamespaceURI != Nvdl.Namespace) { el.Foreign.Add(XDocument.ReadFrom(reader)); continue; } switch (reader.LocalName) { case "mode": el.IncludedModes.Add(ReadIncludedMode()); break; case "namespace": el.Rules.Add(ReadNamespace()); break; case "anyNamespace": el.Rules.Add(ReadAnyNamespace()); break; } } while (!reader.EOF); if (!reader.EOF) { reader.Read(); } return; }
private void SimplifyPhase1(NvdlModeBase mode, NvdlCompileContext ctx) { NvdlModeCompileContext mctx = new NvdlModeCompileContext(mode); ctx.AddModeContext(this, mctx); ArrayList al = new ArrayList(); foreach (NvdlRule r in mode.Rules) { switch (r.Match) { case NvdlRuleTarget.Both: al.Add(new SimpleRule(r, true, ctx)); al.Add(new SimpleRule(r, false, ctx)); break; case NvdlRuleTarget.None: case NvdlRuleTarget.Elements: al.Add(new SimpleRule(r, false, ctx)); break; case NvdlRuleTarget.Attributes: al.Add(new SimpleRule(r, true, ctx)); break; } } foreach (NvdlIncludedMode inc in mode.IncludedModes) { mctx.Included.Add(new SimpleMode(inc, ctx)); } // The rule table is just a dummy store that might // erase because of removal of inclusion. rules = (SimpleRule [])al.ToArray(typeof(SimpleRule)); }
public void Remove(NvdlModeBase item) { List.Add(item); }
public void Add(NvdlModeBase item) { List.Add(item); }
public NvdlModeCompileContext(NvdlModeBase mode) { included = new ArrayList(); }
public NvdlModeCompileContext (NvdlModeBase mode) { included = new ArrayList (); }
public void Remove (NvdlModeBase item) { List.Add (item); }
public void Add (NvdlModeBase item) { List.Add (item); }
public NvdlModeCompileContext(NvdlModeBase mode) { included = new List <SimpleMode> (); }
private void ReadModeCommon (NvdlModeBase el) { FillForeignAttribute (el); if (reader.IsEmptyElement) { reader.Skip (); return; } reader.Read (); do { reader.MoveToContent (); if (reader.NodeType == XmlNodeType.EndElement) break; if (reader.NamespaceURI != Nvdl.Namespace) { el.Foreign.Add (doc.ReadNode (reader)); continue; } switch (reader.LocalName) { case "mode": el.IncludedModes.Add (ReadIncludedMode ()); break; case "namespace": el.Rules.Add (ReadNamespace ()); break; case "anyNamespace": el.Rules.Add (ReadAnyNamespace ()); break; } } while (!reader.EOF); if (!reader.EOF) reader.Read (); return; }
private void SimplifyPhase1 (NvdlModeBase mode, NvdlCompileContext ctx) { NvdlModeCompileContext mctx = new NvdlModeCompileContext (mode); ctx.AddModeContext (this, mctx); ArrayList al = new ArrayList (); foreach (NvdlRule r in mode.Rules) { switch (r.Match) { case NvdlRuleTarget.Both: al.Add (new SimpleRule (r, true, ctx)); al.Add (new SimpleRule (r, false, ctx)); break; case NvdlRuleTarget.None: case NvdlRuleTarget.Elements: al.Add (new SimpleRule (r, false, ctx)); break; case NvdlRuleTarget.Attributes: al.Add (new SimpleRule (r, true, ctx)); break; } } foreach (NvdlIncludedMode inc in mode.IncludedModes) mctx.Included.Add (new SimpleMode (inc, ctx)); // The rule table is just a dummy store that might // erase because of removal of inclusion. rules = (SimpleRule []) al.ToArray (typeof (SimpleRule)); }