예제 #1
0
        public override void GetExpectedParticles(ArrayList al)
        {
            // if not started, then just collect all items from seq.
            if (currentAutomata == null)
            {
                foreach (XmlSchemaParticle p in seq.CompiledItems)
                {
                    al.Add(p);
                    if (!p.ValidateIsEmptiable())
                    {
                        break;
                    }
                }
                return;
            }

            // automata for ongoing iteration
            if (currentAutomata != null)
            {
                currentAutomata.GetExpectedParticles(al);
                if (!currentAutomata.EvaluateIsEmptiable())
                {
                    return;
                }

                // remaining items after currentAutomata
                for (int i = current + 1; i < seq.CompiledItems.Count; i++)
                {
                    XmlSchemaParticle p = seq.CompiledItems [i] as XmlSchemaParticle;
                    al.Add(p);
                    if (!p.ValidateIsEmptiable())
                    {
                        break;
                    }
                }
            }

            // itself
            if (Occured + 1 == seq.ValidatedMaxOccurs)
            {
                return;
            }

            {
                for (int i = 0; i <= current; i++)
                {
                    al.Add(seq.CompiledItems [i]);
                }
            }
        }
예제 #2
0
 // Methods
 public override void GetExpectedParticles(ArrayList al)
 {
     head.GetExpectedParticles(al);
     rest.GetExpectedParticles(al);
 }