Exemple #1
0
// Dump this AST_Factory node to the ostream o.
void
AST_Finder::dump (ACE_OSTREAM_TYPE &o)
{
  AST_Decl *d = 0;

  this->dump_i (o, "finder ");
  this->local_name ()->dump (o);
  this->dump_i (o, "(");

  // Iterator must be explicitly advanced inside the loop.
  for (UTL_ScopeActiveIterator i (this, IK_decls);
       !i.is_done ();)
    {
      d = i.item ();
      d->dump (o);
      i.next ();

      if (!i.is_done())
        {
          this->dump_i (o, ", ");
        }
    }

  this->dump_i (o, ")");
}
Exemple #2
0
// Dump this AST_Operation node (an operation) to the ostream o.
void
AST_Operation::dump (ACE_OSTREAM_TYPE &o)
{
  AST_Decl *d = 0;
  AST_Type *e = 0;
  UTL_String *s = 0;

  if (this->pd_flags == OP_oneway)
    {
      this->dump_i (o, "oneway ");
    }
  else if (this->pd_flags == OP_idempotent)
    {
      this->dump_i (o, "idempotent ");
    }

  this->pd_return_type->name ()->dump (o);
  this->dump_i (o, " ");
  this->local_name ()->dump (o);
  this->dump_i (o, "(");

  // Must advance the iterator explicity inside the loop.
  for (UTL_ScopeActiveIterator i (this, IK_decls); !i.is_done ();)
    {
      d = i.item ();
      d->dump (o);
      i.next ();

      if (!i.is_done())
        {
          this->dump_i (o, ", ");
        }
    }

  this->dump_i (o, ")");

  if (this->pd_exceptions != 0)
    {
      this->dump_i (o, " raises(");

      // Must advance the iterator explicity inside the loop.
      for (UTL_ExceptlistActiveIterator ei (this->pd_exceptions);
           !ei.is_done ();)
        {
          e = ei.item ();
          ei.next ();
          e->local_name ()->dump (o);

          if (!ei.is_done())
            {
             this->dump_i (o, ", ");
            }
        }

      this->dump_i (o, ")");
    }

  if (this->pd_context != 0)
    {
      this->dump_i (o, " context(");

      // Must advance the iterator explicity inside the loop.
      for (UTL_StrlistActiveIterator si (this->pd_context); !si.is_done();)
        {
          s = si.item ();
          si.next ();
          this->dump_i (o, s->get_string ());

          if (!si.is_done())
            {
              this->dump_i (o, ", ");
            }
        }

      this->dump_i (o, ")");
    }
}
Exemple #3
0
// AST Dumping
void
UTL_Scope::dump(ostream &o)
{
   UTL_ScopeActiveIterator *i;
   AST_Decl *d;

   if (idl_global->indent() == NULL)
      idl_global->set_indent(new UTL_Indenter());

   idl_global->indent()->increase();

   if (pd_locals_used > 0)
   {
      i = new UTL_ScopeActiveIterator(this, UTL_Scope::IK_localtypes);

      o << GTDEVEL("\n/* Current Pragma: */\n");
      pd_pragmas.dump(o);

      o << GTDEVEL("\n/* Locally defined types: */\n");

      while (!(i->is_done()))
      {
         d = i->item();

         if (!d->imported())
         {
            idl_global->indent()->skip_to(o);
            d->dump(o);
            o << "\n";
         }

         i->next();
      }

      delete i;
   }

   if (pd_decls_used > 0)
   {
      i = new UTL_ScopeActiveIterator(this, UTL_Scope::IK_decls);

      o << GTDEVEL("\n/* Declarations: */\n");

      while (!(i->is_done()))
      {
         d = i->item();

         if (!d->imported())
         {
            idl_global->indent()->skip_to(o);
            d->dump(o);
            o << ";\n";
         }

         i->next();
      }

      delete i;
   }

   idl_global->indent()->decrease();
}