public void insertar(string token, string lexema)
 {
     if (lisPR == null)
     {
         lisPR = new NodoPR(lexema, token);
     }
     else
     {
         NodoPR n   = new NodoPR(lexema, token);
         NodoPR aux = lisPR;
         while (aux.enlace != null)
         {
             aux = aux.enlace;
         }
         aux.enlace = n;
     }
     cnnPR++;
 }
 public void mostrar(DataGridView dgv2)
 {
     if (lisPR != null)
     {
         dgv2.RowCount = cnnPR;
         int    pos = 0;
         NodoPR aux = lisPR;
         while (aux != null)
         {
             dgv2.Rows[pos].Cells[0].Value = aux.Lexema;
             dgv2.Rows[pos].Cells[1].Value = aux.Token;
             aux = aux.enlace;
             pos++;
         }
     }
     //else
     //MessageBox.Show("La lista esta vacia");  //not necesary?
 }
Beispiel #3
0
 public NodoPR(string tkn, string lex)
 {
     lexema  = lex;
     token   = tkn;
     NodoEnl = null;
 }
 public ListaPR()
 {
     lisPR = null;
 }