public static void dump_grammar() throws internal_error
    {
      System.err.println("===== Terminals =====");
      for (int tidx=0, cnt=0; tidx < terminal.number(); tidx++, cnt++)
	{
	  System.err.print("["+tidx+"]"+terminal.find(tidx).name()+" ");
	  if ((cnt+1) % 5 == 0) System.err.println();
	}
      System.err.println();
      System.err.println();

      System.err.println("===== Non terminals =====");
      for (int nidx=0, cnt=0; nidx < non_terminal.number(); nidx++, cnt++)
	{
	  System.err.print("["+nidx+"]"+non_terminal.find(nidx).name()+" ");
	  if ((cnt+1) % 5 == 0) System.err.println();
	}
      System.err.println();
      System.err.println();


      System.err.println("===== Productions =====");
      for (int pidx=0; pidx < production.number(); pidx++)
	{
	  production prod = production.find(pidx);
	  System.err.print("["+pidx+"] "+prod.lhs().the_symbol().name() + " ::= ");
	  for (int i=0; i<prod.rhs_length(); i++)
	    if (prod.rhs(i).is_action())
	      System.err.print("{action} ");
	    else
	      System.err.print(
			 ((symbol_part)prod.rhs(i)).the_symbol().name() + " ");
	  System.err.println();
	}
      System.err.println();
    }