Ejemplo n.º 1
0
int
be_visitor_xplicit_pre_proc::visit_union_fwd (be_union_fwd *node)
{
  UTL_ScopedName sn (node->local_name (), 0);

  be_union *dummy = 0;
  ACE_NEW_RETURN (dummy,
                  be_union (0,
                            &sn,
                            false,
                            false),
                  -1);

  be_union_fwd *added_union_fwd = 0;
  ACE_NEW_RETURN (added_union_fwd,
                  be_union_fwd (dummy,
                                &sn),
                  -1);

  dummy->fwd_decl (added_union_fwd);

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

  return 0;
}
Ejemplo n.º 2
0
int
be_visitor_xplicit_pre_proc::visit_union (be_union *node)
{
  if (this->ref_type_)
    {
      this->check_and_store (node);
      return 0;
    }

  be_type *ud =
    be_type::narrow_from_decl (node->disc_type ());

  this->ref_type_ = true;

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

  this->ref_type_ = false;

  AST_ConcreteType *disc =
    AST_ConcreteType::narrow_from_decl (this->type_holder_);

  UTL_ScopedName sn (node->local_name (), 0);

  be_union *added_union = 0;
  ACE_NEW_RETURN (added_union,
                  be_union (disc,
                            &sn,
                            false,
                            false),
                  -1);

  idl_global->scopes ().top ()->add_to_scope (added_union);
  idl_global->scopes ().push (added_union);

  if (this->visit_scope (node) != 0)
    {
      ACE_ERROR_RETURN ((LM_ERROR,
                         ACE_TEXT ("be_visitor_xplicit_pre_proc::")
                         ACE_TEXT ("visit_union - code generation ")
                         ACE_TEXT ("for scope failed\n")),
                        -1);
    }

  return 0;
}
Ejemplo n.º 3
0
AST_Union *
be_generator::create_union (AST_ConcreteType *dt,
                            UTL_ScopedName *n,
                            bool is_local,
                            bool is_abstract)
{
  be_union *retval = 0;
  ACE_NEW_RETURN (retval,
                  be_union (dt,
                            n,
                            is_local,
                            is_abstract),
                  0);

  return retval;
}