2 //=============================================================================
6 * Stores global data specific to the compiler back end.
8 * @author Jeff Parsons <parsons@cs.wustl.edu>
10 //=============================================================================
13 #include "orbsvcs/Log_Macros.h"
14 #include "be_global.h"
15 #include "ast_generator.h"
16 #include "global_extern.h"
17 #include "idl_defines.h"
19 TAO_IFR_BE_Export BE_GlobalData
*be_global
= 0;
21 BE_GlobalData::BE_GlobalData (void)
24 enable_locking_ (false),
25 do_included_files_ (true),
26 allow_duplicate_typedefs_ (false)
28 // At this point, the FE has been initialized. We can
29 // now instruct it that we want to preserve c++ keywords.
30 idl_global
->preserve_cpp_keywords (true);
33 BE_GlobalData::~BE_GlobalData (void)
38 BE_GlobalData::removing (void) const
40 return this->removing_
;
44 BE_GlobalData::removing (bool value
)
46 this->removing_
= value
;
50 BE_GlobalData::orb (void) const
52 return this->orb_
.in ();
56 BE_GlobalData::orb (CORBA::ORB_ptr orb
)
62 BE_GlobalData::repository (void) const
64 return this->repository_
.in ();
68 BE_GlobalData::repository (CORBA::Repository_ptr repo
)
70 this->repository_
= repo
;
73 ACE_Unbounded_Stack
<CORBA::Container_ptr
> &
74 BE_GlobalData::ifr_scopes (void)
76 return this->ifr_scopes_
;
80 BE_GlobalData::destroy (void)
85 BE_GlobalData::filename (void) const
87 return this->filename_
;
91 BE_GlobalData::filename (char *fname
)
93 this->filename_
= fname
;
97 BE_GlobalData::enable_locking (void) const
99 return this->enable_locking_
;
103 BE_GlobalData::enable_locking (bool value
)
105 this->enable_locking_
= value
;
109 BE_GlobalData::do_included_files (void) const
111 return this->do_included_files_
;
115 BE_GlobalData::do_included_files (bool val
)
117 this->do_included_files_
= val
;
121 BE_GlobalData::allow_duplicate_typedefs () const
123 return this->allow_duplicate_typedefs_
;
127 BE_GlobalData::allow_duplicate_typedefs (bool val
)
129 this->allow_duplicate_typedefs_
= val
;
133 BE_GlobalData::orb_args (void) const
135 return this->orb_args_
;
139 BE_GlobalData::orb_args (const ACE_CString
& args
)
141 this->orb_args_
= args
;
145 BE_GlobalData::spawn_options (void)
147 return this->orb_args_
+ idl_global
->idl_flags ();
150 #define UNKNOWN_OPTION \
153 ACE_TEXT ("IDL: I don't understand the '%s' option\n"), \
155 idl_global->parse_args_exit (1);
158 BE_GlobalData::parse_args (long &i
, char **av
)
163 if (av
[i
][2] == '\0')
165 be_global
->enable_locking (true);
174 if (av
[i
][2] == '\0')
176 be_global
->removing (true);
186 if (av
[i
][2] == 'i' && av
[i
][3] == '\0')
188 // ... processing of included IDL files.
189 be_global
->do_included_files (0);
198 if (av
[i
][2] == '\0')
200 be_global
->allow_duplicate_typedefs (true);