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