本文整理汇总了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;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}