2 //=============================================================================
6 * Visitor generating code for Module in the client header
8 * @author Aniruddha Gokhale
10 //=============================================================================
14 be_visitor_module_ch::be_visitor_module_ch (be_visitor_context
*ctx
)
15 : be_visitor_module (ctx
)
19 be_visitor_module_ch::~be_visitor_module_ch ()
24 be_visitor_module_ch::visit_module (be_module
*node
)
26 if (node
->cli_hdr_gen () || node
->imported ())
31 TAO_OutStream
*os
= this->ctx_
->stream ();
32 TAO_OutStream
*aos
= 0;
34 TAO_INSERT_COMMENT (os
);
36 *os
<< "namespace " << node
->local_name () << be_nl
39 if (be_global
->gen_anyop_files ())
41 aos
= tao_cg
->anyop_header ();
43 TAO_INSERT_COMMENT (aos
);
45 *aos
<< "namespace " << node
->local_name () << be_nl
49 // Generate code for the module definition by traversing thru the
50 // elements of its scope. We depend on the front-end to have made sure
51 // that only legal syntactic elements appear in our scope.
52 if (this->visit_scope (node
) == -1)
54 ACE_ERROR_RETURN ((LM_ERROR
,
55 "(%N:%l) be_visitor_module_ch::"
57 "codegen for scope failed\n"),
61 *os
<< be_uidt_nl
<< be_nl
;
62 TAO_INSERT_COMMENT (os
);
65 << "} // module " << node
->name ();
67 if (be_global
->gen_anyop_files ())
69 *aos
<< be_uidt_nl
<< be_nl
;
70 TAO_INSERT_COMMENT (aos
);
73 << "} // module " << node
->name () << be_nl
;