diff options
Diffstat (limited to 'modules/TAO/TAO_IDL/util/utl_scope.cpp')
-rw-r--r-- | modules/TAO/TAO_IDL/util/utl_scope.cpp | 622 |
1 files changed, 0 insertions, 622 deletions
diff --git a/modules/TAO/TAO_IDL/util/utl_scope.cpp b/modules/TAO/TAO_IDL/util/utl_scope.cpp index ec5dabfb5e2..f4272394f4d 100644 --- a/modules/TAO/TAO_IDL/util/utl_scope.cpp +++ b/modules/TAO/TAO_IDL/util/utl_scope.cpp @@ -296,63 +296,6 @@ UTL_Scope::~UTL_Scope (void) { } -// Private operations. - -static AST_Decl * -add_type (AST_Type *type) -{ - AST_Decl *result = 0; - UTL_Scope *scope = 0; - - switch (type->node_type()) - { - case AST_Decl::NT_array: - result = - idl_global->root ()->add_array (AST_Array::narrow_from_decl (type)); - break; - case AST_Decl::NT_enum: - result = - type->defined_in ()->add_enum (AST_Enum::narrow_from_decl (type)); - scope = AST_Enum::narrow_from_decl (type); - break; - case AST_Decl::NT_sequence: - result = - idl_global->root ()->add_sequence ( - AST_Sequence::narrow_from_decl (type) - ); - break; - case AST_Decl::NT_string: - case AST_Decl::NT_wstring: - result = - idl_global->root ()->add_string (AST_String::narrow_from_decl (type)); - break; - case AST_Decl::NT_struct: - result = - type->defined_in ()->add_structure ( - AST_Structure::narrow_from_decl (type) - ); - scope = AST_Structure::narrow_from_decl (type); - break; - case AST_Decl::NT_union: - result = - type->defined_in ()->add_union (AST_Union::narrow_from_decl (type)); - scope = AST_Union::narrow_from_decl (type); - break; - default: - // For non-complex types, like predefined types - // no additional add needed, assume everything is ok. - result = (AST_Decl *) 1; - break; - } - - if (scope != 0) - { - result = scope->call_add (); - } - - return result; -} - // Protected operations. // Special version of lookup which only looks at the local name instead of @@ -581,460 +524,6 @@ UTL_Scope::check_for_predef_seq (AST_Decl *d) // Public operations. -// Scope Management Protocol. -// -// All members of the protocol defined in UTL_Scope simply return the node -// and don't do a thing. These members are simply dummies to retain -// compatibility with pre-two-pass compiler back-ends. - -AST_PredefinedType * -UTL_Scope::add_predefined_type (AST_PredefinedType *p) -{ - if (p == 0) - { - return 0; - } - - p->set_added (true); - return p; -} - -AST_Module * -UTL_Scope::add_module (AST_Module *m) -{ - if (m == 0) - { - return 0; - } - - m->set_added (true); - return m; -} - -AST_Interface * -UTL_Scope::add_interface (AST_Interface *i) -{ - if (i == 0) - { - return 0; - } - - i->set_added (true); - return i; -} - -AST_InterfaceFwd * -UTL_Scope::add_interface_fwd (AST_InterfaceFwd *i) -{ - if (i == 0) - { - return 0; - } - - i->set_added (true); - return i; -} - -AST_ValueType * -UTL_Scope::add_valuetype (AST_ValueType *i) -{ - if (i == 0) - { - return 0; - } - - i->set_added (true); - return i; -} - -AST_ValueTypeFwd * -UTL_Scope::add_valuetype_fwd (AST_ValueTypeFwd *i) -{ - if (i == 0) - { - return 0; - } - - i->set_added (true); - return i; -} - -AST_EventType * -UTL_Scope::add_eventtype (AST_EventType *i) -{ - if (i == 0) - { - return 0; - } - - i->set_added (true); - return i; -} - -AST_EventTypeFwd * -UTL_Scope::add_eventtype_fwd (AST_EventTypeFwd *i) -{ - if (i == 0) - { - return 0; - } - - i->set_added (true); - return i; -} - -AST_Component * -UTL_Scope::add_component (AST_Component *i) -{ - if (i == 0) - { - return 0; - } - - i->set_added (true); - return i; -} - -AST_ComponentFwd * -UTL_Scope::add_component_fwd (AST_ComponentFwd *i) -{ - if (i == 0) - { - return 0; - } - - i->set_added (true); - return i; -} - -AST_Home * -UTL_Scope::add_home (AST_Home *i) -{ - if (i == 0) - { - return 0; - } - - i->set_added (true); - return i; -} - -AST_Exception * -UTL_Scope::add_exception (AST_Exception *e) -{ - if (e == 0) - { - return 0; - } - - e->set_added (true); - return e; -} - -AST_Constant * -UTL_Scope::add_constant (AST_Constant *c) -{ - if (c == 0) - { - return 0; - } - - c->set_added (true); - return c; -} - -UTL_StrList * -UTL_Scope::add_context (UTL_StrList *c) -{ - return c; -} - -UTL_NameList * -UTL_Scope::add_exceptions (UTL_NameList *e) -{ - return e; -} - -AST_Attribute * -UTL_Scope::add_attribute (AST_Attribute *a) -{ - if (a == 0) - { - return 0; - } - - a->set_added (true); - - if (!a->field_type ()->added ()) - { - return add_type (a->field_type ()) ? a : 0; - } - else - { - return a; - } -} - -AST_Operation * -UTL_Scope::add_operation (AST_Operation *o) -{ - if (o == 0) - { - return 0; - } - - o->set_added (true); - - if (!o->return_type ()->added ()) - { - return add_type (o->return_type ()) ? o : 0; - } - else - { - return o; - } -} - -AST_Argument * -UTL_Scope::add_argument (AST_Argument *a) -{ - if (a == 0) - { - return 0; - } - - a->set_added (true); - - if (!a->field_type ()->added ()) - { - return add_type (a->field_type ()) ? a : 0; - } - else - { - return a; - } -} - -AST_Union * -UTL_Scope::add_union (AST_Union *u) -{ - if (u == 0) - { - return 0; - } - - u->set_added (true); - return u; -} - -AST_UnionFwd * -UTL_Scope::add_union_fwd (AST_UnionFwd *u) -{ - if (u == 0) - { - return 0; - } - - u->set_added (true); - return u; -} - -AST_UnionBranch * -UTL_Scope::add_union_branch (AST_UnionBranch *u) -{ - if (u == 0) - { - return 0; - } - - u->set_added (true); - - if (!u->field_type ()->added ()) - { - return add_type (u->field_type ()) ? u : 0; - } - else - { - return u; - } -} - -AST_Structure * -UTL_Scope::add_structure (AST_Structure *s) -{ - if (s == 0) - { - return 0; - } - - s->set_added (true); - return s; -} - -AST_StructureFwd * -UTL_Scope::add_structure_fwd (AST_StructureFwd *s) -{ - if (s == 0) - { - return 0; - } - - s->set_added (true); - return s; -} - -AST_Field * -UTL_Scope::add_field (AST_Field *f) -{ - if (f == 0) - { - return 0; - } - - f->set_added (true); - - if (!f->field_type ()->added ()) - { - return add_type (f->field_type ()) ? f : 0; - } - else - { - return f; - } -} - -AST_Enum * -UTL_Scope::add_enum (AST_Enum *e) -{ - if (e == 0) - { - return 0; - } - - e->set_added (true); - return e; -} - -AST_EnumVal * -UTL_Scope::add_enum_val (AST_EnumVal *e) -{ - if (e == 0) - { - return 0; - } - - e->set_added (true); - return e; -} - -AST_Typedef * -UTL_Scope::add_typedef (AST_Typedef *t) -{ - if (t == 0) - { - return 0; - } - - t->set_added (true); - if (!t->base_type ()->added ()) - { - return add_type (t->base_type ()) ? t : 0; - } - else - { - return t; - } -} - -AST_Sequence * -UTL_Scope::add_sequence (AST_Sequence *s) -{ - if (s == 0) - { - return 0; - } - - s->set_added (true); - - if (!s->base_type ()->added ()) - { - return add_type (s->base_type ()) ? s : 0; - } - else - { - return s; - } -} - -AST_String * -UTL_Scope::add_string (AST_String *s) -{ - if (s == 0) - { - return 0; - } - - s->set_added (true); - return s; -} - -AST_Array * -UTL_Scope::add_array (AST_Array *a) -{ - if (a == 0) - { - return 0; - } - - a->set_added (true); - - if (!a->base_type ()->added ()) - { - return add_type (a->base_type ()) ? a : 0; - } - else - { - return a; - } -} - -AST_Native * -UTL_Scope::add_native (AST_Native *n) -{ - if (n == 0) - { - return 0; - } - - n->set_added (true); - return n; -} - -AST_Factory * -UTL_Scope::add_factory (AST_Factory *f) -{ - // We don't invite any new types so there is nothing actually to add - if (f == 0) - { - return 0; - } - - f->set_added (true); - return f; -} - -AST_PortType * -UTL_Scope::add_porttype (AST_PortType *p) -{ - if (p == 0) - { - return 0; - } - - p->set_added (true); - return p; -} - // Protected Front End Scope Management Protocol. // // All members of the protocol defined in UTL_Scope simply return NULL @@ -1306,117 +795,6 @@ UTL_Scope::fe_add_connector (AST_Connector *) return 0; } -// This is the second pass of the front end -// It calls the public add protocol on everything in scope. -// It calls the add_xx functions of the most derived AST_Node. - -AST_Decl * -UTL_Scope::call_add (void) -{ - AST_Decl *result = 0; - AST_Decl *decl = 0; - - UTL_ScopeActiveIterator i (this, - UTL_Scope::IK_decls); - UTL_Scope *scope = 0; - - while (!i.is_done ()) - { - decl = i.item (); - scope = 0; - - switch (decl->node_type ()) - { - case AST_Decl::NT_argument: - result = add_argument (AST_Argument::narrow_from_decl (decl)); - break; - case AST_Decl::NT_array: - result = add_array (AST_Array::narrow_from_decl (decl)); - break; - case AST_Decl::NT_attr: - result = add_attribute (AST_Attribute::narrow_from_decl (decl)); - break; - case AST_Decl::NT_const: - result = add_constant (AST_Constant::narrow_from_decl (decl)); - break; - case AST_Decl::NT_enum: - scope = AST_Enum::narrow_from_decl (decl); - result = add_enum (AST_Enum::narrow_from_decl (decl)); - break; - case AST_Decl::NT_enum_val: - result = add_enum_val (AST_EnumVal::narrow_from_decl (decl)); - break; - case AST_Decl::NT_except: - scope = AST_Exception::narrow_from_decl (decl); - result = add_exception (AST_Exception::narrow_from_decl (decl)); - break; - case AST_Decl::NT_field: - result = add_field (AST_Field::narrow_from_decl (decl)); - break; - case AST_Decl::NT_interface: - scope = AST_Interface::narrow_from_decl (decl); - result = add_interface (AST_Interface::narrow_from_decl (decl)); - break; - case AST_Decl::NT_interface_fwd: - result = - add_interface_fwd (AST_InterfaceFwd::narrow_from_decl (decl)); - break; - case AST_Decl::NT_module: - scope = AST_Module::narrow_from_decl (decl); - result = add_module (AST_Module::narrow_from_decl (decl)); - break; - case AST_Decl::NT_native: - result = add_native (AST_Native::narrow_from_decl (decl)); - break; - case AST_Decl::NT_op: - result = add_operation (AST_Operation::narrow_from_decl (decl)); - scope = AST_Operation::narrow_from_decl (decl); - break; - case AST_Decl::NT_pre_defined: - result = - add_predefined_type (AST_PredefinedType::narrow_from_decl (decl)); - break; - case AST_Decl::NT_sequence: - result = add_sequence (AST_Sequence::narrow_from_decl (decl)); - break; - case AST_Decl::NT_string: - case AST_Decl::NT_wstring: - result = add_string (AST_String::narrow_from_decl (decl)); - break; - case AST_Decl::NT_struct: - result = add_structure (AST_Structure::narrow_from_decl (decl)); - scope = AST_Structure::narrow_from_decl (decl); - break; - case AST_Decl::NT_typedef: - result = add_typedef (AST_Typedef::narrow_from_decl (decl)); - break; - case AST_Decl::NT_union: - result = add_union (AST_Union::narrow_from_decl (decl)); - scope = AST_Union::narrow_from_decl (decl); - break; - case AST_Decl::NT_union_branch: - result = - add_union_branch (AST_UnionBranch::narrow_from_decl (decl)); - break; - case AST_Decl::NT_factory: - result = add_factory (AST_Factory::narrow_from_decl (decl)); - scope = AST_Factory::narrow_from_decl (decl); - break; - default: - return 0; - } - - if (scope != 0) - { - scope->call_add (); - } - - i.next (); - } - - return result; -} - // Private lookup mechanism. // For dealing with lookups of 'Object' and 'TypeCode'. |