2 //=============================================================================
6 * Generic visitor generating code for Exceptions.
8 * @author Aniruddha Gokhale
10 //=============================================================================
12 #include "exception.h"
14 // Generic exception visitor.
15 be_visitor_exception::be_visitor_exception (be_visitor_context
*ctx
)
16 : be_visitor_scope (ctx
)
20 be_visitor_exception::~be_visitor_exception ()
24 // Visit the Exception node and its scope.
26 be_visitor_exception::visit_exception (be_exception
*)
33 be_visitor_exception::visit_field (be_field
*node
)
35 // Instantiate a visitor context with a copy of our context. This info
36 // will be modified based on what type of node we are visiting.
37 be_visitor_context
ctx (*this->ctx_
);
41 // This switch is acceptable rather than having derived visitors overriding
42 // this method and differing only in what state they set
44 switch (this->ctx_
->state ())
46 case TAO_CodeGen::TAO_ROOT_CH
:
47 case TAO_CodeGen::TAO_INTERFACE_CH
:
49 be_visitor_field_ch
visitor (&ctx
);
50 status
= node
->accept (&visitor
);
53 case TAO_CodeGen::TAO_ROOT_CI
:
55 be_visitor_field_ci
visitor (&ctx
);
56 status
= node
->accept (&visitor
);
59 case TAO_CodeGen::TAO_ROOT_CS
:
61 be_visitor_field_cs
visitor (&ctx
);
62 status
= node
->accept (&visitor
);
65 case TAO_CodeGen::TAO_ROOT_CDR_OP_CH
:
67 be_visitor_field_cdr_op_ch
visitor (&ctx
);
68 status
= node
->accept (&visitor
);
71 case TAO_CodeGen::TAO_ROOT_CDR_OP_CS
:
73 be_visitor_field_cdr_op_cs
visitor (&ctx
);
74 status
= node
->accept (&visitor
);
79 ACE_ERROR_RETURN ((LM_ERROR
,
80 "(%N:%l) be_visitor_exception::"
82 "Bad context state\n"),
89 ACE_ERROR_RETURN ((LM_ERROR
,
90 "(%N:%l) be_visitor_exception::"
92 "failed to accept visitor\n"),