예제 #1
0
        internal override IElement CreateElement(IElementFactory elementFactory, IElement parent, IRule rule, IdentifierCollection ruleIds)
        {
            IItem item = elementFactory.CreateItem(parent, rule, _minRepeat, _maxRepeat, 0.5f, 1f);

            CreateChildrenElements(elementFactory, item, rule, ruleIds);
            return(item);
        }
예제 #2
0
        private IItem ParseItem(SrgsItem srgsItem, IElement parent, IRule rule)
        {
            IItem item = _parser.CreateItem(parent, rule, srgsItem.MinRepeat, srgsItem.MaxRepeat, srgsItem.RepeatProbability, srgsItem.Weight);

            foreach (SrgsElement sortedTagElement in GetSortedTagElements(srgsItem.Elements))
            {
                ProcessChildNodes(sortedTagElement, item, rule);
            }
            item.PostParse(parent);
            return(item);
        }
예제 #3
0
        internal override IElement CreateElement(IElementFactory elementFactory, IElement parent, IRule rule, IdentifierCollection ruleIds)
        {
            // Create and return the real item (the item including the grammar)
            // for the current grammar
            IItem item = elementFactory.CreateItem(parent, rule, _minRepeat, _maxRepeat, 0.5f, 1f);

            // Create the children elements
            CreateChildrenElements(elementFactory, item, rule, ruleIds);

            return(item);
        }