bool java_bytecode_convert(
  const java_bytecode_parse_treet &parse_tree,
  symbol_tablet &symbol_table,
  message_handlert &message_handler)
{
  java_bytecode_convertt java_bytecode_convert(
    symbol_table, message_handler);

  try
  {
    java_bytecode_convert(parse_tree);
    return false;
  }

  catch(int)
  {
  }

  catch(const char *e)
  {
    java_bytecode_convert.error() << e << messaget::eom;
  }

  catch(const std::string &e)
  {
    java_bytecode_convert.error() << e << messaget::eom;
  }

  return true;
}
bool java_bytecode_languaget::typecheck(
  symbol_tablet &symbol_table,
  const std::string &module)
{
  // first convert all
  for(java_class_loadert::class_mapt::const_iterator
      c_it=java_class_loader.class_map.begin();
      c_it!=java_class_loader.class_map.end();
      c_it++)
  {
    if(c_it->second.parsed_class.name.empty())
      continue;

    debug() << "Converting class " << c_it->first << eom;

    if(java_bytecode_convert(
         c_it->second, symbol_table, get_message_handler()))
      return true;
  }

  // now typecheck all
  if(java_bytecode_typecheck(
       symbol_table, get_message_handler()))
    return true;

  return false;
}
bool java_bytecode_languaget::typecheck(
  symbol_tablet &symbol_table,
  const std::string &module)
{
  symbol_tablet new_symbol_table;

  if(java_bytecode_convert(
       parse_tree, new_symbol_table, module, get_message_handler()))
    return true;
  
  if(java_bytecode_typecheck(
       new_symbol_table, module, get_message_handler()))
    return true;

  symbol_table.swap(new_symbol_table);

//  if(linking(new_symbol_table, symbol_table, message_handler))
//    return true;
    
  return false;
}