예제 #1
0
        internal override GrammarBuilderBase Clone()
        {
            ItemElement itemElement = new ItemElement(_minRepeat, _maxRepeat);

            itemElement.CloneItems(this);
            return(itemElement);
        }
예제 #2
0
        internal override IElement CreateElement(IElementFactory elementFactory, IElement parent, IRule rule, IdentifierCollection ruleIds)
        {
            IOneOf oneOf = elementFactory.CreateOneOf(parent, rule);

            foreach (GrammarBuilderBase item2 in base.Items)
            {
                ItemElement itemElement = item2 as ItemElement;
                if (itemElement == null)
                {
                    itemElement = new ItemElement(item2);
                }
                IItem item = (IItem)itemElement.CreateElement(elementFactory, oneOf, rule, ruleIds);
                item.PostParse(oneOf);
                elementFactory.AddItem(oneOf, item);
            }
            return(oneOf);
        }
예제 #3
0
        public override bool Equals(object obj)
        {
            ItemElement itemElement = obj as ItemElement;

            if (itemElement == null)
            {
                return(false);
            }
            if (!base.Equals(obj))
            {
                return(false);
            }
            if (_minRepeat == itemElement._minRepeat)
            {
                return(_maxRepeat == itemElement._maxRepeat);
            }
            return(false);
        }