Exemplo n.º 1
0
        internal override GrammarBuilderBase Clone()
        {
            ItemElement itemElement = new ItemElement(_minRepeat, _maxRepeat);

            itemElement.CloneItems(this);
            return(itemElement);
        }
Exemplo n.º 2
0
        public override bool Equals(object obj)
        {
            ItemElement refObj = obj as ItemElement;

            if (refObj == null)
            {
                return(false);
            }
            if (!base.Equals(obj))
            {
                return(false);
            }
            return(_minRepeat == refObj._minRepeat && _maxRepeat == refObj._maxRepeat);
        }
Exemplo n.º 3
0
        internal override IElement CreateElement(IElementFactory elementFactory, IElement parent, IRule rule, IdentifierCollection ruleIds)
        {
            // Create and return the IOneOf representing the current object
            IOneOf oneOf = elementFactory.CreateOneOf(parent, rule);

            foreach (GrammarBuilderBase item in Items)
            {
                ItemElement newItem = item as ItemElement ?? new ItemElement(item);

                IItem element = (IItem)newItem.CreateElement(elementFactory, oneOf, rule, ruleIds);
                element.PostParse(oneOf);
                elementFactory.AddItem(oneOf, element);
            }
            return(oneOf);
        }
Exemplo n.º 4
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);
        }
Exemplo n.º 5
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);
        }