当前位置: 首页>>代码示例>>C++>>正文


C++ AST_Decl::imported方法代码示例

本文整理汇总了C++中AST_Decl::imported方法的典型用法代码示例。如果您正苦于以下问题:C++ AST_Decl::imported方法的具体用法?C++ AST_Decl::imported怎么用?C++ AST_Decl::imported使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AST_Decl的用法示例。


在下文中一共展示了AST_Decl::imported方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: while

void
be_CodeGenerator::Generate(be_ClientImplementation& source)
{
   UTL_ScopeActiveIterator* i;
   AST_Decl * d;
   UTL_Scope * s = (UTL_Scope*)narrow((long) & UTL_Scope::type_id);

   if (s)
   {
      i = new UTL_ScopeActiveIterator(s, UTL_Scope::IK_decls);

      while (!(i->is_done()))
      {
         be_CodeGenerator * cg;

         d = i->item();

         if (!d->imported() &&
             (cg = (be_CodeGenerator*)d->narrow((long) & be_CodeGenerator::type_id)))
         {
            cg->Generate(source);
         }

         i->next();
      }

      delete i;
   }
   else
   {
      assert(pbfalse);
   }
}
开发者ID:xrl,项目名称:opensplice_dds,代码行数:33,代码来源:xbe_codegen.cpp

示例2: GenerateGlobalDecls

void be_root::GenerateGlobalDecls (be_ClientHeader & source)
{
   UTL_ScopeActiveIterator * i;
   be_CodeGenerator * cg;
   AST_Decl * d;
   UTL_Scope * s = (UTL_Scope*) narrow ((long) & UTL_Scope::type_id);

   if (s)
   {
      // Iterate through decls

      i = new UTL_ScopeActiveIterator (s, UTL_Scope::IK_decls);

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

         if (!d->imported ())
         {
            cg = (be_CodeGenerator*) d->narrow
               ((long) & be_CodeGenerator::type_id);

            if (cg)
            {
               cg->Generate (source);
            }
         }

         i->next ();
      }

      delete i;
   }
}
开发者ID:osrf,项目名称:opensplice,代码行数:34,代码来源:xbe_root.cpp

示例3:

// Compute the default index.
int
AST_Union::compute_default_index (void)
{
  AST_Decl *d = 0;
  AST_UnionBranch *ub = 0;
  int i = 0;

  // If default case does not exist, it will have a value of -1 according to
  // the spec.
  this->default_index_ = -1;

  // If there are elements in this scope...
  if (this->nmembers () > 0)
    {
      // Instantiate a scope iterator.
      for (UTL_ScopeActiveIterator si (this, UTL_Scope::IK_decls);
           !si.is_done ();
           si.next ())
        {
          // Get the next AST decl node.
          d = si.item ();

          // If an enum is declared in our scope, its members are
          // added to our scope as well, to detect clashes.
          if (d->node_type () == AST_Decl::NT_enum_val)
            {
              continue;
            }

          if (!d->imported ())
            {
              ub = AST_UnionBranch::narrow_from_decl (d);

              for (unsigned long j = 0; j < ub->label_list_length (); ++j)
                {
                  // Check if we are printing the default case.
                  AST_UnionLabel::UnionLabel ulk = ub->label (j)->label_kind ();
                  if (ulk == AST_UnionLabel::UL_default)
                    {
                      // Zero based indexing.
                      this->default_index_ = i;
                    }
                }

              // TAO's Typecode class keeps only a member count (not
              // a label count) so this increment has been moved
              // out of the inner loop.
              ++i;
            }
        }
    }

  return 0;
}
开发者ID:CCJY,项目名称:ATCD,代码行数:55,代码来源:ast_union.cpp

示例4: return

