예제 #1
0
        public void Build()
        {
            Debug.Assert(m_predicateList.Count == m_expFutureList.Count);

            if (m_predicateList.Count == 0)
            {
                return;
            }

            List <char>[] charSetList = new List <char> [m_predicateList.Count];

            for (int j = 0; j < m_predicateList.Count; j++)
            {
                charSetList[j] = new List <char>();
            }

            for (int i = Char.MinValue; i < Char.MaxValue; i++)
            {
                char c = (char)i;
                for (int j = 0; j < m_predicateList.Count; j++)
                {
                    if (m_predicateList[j](c))
                    {
                        charSetList[j].Add(c);
                    }
                }
            }

            for (int j = 0; j < m_predicateList.Count; j++)
            {
                RegularExpression charSetExp = new AlternationCharSetExpression(charSetList[j]);
                m_expFutureList[j](charSetExp);
            }
        }
예제 #2
0
 public abstract T ConvertAlternationCharSet(AlternationCharSetExpression exp);