1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112
|
using System;
using System.Collections;
using System.Collections.Specialized;
using System.Xml;
using Commons.Xml;
namespace Commons.Xml.Nvdl
{
internal class NvdlCompileContext
{
NvdlRules rules;
NvdlConfig config;
XmlResolver resolver;
Hashtable compiledModes = new Hashtable ();
Hashtable modeContexts = new Hashtable ();
Hashtable cancelledRules = new Hashtable ();
Hashtable ruleContexts = new Hashtable ();
public NvdlCompileContext (NvdlRules rules, NvdlConfig config, XmlResolver resolver)
{
this.rules = rules;
this.config = config;
this.resolver = resolver;
}
public NvdlRules Rules {
get { return rules; }
}
public NvdlConfig Config {
get { return config; }
}
internal XmlResolver XmlResolver {
get { return resolver; }
}
internal void AddCompiledMode (string name, SimpleMode m)
{
compiledModes.Add (m.Name, m);
}
internal void AddCompiledMode (NvdlModeUsage u, SimpleMode m)
{
compiledModes.Add (u, m);
}
internal void AddCompiledMode (NvdlContext c, SimpleMode m)
{
compiledModes.Add (c, m);
}
internal SimpleMode GetCompiledMode (string name)
{
return compiledModes [name] as SimpleMode;
}
internal SimpleMode GetCompiledMode (NvdlModeUsage u)
{
return compiledModes [u] as SimpleMode;
}
internal SimpleMode GetCompiledMode (NvdlContext c)
{
return compiledModes [c] as SimpleMode;
}
internal ICollection GetCompiledModes ()
{
return compiledModes.Values;
}
internal NvdlModeCompileContext GetModeContext (SimpleMode m)
{
return modeContexts [m] as NvdlModeCompileContext;
}
internal void AddModeContext (SimpleMode m,
NvdlModeCompileContext mctx)
{
modeContexts.Add (m, mctx);
}
internal NvdlRule GetRuleContext (SimpleRule r)
{
return ruleContexts [r] as NvdlRule;
}
internal void AddRuleContext (SimpleRule r, NvdlRule rctx)
{
ruleContexts.Add (r, rctx);
}
public Hashtable CancelledRules {
get { return cancelledRules; }
}
}
internal class NvdlModeCompileContext
{
ArrayList included;
public NvdlModeCompileContext (NvdlModeBase mode)
{
included = new ArrayList ();
}
public ArrayList Included {
get { return included; }
}
}
}
|