Exemplo n.º 1
0
        public NvdlSection(NvdlDispatcher dispatcher,
                           NvdlSection parentState)
        {
            this.dispatcher = dispatcher;
            this.ns         = dispatcher.Reader.NamespaceURI;

            if (parentState == null)
            {
                foreach (SimpleAction a in FindElementRule(
                             dispatcher.Rules.StartMode,
                             dispatcher.Reader).Actions)
                {
                    ilist.Add(GetInterp(a, dispatcher));
                }
            }
            else
            {
                foreach (NvdlInterpretation pi in
                         parentState.ilist)
                {
                    PopulateInterp(dispatcher, pi, parentState);
                }
            }

            NvdlDebug.Writer.WriteLine("New section: ns {0} / interp.count {1} / loc: {2}", ns, ilist.Count, ((IXmlLineInfo)dispatcher.Reader).LineNumber);
        }
Exemplo n.º 2
0
        private void PopulateInterp(
            NvdlDispatcher d, NvdlInterpretation i,
            NvdlSection parentState)
        {
            SimpleMode m    = FindContextMode(i.Action, parentState);
            SimpleRule rule = FindElementRule(m, dispatcher.Reader);

            NvdlDebug.Writer.WriteLine("***** populate interp from action {0} whose mode is {1}. Rule is {2} whose actions are {3}", i.Action.Location, m.Location, rule.Location, rule.Actions.Length);
            foreach (SimpleAction a in rule.Actions)
            {
                NvdlInterpretation cur = i;
                for (; cur != null; cur = cur.Parent)
                {
                    if (cur.CreatedMode == m && cur.Action == a)
                    {
                        NvdlDebug.Writer.WriteLine("------- corresponding PlanElem already exists.");
                        break;
                    }
                }
                if (cur == null)
                {
                    cur = CreateInterp(d, m, a, i);
                }
                ilist.Add(cur);
            }
        }
Exemplo n.º 3
0
		public NvdlValidatingReader (XmlReader reader, NvdlRules rules,
			XmlResolver resolver, NvdlConfig config)
			: base (reader)
		{
			dispatcher = new NvdlDispatcher (new SimpleRules (
				new NvdlCompileContext (
				rules, config, resolver)), this);
		}
Exemplo n.º 4
0
 public NvdlValidatingReader(XmlReader reader, NvdlRules rules,
                             XmlResolver resolver, NvdlConfig config)
     : base(reader)
 {
     dispatcher = new NvdlDispatcher(new SimpleRules(
                                         new NvdlCompileContext(
                                             rules, config, resolver)), this);
 }
Exemplo n.º 5
0
 public NvdlInterpretation(NvdlDispatcher dispatcher,
                           SimpleMode createdMode, SimpleAction action,
                           NvdlInterpretation parent)
 {
     this.dispatcher  = dispatcher;
     this.createdMode = createdMode;
     this.action      = action;
     this.parent      = parent;
 }
Exemplo n.º 6
0
        public NvdlValidateInterp(NvdlDispatcher dispatcher,
                                  SimpleMode createdMode, SimpleValidate validate,
                                  NvdlInterpretation parent)
            : base(dispatcher, createdMode, validate, parent)
        {
            this.reader   = new NvdlFilteredXmlReader(dispatcher.Reader, this);
            this.validate = validate;
            validator     = validate.CreateValidator(this.reader);

            dispatcher.Validator.OnMessage(validate.Messages);
        }
Exemplo n.º 7
0
        private NvdlInterpretation CreateInterp(NvdlDispatcher d,
                                                SimpleMode m, SimpleAction a, NvdlInterpretation p)
        {
            SimpleValidate v = a as SimpleValidate;

            if (v != null)
            {
                return(new NvdlValidateInterp(d, m, v, p));
            }
            return(new NvdlResultInterp(d, m, (SimpleResultAction)a, p));
        }
Exemplo n.º 8
0
        private NvdlInterpretation CreateInterp(NvdlDispatcher d,
                                                SimpleMode m, SimpleAction a, NvdlInterpretation p)
        {
            NvdlDebug.Writer.WriteLine("***** new interp from action {0} from mode {1}", a.Location, m.Location);
            SimpleValidate v = a as SimpleValidate;

            if (v != null)
            {
                return(new NvdlValidateInterp(d, m, v, p));
            }
            return(new NvdlResultInterp(d, m, (SimpleResultAction)a, p));
        }
Exemplo n.º 9
0
        public NvdlResultInterp(NvdlDispatcher dispatcher,
                                SimpleMode createdMode,
                                SimpleResultAction resultAction,
                                NvdlInterpretation parent)
            : base(dispatcher, createdMode, resultAction, parent)
        {
            NvdlDebug.Writer.WriteLine("++++++ new resultAction " + resultAction.Location);
            type = resultAction.ResultType;

            if (type == NvdlResultType.AttachPlaceholder && parent != null)
            {
                parent.AttachPlaceholder();
            }
        }
Exemplo n.º 10
0
        private void PopulateInterp(
            NvdlDispatcher d, NvdlInterpretation i,
            NvdlSection parentState)
        {
            SimpleMode m    = FindContextMode(i.Action, parentState);
            SimpleRule rule = FindElementRule(m, dispatcher.Reader);

            foreach (SimpleAction a in rule.Actions)
            {
                NvdlInterpretation cur = i;
                for (; cur != null; cur = cur.Parent)
                {
                    if (cur.CreatedMode == m && cur.Action == a)
                    {
                        break;
                    }
                }
                if (cur == null)
                {
                    cur = CreateInterp(d, m, a, i);
                }
                ilist.Add(cur);
            }
        }
