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


C++ AST_Type::in_recursion方法代码示例

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


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

示例1: return

// Are we or the parameter node involved in any recursion?
bool
AST_Exception::in_recursion (ACE_Unbounded_Queue<AST_Type *> &list)
{
  bool self_test = (list.size () == 0);

  // We should calculate this only once. If it has already been
  // done, just return it.
  if (self_test && this->in_recursion_ != -1)
    {
      return (this->in_recursion_ == 1);
    }

  if (list.size () > 1)
  {
    if (match_names (this, list))
      {
        // this happens when we are not recursed ourselves but instead
        // are part of another recursive type
        return false;
      }
  }

  list.enqueue_tail(this);

  // Proceed if the number of members in our scope is greater than 0.
  if (this->nmembers () > 0)
    {
      // Continue until each element is visited.
      for (UTL_ScopeActiveIterator i (this, IK_decls);!i.is_done ();i.next ())
        {
          AST_Field *field = AST_Field::narrow_from_decl (i.item ());

          if (field == 0)
            // This will be an enum value or other legitimate non-field
            // member - in any case, no recursion.
            {
              continue;
            }

          AST_Type *type = field->field_type ();

          if (type->node_type () == AST_Decl::NT_typedef)
            {
              AST_Typedef *td = AST_Typedef::narrow_from_decl (type);
              type = td->primitive_base_type ();
            }

          if (type == 0)
            {
              ACE_ERROR_RETURN ((LM_ERROR,
                                 ACE_TEXT ("(%N:%l) AST_Exception::")
                                 ACE_TEXT ("in_recursion - ")
                                 ACE_TEXT ("bad field type\n")),
                                0);
            }

          if (type->in_recursion (list))
            {
              if (self_test)
                this->in_recursion_ = 1;
              idl_global->recursive_type_seen_ = true;
              return true;
            }
        }
    }

  // Not in recursion.
  if (self_test)
    this->in_recursion_ = 0;
  return 0; //this->in_recursion_;
}
开发者ID:CCJY,项目名称:ATCD,代码行数:72,代码来源:ast_exception.cpp


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