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


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

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


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

示例1:

int
ast_visitor_tmpl_module_inst::visit_scope (UTL_Scope *node)
{
  for (UTL_ScopeActiveIterator si (node, UTL_Scope::IK_decls);
       !si.is_done ();
       si.next ())
    {
      AST_Decl *d = si.item ();

      if (d == 0)
        {
          ACE_ERROR_RETURN ((LM_ERROR,
                             ACE_TEXT ("ast_visitor_tmpl_module_inst::")
                             ACE_TEXT ("visit_scope - ")
                             ACE_TEXT ("bad node in this scope\n")),
                            -1);
        }

      // Send the visitor.
      if (d == 0 || d->ast_accept (this) == -1)
        {
          ACE_ERROR_RETURN ((LM_ERROR,
                             ACE_TEXT ("ast_visitor_tmpl_module_inst::")
                             ACE_TEXT ("visit_scope - ")
                             ACE_TEXT ("codegen for scope failed\n")),
                            -1);
        }
    }

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

示例2: si

int
idl2jni_visitor::visit_scope(UTL_Scope *node)
{
  if (node->nmembers() > 0) {
    UTL_ScopeActiveIterator si(node, UTL_Scope::IK_decls);
    AST_Decl *d = 0;

    while (!si.is_done()) {
      d = si.item();

      if (d == 0) {
        ACE_ERROR_RETURN((LM_ERROR,
                          ACE_TEXT("(%N:%l) idl2jni_visitor::visit_")
                          ACE_TEXT("scope - bad node in this scope\n")), -1);
      }

      if (d->node_type() == AST_Decl::NT_pre_defined) {
        si.next();
        continue;
      }

      if (d->ast_accept(this) == -1) {
        ACE_ERROR_RETURN((LM_ERROR,
                          ACE_TEXT("(%N:%l) idl2jni_visitor::visit_")
                          ACE_TEXT("scope - failed to accept visitor\n")), -1);
      }

      si.next();
    }
  }

  return 0;
}
开发者ID:svn2github,项目名称:OpenDDS,代码行数:33,代码来源:idl2jni_visitor.cpp

示例3: name

int
ast_visitor_reifying::visit_param_holder (AST_Param_Holder *node)
{
  size_t i = 0;
  FE_Utils::T_ARGLIST const *t_args =
    this->ctx_->template_args ();

  for (FE_Utils::T_PARAMLIST_INFO::ITERATOR iter (
         *this->ctx_->template_params ());
       !iter.done ();
       iter.advance (), ++i)
    {
      FE_Utils::T_Param_Info *item = 0;
      iter.next (item);

      ACE_CString name (item->name_);

      /// The param holder's info->name_ may be the same as the
      /// node's local name, but if the node comes from an
      /// alias, info->name_ will be the name of the alias's
      /// referenced template module parameter, while the local
      /// name will be that of the corresponding alias param
      /// name, which is what we want.
      if (name == node->local_name ()->get_string ())
        {
          AST_Decl **ret_ptr = 0;

          if (t_args->get (ret_ptr, i) == 0)
            {
              AST_Decl *candidate = *ret_ptr;

              return candidate->ast_accept (this);
            }
          else
            {
              ACE_ERROR_RETURN ((LM_ERROR,
                                 ACE_TEXT ("ast_visitor_reifying::")
                                 ACE_TEXT ("visit_param_holder() - access of ")
                                 ACE_TEXT ("current template arglist failed - ")
                                 ACE_TEXT ("param=%C scope=%C index=%d\n"),
                                 item->name_.c_str (),
                                 ScopeAsDecl (idl_global->scopes ().top ())->full_name (),
                                 i),
                                -1);
            }
        }
    }

  ACE_ERROR_RETURN ((LM_ERROR,
                     ACE_TEXT ("ast_visitor_reifying::")
                     ACE_TEXT ("visit_param_holder() - no match for ")
                     ACE_TEXT ("template param %C in %C\n"),
                     node->local_name ()->get_string (),
                     ScopeAsDecl (idl_global->scopes ().top ())->full_name ()),
                    -1);
}
开发者ID:CCJY,项目名称:ATCD,代码行数:56,代码来源:ast_visitor_reifying.cpp

示例4: visit_scope

//
// visit_scope
//
int Provides_Svnt_Impl::visit_scope (UTL_Scope * node)
{
  // Interfaces could be in a different IDL file, so we don't want to
  // skip them as the default visit_scope implementation does
  for (UTL_ScopeActiveIterator si (node, UTL_Scope::IK_decls);
       !si.is_done (); si.next ())
  {
    AST_Decl * d = si.item ();

    if (0 != d->ast_accept (this))
      return -1;
  }
  return 0;
}
开发者ID:SEDS,项目名称:CUTS,代码行数:17,代码来源:Provides_Svnt_Impl.cpp

示例5:

int
ir_simulator_visitor::visit_scope (UTL_Scope *node)
{
    XMI_TRACE ("got a scope");

    for (UTL_ScopeActiveIterator si (node, UTL_Scope::IK_decls);
            !si.is_done ();
            si.next ())
    {
        AST_Decl *d = si.item ();

        if (d->ast_accept (this) != 0)
        {
            ACE_ERROR_RETURN ((LM_ERROR,
                               "ir_simulator_visitor::visit_scope - "
                               "codegen for scope failed\n"),
                              -1);
        }
    }
    return 0;
}
开发者ID:akostrikov,项目名称:ATCD,代码行数:21,代码来源:IR_Simulator_visitor.cpp


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