Esempio n. 1
0
AST_Typedef *
be_generator::create_typedef (AST_Type *bt,
                              UTL_ScopedName *n,
                              bool is_local,
                              bool is_abstract)
{
  be_typedef *retval = 0;
  ACE_NEW_RETURN (retval,
                  be_typedef (bt,
                              n,
                              is_local,
                              is_abstract),
                  0);

  return retval;
}
Esempio n. 2
0
int
be_visitor_xplicit_pre_proc::visit_typedef (be_typedef *node)
{
  if (this->ref_type_)
    {
      this->check_and_store (node);
      return 0;
    }

  be_type *t =
    be_type::narrow_from_decl (node->field_type ());

  this->ref_type_ = true;

  if (t->accept (this) != 0)
    {
      ACE_ERROR_RETURN ((LM_ERROR,
                         ACE_TEXT ("be_visitor_xplicit_pre_proc::")
                         ACE_TEXT ("visit_typedef - code generation ")
                         ACE_TEXT ("for base type failed\n")),
                        -1);
    }

  this->ref_type_ = false;

  UTL_ScopedName sn (node->local_name (), 0);
  AST_Type *bt =
    AST_Type::narrow_from_decl (this->type_holder_);

  be_typedef *added_typedef = 0;
  ACE_NEW_RETURN (added_typedef,
                  be_typedef (bt,
                              &sn,
                              false,
                              false),
                  -1);

  idl_global->scopes ().top ()->add_to_scope (added_typedef);

  return 0;
}