Beispiel #1
0
        public void dump()
        {
#if DUMMY
            Console.WriteLine("[Dfa begin dump]");
            Console.WriteLine("group=" + Int32.ToString(group));
            Console.WriteLine("mark=" + Boolean.ToString(mark));
            if (accept == null)
            {
                Console.WriteLine("accept=null");
            }
            else
            {
                accept.dump();
            }
            Console.WriteLine("anchor=" + Int32.ToString(anchor));
            if (nfa_set == null)
            {
                Console.WriteLine("nfa_set=null");
            }
            else
            {
                int n1 = nfa_set.Count;
                for (int i = 0; i < n1; i++)
                {
                    Object o2 = nfa_set[i];
                    Console.Write("i=" + Int32.ToString(i) + " elem=");
                    if (o2 == null)
                    {
                        Console.WriteLine("null");
                    }
                    else
                    {
                        Nfa elem = (CNfa)o2;
                        elem.dump();
                    }
                }
            }
            if (nfa_bit == null)
            {
                Console.WriteLine("nfa_bit=null");
            }
            else
            {
                Console.Write("nfa_bit(" + Int32.ToString(nfa_bit.GetLength()) + ")=");
                for (int i = 0; i < nfa_bit.GetLength(); i++)
                {
                    if (nfa_bit.Get(i))
                    {
                        Console.Write("1");
                    }
                    else
                    {
                        Console.Write("0");
                    }
                }
                Console.WriteLine("");
            }
            Console.WriteLine("[Dfa end dump]");
#endif
        }
Beispiel #2
0
 public void dump()
 {
     Console.WriteLine("[Nfa begin dump]");
     Console.WriteLine("label=" + Int32.ToString(label));
     Console.WriteLine("edge=" + Int32.ToString(edge));
     Console.Write("set=");
     if (cset == null)
     {
         Console.WriteLine("null");
     }
     else
     {
         Console.WriteLine(cset);
     }
     Console.Write("next=");
     if (next == null)
     {
         Console.WriteLine("null");
     }
     else
     {
         Console.WriteLine(next);
     }
     Console.Write("next2=");
     if (next2 == null)
     {
         Console.WriteLine("null");
     }
     else
     {
         Console.WriteLine(next2);
     }
     Console.Write("accept=");
     if (accept == null)
     {
         Console.WriteLine("null");
     }
     else
     {
         accept.dump();
     }
     Console.WriteLine("anchor=" + Int32.ToString(anchor));
     Console.Write("states=");
     if (states == null)
     {
         Console.WriteLine("null");
     }
     else
     {
         for (int i = 0; i < states.GetLength(); i++)
         {
             if (states.Get(i))
             {
                 Console.Write("1");
             }
             else
             {
                 Console.Write("0");
             }
         }
         Console.WriteLine("");
     }
     Console.WriteLine("[Nfa end dump]");
 }