blob: f8a3fa23c9abdf30c4bc1ba37b99d0717172a485 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
//=============================================================================
/**
* @file be_null_return_emitter.cpp
*
* Emits 'return x;' for all CORBA types and ACE-supported
* platforms.
*
* @author Jeff Parsons
*/
//=============================================================================
#include "be_null_return_emitter.h"
#include "be_visitor_null_return_value.h"
#include "be_visitor_context.h"
#include "be_helper.h"
#include "be_typedef.h"
#include "be_structure.h"
#include "be_union.h"
be_null_return_emitter::be_null_return_emitter (
be_visitor_context *ctx)
: ctx_ (ctx),
os_ (*ctx->stream ())
{
}
be_null_return_emitter::~be_null_return_emitter ()
{
}
int
be_null_return_emitter::emit (be_type *node)
{
os_ << "return ";
be_visitor_null_return_value visitor (this->ctx_);
if (node->accept (&visitor) == -1)
{
ACE_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("be_null_return_emitter::")
ACE_TEXT ("emit(be_decl *) - accept() ")
ACE_TEXT ("failed for %C\n"),
node->full_name ()),
-1);
}
os_ << ";";
return 0;
}
|