public void dump_stack()
    {
      if (stack == null)
	{
	  debug_message("# Stack dump requested, but stack is null");
	  return;
	}

      debug_message("============ Parse Stack Dump ============");

      /* dump the stack */
      for (int i=0; i<stack.size(); i++)
	{
	  debug_message("Symbol: " + ((Symbol)stack.elementAt(i)).sym +
			" State: " + ((Symbol)stack.elementAt(i)).parse_state);
	}
      debug_message("==========================================");
    }