Пример #1
0
//
// generate
//
bool IDL_Generator_File::generate (PICML::File_in file)
{
  // Construct the hash definition for this file.
  std::string hashdef = "_" + std::string (file->name ()) + "_IDL_";
  std::transform (hashdef.begin (),
                  hashdef.end (),
                  hashdef.begin (),
                  &::toupper);

  this->idl_
    << "#ifndef " << hashdef << nl
    << "#define " << hashdef << nl
    << nl;

  for (auto include : file->get_FileRefs ())
    include_t (this->idl_)(include);

  // Preprocess the file. This will genenerate the necessary
  // forward declarations for any object at the top of the
  // target output file.
  IDL_File_Dependency_Processor depends_graph;
  IDL_File_Processor idl_proc (depends_graph, this->idl_);
  file->accept (&idl_proc);

  // Visit the file and generate its contents.
  IDL_File_Generator generator (depends_graph, this->idl_);
  file->accept (&generator);

  this->idl_
    << nl
    << "#endif    // !defined " << hashdef << nl
    << nl;

  return true;
}
Пример #2
0
bool CUTS_BE_Preprocessor_T <T>::
preprocess (const PICML::File_in file, const CUTS_BE_IDL_Node * & node)
{
  this->preprocess (file);
  this->idl_graph_.find (file->name (), node);
  return true;
}
Пример #3
0
bool CUTS_BE_Preprocessor_T <T>::preprocess (const PICML::File_in file)
{
  CUTS_BE_IDL_Graph_Builder builder (this->idl_graph_);
  file->accept (builder);

  return true;
}