int
be_visitor_union_branch_cdr_op_cs::explicit_default (void)
{
  be_union *bu =
    be_union::narrow_from_decl (this->ctx_->scope ()->decl ());
  int def_index = bu->default_index ();

  if (def_index != -1)
    {
      be_union_branch *ub =
        be_union_branch::narrow_from_decl (this->ctx_->node ());

      int i = 0;

      // Instantiate a scope iterator.
      for (UTL_ScopeActiveIterator si (bu, UTL_Scope::IK_decls);
           !si.is_done ();
           si.next ())
        {
          be_union_branch *bub = 0; // union branch node

          AST_Decl *d = si.item ();

          if (!d->imported ())
            {
              bub = be_union_branch::narrow_from_decl (d);
            }

          if (bub == ub)
            {
              return (i == def_index);
            }
          else
            {
              ++i;
            }
        }
    }

  return 0;
}
开发者ID:asdlei00,项目名称:ACE,代码行数:41,代码来源:cdr_op_cs.cpp

示例5: GenerateGlobalTypes

void be_root::GenerateGlobalTypes (be_ClientHeader& source)
{
   UTL_ScopeActiveIterator * i;
   be_CodeGenerator * cg;
   AST_Decl * d;
   be_Type * bt;
   DDS_StdString scope;
   UTL_Scope * s = (UTL_Scope*) narrow ((long) & UTL_Scope::type_id);

   if (s)
   {
      // Iterate through types

      i = new UTL_ScopeActiveIterator (s, UTL_Scope::IK_localtypes);

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

         if (! d->imported ())
         {
            cg = (be_CodeGenerator*) d->narrow
               ((long) & be_CodeGenerator::type_id);
            if (cg)
            {
               bt = (be_Type*) d->narrow ((long) & be_Type::type_id);

               scope = bt->EnclosingScope ();
               if (! bt->HasTypeDef () && scope == NULL)
               {
                  cg->Generate (source);
               }
            }
         }

         i->next ();
      }

      delete i;
   }
}
开发者ID:osrf,项目名称:opensplice,代码行数:41,代码来源:xbe_root.cpp

示例6: Generate

void be_structure::Generate (be_ClientImplementation & source)
{
   UTL_ScopeActiveIterator * i;
   AST_Decl * d;
   UTL_Scope * s = (UTL_Scope*)narrow((long) & UTL_Scope::type_id);

   if (BE_Globals::ignore_interfaces && IsInterfaceDependant ())
   {
      return;
   }

   if (s)
   {
      i = new UTL_ScopeActiveIterator(s, UTL_Scope::IK_localtypes);

      while (!(i->is_done()))
      {
         be_CodeGenerator * cg;

         d = i->item();

         if (!d->imported() &&
               (cg = (be_CodeGenerator*)d->narrow((long) & be_CodeGenerator::type_id)))
         {
            cg->Generate (source);
         }

         i->next();
      }

      delete i;
   }
   else
   {
      assert(pbfalse);
   }
}
开发者ID:xrl,项目名称:opensplice_dds,代码行数:37,代码来源:xbe_structure.cpp

示例7: iter

void
be_CodeGenerator::Generate(be_ClientHeader& source)
{
   UTL_Scope* s = (UTL_Scope*)narrow((long) & UTL_Scope::type_id);
   assert(s);

   // ITERATE THROUGH DECLS
   UTL_ScopeActiveIterator iter(s, UTL_Scope::IK_both);

   while (!(iter.is_done()))
   {
      be_CodeGenerator* cg;

      AST_Decl* d = iter.item();

      if (!d->imported() &&
          (cg = (be_CodeGenerator*)d->narrow((long) & be_CodeGenerator::type_id)))
      {
         cg->Generate(source);
      }

      iter.next();
   }
}
开发者ID:xrl,项目名称:opensplice_dds,代码行数:24,代码来源:xbe_codegen.cpp

示例8: GTDEVEL

// 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();
}
开发者ID:S73417H,项目名称:opensplice,代码行数:63,代码来源:utl_scope.cpp


注:本文中的AST_Decl::imported方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。