Exemplo n.º 11
0
        public NvdlSection(NvdlDispatcher dispatcher,
                           NvdlSection parentState)
        {
            this.dispatcher = dispatcher;
            this.ns         = dispatcher.Reader.NamespaceURI;

            if (parentState == null)
            {
                foreach (SimpleAction a in FindElementRule(
                             dispatcher.Rules.StartMode,
                             dispatcher.Reader).Actions)
                {
                    ilist.Add(GetInterp(a, dispatcher));
                }
            }
            else
            {
                foreach (NvdlInterpretation pi in
                         parentState.ilist)
                {
                    PopulateInterp(dispatcher, pi, parentState);
                }
            }
        }
Exemplo n.º 12
0
		public NvdlResultInterp (NvdlDispatcher dispatcher,
			SimpleMode createdMode,
			SimpleResultAction resultAction,
			NvdlInterpretation parent)
			: base (dispatcher, createdMode, resultAction, parent)
		{
NvdlDebug.Writer.WriteLine ("++++++ new resultAction " + resultAction.Location);
			type = resultAction.ResultType;

			if (type == NvdlResultType.AttachPlaceholder && parent != null)
				parent.AttachPlaceholder ();
		}
Exemplo n.º 13
0
		private NvdlInterpretation GetInterp (
			SimpleAction a, NvdlDispatcher d)
		{
			return CreateInterp (d, d.Rules.StartMode, a, null);
		}
Exemplo n.º 14
0
		public NvdlSection (NvdlDispatcher dispatcher,
			NvdlSection parentState)
		{
			this.dispatcher = dispatcher;
			this.ns = dispatcher.Reader.NamespaceURI;

			if (parentState == null) {
				foreach (SimpleAction a in FindElementRule (
					dispatcher.Rules.StartMode,
					dispatcher.Reader).Actions)
					ilist.Add (GetInterp (a, dispatcher));
			} else {
				foreach (NvdlInterpretation pi in
					parentState.ilist) {
					PopulateInterp (dispatcher, pi, parentState);
				}
			}

NvdlDebug.Writer.WriteLine ("New section: ns {0} / interp.count {1} / loc: {2}", ns, ilist.Count, ((IXmlLineInfo) dispatcher.Reader).LineNumber);
		}
Exemplo n.º 15
0
		private NvdlInterpretation CreateInterp (NvdlDispatcher d,
			SimpleMode m, SimpleAction a, NvdlInterpretation p)
		{
NvdlDebug.Writer.WriteLine ("***** new interp from action {0} from mode {1}", a.Location, m.Location);
			SimpleValidate v = a as SimpleValidate;
			if (v != null)
				return new NvdlValidateInterp (d, m, v, p);
			return new NvdlResultInterp (d, m, (SimpleResultAction) a, p);
		}
Exemplo n.º 16
0
 private NvdlInterpretation GetInterp(
     SimpleAction a, NvdlDispatcher d)
 {
     return(CreateInterp(d, d.Rules.StartMode, a, null));
 }
Exemplo n.º 17
0
		private void PopulateInterp (
			NvdlDispatcher d, NvdlInterpretation i,
			NvdlSection parentState)
		{
			SimpleMode m = FindContextMode (i.Action, parentState);
			SimpleRule rule = FindElementRule (m, dispatcher.Reader);
NvdlDebug.Writer.WriteLine ("***** populate interp from action {0} whose mode is {1}. Rule is {2} whose actions are {3}", i.Action.Location, m.Location, rule.Location, rule.Actions.Length);
			foreach (SimpleAction a in rule.Actions) {
				NvdlInterpretation cur = i;
				for (;cur != null; cur = cur.Parent)
					if (cur.CreatedMode == m && cur.Action == a) {
NvdlDebug.Writer.WriteLine ("------- corresponding PlanElem already exists.");
						break;
					}
				if (cur == null)
					cur = CreateInterp (d, m, a, i);
				ilist.Add (cur);
			}
		}
Exemplo n.º 18
0
 internal NvdlValidatingReader(XmlReader reader, SimpleRules rules)
     : base(reader)
 {
     dispatcher = new NvdlDispatcher(rules, this);
 }
Exemplo n.º 19
0
		public NvdlInterpretation (NvdlDispatcher dispatcher,
			SimpleMode createdMode, SimpleAction action,
			NvdlInterpretation parent)
		{
			this.dispatcher = dispatcher;
			this.createdMode = createdMode;
			this.action = action;
			this.parent = parent;
		}
Exemplo n.º 20
0
		internal NvdlValidatingReader (XmlReader reader, SimpleRules rules)
			: base (reader)
		{
			dispatcher = new NvdlDispatcher (rules, this);
		}
Exemplo n.º 21
0
		public NvdlValidateInterp (NvdlDispatcher dispatcher,
			SimpleMode createdMode, SimpleValidate validate,
			NvdlInterpretation parent)
			: base (dispatcher, createdMode, validate, parent)
		{
NvdlDebug.Writer.WriteLine ("++++++ new validate " + validate.Location);
			this.reader = new NvdlFilteredXmlReader (dispatcher.Reader, this);
			this.validate = validate;
			validator = validate.CreateValidator (this.reader);

			dispatcher.Validator.OnMessage (validate.Messages);
		}