Пример #1
0
        public LookAheadSet CreateIntersection(LookAheadSet set)
        {
            LookAheadSet result = new LookAheadSet(_maxLength);

            for (int i = 0; i < _elements.Count; i++)
            {
                var seq1 = (Sequence)_elements[i];
                var seq2 = set.FindSequence(seq1);
                if (seq2 != null && seq1.IsRepetitive())
                {
                    result.Add(seq2);
                }
                else if (seq2 != null)
                {
                    result.Add(seq1);
                }
            }

            return(result);
        }