2 //=============================================================================
6 * Visitor generating code for Root in the server header
8 * @author Aniruddha Gokhale
10 //=============================================================================
14 be_visitor_root_sh::be_visitor_root_sh (be_visitor_context
*ctx
)
15 : be_visitor_root (ctx
)
19 be_visitor_root_sh::~be_visitor_root_sh ()
24 be_visitor_root_sh::visit_root (be_root
*node
)
26 if (this->init () == -1)
28 ACE_ERROR_RETURN ((LM_ERROR
,
29 ACE_TEXT ("be_visitor_root_sh::init - ")
30 ACE_TEXT ("failed to initialize\n")),
34 if (be_global
->gen_arg_traits ())
36 if (this->gen_arg_traits (node
) == -1)
38 /// Error message already output.
43 /// The SI and SS cases are caught in BE_produce(). We
44 /// want to generate an empty skeleton header file, which
45 /// has been done, so -SS can flag a skip of the scope
46 /// traversal, but we want to generate the skeleton
47 /// end-of-header file stuff, so we don't bail completely.
48 if (be_global
->gen_skel_files ())
50 if (this->visit_scope (node
) == -1)
52 ACE_ERROR_RETURN ((LM_ERROR
,
53 ACE_TEXT ("be_visitor_root_sh::visit_root - ")
54 ACE_TEXT ("codegen for scope failed\n")),
59 (void) tao_cg
->end_server_header ();
65 be_visitor_root_sh::init ()
67 /// First open the server-side file for writing
69 tao_cg
->start_server_header (
70 be_global
->be_get_server_hdr_fname ());
74 ACE_ERROR_RETURN ((LM_ERROR
,
75 ACE_TEXT ("be_visitor_root_sh::init - ")
76 ACE_TEXT ("Error opening server header file\n")),
80 /// Initialize the stream.
81 this->ctx_
->stream (tao_cg
->server_header ());
86 be_visitor_root_sh::gen_arg_traits (be_root
*node
)
88 be_visitor_context ctx
= *this->ctx_
;
89 be_visitor_arg_traits
arg_visitor ("S", &ctx
);
90 int status
= node
->accept (&arg_visitor
);
94 ACE_ERROR_RETURN ((LM_ERROR
,
95 ACE_TEXT ("be_visitor_root_sh::")
96 ACE_TEXT ("gen_arg_traits - failed to ")
97 ACE_TEXT ("generate skeleton arg traits\n")),