summaryrefslogtreecommitdiff
path: root/modules/TAO/TAO_IDL/ast/ast_module.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/TAO/TAO_IDL/ast/ast_module.cpp')
-rw-r--r--modules/TAO/TAO_IDL/ast/ast_module.cpp46
1 files changed, 46 insertions, 0 deletions
diff --git a/modules/TAO/TAO_IDL/ast/ast_module.cpp b/modules/TAO/TAO_IDL/ast/ast_module.cpp
index 73bd9c1af10..7b75e56c5c9 100644
--- a/modules/TAO/TAO_IDL/ast/ast_module.cpp
+++ b/modules/TAO/TAO_IDL/ast/ast_module.cpp
@@ -78,6 +78,7 @@ trademarks or registered trademarks of Sun Microsystems, Inc.
#include "ast_component.h"
#include "ast_component_fwd.h"
#include "ast_porttype.h"
+#include "ast_connector.h"
#include "ast_home.h"
#include "ast_constant.h"
#include "ast_exception.h"
@@ -696,6 +697,51 @@ AST_Module::fe_add_component (AST_Component *t)
return t;
}
+AST_Connector *
+AST_Module::fe_add_connector (AST_Connector *t)
+{
+ AST_Decl *d = 0;
+
+ // Already defined and cannot be redefined? Or already used?
+ if ((d = this->lookup_for_add (t, false)) != 0)
+ {
+ if (!can_be_redefined (d))
+ {
+ idl_global->err ()->error3 (UTL_Error::EIDL_REDEF,
+ t,
+ this,
+ d);
+ return 0;
+ }
+
+ if (this->referenced (d, t->local_name ()))
+ {
+ idl_global->err ()->error3 (UTL_Error::EIDL_DEF_USE,
+ t,
+ this,
+ d);
+ return 0;
+ }
+
+ if (t->has_ancestor (d))
+ {
+ idl_global->err ()->redefinition_in_scope (t,
+ d);
+ return 0;
+ }
+ }
+
+ // Add it to local types.
+ this->add_to_local_types (t);
+
+ // Add it to set of locally referenced symbols.
+ this->add_to_referenced (t,
+ false,
+ t->local_name ());
+
+ return t;
+}
+
// Add this AST_Home node (a value type declaration) to this scope.
AST_Home *
AST_Module::fe_add_home (AST_Home *t)