示例#1
0
        protected void CreatePattern(PatternKey pattern)
        {
            string lDFA = (new DFAPattern(pattern.Pattern, pattern.Transformation)).DFA;

            DFANodes = new List <DFANode>(lDFA.Length + 1);
            DFANodes.Add(new DFANode());

            for (int lState = 0; lState < lDFA.Length; lState++)
            {
                DFANode lDFANode = new DFANode();

                char c = lDFA[lState];

                for (int z = 0; z < 4; z++)
                {
                    if (Buckets[z].IndexOf(c) >= 0)
                    {
                        lDFANode[z] = lState + 2;
                    }
                }

                DFANodes.Add(lDFANode);
            }

            DFANode lDFANodeLast = new DFANode();

            lDFANodeLast.Add(pattern);
            DFANodes.Add(lDFANodeLast);
        }
示例#2
0
        public void Add(PatternKey pattern)
        {
            if (Attributes == null)
            {
                Attributes = new List <PatternKey>();
            }

            Attributes.Add(pattern);
        }
示例#3
0
 public DFAMatrix(PatternKey pattern)
 {
     CreatePattern(pattern);
 }
示例#4
0
 public DFAMatrix(PatternKey pattern)
 {
     CreatePattern(pattern);
 }
示例#5
0
        protected void CreatePattern(PatternKey pattern)
        {
            string lDFA = (new DFAPattern(pattern.Pattern, pattern.Transformation)).DFA;

            DFANodes = new List<DFANode>(lDFA.Length + 1);
            DFANodes.Add(new DFANode());

            for (int lState = 0; lState < lDFA.Length; lState++)
            {
                DFANode lDFANode = new DFANode();

                char c = lDFA[lState];

                for (int z = 0; z < 4; z++)
                    if (Buckets[z].IndexOf(c) >= 0)
                        lDFANode[z] = lState + 2;

                DFANodes.Add(lDFANode);
            }

            DFANode lDFANodeLast = new DFANode();
            lDFANodeLast.Add(pattern);
            DFANodes.Add(lDFANodeLast);
        }
示例#6
0
        public void Add(PatternKey pattern)
        {
            if (Attributes == null)
                Attributes = new List<PatternKey>();

            Attributes.Add(pattern);
        }