2 //=============================================================================
6 * Visitor generating code for the Root node. This is a generic visitor.
8 * @author Aniruddha Gokhale
10 //=============================================================================
14 // Generic Root visitor
15 be_visitor_root::be_visitor_root (be_visitor_context
*ctx
)
16 : be_visitor_module (ctx
)
20 be_visitor_root::~be_visitor_root (void)
25 be_visitor_root::visit_module (be_module
*node
)
27 // Instantiate a visitor context with a copy of our context. This info
28 // will be modified based on what type of node we are visiting.
29 be_visitor_context
ctx (*this->ctx_
);
33 switch (this->ctx_
->state ())
35 case TAO_CodeGen::TAO_ROOT_CH
:
37 be_visitor_module_ch
visitor (&ctx
);
38 status
= node
->accept (&visitor
);
41 case TAO_CodeGen::TAO_ROOT_SH
:
43 be_visitor_module_sh
visitor (&ctx
);
44 status
= node
->accept (&visitor
);
47 case TAO_CodeGen::TAO_ROOT_IH
:
49 be_visitor_module_ih
visitor (&ctx
);
50 status
= node
->accept (&visitor
);
53 case TAO_CodeGen::TAO_ROOT_ANY_OP_CH
:
54 case TAO_CodeGen::TAO_ROOT_ANY_OP_CS
:
56 be_visitor_module_any_op
visitor (&ctx
);
57 status
= node
->accept (&visitor
);
60 case TAO_CodeGen::TAO_ROOT_CDR_OP_CH
:
61 case TAO_CodeGen::TAO_ROOT_CDR_OP_CS
:
63 be_visitor_module_cdr_op
visitor (&ctx
);
64 status
= node
->accept (&visitor
);
69 be_visitor_module
visitor (&ctx
);
70 status
= node
->accept (&visitor
);
77 ACE_ERROR_RETURN ((LM_ERROR
,
78 "(%N:%l) be_visitor_root::"
80 "failed to accept visitor\n"),