Example #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]);
                }
            }
        }
 public override void GetExpectedParticles(ArrayList al)
 {
     if (this.currentAutomata == null)
     {
         foreach (XmlSchemaObject xmlSchemaObject in this.seq.CompiledItems)
         {
             XmlSchemaParticle xmlSchemaParticle = (XmlSchemaParticle)xmlSchemaObject;
             al.Add(xmlSchemaParticle);
             if (!xmlSchemaParticle.ValidateIsEmptiable())
             {
                 break;
             }
         }
         return;
     }
     if (this.currentAutomata != null)
     {
         this.currentAutomata.GetExpectedParticles(al);
         if (!this.currentAutomata.EvaluateIsEmptiable())
         {
             return;
         }
         for (int i = this.current + 1; i < this.seq.CompiledItems.Count; i++)
         {
             XmlSchemaParticle xmlSchemaParticle2 = this.seq.CompiledItems[i] as XmlSchemaParticle;
             al.Add(xmlSchemaParticle2);
             if (!xmlSchemaParticle2.ValidateIsEmptiable())
             {
                 break;
             }
         }
     }
     if (base.Occured + 1 == this.seq.ValidatedMaxOccurs)
     {
         return;
     }
     for (int j = 0; j <= this.current; j++)
     {
         al.Add(this.seq.CompiledItems[j]);
     }
 }