本文整理汇总了C++中AST_Expression::param_holder方法的典型用法代码示例。如果您正苦于以下问题:C++ AST_Expression::param_holder方法的具体用法?C++ AST_Expression::param_holder怎么用?C++ AST_Expression::param_holder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AST_Expression
的用法示例。
在下文中一共展示了AST_Expression::param_holder方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: id
int
ast_visitor_reifying::visit_sequence (AST_Sequence *node)
{
AST_Type *bt = node->base_type ();
if (bt->ast_accept (this) != 0)
{
ACE_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("ast_visitor_reifying::")
ACE_TEXT ("visit_sequence - ")
ACE_TEXT ("visit of base type failed\n")),
-1);
}
bt = AST_Type::narrow_from_decl (this->reified_node_);
AST_Expression *v = node->max_size ();
AST_Param_Holder *ph = v->param_holder ();
if (ph != 0)
{
if (this->visit_param_holder (ph) != 0)
{
ACE_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("ast_visitor_reifying::")
ACE_TEXT ("visit_sequence - ")
ACE_TEXT ("visit_param_holder() ")
ACE_TEXT ("failed\n")),
-1);
}
AST_Constant *c =
AST_Constant::narrow_from_decl (this->reified_node_);
v = c->constant_value ();
}
AST_Expression *bound =
idl_global->gen ()->create_expr (v,
AST_Expression::EV_ulong);
Identifier id ("sequence");
UTL_ScopedName sn (&id, 0);
this->reified_node_ =
idl_global->gen ()->create_sequence (bound,
bt,
&sn,
false,
false);
// No need to add this new node to any scope - it's anonymous
// and owned by the node that references it.
return 0;
}
示例2: if
int
ast_visitor_reifying::visit_string (AST_String *node)
{
AST_Expression *b = node->max_size ();
AST_Param_Holder *ph = b->param_holder ();
if (ph != 0)
{
if (this->visit_param_holder (ph) != 0)
{
ACE_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("ast_visitor_reifying::")
ACE_TEXT ("visit_string - ")
ACE_TEXT ("visit_param_holder() ")
ACE_TEXT ("failed\n")),
-1);
}
AST_Constant *c =
AST_Constant::narrow_from_decl (this->reified_node_);
b = c->constant_value ();
}
else if (b->ev ()->u.ulval == 0)
{
this->reified_node_ = node;
return 0;
}
AST_Expression *bound = 0;
ACE_NEW_RETURN (bound,
AST_Expression (b,
AST_Expression::EV_ulong),
-1);
Identifier id ("string");
UTL_ScopedName sn (&id, 0);
ACE_NEW_RETURN (this->reified_node_,
AST_String (AST_Decl::NT_string,
&sn,
bound,
node->width ()),
-1);
return 0;
}