Exemplo n.º 1
0
        public static ParseFilter Create(string filter_pattern)
        {
            ParseFilter filter = new ParseFilter();
            int place = 0;
            filter.ParseName(filter_pattern, ref place);
            filter.ParseChildren(filter_pattern, ref place);

            return filter;
        }
Exemplo n.º 2
0
 private void ParseChildren(string format, ref int place)
 {
     char current = format[place];
     while ((place < format.Length) && (current != ')'))
     {
         place++;
         ParseFilter child = new ParseFilter(parent_);
         child.ParseName(format, ref place);
         if (child.Name == "*")
         {
             this.AllChildren = true;
             place = format.IndexOf(')', place);
             break;
         }
         current = format[place];
         if (current == '[')
         {
             child.ParseAttributes(format, ref place);
         }
         current = format[place];
         if (current == '(')
         {
             child.ParseChildren(format, ref place);
         }
         current = format[place];
         this.AcceptableChildren.Add(child.Name, child);
     }
     place++;
 }