示例#1
0
int
be_visitor_xplicit_pre_proc::visit_constant (be_constant *node)
{
  if (this->ref_type_)
    {
      this->check_and_store (node);
      return 0;
    }

  AST_Expression *new_v = 0;
  ACE_NEW_RETURN (new_v,
                  AST_Expression (node->constant_value (),
                                  node->et ()),
                  -1);

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

  be_constant *added_const = 0;
  ACE_NEW_RETURN (added_const,
                  be_constant (node->et (),
                               new_v,
                               &sn),
                  -1);

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

  return 0;
}
示例#2
0
AST_Constant *
be_generator::create_constant (AST_Expression::ExprType et,
                               AST_Expression *ev,
                               UTL_ScopedName *n)
{
  be_constant *retval = 0;
  ACE_NEW_RETURN (retval,
                  be_constant (et,
                               ev,
                               n),
                  0);

  return retval;
}