public override EntityRegexMatchState Interpret(EntityRegexMatchInfo info, EntityRegexMatchState state)
        {
            if (state == null || state.Count == 0)
            {
                return(null);
            }

            EntityRegexMatchState result = state.Clone();

            EntityRegexMatchState temp = new EntityRegexMatchState();

            foreach (StateItem item in state)
            {
                if (Validator.Interpret(info.GetNextEntity(item)))
                {
                    item.AddPassed(info.CurrentPatternIndex);
                    temp.Add(item);
                }
            }

            temp = this.Interpret(info, temp);
            if (temp != null)
            {
                result.AddRange(temp);
            }

            return(result);
        }
        public override EntityRegexMatchState Interpret(EntityRegexMatchInfo info, EntityRegexMatchState state)
        {
            if (state == null || state.Count == 0)
            {
                return(null);
            }

            EntityRegexMatchState result = state.Clone();

            foreach (StateItem item in state)
            {
                if (info.NextEntityExists(item) && Validator.Interpret(info.GetNextEntity(item)))
                {
                    item.AddPassed(info.CurrentPatternIndex);
                    result.Add(item);
                }
            }

            return(result);
        }
Beispiel #3
0
        public override EntityRegexMatchState Interpret(EntityRegexMatchInfo info, EntityRegexMatchState state)
        {
            if (state == null || state.Count == 0)
            {
                return(null);
            }

            EntityRegexMatchState result = new EntityRegexMatchState();

            foreach (StateItem item in state)
            {
                if (info.StartIndex + item.NextEntityIndex < info.Entities.Length && Validator.Interpret(info.GetNextEntity(item)))
                {
                    item.AddPassed(info.CurrentPatternIndex);
                    result.Add(item);
                }
            }

            return(result);
        }