示例#1
0
文件: Emit.cs 项目: xmaxmex/Phalanger
 private void print_details()
 {
     Console.WriteLine("---------------------- Transition Table ----------------------");
     for (int i = 0; i < this.spec.row_map.Length; i++)
     {
         Console.Write("State " + i);
         Accept accept = this.spec.accept_list[i];
         if (accept == null)
         {
             Console.WriteLine(" [nonaccepting]");
         }
         else
         {
             Console.Write(" [accepting, ");
             accept.Dump();
             Console.Write("]");
         }
         DTrans dTrans = this.spec.dtrans_list[this.spec.row_map[i]];
         bool   flag   = false;
         int    num    = dTrans.GetDTrans(this.spec.col_map[0]);
         if (-1 != num)
         {
             flag = true;
             Console.Write("\tgoto " + num.ToString() + " on [");
         }
         for (int j = 1; j < this.spec.dtrans_ncols; j++)
         {
             int dTrans2 = dTrans.GetDTrans(this.spec.col_map[j]);
             if (num == dTrans2)
             {
                 if (-1 != num)
                 {
                     Console.Write((char)j);
                 }
             }
             else
             {
                 num = dTrans2;
                 if (flag)
                 {
                     Console.WriteLine("]");
                     flag = false;
                 }
                 if (-1 != num)
                 {
                     flag = true;
                     Console.Write("\tgoto " + num.ToString() + " on [" + char.ToString((char)j));
                 }
             }
         }
         if (flag)
         {
             Console.WriteLine("]");
         }
     }
     Console.WriteLine("---------------------- Transition Table ----------------------");
 }