private IOneOf ParseOneOf(SrgsOneOf srgsOneOf, IElement parent, IRule rule) { IOneOf oneOf = _parser.CreateOneOf(parent, rule); foreach (SrgsItem item in srgsOneOf.Items) { ProcessChildNodes(item, oneOf, rule); } oneOf.PostParse(parent); return(oneOf); }
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); }
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); }