diff options
Diffstat (limited to 'TAO')
25 files changed, 1004 insertions, 963 deletions
diff --git a/TAO/TAO_IDL/ast/ast_interface_fwd.cpp b/TAO/TAO_IDL/ast/ast_interface_fwd.cpp index 8cb776cfed2..26bfd324b2d 100644 --- a/TAO/TAO_IDL/ast/ast_interface_fwd.cpp +++ b/TAO/TAO_IDL/ast/ast_interface_fwd.cpp @@ -62,135 +62,111 @@ NOTE: SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are trademarks or registered trademarks of Sun Microsystems, Inc. - */ +*/ -/* - * ast_interface_fwd.cc - Implementation of class AST_InterfaceFwd - * - * AST_InterfaceFwd nodes denote forward declarations of IDL interfaces - * AST_InterfaceFwd nodes have a field containing the full declaration - * of the interface, which is initialized when that declaration is - * encountered. - */ +// AST_InterfaceFwd nodes denote forward declarations of IDL interfaces +// AST_InterfaceFwd nodes have a field containing the full declaration +// of the interface, which is initialized when that declaration is +// encountered. -#include "idl.h" -#include "idl_extern.h" +#include "idl.h" +#include "idl_extern.h" ACE_RCSID(ast, ast_interface_fwd, "$Id$") -/* - * Constructor(s) and destructor - */ -AST_InterfaceFwd::AST_InterfaceFwd () - : pd_full_definition (NULL) +// Constructor(s) and destructor. +AST_InterfaceFwd::AST_InterfaceFwd (void) + : pd_full_definition (0) { } -AST_InterfaceFwd::AST_InterfaceFwd( AST_Interface *dummy, +AST_InterfaceFwd::AST_InterfaceFwd (AST_Interface *dummy, UTL_ScopedName *n, UTL_StrList *p) - : AST_Decl (AST_Decl::NT_interface_fwd, n, p) + : AST_Decl (AST_Decl::NT_interface_fwd, + n, + p) { - /* - * Create a dummy placeholder for the forward declared interface. This - * interface node is not yet defined (n_inherits < 0), so some operations - * will fail - */ + // Create a dummy placeholder for the forward declared interface. This + // interface node is not yet defined (n_inherits < 0), so some operations + // will fail. pd_full_definition = dummy; - - // The requirement that forward declared interfaces must be defined in the - // same 'translation unit' was removed in CORBA 2.3.1 (99-10-07). - /* - * Record the node in a list to be checked after the entire AST has been - * parsed. All nodes in the list must have n_inherits >= 0, else this - * indicates that a full definition was not seen for this forward - * delcared interface - */ -// AST_record_fwd_interface(this); } AST_InterfaceFwd::~AST_InterfaceFwd (void) { } -/* - * Private operations - */ +// Private operations. -idl_bool AST_InterfaceFwd::is_local () +idl_bool AST_InterfaceFwd::is_local (void) { - return this->full_definition()->is_local (); + return this->full_definition ()->is_local (); } - -idl_bool AST_InterfaceFwd::is_valuetype () +idl_bool AST_InterfaceFwd::is_valuetype (void) { - return this->full_definition()->is_valuetype(); + return this->full_definition ()->is_valuetype (); } - -idl_bool AST_InterfaceFwd::is_abstract_valuetype () +idl_bool AST_InterfaceFwd::is_abstract_valuetype (void) { - return this->full_definition()->is_abstract_valuetype(); + return this->full_definition ()->is_abstract_valuetype (); } -void AST_InterfaceFwd::set_abstract_valuetype () +void AST_InterfaceFwd::set_abstract_valuetype (void) { // Don't forget about dummy placeholder ! (see constructor) - // (only if the be class isn't used) + // (only if the be class isn't used). ACE_ASSERT (0); } +// Redefinition of inherited virtual operations. -/* - * Public operations - */ - -/* - * Redefinition of inherited virtual operations - */ - -/* - * Dump this AST_InterfaceFwd node to the ostream o - */ +// Dump this AST_InterfaceFwd node to the ostream o. void -AST_InterfaceFwd::dump(ostream &o) +AST_InterfaceFwd::dump (ostream &o) { if (this->is_valuetype ()) { if (this->is_abstract_valuetype ()) - o << "abstract "; + { + o << "abstract "; + } + o << "valuetype "; } else { if (this->is_abstract ()) - o << "abstract "; + { + o << "abstract "; + } else if (this->is_local ()) - o << "local "; + { + o << "local "; + } + o << "interface "; } - local_name()->dump(o); + + this->local_name ()->dump (o); } -/* - * Data accessors - */ +// Data accessors. AST_Interface * -AST_InterfaceFwd::full_definition() +AST_InterfaceFwd::full_definition (void) { - return pd_full_definition; + return this->pd_full_definition; } void -AST_InterfaceFwd::set_full_definition(AST_Interface *nfd) +AST_InterfaceFwd::set_full_definition (AST_Interface *nfd) { - pd_full_definition = nfd; + this->pd_full_definition = nfd; } -/* - * Narrowing methods - */ +// Narrowing methods. IMPL_NARROW_METHODS1 (AST_InterfaceFwd, AST_Type) IMPL_NARROW_FROM_DECL (AST_InterfaceFwd) diff --git a/TAO/TAO_IDL/ast/ast_module.cpp b/TAO/TAO_IDL/ast/ast_module.cpp index 646054633b0..3f081956525 100644 --- a/TAO/TAO_IDL/ast/ast_module.cpp +++ b/TAO/TAO_IDL/ast/ast_module.cpp @@ -166,7 +166,7 @@ AST_Module::fe_add_module (AST_Module *t) // flagged as an error. #ifndef ACE_HAS_USING_KEYWORD - if (referenced (d, t->local_name ()) + if (this->referenced (d, t->local_name ()) && !d->imported () && !ACE_BIT_ENABLED (idl_global->compile_flags (), IDL_CF_NOWARNINGS)) @@ -230,7 +230,7 @@ AST_Module::fe_add_interface (AST_Interface *t) if ((predef = lookup_for_add (t, I_FALSE)) != 0) { // Treat fwd declared interfaces specially - if (predef->node_type() == AST_Decl::NT_interface) + if (predef->node_type () == AST_Decl::NT_interface) { fwd = AST_Interface::narrow_from_decl (predef); @@ -254,7 +254,7 @@ AST_Module::fe_add_interface (AST_Interface *t) } // OK, not illegal redef of forward declaration. Now check whether. // it has been referenced already. - else if (referenced (predef, t->local_name ())) + else if (this->referenced (predef, t->local_name ())) { idl_global->err ()->error3 (UTL_Error::EIDL_DEF_USE, t, @@ -382,7 +382,7 @@ AST_Module::fe_add_constant (AST_Constant *t) return 0; } - if (referenced (d, t->local_name ())) + if (this->referenced (d, t->local_name ())) { idl_global->err ()->error3 (UTL_Error::EIDL_DEF_USE, t, @@ -428,7 +428,7 @@ AST_Module::fe_add_exception (AST_Exception *t) return 0; } - if (referenced (d, t->local_name ())) + if (this->referenced (d, t->local_name ())) { idl_global->err ()->error3 (UTL_Error::EIDL_DEF_USE, t, @@ -566,7 +566,7 @@ AST_Module::fe_add_enum (AST_Enum *t) return 0; } - if (referenced(d, t->local_name ())) + if (this->referenced (d, t->local_name ())) { idl_global->err ()->error3 (UTL_Error::EIDL_DEF_USE, t, @@ -606,7 +606,7 @@ AST_Module::fe_add_enum_val (AST_EnumVal *t) // Already defined and cannot be redefined? Or already used? if ((d = lookup_for_add(t, I_FALSE)) != 0) { - if (!can_be_redefined(d)) + if (!can_be_redefined (d)) { idl_global->err ()->error3 (UTL_Error::EIDL_REDEF, t, @@ -615,7 +615,7 @@ AST_Module::fe_add_enum_val (AST_EnumVal *t) return 0; } - if (this->referenced(d, t->local_name ())) + if (this->referenced (d, t->local_name ())) { idl_global->err ()->error3 (UTL_Error::EIDL_DEF_USE, t, @@ -624,7 +624,7 @@ AST_Module::fe_add_enum_val (AST_EnumVal *t) return 0; } - if (t->has_ancestor(d)) + if (t->has_ancestor (d)) { idl_global->err ()->redefinition_in_scope (t, d); @@ -670,7 +670,7 @@ AST_Module::fe_add_typedef (AST_Typedef *t) return 0; } - if (t->has_ancestor(d)) + if (t->has_ancestor (d)) { idl_global->err ()->redefinition_in_scope (t, d); @@ -781,9 +781,9 @@ AST_Module::be_add_interface (AST_Interface *i, { // Add it to scope. this->add_to_scope (i, - ix); + ix); - // Add it to set of locally referenced symbols + // Add it to set of locally referenced symbols. this->add_to_referenced (i, I_FALSE, i->local_name (), diff --git a/TAO/TAO_IDL/ast/ast_native.cpp b/TAO/TAO_IDL/ast/ast_native.cpp index f26ee641b0b..9a9a79700f8 100644 --- a/TAO/TAO_IDL/ast/ast_native.cpp +++ b/TAO/TAO_IDL/ast/ast_native.cpp @@ -3,37 +3,37 @@ // AST_Native: New IDL type added by the POA spec -#include "idl.h" -#include "idl_extern.h" +#include "idl.h" +#include "idl_extern.h" ACE_RCSID(ast, ast_native, "$Id$") -/* - * Constructor(s) - */ +// Constructor(s). + AST_Native::AST_Native (void) { } AST_Native::AST_Native(UTL_ScopedName *n, UTL_StrList *p) - : AST_Decl (AST_Decl::NT_native, n, p) + : AST_Decl (AST_Decl::NT_native, + n, + p) { } +// Destructor. AST_Native::~AST_Native (void) { } -/* - * Dump this AST_Native node to the ostream o - */ +// Dump this AST_Native node to the ostream o. void AST_Native::dump (ostream &o) { AST_Decl::dump (o); } -// Narrowing +// Narrowing. IMPL_NARROW_METHODS1(AST_Native, AST_Type) IMPL_NARROW_FROM_DECL(AST_Native) diff --git a/TAO/TAO_IDL/ast/ast_recursive.cpp b/TAO/TAO_IDL/ast/ast_recursive.cpp index 6c72be562fc..b4e6f0dc27f 100644 --- a/TAO/TAO_IDL/ast/ast_recursive.cpp +++ b/TAO/TAO_IDL/ast/ast_recursive.cpp @@ -62,108 +62,122 @@ NOTE: SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are trademarks or registered trademarks of Sun Microsystems, Inc. - */ +*/ -/* - * ast_recursive.cc - Check whether a type is used recursively in a situation - * where this use would be illegal. - * - * EXPLANATION: The CORBAS says that the only legal use of recursive types is - * in a manifest sequence declared inside a struct or union whose base type is - * the struct or union - * - * ALGORITH FOR CHECK: - * Sequences push a NULL on the scope stack to mark where in the scope nesting - * they appear. - * - * - If the type is not a struct or union, return FALSE (legal use of type) - * - Otherwise check up the scope stack, looking for this base type. If we - * find a NULL return FALSE (legal use of type, since it is inside some - * sequence). If we find the type on the stack, return TRUE (illegal use - * since it was not bracketed by a sequence). If we don't find the base - * type nor a sequence, return FALSE (legal use, since we're not nested). - */ - -#include "idl.h" -#include "idl_extern.h" +// EXPLANATION: The CORBA spec says that the only legal use of recursive types is +// in a manifest sequence declared inside a struct or union whose base type is +// the struct or union. + +// ALGORITHM FOR CHECK: +// Sequences push a NULL on the scope stack to mark where in the scope nesting +// they appear. + +// - If the type is not a struct or union, return FALSE (legal use of type). +// - Otherwise check up the scope stack, looking for this base type. If we +// find a NULL return FALSE (legal use of type, since it is inside some +// sequence). If we find the type on the stack, return TRUE (illegal use +// since it was not bracketed by a sequence). If we don't find the base +// type nor a sequence, return FALSE (legal use, since we're not nested). + +#include "idl.h" +#include "idl_extern.h" ACE_RCSID(ast, ast_recursive, "$Id$") -/* - * FE_illegal_recursive_type() - Implement the algorithm described above - */ idl_bool -AST_illegal_recursive_type(AST_Decl *t) +AST_illegal_recursive_type (AST_Decl *t) { - UTL_ScopeStackActiveIterator *i = 0; - UTL_Scope *s = 0; - AST_Structure *st1 = 0, *st2 = 0; - AST_Union *un1 = 0, *un2 = 0; - idl_bool check_for_struct = I_FALSE, - check_for_union = I_FALSE; - - if (t == NULL) return I_FALSE; + if (t == 0) + { + return I_FALSE; + } - /* - * We only care about structs and unions - */ - if (t->node_type() != AST_Decl::NT_struct && - t->node_type() != AST_Decl::NT_union) - return I_FALSE; // NOT ILLEGAL - /* - * Narrow the type appropriately so comparison will work - */ - if (t->node_type() == AST_Decl::NT_struct) { - check_for_struct = I_TRUE; - st1 = AST_Structure::narrow_from_decl(t); - if (st1 == NULL) - return I_FALSE; // NOT ILLEGAL - } else if (t->node_type() == AST_Decl::NT_union) { - check_for_union = I_TRUE; - un1 = AST_Union::narrow_from_decl(t); - if (un1 == NULL) - return I_FALSE; // NOT ILLEGAL - } - /* - * OK, iterate up the stack - */ - i = new UTL_ScopeStackActiveIterator(idl_global->scopes()); - while (!(i->is_done())) { - s = i->item(); - /* - * If we hit a NULL we're done since it means that we're nested inside - * a sequence, where recursive types may be used - */ - if (s == NULL) { - delete i; - return I_FALSE; // NOT ILLEGAL + // We only care about structs and unions. + if (t->node_type () != AST_Decl::NT_struct + && t->node_type () != AST_Decl::NT_union) + { + return I_FALSE; // NOT ILLEGAL. + } + + idl_bool check_for_struct = I_FALSE; + idl_bool check_for_union = I_FALSE; + AST_Structure *st1 = 0; + AST_Union *un1 = 0; + + // Narrow the type appropriately so comparison will work. + if (t->node_type () == AST_Decl::NT_struct) + { + check_for_struct = I_TRUE; + st1 = AST_Structure::narrow_from_decl (t); + + if (st1 == 0) + { + return I_FALSE; // NOT ILLEGAL. + } + } + else if (t->node_type () == AST_Decl::NT_union) + { + check_for_union = I_TRUE; + un1 = AST_Union::narrow_from_decl (t); + + if (un1 == 0) + { + return I_FALSE; // NOT ILLEGAL. + } } - /* - * OK, must check this scope - */ - if (s->scope_node_type() == AST_Decl::NT_struct && check_for_struct) { - st2 = AST_Structure::narrow_from_scope(s); - if (st2 != NULL && st2 == st1) { - delete i; - return I_TRUE; // ILLEGAL RECURSIVE TYPE USE - } - } else if (s->scope_node_type() == AST_Decl::NT_union && - check_for_union) { - un2 = AST_Union::narrow_from_scope(s); - if (un2 != NULL && un2 == un1) { - delete i; - return I_TRUE; // ILLEGAL RECURSIVE TYPE USE - } + + // OK, iterate up the stack. + UTL_ScopeStackActiveIterator *i = 0; + ACE_NEW_RETURN (i, + UTL_ScopeStackActiveIterator (idl_global->scopes ()), + 0); + + UTL_Scope *s = 0; + AST_Structure *st2 = 0; + AST_Union *un2 = 0; + + while (!i->is_done ()) + { + s = i->item (); + + // If we hit a NULL we're done since it means that we're nested inside + // a sequence, where recursive types may be used. + if (s == 0) + { + delete i; + return I_FALSE; // NOT ILLEGAL. + } + + // OK, must check this scope. + if (s->scope_node_type () == AST_Decl::NT_struct + && check_for_struct == I_TRUE) + { + st2 = AST_Structure::narrow_from_scope (s); + + if (st2 != 0 && st2 == st1) + { + delete i; + return I_TRUE; // ILLEGAL RECURSIVE TYPE USE. + } + } + else if (s->scope_node_type () == AST_Decl::NT_union + && check_for_union == I_TRUE) + { + un2 = AST_Union::narrow_from_scope (s); + + if (un2 != 0 && un2 == un1) + { + delete i; + return I_TRUE; // ILLEGAL RECURSIVE TYPE USE. + } + } + + // This one is fine, get next item. + i->next (); } - /* - * This one is fine, get next item - */ - i->next(); - } - /* - * No more scopes to check. This type was used legally - */ + + // No more scopes to check. This type was used legally. delete i; - return I_FALSE; // NOT ILLEGAL + return I_FALSE; // NOT ILLEGAL. } diff --git a/TAO/TAO_IDL/ast/ast_root.cpp b/TAO/TAO_IDL/ast/ast_root.cpp index e0da98e0aae..d22eeec7325 100644 --- a/TAO/TAO_IDL/ast/ast_root.cpp +++ b/TAO/TAO_IDL/ast/ast_root.cpp @@ -62,33 +62,29 @@ NOTE: SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are trademarks or registered trademarks of Sun Microsystems, Inc. - */ +*/ -/* - * ast_root.cc - Implementation of class AST_Root - * - * AST_Root nodes represent the roots of ASTs. - * AST_Root is a subclass of AST_Module, and is defined to allow BEs - * to subclass it to associate their own information with an entire - * AST. - */ +// AST_Root nodes represent the roots of ASTs. +// AST_Root is a subclass of AST_Module, and is defined to allow BEs +// to subclass it to associate their own information with an entire +// AST. -#include "idl.h" -#include "idl_extern.h" +#include "idl.h" +#include "idl_extern.h" ACE_RCSID(ast, ast_root, "$Id$") -/* - * Constructor(s) and destructor - */ -AST_Root::AST_Root () +// Constructor(s) and destructor. +AST_Root::AST_Root (void) { } AST_Root::AST_Root (UTL_ScopedName *n, UTL_StrList *p) - : AST_Decl(AST_Decl::NT_module, n, p), - UTL_Scope(AST_Decl::NT_module) + : AST_Decl (AST_Decl::NT_module, + n, + p), + UTL_Scope (AST_Decl::NT_module) { } @@ -96,78 +92,102 @@ AST_Root::~AST_Root (void) { } -/* - * Private operations - */ - -/* - * Public operations - */ - -/* - * Add protocol - */ +// Add protocol. -/* - * Add this AST_Sequence to the locally defined types in this scope - */ +// Add this AST_Sequence to the locally defined types in this scope. AST_Sequence * -AST_Root::fe_add_sequence(AST_Sequence *t) +AST_Root::fe_add_sequence (AST_Sequence *t) { - if (t == NULL) - return NULL; - t->set_name(new UTL_ScopedName(new Identifier("local type", 1, 0, I_FALSE), - NULL)); - add_to_local_types(t); + if (t == 0) + { + return 0; + } + + Identifier *id = 0; + ACE_NEW_RETURN (id, + Identifier ("local type", + 1, + 0, + I_FALSE), + 0); + + UTL_ScopedName *sn = 0; + ACE_NEW_RETURN (sn, + UTL_ScopedName (id, + 0), + 0); + + t->set_name (sn); + this->add_to_local_types (t); return t; } -/* - * Add this AST_String to the locally defined types in this scope - */ +// Add this AST_String to the locally defined types in this scope. AST_String * -AST_Root::fe_add_string(AST_String *t) +AST_Root::fe_add_string (AST_String *t) { - if (t == NULL) - return NULL; - t->set_name(new UTL_ScopedName(new Identifier("local type", 1, 0, I_FALSE), - NULL)); - add_to_local_types(t); - + if (t == 0) + { + return 0; + } + + Identifier *id = 0; + ACE_NEW_RETURN (id, + Identifier ("local type", + 1, + 0, + I_FALSE), + 0); + + UTL_ScopedName *sn = 0; + ACE_NEW_RETURN (sn, + UTL_ScopedName (id, + 0), + 0); + + t->set_name (sn); + this->add_to_local_types (t); return t; } -/* - * Add this AST_Array to the locally defined types in this scope - */ +// Add this AST_Array to the locally defined types in this scope. AST_Array * -AST_Root::fe_add_array(AST_Array *t) +AST_Root::fe_add_array (AST_Array *t) { - if (t == NULL) - return NULL; - t->set_name(new UTL_ScopedName(new Identifier("local type",1,0,I_FALSE), - NULL)); - add_to_local_types(t); - + if (t == 0) + { + return 0; + } + + Identifier *id = 0; + ACE_NEW_RETURN (id, + Identifier ("local type", + 1, + 0, + I_FALSE), + 0); + + UTL_ScopedName *sn = 0; + ACE_NEW_RETURN (sn, + UTL_ScopedName (id, + 0), + 0); + + t->set_name (sn); + this->add_to_local_types (t); return t; } -/* - * Redefinition of inherited virtual operations - */ +// Redefinition of inherited virtual operations. -/* - * Dump this AST_Root node to the ostream o - */ +// Dump this AST_Root node to the ostream o. void -AST_Root::dump(ostream &o) +AST_Root::dump (ostream &o) { - UTL_Scope::dump(o); + UTL_Scope::dump (o); } -/* - * Narrowing methods - */ +// Narrowing methods. IMPL_NARROW_METHODS1(AST_Root, AST_Module) IMPL_NARROW_FROM_DECL(AST_Root) IMPL_NARROW_FROM_SCOPE(AST_Root) diff --git a/TAO/TAO_IDL/ast/ast_string.cpp b/TAO/TAO_IDL/ast/ast_string.cpp index 498f3654e9b..5066feec75c 100644 --- a/TAO/TAO_IDL/ast/ast_string.cpp +++ b/TAO/TAO_IDL/ast/ast_string.cpp @@ -62,36 +62,32 @@ NOTE: SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are trademarks or registered trademarks of Sun Microsystems, Inc. - */ +*/ -/* - * ast_string.cc - Implementation of class AST_String - * - * AST_String nodes represent IDL string declarations. - * AST_String is a subclass of AST_ConcreteType. - * AST_String nodes have a maximum size (an AST_Expression which must - * evaluate to a positive integer). - */ +// AST_String nodes represent IDL string declarations. +// AST_String is a subclass of AST_ConcreteType. +// AST_String nodes have a maximum size (an AST_Expression which must +// evaluate to a positive integer). -#include "idl.h" -#include "idl_extern.h" +#include "idl.h" +#include "idl_extern.h" ACE_RCSID(ast, ast_string, "$Id$") - -/* - * Constructor(s) and destructor - */ -AST_String::AST_String () +// Constructor(s) and destructor. +AST_String::AST_String (void) : pd_max_size (0), - pd_width (1) + pd_width (sizeof (char)) { } AST_String::AST_String (AST_Expression *ms) : AST_Decl (AST_Decl::NT_string, - new UTL_ScopedName (new Identifier ("string", 1, 0, I_FALSE), - NULL), - NULL), + new UTL_ScopedName (new Identifier ("string", + 1, + 0, + I_FALSE), + 0), + 0), pd_max_size (ms), pd_width (sizeof (char)) { @@ -111,10 +107,10 @@ AST_String::AST_String (AST_Expression *ms, 1, 0, I_FALSE), - NULL), - NULL), - pd_max_size(ms), - pd_width(wide) + 0), + 0), + pd_max_size (ms), + pd_width (wide) { } @@ -122,45 +118,31 @@ AST_String::~AST_String (void) { } -/* - * Private operations - */ +// Redefinition of inherited virtual operations. -/* - * Public operations - */ - -/* - * Redefinition of inherited virtual operations - */ - -/* - * Dump this AST_String node to the ostream o - */ +// Dump this AST_String node to the ostream o. void AST_String::dump(ostream &o) { o << "string <"; - pd_max_size->dump(o); + this->pd_max_size->dump (o); o << ">"; } -/* - * Data accessors - */ +// Data accessors. AST_Expression * -AST_String::max_size() +AST_String::max_size (void) { - return pd_max_size; + return this->pd_max_size; } long -AST_String::width() +AST_String::width (void) { - return pd_width; + return this->pd_width; } -// Narrowing +// Narrowing. IMPL_NARROW_METHODS1(AST_String, AST_ConcreteType) IMPL_NARROW_FROM_DECL(AST_String) diff --git a/TAO/TAO_IDL/ast/ast_typedef.cpp b/TAO/TAO_IDL/ast/ast_typedef.cpp index ca5528fe8a8..6f8dae68dba 100644 --- a/TAO/TAO_IDL/ast/ast_typedef.cpp +++ b/TAO/TAO_IDL/ast/ast_typedef.cpp @@ -62,28 +62,22 @@ NOTE: SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are trademarks or registered trademarks of Sun Microsystems, Inc. - */ +*/ -/* - * ast_typedef.cc - Implementation of class AST_Typedef - * - * AST_Typedef nodes represent an IDL typedef statement. - * AST_Typedef is a subclass of AST_Decl (it is not a type, - * but instead is a type renaming). - * AST_Typedef nodes have a base type (a subclass of AST_Type) - * and a name (an UTL_ScopedName). - */ - -#include "idl.h" -#include "idl_extern.h" +// AST_Typedef nodes represent an IDL typedef statement. +// AST_Typedef is a subclass of AST_Decl (it is not a type, +// but instead is a type renaming). +// AST_Typedef nodes have a base type (a subclass of AST_Type) +// and a name (an UTL_ScopedName). + +#include "idl.h" +#include "idl_extern.h" ACE_RCSID(ast, ast_typedef, "$Id$") -/* - * Constructor(s) and destructor - */ -AST_Typedef::AST_Typedef () - : pd_base_type(NULL) +// Constructor(s) and destructor. +AST_Typedef::AST_Typedef (void) + : pd_base_type (0) { } @@ -92,9 +86,12 @@ AST_Typedef::AST_Typedef (AST_Type *bt, UTL_StrList *p, idl_bool local, idl_bool abstract) - : AST_Decl (AST_Decl::NT_typedef, n, p), - COMMON_Base (bt->is_local () || local, abstract), - pd_base_type(bt) + : AST_Decl (AST_Decl::NT_typedef, + n, + p), + COMMON_Base (bt->is_local () || local, + abstract), + pd_base_type (bt) { } @@ -102,46 +99,35 @@ AST_Typedef::~AST_Typedef (void) { } -/* - * Private operations - */ - -/* - * Public operations - */ +// Redefinition of inherited virtual operations. - -/* - * Redefinition of inherited virtual operations - */ - -/* - * Dump this AST_Typedef node to the ostream o - */ +// Dump this AST_Typedef node to the ostream o. void -AST_Typedef::dump(ostream &o) +AST_Typedef::dump (ostream &o) { if (this->is_local ()) - o << "(local) "; + { + o << "(local) "; + } else - o << "(abstract) "; + { + o << "(abstract) "; + } o << "typedef "; - pd_base_type->dump(o); + this->pd_base_type->dump (o); o << " "; - local_name()->dump(o); + this->local_name ()->dump (o); } -/* - * Data accessors - */ +// Data accessors. AST_Type * -AST_Typedef::base_type() +AST_Typedef::base_type (void) { - return pd_base_type; + return this->pd_base_type; } -// Narrowing +// Narrowing. IMPL_NARROW_METHODS1(AST_Typedef, AST_Type) IMPL_NARROW_FROM_DECL(AST_Typedef) diff --git a/TAO/TAO_IDL/ast/ast_union_branch.cpp b/TAO/TAO_IDL/ast/ast_union_branch.cpp index c3114fabe89..92e28fb179f 100644 --- a/TAO/TAO_IDL/ast/ast_union_branch.cpp +++ b/TAO/TAO_IDL/ast/ast_union_branch.cpp @@ -62,27 +62,21 @@ NOTE: SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are trademarks or registered trademarks of Sun Microsystems, Inc. - */ +*/ -/* - * ast_union_branch.cc - Implementation of class AST_UnionBranch - * - * AST_UnionBranch nodes represent a single branch of an IDL union - * declaration. - * AST_UnionBranch is a subclass of AST_Field, adding a label (which - * is a subclass of AST_UnionLabel). - */ +// AST_UnionBranch nodes represent a single branch of an IDL union +// declaration. +// AST_UnionBranch is a subclass of AST_Field, adding a label (which +// is a subclass of AST_UnionLabel). -#include "idl.h" -#include "idl_extern.h" +#include "idl.h" +#include "idl_extern.h" ACE_RCSID(ast, ast_union_branch, "$Id$") -/* - * Constructor(s) and destructor - */ -AST_UnionBranch::AST_UnionBranch () - : pd_ll (NULL) +// Constructor(s) and destructor. +AST_UnionBranch::AST_UnionBranch (void) + : pd_ll (0) { } @@ -90,9 +84,14 @@ AST_UnionBranch::AST_UnionBranch (UTL_LabelList *ll, AST_Type *ft, UTL_ScopedName *n, UTL_StrList *p) -: AST_Field (AST_Decl::NT_union_branch, ft, n, p), - AST_Decl (AST_Decl::NT_union_branch, n, p), - pd_ll (ll) + : AST_Field (AST_Decl::NT_union_branch, + ft, + n, + p), + AST_Decl (AST_Decl::NT_union_branch, + n, + p), + pd_ll (ll) { } @@ -100,38 +99,24 @@ AST_UnionBranch::~AST_UnionBranch (void) { } -/* - * Private operations - */ - -/* - * Public operations - */ - -/* - * Redefinition of inherited virtual operations - */ +// Redefinition of inherited virtual operations. -/* - * Dump this AST_UnionBranch node to the ostream o - */ +// Dump this AST_UnionBranch node to the ostream o. void -AST_UnionBranch::dump(ostream &o) +AST_UnionBranch::dump (ostream &o) { - for (unsigned long i = 0; - i < this->label_list_length (); ++i) + for (unsigned long i = 0; i < this->label_list_length (); ++i) { o << "case "; AST_UnionLabel *ul = this->label (i); - ul->dump(o); + ul->dump (o); o << ": \n"; } - AST_Field::dump(o); + + AST_Field::dump (o); } -/* - * Data accessors - */ +// Data accessors. AST_UnionLabel * AST_UnionBranch::label (unsigned long index) @@ -145,8 +130,10 @@ AST_UnionBranch::label (unsigned long index) { return iter.item (); } + ++i; } + return 0; } @@ -154,11 +141,15 @@ unsigned long AST_UnionBranch::label_list_length (void) { if (this->pd_ll) - return this->pd_ll->length (); + { + return this->pd_ll->length (); + } else - return 0; + { + return 0; + } } -// Narrowing +// Narrowing. IMPL_NARROW_METHODS1(AST_UnionBranch, AST_Field) IMPL_NARROW_FROM_DECL(AST_UnionBranch) diff --git a/TAO/TAO_IDL/ast/ast_union_label.cpp b/TAO/TAO_IDL/ast/ast_union_label.cpp index 2bd1fdc6b12..1ab3e7252a4 100644 --- a/TAO/TAO_IDL/ast/ast_union_label.cpp +++ b/TAO/TAO_IDL/ast/ast_union_label.cpp @@ -62,81 +62,68 @@ NOTE: SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are trademarks or registered trademarks of Sun Microsystems, Inc. - */ +*/ +// AST_UnionLabel denotes the label of a branch in an IDL union +// declaration. +// AST_UnionLabel nodes have a label kind (the values come from the +// enum AST_UnionLabel::LabelKind) and a label value (which is a +// subclass of AST_Expression). -/* - * ast_union_label.cc - Implementation of class AST_UnionLabel - * - * AST_UnionLabel denotes the label of a branch in an IDL union - * declaration. - * AST_UnionLabel nodes have a label kind (the values come from the - * enum AST_UnionLabel::LabelKind) and a label value (which is a - * subclass of AST_Expression). - */ - -#include "idl.h" -#include "idl_extern.h" +#include "idl.h" +#include "idl_extern.h" ACE_RCSID(ast, ast_union_label, "$Id$") -/* - * Constructor(s) - */ -AST_UnionLabel::AST_UnionLabel () - : pd_label_kind (UL_default), - pd_label_val (NULL) +// Constructor(s) and destructor. + +AST_UnionLabel::AST_UnionLabel (void) + : pd_label_kind (UL_default), + pd_label_val (0) { } AST_UnionLabel::AST_UnionLabel (UnionLabel lk, AST_Expression *lv) - : pd_label_kind (lk), - pd_label_val (lv) + : pd_label_kind (lk), + pd_label_val (lv) { - if (lv != NULL) - lv->evaluate (AST_Expression::EK_const); + if (lv != 0) + { + lv->evaluate (AST_Expression::EK_const); + } } AST_UnionLabel::~AST_UnionLabel (void) { } -/* - * Private operations - */ +// Redefinition of inherited virtual operations. -/* - * Public operations - */ - -/* - * Redefinition of inherited virtual operations - */ +// Dump this AST_UnionLabel node to the ostream o. +void +AST_UnionLabel::dump (ostream &o) +{ + if (this->pd_label_kind == UL_default) + { + o << "default"; + } + else + { + this->pd_label_val->dump (o); + } +} -/* - * Data accessors - */ +// Data accessors. AST_UnionLabel::UnionLabel -AST_UnionLabel::label_kind() +AST_UnionLabel::label_kind (void) { - return pd_label_kind; + return this->pd_label_kind; } AST_Expression * -AST_UnionLabel::label_val() +AST_UnionLabel::label_val (void) { - return pd_label_val; + return this->pd_label_val; } -/* - * Dump this AST_UnionLabel node to the ostream o - */ -void -AST_UnionLabel::dump(ostream &o) -{ - if (pd_label_kind == UL_default) - o << "default"; - else - pd_label_val->dump(o); -} diff --git a/TAO/TAO_IDL/be/be_interface.cpp b/TAO/TAO_IDL/be/be_interface.cpp index 368a435953f..346977c34e7 100644 --- a/TAO/TAO_IDL/be/be_interface.cpp +++ b/TAO/TAO_IDL/be/be_interface.cpp @@ -2055,7 +2055,7 @@ be_interface::gen_skel_helper (be_interface *derived, // Generate the static method corresponding to this method. *os << "static void " << d->local_name () << "_skel (" << be_idt << be_idt_nl - << "CORBA::ServerRequest &req, " << be_nl + << "TAO_ServerRequest &req, " << be_nl << "void *obj," << be_nl << "void *context," << be_nl << "CORBA::Environment &ACE_TRY_ENV =" << be_idt_nl @@ -2070,7 +2070,7 @@ be_interface::gen_skel_helper (be_interface *derived, << derived->full_skel_name () << "::" << d->local_name () << "_skel (" << be_idt << be_idt_nl - << "CORBA::ServerRequest &req," << be_nl + << "TAO_ServerRequest &req," << be_nl << "void *obj," << be_nl << "void *context," << be_nl << "CORBA::Environment &ACE_TRY_ENV" << be_uidt_nl @@ -2108,7 +2108,7 @@ be_interface::gen_skel_helper (be_interface *derived, // Generate the static method corresponding to this method. *os << "static void _get_" << d->local_name () << "_skel (" << be_idt << be_idt_nl - << "CORBA::ServerRequest &req," << be_nl + << "TAO_ServerRequest &req," << be_nl << "void *obj," << be_nl << "void *context," << be_nl << "CORBA::Environment &ACE_TRY_ENV =" << be_idt_nl @@ -2123,7 +2123,7 @@ be_interface::gen_skel_helper (be_interface *derived, << derived->full_skel_name () << "::_get_" << d->local_name () << "_skel (" << be_idt << be_idt_nl - << "CORBA::ServerRequest &req," << be_nl + << "TAO_ServerRequest &req," << be_nl << "void *obj," << be_nl << "void *context," << be_nl << "CORBA::Environment &ACE_TRY_ENV" << be_uidt_nl @@ -2157,7 +2157,7 @@ be_interface::gen_skel_helper (be_interface *derived, // this method. *os << "static void _set_" << d->local_name () << "_skel (" << be_idt << be_idt_nl - << "CORBA::ServerRequest &req," << be_nl + << "TAO_ServerRequest &req," << be_nl << "void *obj," << be_nl << "void *context," << be_nl << "CORBA::Environment &ACE_TRY_ENV = " << be_idt_nl @@ -2173,7 +2173,7 @@ be_interface::gen_skel_helper (be_interface *derived, << derived->full_skel_name () << "::_set_" << d->local_name () << "_skel (" << be_idt << be_idt_nl - << "CORBA::ServerRequest &req," << be_nl + << "TAO_ServerRequest &req," << be_nl << "void *obj," << be_nl << "void *context," << be_nl << "CORBA::Environment &ACE_TRY_ENV" << be_uidt_nl diff --git a/TAO/TAO_IDL/be/be_visitor_enum/cdr_op_ci.cpp b/TAO/TAO_IDL/be/be_visitor_enum/cdr_op_ci.cpp index 79c43fb641a..e8c9f0c5bc8 100644 --- a/TAO/TAO_IDL/be/be_visitor_enum/cdr_op_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_enum/cdr_op_ci.cpp @@ -18,10 +18,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - +#include "idl.h" +#include "idl_extern.h" +#include "be.h" #include "be_visitor_enum.h" ACE_RCSID(be_visitor_enum, cdr_op_ci, "$Id$") @@ -29,11 +28,10 @@ ACE_RCSID(be_visitor_enum, cdr_op_ci, "$Id$") // *************************************************************************** // Enum visitor for generating CDR operator declarations in the client -// stubs file +// stubs file. // *************************************************************************** -be_visitor_enum_cdr_op_ci::be_visitor_enum_cdr_op_ci -(be_visitor_context *ctx) +be_visitor_enum_cdr_op_ci::be_visitor_enum_cdr_op_ci (be_visitor_context *ctx) : be_visitor_scope (ctx) { } @@ -46,12 +44,13 @@ int be_visitor_enum_cdr_op_ci::visit_enum (be_enum *node) { if (node->cli_inline_cdr_op_gen () || node->imported ()) - return 0; + { + return 0; + } TAO_OutStream *os = this->ctx_->stream (); - - // generate CDR << and >> operators + // Generate CDR << and >> operators. os->indent (); *os << "ACE_INLINE CORBA::Boolean operator<< (TAO_OutputCDR &strm, " << "const " << node->name () << " &_tao_enumval)" << be_nl diff --git a/TAO/TAO_IDL/be/be_visitor_field/cdr_op_ci.cpp b/TAO/TAO_IDL/be/be_visitor_field/cdr_op_ci.cpp index 8986d5f2114..b6644dcc018 100644 --- a/TAO/TAO_IDL/be/be_visitor_field/cdr_op_ci.cpp +++ b/TAO/TAO_IDL/be/be_visitor_field/cdr_op_ci.cpp @@ -18,108 +18,119 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - +#include "idl.h" +#include "idl_extern.h" +#include "be.h" #include "be_visitor_field.h" ACE_RCSID(be_visitor_field, cdr_op_ci, "$Id$") // ********************************************** -// visitor for field in the client stubs file +// Visitor for field in the client stubs file. // ********************************************** -// constructor -be_visitor_field_cdr_op_ci::be_visitor_field_cdr_op_ci (be_visitor_context *ctx) +// Constructor. +be_visitor_field_cdr_op_ci::be_visitor_field_cdr_op_ci ( + be_visitor_context *ctx + ) : be_visitor_decl (ctx) { } -// destructor +// Destructor. be_visitor_field_cdr_op_ci::~be_visitor_field_cdr_op_ci (void) { } -// visit the field node +// Visit the field node. int be_visitor_field_cdr_op_ci::visit_field (be_field *node) { be_type *bt = be_type::narrow_from_decl (node->field_type ()); - if (!bt) + + if (bt == 0) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_field_cdr_op_ci::" "visit_field - " - "Bad field type\n" - ), -1); + "Bad field type\n"), + -1); } - this->ctx_->node (node); // save the node + // Save the node. + this->ctx_->node (node); + if (bt->accept (this) == -1) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_field_cdr_op_ci::" "visit_field - " - "codegen for field type failed\n" - ), -1); + "codegen for field type failed\n"), + -1); } + return 0; } -// visit array +// Visit array, int be_visitor_field_cdr_op_ci::visit_array (be_array *node) { - TAO_OutStream *os; // output stream - os = this->ctx_->stream (); + TAO_OutStream *os = this->ctx_->stream (); - // retrieve the field node + // Retrieve the field node. be_field *f = this->ctx_->be_node_as_field (); - if (!f) + + if (f == 0) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_field_cdr_op_ci::" "visit_array - " - "cannot retrieve field node\n" - ), -1); + "cannot retrieve field node\n"), + -1); } - // for anonymous arrays, the type name has a _ prepended. We compute + // For anonymous arrays, the type name has a _ prepended. We compute // the full_name with or without the underscore and use it later on. - char fname [NAMEBUFSIZE]; // to hold the full and + char fname [NAMEBUFSIZE]; - // save the node's local name and full name in a buffer for quick - // use later on + // Save the node's local name and full name in a buffer for quick + // use later on. ACE_OS::memset (fname, '\0', NAMEBUFSIZE); - if (!this->ctx_->alias () // not a typedef + + if (this->ctx_->alias () == 0 // Not a typedef. && node->is_child (this->ctx_->scope ())) { - // for anonymous arrays ... + // For anonymous arrays ... // we have to generate a name for us that has an underscore // prepended to our local name. This needs to be inserted after - // the parents's name - + // the parents's name. if (node->is_nested ()) { be_decl *parent = be_scope::narrow_from_scope (node->defined_in ())->decl (); - ACE_OS::sprintf (fname, "%s::_%s", parent->full_name (), + ACE_OS::sprintf (fname, + "%s::_%s", + parent->full_name (), node->local_name ()->get_string ()); } else { - ACE_OS::sprintf (fname, "_%s", node->full_name ()); + ACE_OS::sprintf (fname, + "_%s", + node->full_name ()); } } else { - // typedefed node - ACE_OS::sprintf (fname, "%s", node->full_name ()); + // Typedefed node. + ACE_OS::sprintf (fname, + "%s", + node->full_name ()); } - // check what is the code generation substate. Are we generating + // Check what is the code generation substate. Are we generating // code for the in/out operators for our parent or for us? switch (this->ctx_->sub_state ()) { @@ -135,71 +146,76 @@ be_visitor_field_cdr_op_ci::visit_array (be_array *node) // This is done in cdr_op_cs and hacked into *.i. break; default: - // error + // Error. ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_field_cdr_op_ci::" "visit_array - " - "bad sub state\n" - ), -1); + "bad sub state\n"), + -1); } - // if not a typedef and we are defined in the use scope, we must be defined - - if (!this->ctx_->alias () // not a typedef + // If not a typedef and we are defined in the use scope, we must be defined. + if (this->ctx_->alias () == 0 // Not a typedef. && node->is_child (this->ctx_->scope ())) { - // this is the case for anonymous arrays. Generate the <<, >> operators - // for the type defined by the anonymous array + // This is the case for anonymous arrays. Generate the <<, >> operators + // for the type defined by the anonymous array. - // instantiate a visitor context with a copy of our context. This info - // will be modified based on what type of node we are visiting + // Instantiate a visitor context with a copy of our context. This info + // will be modified based on what type of node we are visiting. be_visitor_context ctx (*this->ctx_); - ctx.node (node); // set the node to be the node being visited. The scope - // is still the same - // first generate the declaration + // Set the node to be the node being visited. The scope is + // still the same. + ctx.node (node); + + // First generate the declaration. ctx.state (TAO_CodeGen::TAO_ARRAY_CDR_OP_CI); be_visitor *visitor = tao_cg->make_visitor (&ctx); - if (!visitor) + + if (visitor == 0) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_field_cdr_op_ci::" "visit_array - " - "Bad visitor\n" - ), -1); + "Bad visitor\n"), + -1); } + if (node->accept (visitor) == -1) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_field_cdr_op_ci::" "visit_array - " - "codegen failed\n" - ), -1); + "codegen failed\n"), + -1); } + delete visitor; } + return 0; } -// visit enum type +// Visit enum type. int be_visitor_field_cdr_op_ci::visit_enum (be_enum *node) { - TAO_OutStream *os; // output stream - os = this->ctx_->stream (); + TAO_OutStream *os = this->ctx_->stream (); - // retrieve the field node + // Retrieve the field node. be_field *f = this->ctx_->be_node_as_field (); - if (!f) + + if (f == 0) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_field_cdr_op_ci::" "visit_array - " - "cannot retrieve field node\n" - ), -1); + "cannot retrieve field node\n"), + -1); } - // check what is the code generations substate. Are we generating code for + // Check what is the code generations substate. Are we generating code for // the in/out operators for our parent or for us? switch (this->ctx_->sub_state ()) { @@ -210,59 +226,64 @@ be_visitor_field_cdr_op_ci::visit_enum (be_enum *node) *os << "(strm << _tao_aggregate." << f->local_name () << ")"; return 0; case TAO_CodeGen::TAO_CDR_SCOPE: - // proceed further + // Proceed further. break; default: - // error + // Error. ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_field_cdr_op_ci::" "visit_enum - " - "bad sub state\n" - ), -1); + "bad sub state\n"), + -1); } - if (node->node_type () != AST_Decl::NT_typedef // not a typedef - && node->is_child (this->ctx_->scope ())) // node is defined inside the - // structure + if (node->node_type () != AST_Decl::NT_typedef // Not a typedef. + && node->is_child (this->ctx_->scope ())) // Node is defined inside + // the structure. { - // instantiate a visitor context with a copy of our context. This info - // will be modified based on what type of node we are visiting + // Instantiate a visitor context with a copy of our context. This info + // will be modified based on what type of node we are visiting. be_visitor_context ctx (*this->ctx_); - ctx.node (node); // set the node to be the node being visited. The scope - // is still the same - // generate the typcode for enums + // Set the node to be the node being visited. The scope + // is still the same. + ctx.node (node); + + // Generate the typcode for enums. ctx.state (TAO_CodeGen::TAO_ENUM_CDR_OP_CI); be_visitor *visitor = tao_cg->make_visitor (&ctx); - if (!visitor) + + if (visitor == 0) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_field_cdr_op_ci::" "visit_enum - " - "Bad visitor\n" - ), -1); + "Bad visitor\n"), + -1); } + if (node->accept (visitor) == -1) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_field_cdr_op_ci::" "visit_enum - " - "codegen failed\n" - ), -1); + "codegen failed\n"), + -1); } + delete visitor; } + return 0; } -// visit interface type +// Visit interface type. int be_visitor_field_cdr_op_ci::visit_interface (be_interface *) { - TAO_OutStream *os; // output stream - os = this->ctx_->stream (); + TAO_OutStream *os = this->ctx_->stream (); - // retrieve the field node + // Retrieve the field node. be_field *f = this->ctx_->be_node_as_field (); if (!f) { @@ -273,7 +294,7 @@ be_visitor_field_cdr_op_ci::visit_interface (be_interface *) ), -1); } - // check what is the code generations substate. Are we generating code for + // Check what is the code generations substate. Are we generating code for // the in/out operators for our parent or for us? switch (this->ctx_->sub_state ()) { @@ -284,39 +305,40 @@ be_visitor_field_cdr_op_ci::visit_interface (be_interface *) *os << "(strm << _tao_aggregate." << f->local_name () << ".in ())"; break; case TAO_CodeGen::TAO_CDR_SCOPE: - // nothing to be done because an interface cannit be declared inside a - // structure + // Nothing to be done because an interface cannit be declared inside a + // structure. break; default: - // error + // Error. ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_field_cdr_op_ci::" "visit_interface - " - "bad sub state\n" - ), -1); + "bad sub state\n"), + -1); } + return 0; } -// visit interface forward type +// Visit interface forward type. int be_visitor_field_cdr_op_ci::visit_interface_fwd (be_interface_fwd *) { - TAO_OutStream *os; // output stream - os = this->ctx_->stream (); + TAO_OutStream *os = this->ctx_->stream (); - // retrieve the field node + // Retrieve the field node. be_field *f = this->ctx_->be_node_as_field (); - if (!f) + + if (f == 0) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_field_cdr_op_ci::" "visit_interface_fwd - " - "cannot retrieve field node\n" - ), -1); + "cannot retrieve field node\n"), + -1); } - // check what is the code generations substate. Are we generating code for + // Check what is the code generations substate. Are we generating code for // the in/out operators for our parent or for us? switch (this->ctx_->sub_state ()) { @@ -327,114 +349,140 @@ be_visitor_field_cdr_op_ci::visit_interface_fwd (be_interface_fwd *) *os << "(strm << _tao_aggregate." << f->local_name () << ".in ())"; break; case TAO_CodeGen::TAO_CDR_SCOPE: - // nothing to be done because an interface cannit be declared inside a - // structure + // Nothing to be done because an interface cannit be declared inside a + // structure. break; default: - // error + // Error. ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_field_cdr_op_ci::" "visit_interface_fwd - " - "bad sub state\n" - ), -1); + "bad sub state\n"), + -1); } + return 0; } -// visit predefined type +// Visit predefined type. int be_visitor_field_cdr_op_ci::visit_predefined_type (be_predefined_type *node) { - TAO_OutStream *os; // output stream - os = this->ctx_->stream (); + TAO_OutStream *os = this->ctx_->stream (); - // retrieve the field node + // Retrieve the field node. be_field *f = this->ctx_->be_node_as_field (); - if (!f) + + if (f == 0) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_field_cdr_op_ci::" "visit_predefined_type - " - "cannot retrieve field node\n" - ), -1); + "cannot retrieve field node\n"), + -1); } - // check what is the code generations substate. Are we generating code for + // Check what is the code generations substate. Are we generating code for // the in/out operators for our parent or for us? switch (this->ctx_->sub_state ()) { case TAO_CodeGen::TAO_CDR_INPUT: - // is a psuedo obj + // Is a psuedo object. if (node->pt () == AST_PredefinedType::PT_pseudo) - *os << "(strm >> _tao_aggregate." << f->local_name () - << ".out ())"; + { + *os << "(strm >> _tao_aggregate." << f->local_name () + << ".out ())"; + } else if (node->pt () == AST_PredefinedType::PT_char) - *os << "(strm >> CORBA::Any::to_char (_tao_aggregate." - << f->local_name () << "))"; + { + *os << "(strm >> CORBA::Any::to_char (_tao_aggregate." + << f->local_name () << "))"; + } else if (node->pt () == AST_PredefinedType::PT_wchar) - *os << "(strm >> CORBA::Any::to_wchar (_tao_aggregate." - << f->local_name () << "))"; + { + *os << "(strm >> CORBA::Any::to_wchar (_tao_aggregate." + << f->local_name () << "))"; + } else if (node->pt () == AST_PredefinedType::PT_octet) - *os << "(strm >> CORBA::Any::to_octet (_tao_aggregate." - << f->local_name () << "))"; + { + *os << "(strm >> CORBA::Any::to_octet (_tao_aggregate." + << f->local_name () << "))"; + } else if (node->pt () == AST_PredefinedType::PT_boolean) - *os << "(strm >> CORBA::Any::to_boolean (_tao_aggregate." - << f->local_name () << "))"; + { + *os << "(strm >> CORBA::Any::to_boolean (_tao_aggregate." + << f->local_name () << "))"; + } else - *os << "(strm >> _tao_aggregate." << f->local_name () << ")"; + { + *os << "(strm >> _tao_aggregate." << f->local_name () << ")"; + } break; case TAO_CodeGen::TAO_CDR_OUTPUT: - // is a psuedo obj + // Is a psuedo object. if (node->pt () == AST_PredefinedType::PT_pseudo) - *os << "(strm << _tao_aggregate." << f->local_name () << ".in ())"; + { + *os << "(strm << _tao_aggregate." << f->local_name () << ".in ())"; + } else if (node->pt () == AST_PredefinedType::PT_char) - *os << "(strm << CORBA::Any::from_char (_tao_aggregate." - << f->local_name () << "))"; + { + *os << "(strm << CORBA::Any::from_char (_tao_aggregate." + << f->local_name () << "))"; + } else if (node->pt () == AST_PredefinedType::PT_wchar) - *os << "(strm << CORBA::Any::from_wchar (_tao_aggregate." - << f->local_name () << "))"; + { + *os << "(strm << CORBA::Any::from_wchar (_tao_aggregate." + << f->local_name () << "))"; + } else if (node->pt () == AST_PredefinedType::PT_octet) - *os << "(strm << CORBA::Any::from_octet (_tao_aggregate." - << f->local_name () << "))"; + { + *os << "(strm << CORBA::Any::from_octet (_tao_aggregate." + << f->local_name () << "))"; + } else if (node->pt () == AST_PredefinedType::PT_boolean) - *os << "(strm << CORBA::Any::from_boolean (_tao_aggregate." - << f->local_name () << "))"; + { + *os << "(strm << CORBA::Any::from_boolean (_tao_aggregate." + << f->local_name () << "))"; + } else - *os << "(strm << _tao_aggregate." << f->local_name () << ")"; + { + *os << "(strm << _tao_aggregate." << f->local_name () << ")"; + } break; case TAO_CodeGen::TAO_CDR_SCOPE: - // nothing to be done + // Nothing to be done. break; default: - // error + // Error. ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_field_cdr_op_ci::" "visit_array - " - "bad sub state\n" - ), -1); + "bad sub state\n"), + -1); } return 0; } +// Visit sequence type. int be_visitor_field_cdr_op_ci::visit_sequence (be_sequence *node) { - TAO_OutStream *os; // output stream - os = this->ctx_->stream (); + TAO_OutStream *os = this->ctx_->stream (); - // retrieve the field node + // Retrieve the field node. be_field *f = this->ctx_->be_node_as_field (); - if (!f) + + if (f == 0) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_field_cdr_op_ci::" "visit_sequence - " - "cannot retrieve field node\n" - ), -1); + "cannot retrieve field node\n"), + -1); } - // check what is the code generations substate. Are we generating code for + // Check what is the code generations substate. Are we generating code for // the in/out operators for our parent or for us? switch (this->ctx_->sub_state ()) { @@ -445,30 +493,32 @@ be_visitor_field_cdr_op_ci::visit_sequence (be_sequence *node) *os << "(strm << _tao_aggregate." << f->local_name () << ")"; return 0; case TAO_CodeGen::TAO_CDR_SCOPE: - // proceed further + // Proceed further. break; default: - // error + // Error. ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_field_cdr_op_ci::" "visit_sequence - " - "bad sub state\n" - ), -1); + "bad sub state\n"), + -1); } if (node->node_type () != AST_Decl::NT_typedef && node->is_child (this->ctx_->scope ())) - // not a typedef AND - // node is defined inside the structure + // Not a typedef AND + // node is defined inside the structure. { - // Anonymous sequence - // instantiate a visitor context with a copy of our context. This info - // will be modified based on what type of node we are visiting + // Anonymous sequence. + // Instantiate a visitor context with a copy of our context. This info + // will be modified based on what type of node we are visiting. be_visitor_context ctx (*this->ctx_); - ctx.node (node); // set the node to be the node being visited. The scope is - // still the same - // generate the inline code for structs + // Set the node to be the node being visited. The scope is + // still the same. + ctx.node (node); + + // Generate the inline code for structs. ctx.state (TAO_CodeGen::TAO_SEQUENCE_CDR_OP_CI); be_visitor *visitor = tao_cg->make_visitor (&ctx); if (!visitor) @@ -476,38 +526,41 @@ be_visitor_field_cdr_op_ci::visit_sequence (be_sequence *node) ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_field_cdr_op_ci::" "visit_sequence - " - "Bad visitor\n" - ), -1); + "Bad visitor\n"), + -1); } + if (node->accept (visitor) == -1) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_field_cdr_op_ci::" "visit_sequence - " - "codegen failed\n" - ), -1); + "codegen failed\n"), + -1); } + delete visitor; } + return 0; } -// visit string type +// Visit string type. int be_visitor_field_cdr_op_ci::visit_string (be_string *) { - TAO_OutStream *os; // output stream - os = this->ctx_->stream (); + TAO_OutStream *os = this->ctx_->stream (); - // retrieve the field node + // Retrieve the field node. be_field *f = this->ctx_->be_node_as_field (); - if (!f) + + if (f == 0) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_field_cdr_op_ci::" "visit_string - " - "cannot retrieve field node\n" - ), -1); + "cannot retrieve field node\n"), + -1); } // check what is the code generation's substate. Are we generating code for @@ -521,39 +574,39 @@ be_visitor_field_cdr_op_ci::visit_string (be_string *) *os << "(strm << _tao_aggregate." << f->local_name () << ".in ())"; break; case TAO_CodeGen::TAO_CDR_SCOPE: - // nothing to be done + // Nothing to be done. break; default: - // error + // Error. ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_field_cdr_op_ci::" "visit_array - " - "bad substate\n" - ), -1); + "bad substate\n"), + -1); } return 0; } -// visit structure type +// Visit structure type. int be_visitor_field_cdr_op_ci::visit_structure (be_structure *node) { - TAO_OutStream *os; // output stream - os = this->ctx_->stream (); + TAO_OutStream *os = this->ctx_->stream (); - // retrieve the field node + // retrieve the field node. be_field *f = this->ctx_->be_node_as_field (); - if (!f) + + if (f == 0) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_field_cdr_op_ci::" "visit_structure - " - "cannot retrieve field node\n" - ), -1); + "cannot retrieve field node\n"), + -1); } - // check what is the code generations substate. Are we generating code for + // Check what is the code generations substate. Are we generating code for // the in/out operators for our parent or for us? switch (this->ctx_->sub_state ()) { @@ -564,92 +617,101 @@ be_visitor_field_cdr_op_ci::visit_structure (be_structure *node) *os << "(strm << _tao_aggregate." << f->local_name () << ")"; return 0; case TAO_CodeGen::TAO_CDR_SCOPE: - // proceed further + // Proceed further. break; default: - // error + // Error. ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_field_cdr_op_ci::" "visit_structure - " - "bad sub state\n" - ), -1); + "bad sub state\n"), + -1); } - if (node->node_type () != AST_Decl::NT_typedef // not a typedef - && node->is_child (this->ctx_->scope ())) // node is defined inside the - // structure + if (node->node_type () != AST_Decl::NT_typedef // Not a typedef. + && node->is_child (this->ctx_->scope ())) // Node is defined inside + // the structure. { - // instantiate a visitor context with a copy of our context. This info - // will be modified based on what type of node we are visiting + // Instantiate a visitor context with a copy of our context. This info + // will be modified based on what type of node we are visiting. be_visitor_context ctx (*this->ctx_); - ctx.node (node); // set the node to be the node being visited. The scope is - // still the same - // generate the inline code for structs + + // Set the node to be the node being visited. The scope is + // still the same. + ctx.node (node); + + // Generate the inline code for structs. ctx.state (TAO_CodeGen::TAO_STRUCT_CDR_OP_CI); be_visitor *visitor = tao_cg->make_visitor (&ctx); - if (!visitor) + + if (visitor == 0) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_field_cdr_op_ci::" "visit_struct - " - "Bad visitor\n" - ), -1); + "Bad visitor\n"), + -1); } + if (node->accept (visitor) == -1) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_field_cdr_op_ci::" "visit_struct - " - "codegen failed\n" - ), -1); + "codegen failed\n"), + -1); } + delete visitor; } + return 0; } -// visit typedef type +// Visit typedef type. int be_visitor_field_cdr_op_ci::visit_typedef (be_typedef *node) { - this->ctx_->alias (node); // save the typedef node for use in code generation - // as we visit the base type + // Save the typedef node for use in code generation + // as we visit the base type. + this->ctx_->alias (node); - // the node to be visited in the base primitve type that gets typedefed + // The node to be visited in the base primitve type that gets typedefed. be_type *bt = node->primitive_base_type (); - if (!bt || (bt->accept (this) == -1)) + + if (bt == 0 || bt->accept (this) == -1) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_field_cdr_op_ci::" "visit_typedef - " - "Bad primitive type\n" - ), -1); + "Bad primitive type\n"), + -1); } this->ctx_->alias (0); return 0; } -// visit union type +// Visit union type. int be_visitor_field_cdr_op_ci::visit_union (be_union *node) { - TAO_OutStream *os; // output stream - os = this->ctx_->stream (); + TAO_OutStream *os = this->ctx_->stream (); - // retrieve the field node + // Retrieve the field node. be_field *f = this->ctx_->be_node_as_field (); - if (!f) + + if (f == 0) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_field_cdr_op_ci::" "visit_union - " - "cannot retrieve field node\n" - ), -1); + "cannot retrieve field node\n"), + -1); } - // check what is the code generations substate. Are we generating code for + // Check what is the code generations substate. Are we generating code for // the in/out operators for our parent or for us? switch (this->ctx_->sub_state ()) { @@ -660,55 +722,63 @@ be_visitor_field_cdr_op_ci::visit_union (be_union *node) *os << "(strm << _tao_aggregate." << f->local_name () << ")"; return 0; case TAO_CodeGen::TAO_CDR_SCOPE: - // proceed further + // Proceed further. break; default: - // error + // Error. ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_field_cdr_op_ci::" "visit_union - " - "bad sub state\n" - ), -1); + "bad sub state\n"), + -1); } - if (node->node_type () != AST_Decl::NT_typedef // not a typedef - && node->is_child (this->ctx_->scope ())) // node is defined inside the - // structure + if (node->node_type () != AST_Decl::NT_typedef // Not a typedef. + && node->is_child (this->ctx_->scope ())) // Node is defined inside the + // the structure. { - // instantiate a visitor context with a copy of our context. This info - // will be modified based on what type of node we are visiting + // Instantiate a visitor context with a copy of our context. This info + // will be modified based on what type of node we are visiting. be_visitor_context ctx (*this->ctx_); - ctx.node (node); // set the node to be the node being visited. The scope is - // still the same - // generate the inline code for union + + // Set the node to be the node being visited. The scope is + // still the same. + ctx.node (node); + + // Generate the inline code for union. ctx.state (TAO_CodeGen::TAO_UNION_CDR_OP_CI); be_visitor *visitor = tao_cg->make_visitor (&ctx); - if (!visitor) + + if (visitor == 0) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_field_cdr_op_ci::" "visit_union - " - "Bad visitor\n" - ), -1); + "Bad visitor\n"), + -1); } + if (node->accept (visitor) == -1) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_field_cdr_op_ci::" "visit_union - " - "codegen failed\n" - ), -1); + "codegen failed\n"), + -1); } + delete visitor; } + return 0; } // **************************************************************** -be_visitor_cdr_op_field_decl:: - be_visitor_cdr_op_field_decl (be_visitor_context *ctx) +be_visitor_cdr_op_field_decl::be_visitor_cdr_op_field_decl ( + be_visitor_context *ctx + ) : be_visitor_scope (ctx) { } @@ -725,77 +795,87 @@ int be_visitor_cdr_op_field_decl::visit_field (be_field *node) { be_type *bt = be_type::narrow_from_decl (node->field_type ()); - if (!bt) + + if (bt == 0) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_cdr_op_field_decl::" "visit_field - " - "Bad field type\n" - ), -1); + "Bad field type\n"), + -1); } // @@ Shouldn't this be saved in the visitor and not the context?! - this->ctx_->node (node); // save the node + this->ctx_->node (node); + if (bt->accept (this) == -1) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_cdr_op_field_decl::" "visit_field - " - "codegen for field type failed\n" - ), -1); + "codegen for field type failed\n"), + -1); } + return 0; } -// visit array +// Visit array int be_visitor_cdr_op_field_decl::visit_array (be_array *node) { - TAO_OutStream *os; // output stream - os = this->ctx_->stream (); + TAO_OutStream *os = this->ctx_->stream (); - // retrieve the field node + // Retrieve the field node. be_field *f = this->ctx_->be_node_as_field (); - if (!f) + + if (f == 0) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_cdr_op_field_decl::" "visit_array - " - "cannot retrieve field node\n" - ), -1); + "cannot retrieve field node\n"), + -1); } - // for anonymous arrays, the type name has a _ prepended. We compute + // For anonymous arrays, the type name has a _ prepended. We compute // the full_name with or without the underscore and use it later on. - char fname [NAMEBUFSIZE]; // to hold the full and + char fname [NAMEBUFSIZE]; ACE_OS::memset (fname, '\0', NAMEBUFSIZE); - if (!this->ctx_->alias () // not a typedef + + if (this->ctx_->alias () == 0 // Not a typedef. && node->is_child (this->ctx_->scope ())) { - // for anonymous arrays ... + // For anonymous arrays, // we have to generate a name for us that has an underscope // prepended to our local name. This needs to be inserted after - // the parents's name + // the parents's name. if (node->is_nested ()) { be_decl *parent = be_scope::narrow_from_scope (node->defined_in ())->decl (); - ACE_OS::sprintf (fname, "%s::_%s", parent->full_name (), + ACE_OS::sprintf (fname, + "%s::_%s", + parent->full_name (), node->local_name ()->get_string ()); } else { - ACE_OS::sprintf (fname, "_%s", node->full_name ()); + ACE_OS::sprintf (fname, + "_%s", + node->full_name ()); } } else { - // typedefed node - ACE_OS::sprintf (fname, "%s", node->full_name ()); + // Typedefed node. + ACE_OS::sprintf (fname, + "%s", + node->full_name ()); } - // check what is the code generation substate. Are we generating code for + // Check what is the code generation substate. Are we generating code for // the in/out operators for our parent or for us? switch (this->ctx_->sub_state ()) { @@ -808,36 +888,38 @@ be_visitor_cdr_op_field_decl::visit_array (be_array *node) << "_tao_aggregate." << f->local_name () << be_uidt_nl << ")" << be_uidt << be_uidt_nl << ");" << be_uidt_nl; - return 0; + break; case TAO_CodeGen::TAO_CDR_SCOPE: default: - // error + // Error. ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_cdr_op_field_decl::" "visit_array - " - "bad sub state\n" - ), -1); + "bad sub state\n"), + -1); } - ACE_NOTREACHED (return 0); + + return 0; } -// visit typedef type +// Visit typedef type. int be_visitor_cdr_op_field_decl::visit_typedef (be_typedef *node) { - this->ctx_->alias (node); // save the typedef node for use in code generation - // as we visit the base type + this->ctx_->alias (node); // Save the typedef node for use in code + // generation as we visit the base type. - // the node to be visited in the base primitve type that gets typedefed + // The node to be visited in the base primitve type that gets typedefed. be_type *bt = node->primitive_base_type (); - if (!bt || (bt->accept (this) == -1)) + + if (bt == 0 || bt->accept (this) == -1) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_cdr_op_field_decl::" "visit_typedef - " - "Bad primitive type\n" - ), -1); + "Bad primitive type\n"), + -1); } this->ctx_->alias (0); diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_sh.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_sh.cpp index e576b1897d9..6b6248d5d79 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interface_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_sh.cpp @@ -121,7 +121,7 @@ be_visitor_interface_sh::visit_interface (be_interface *node) // add a skeleton for our _is_a method *os << "static void _is_a_skel (" << be_idt << be_idt_nl - << "CORBA::ServerRequest &req," << be_nl + << "TAO_ServerRequest &req," << be_nl << "void *obj," << be_nl << "void *context," << be_nl << "CORBA::Environment &ACE_TRY_ENV = " << be_idt_nl @@ -131,7 +131,7 @@ be_visitor_interface_sh::visit_interface (be_interface *node) // add a skeleton for our _non_existent method *os << "static void _non_existent_skel (" << be_idt << be_idt_nl - << "CORBA::ServerRequest &req," << be_nl + << "TAO_ServerRequest &req," << be_nl << "void *obj," << be_nl << "void *context," << be_nl << "CORBA::Environment &ACE_TRY_ENV = " << be_idt_nl @@ -141,7 +141,7 @@ be_visitor_interface_sh::visit_interface (be_interface *node) // add the dispatch method *os << "virtual void _dispatch (" << be_idt << be_idt_nl - << "CORBA::ServerRequest &_tao_req," << be_nl + << "TAO_ServerRequest &_tao_req," << be_nl << "void *_tao_context," << be_nl << "CORBA::Environment &ACE_TRY_ENV = " << be_idt_nl << "TAO_default_environment ()" diff --git a/TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp b/TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp index a0064b29148..a4d67baf434 100644 --- a/TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_interface/interface_ss.cpp @@ -224,7 +224,7 @@ be_visitor_interface_ss::visit_interface (be_interface *node) os->indent (); *os << "void " << node->full_skel_name () << "::_is_a_skel (" << be_idt << be_idt_nl - << "CORBA::ServerRequest &_tao_server_request, " << be_nl + << "TAO_ServerRequest &_tao_server_request, " << be_nl << "void * _tao_object_reference," << be_nl << "void * /* context */," << be_nl << "CORBA::Environment &ACE_TRY_ENV" << be_uidt_nl @@ -256,7 +256,7 @@ be_visitor_interface_ss::visit_interface (be_interface *node) // generate code for the _non_existent skeleton *os << "void " << node->full_skel_name () << "::_non_existent_skel (" << be_idt << be_idt_nl - << "CORBA::ServerRequest &_tao_server_request, " << be_nl + << "TAO_ServerRequest &_tao_server_request, " << be_nl << "void * _tao_object_reference," << be_nl << "void * /* context */," << be_nl << "CORBA::Environment &ACE_TRY_ENV" << be_uidt_nl @@ -329,7 +329,7 @@ be_visitor_interface_ss::visit_interface (be_interface *node) // now the dispatch method *os << "void " << node->full_skel_name () << - "::_dispatch (CORBA::ServerRequest &req, " << + "::_dispatch (TAO_ServerRequest &req, " << "void *context, CORBA::Environment &ACE_TRY_ENV)" << be_nl; *os << "{" << be_idt_nl; //BRT diff --git a/TAO/TAO_IDL/be/be_visitor_operation/operation_sh.cpp b/TAO/TAO_IDL/be/be_visitor_operation/operation_sh.cpp index 73711d54d2f..d1c05d7d594 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/operation_sh.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/operation_sh.cpp @@ -135,7 +135,7 @@ be_visitor_operation_sh::visit_operation (be_operation *node) } *os << node->local_name () << "_skel (" << be_idt << be_idt_nl - << "CORBA::ServerRequest &_tao_req, " << be_nl + << "TAO_ServerRequest &_tao_req, " << be_nl << "void *_tao_obj, " << be_nl << "void *_tao_context, " << be_nl << "CORBA::Environment &ACE_TRY_ENV = " << be_idt_nl diff --git a/TAO/TAO_IDL/be/be_visitor_operation/operation_ss.cpp b/TAO/TAO_IDL/be/be_visitor_operation/operation_ss.cpp index 5c9b74a8015..a8531a383fc 100644 --- a/TAO/TAO_IDL/be/be_visitor_operation/operation_ss.cpp +++ b/TAO/TAO_IDL/be/be_visitor_operation/operation_ss.cpp @@ -122,7 +122,7 @@ be_visitor_operation_ss::visit_operation (be_operation *node) } *os << node->local_name () << "_skel (" << be_idt << be_idt_nl - << "CORBA::ServerRequest &_tao_server_request," << be_nl + << "TAO_ServerRequest &_tao_server_request," << be_nl << "void *_tao_object_reference, " << be_nl << "void * /* context */, " << be_nl << "CORBA::Environment &ACE_TRY_ENV" << be_uidt_nl diff --git a/TAO/TAO_IDL/be/be_visitor_scope.cpp b/TAO/TAO_IDL/be/be_visitor_scope.cpp index e0b68c22751..5c3c00d2a15 100644 --- a/TAO/TAO_IDL/be/be_visitor_scope.cpp +++ b/TAO/TAO_IDL/be/be_visitor_scope.cpp @@ -19,10 +19,9 @@ // // ============================================================================ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - +#include "idl.h" +#include "idl_extern.h" +#include "be.h" #include "be_visitor_scope.h" ACE_RCSID(be, be_visitor_scope, "$Id$") @@ -31,7 +30,7 @@ ACE_RCSID(be, be_visitor_scope, "$Id$") // ****************************************************** // Generic visitor for a scope. // All elements that give rise to a scope inherit from -// this class +// this class. // ****************************************************** be_visitor_scope::be_visitor_scope (be_visitor_context *ctx) @@ -44,41 +43,45 @@ be_visitor_scope::~be_visitor_scope (void) { } -// visit the scope and its elements +// Visit the scope and its elements. int be_visitor_scope::visit_scope (be_scope *node) { - // proceed if the number of members in our scope is greater than 0 + // Proceed if the number of members in our scope is greater than 0. if (node->nmembers () > 0) { - // initialize an iterator to iterate thru our scope + // Initialize an iterator to iterate over our scope. UTL_ScopeActiveIterator *si; ACE_NEW_RETURN (si, UTL_ScopeActiveIterator (node, UTL_Scope::IK_decls), -1); + this->elem_number_ = 0; - // continue until each element is visited + + // Continue until each element is visited. while (!si->is_done ()) { AST_Decl *d = si->item (); - if (!d) + + if (d == 0) { delete si; ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_scope::visit_scope - " - "bad node in this scope\n"), -1); + "bad node in this scope\n"), + -1); } be_decl *bd = be_decl::narrow_from_decl (d); - // set the scope node as "node" in which the code is being + // Set the scope node as "node" in which the code is being // generated so that elements in the node's scope can use it - // for code generation + // for code generation. this->ctx_->scope (node->decl ()); - // set the node to be visited + // Set the node to be visited. this->ctx_->node (bd); this->elem_number_++; @@ -88,16 +91,18 @@ be_visitor_scope::visit_scope (be_scope *node) delete si; ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_scope::visit_scope - " - "pre processing failed\n"), -1); + "pre processing failed\n"), + -1); } // Send the visitor. - if (bd == 0 || bd->accept (this) == -1) + if (bd == 0 || bd->accept (this) == -1) { delete si; ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_scope::visit_scope - " - "codegen for scope failed\n"), -1); + "codegen for scope failed\n"), + -1); } @@ -107,12 +112,15 @@ be_visitor_scope::visit_scope (be_scope *node) delete si; ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_scope::visit_scope - " - "post processing failed\n"), -1); + "post processing failed\n"), + -1); } + si->next (); - } // end of while loop + } // End of while loop. + delete si; - } // end of if + } // End of if. return 0; } @@ -132,11 +140,11 @@ be_visitor_scope::pre_process (be_decl *) int be_visitor_scope::elem_number (void) { - // return the current element that we are working on + // Return the current element that we are working on. return this->elem_number_; } -// find the element that succeeds "elem" in the list +// Find the element that succeeds "elem" in the list. int be_visitor_scope::next_elem (be_decl *elem, be_decl *&successor) @@ -144,71 +152,85 @@ be_visitor_scope::next_elem (be_decl *elem, be_decl *ctx_scope = this->ctx_->scope (); be_scope *node = 0; - if (ctx_scope) + if (ctx_scope != 0) { node = ctx_scope->scope (); } - if (!ctx_scope || !node) + if (ctx_scope == 0 || node == 0) { ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_scope::next_elem - " - "bad scope\n"), -1); + "bad scope\n"), + -1); } successor = 0; - // proceed if the number of members in our scope is greater than 0 + + // Proceed if the number of members in our scope is greater than 0. if (node->nmembers () > 0) { - // initialize an iterator to iterate thru our scope + // Initialize an iterator to iterate thru our scope. UTL_ScopeActiveIterator *si; ACE_NEW_RETURN (si, UTL_ScopeActiveIterator (node, UTL_Scope::IK_decls), -1); - // continue until each element is visited + + // Continue until each element is visited. while (!si->is_done ()) { be_decl *bd = be_decl::narrow_from_decl (si->item ()); - if (!bd) + + if (bd == 0) { delete si; ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_scope::next_elem - " - "bad node in this scope\n"), -1); + "bad node in this scope\n"), + -1); } if (bd == elem) { - // find who is next to me + // Find who is next to me. si->next (); + if (si->is_done ()) { - // nobody left in the list + // Nobody left in the list. delete si; return 0; } + successor = be_decl::narrow_from_decl (si->item ()); - if (!successor) + + if (successor == 0) { delete si; ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_visitor_scope::next_elem - " - "bad node in this scope\n"), -1); + "bad node in this scope\n"), + -1); } - // nothing else to do + + // Nothing else to do. delete si; return 0; } else - // proceed to the next element - si->next (); - } // end of while loop + { + // Proceed to the next element. + si->next (); + } + } // End of while loop. + delete si; - } // end of if + } // End of if. + return 0; } @@ -216,37 +238,46 @@ idl_bool be_visitor_scope::last_node (be_decl *bd) { be_decl *next = 0; - (void) this->next_elem (bd, next); - if (next) - // not the last - return 0; + (void) this->next_elem (bd, + next); - // I am the last one + if (next != 0) + { + // Not the last. + return 0; + } + + // I am the last one. return 1; } idl_bool be_visitor_scope::last_inout_or_out_node (be_decl *) { - // Return true if we are the last inout or out argument + // Return true if we are the last inout or out argument. be_decl *next = 0; - this->next_elem (this->ctx_->node (), - next); - while (next) + (void) this->next_elem (this->ctx_->node (), + next); + + while (next != 0) { be_argument *arg = be_argument::narrow_from_decl (next); if (arg->direction () == AST_Argument::dir_INOUT || arg->direction () == AST_Argument::dir_OUT) - // not the last + { + // Not the last. return 0; + } be_decl *next_next = 0; - this->next_elem (next, next_next); + this->next_elem (next, + next_next); next = next_next; } - // I am the last one + + // I am the last one. return 1; } diff --git a/TAO/TAO_IDL/include/ast_interface_fwd.h b/TAO/TAO_IDL/include/ast_interface_fwd.h index 25711ec2973..1facd86c72b 100644 --- a/TAO/TAO_IDL/include/ast_interface_fwd.h +++ b/TAO/TAO_IDL/include/ast_interface_fwd.h @@ -62,53 +62,50 @@ NOTE: SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are trademarks or registered trademarks of Sun Microsystems, Inc. - */ +*/ #ifndef _AST_INTERFACE_FWD_AST_INTERFACE_FWD_HH #define _AST_INTERFACE_FWD_AST_INTERFACE_FWD_HH -// Representation of a forward interface declaration - -/* -** DEPENDENCIES: ast_decl.hh, ast_interface.hh, utl_scoped_name.hh, -** utl_strlist.hh -** -** USE: Included from ast.hh -*/ +// Representation of a forward interface declaration. class TAO_IDL_FE_Export AST_InterfaceFwd : public virtual AST_Type { public: - // Operations + // Operations. + + // Constructor(s). + AST_InterfaceFwd (void); - // Constructor(s) - AST_InterfaceFwd (); AST_InterfaceFwd (AST_Interface *dummy, UTL_ScopedName *n, UTL_StrList *p); + // Destructor. virtual ~AST_InterfaceFwd (void); - // Data Accessors - AST_Interface *full_definition(); - void set_full_definition(AST_Interface *nfd); + // Data Accessors. + AST_Interface *full_definition (void); + + void set_full_definition (AST_Interface *nfd); - virtual idl_bool is_local (); - virtual idl_bool is_valuetype (); - virtual idl_bool is_abstract_valuetype (); - virtual void set_abstract_valuetype (); + virtual idl_bool is_local (void); + virtual idl_bool is_valuetype (void); + virtual idl_bool is_abstract_valuetype (void); + virtual void set_abstract_valuetype (void); - // Narrowing + // Narrowing. DEF_NARROW_METHODS1(AST_InterfaceFwd, AST_Type); DEF_NARROW_FROM_DECL(AST_InterfaceFwd); - // AST Dumping - virtual void dump(ostream &); + // AST Dumping. + virtual void dump(ostream &); private: - // Data - AST_Interface *pd_full_definition; // The interface this is a - // forward declaration of + // Data. + + AST_Interface *pd_full_definition; + // The interface this is a forward declaration of }; #endif // _AST_INTERFACE_FWD_AST_INTERFACE_FWD_HH diff --git a/TAO/TAO_IDL/include/ast_module.h b/TAO/TAO_IDL/include/ast_module.h index 24922866297..7b8959b053c 100644 --- a/TAO/TAO_IDL/include/ast_module.h +++ b/TAO/TAO_IDL/include/ast_module.h @@ -62,53 +62,48 @@ NOTE: SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are trademarks or registered trademarks of Sun Microsystems, Inc. - */ +*/ #ifndef _AST_MODULE_AST_MODULE_HH #define _AST_MODULE_AST_MODULE_HH -// Representation of module +// Representation of module. // // NOTE: add(AST_EnumValue *) is defined here because enums can // be defined manifest locally; the constants defined in these // enums are inserted in the enclosing scope. -/* -** DEPENDENCIES: ast_decl.hh, utl_scope.hh, utl_scoped_name.hh, utl_strlist.hh -** -** USE: Included from ast.hh -*/ - class TAO_IDL_FE_Export AST_Module : public virtual AST_Decl, public virtual UTL_Scope { public: - // Operations + // Operations. - // Constructor(s) - AST_Module (); + // Constructor(s) and destructor. + AST_Module (void); AST_Module (UTL_ScopedName *n, UTL_StrList *p); virtual ~AST_Module (void); - // Narrowing + // Narrowing. DEF_NARROW_METHODS2(AST_Module, AST_Decl, UTL_Scope); DEF_NARROW_FROM_DECL(AST_Module); DEF_NARROW_FROM_SCOPE(AST_Module); - // AST Dumping - virtual void dump(ostream &o); + // AST Dumping. + virtual void dump (ostream &o); - // involved in OBV_ namespace generation - void set_has_nested_valuetype (); - idl_bool has_nested_valuetype (); + // Involved in OBV_ namespace generation. + void set_has_nested_valuetype (void); + idl_bool has_nested_valuetype (void); // Allows adding an interface to a later point // The interface i is inserted after interface ix, if // ix is not null. - int be_add_interface (AST_Interface *i, AST_Interface *ix = 0); + int be_add_interface (AST_Interface *i, + AST_Interface *ix = 0); // The first time 'module CORBA' is seen, add predefined types // TypeCode, TCKind and ValueBase to its scope. @@ -127,24 +122,34 @@ public: virtual void destroy (void); private: - friend void fe_populate(AST_Module *m); - friend int tao_yyparse(); + friend void fe_populate (AST_Module *m); + friend int tao_yyparse (void); // Scope Management Protocol - virtual AST_PredefinedType *fe_add_predefined_type(AST_PredefinedType *t); - virtual AST_Module *fe_add_module(AST_Module *m); - // Add the current interface i before interface ix - virtual AST_Interface *fe_add_interface(AST_Interface *i); - virtual AST_InterfaceFwd *fe_add_interface_fwd(AST_InterfaceFwd *i); - virtual AST_Constant *fe_add_constant(AST_Constant *c); - virtual AST_Exception *fe_add_exception(AST_Exception *e); - virtual AST_Union *fe_add_union(AST_Union *u); - virtual AST_Structure *fe_add_structure(AST_Structure *s); - virtual AST_Enum *fe_add_enum(AST_Enum *e); - virtual AST_EnumVal *fe_add_enum_val(AST_EnumVal *v); - virtual AST_Typedef *fe_add_typedef(AST_Typedef *t); - virtual AST_Native *fe_add_native (AST_Native *n); + virtual AST_PredefinedType *fe_add_predefined_type (AST_PredefinedType *t); + + virtual AST_Module *fe_add_module (AST_Module *m); + + virtual AST_Interface *fe_add_interface (AST_Interface *i); + + virtual AST_InterfaceFwd *fe_add_interface_fwd (AST_InterfaceFwd *i); + + virtual AST_Constant *fe_add_constant (AST_Constant *c); + + virtual AST_Exception *fe_add_exception (AST_Exception *e); + + virtual AST_Union *fe_add_union (AST_Union *u); + + virtual AST_Structure *fe_add_structure (AST_Structure *s); + + virtual AST_Enum *fe_add_enum (AST_Enum *e); + + virtual AST_EnumVal *fe_add_enum_val (AST_EnumVal *v); + + virtual AST_Typedef *fe_add_typedef (AST_Typedef *t); + + virtual AST_Native *fe_add_native (AST_Native *n); idl_bool pd_has_nested_valuetype; diff --git a/TAO/TAO_IDL/include/ast_native.h b/TAO/TAO_IDL/include/ast_native.h index f1ae461def4..efd5d54f112 100644 --- a/TAO/TAO_IDL/include/ast_native.h +++ b/TAO/TAO_IDL/include/ast_native.h @@ -4,36 +4,31 @@ #ifndef _AST_NATIVE_H_ #define _AST_NATIVE_H_ -// Representation of "native" IDL type added by the POA spec -// -/* -** DEPENDENCIES: ast_decl.h -** -** USE: Included from ast.h -*/ +// Representation of "native" IDL type added by the POA spec. class TAO_IDL_FE_Export AST_Native : public virtual AST_Type { public: - // =Operations + // Operations. + + // Constructor(s). - // Constructor(s) AST_Native (void); - // default constructor + // Default constructor. AST_Native (UTL_ScopedName *n, UTL_StrList *p); - // constructor that initializes its scoped name + // Constructor that initializes the scoped name. virtual ~AST_Native (void); - // destructor + // Destructor. - // Narrowing + // Narrowing. DEF_NARROW_METHODS1(AST_Native, AST_Type); DEF_NARROW_FROM_DECL(AST_Native); - // AST Dumping - virtual void dump(ostream &o); + // AST Dumping. + virtual void dump(ostream &o); }; #endif /* AST_NATIVE_H */ diff --git a/TAO/TAO_IDL/include/ast_root.h b/TAO/TAO_IDL/include/ast_root.h index a4f3e485803..5376afa638c 100644 --- a/TAO/TAO_IDL/include/ast_root.h +++ b/TAO/TAO_IDL/include/ast_root.h @@ -62,49 +62,43 @@ NOTE: SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are trademarks or registered trademarks of Sun Microsystems, Inc. - */ +*/ #ifndef _AST_ROOT_AST_ROOT_HH #define _AST_ROOT_AST_ROOT_HH -// Representation of root of AST - -/* -** DEPENDENCIES: ast_module.hh, utl_scoped_name.hh, utl_strlist.hh -** -** USE: Included from ast.hh -*/ +// Representation of root of AST. class TAO_IDL_FE_Export AST_Root : public virtual AST_Module { public: - // Operations + // Operations. - // Constructor(s) - AST_Root (); + // Constructor(s) and destructor. + AST_Root (void); AST_Root (UTL_ScopedName *n, UTL_StrList *p); virtual ~AST_Root (void); - // Narrowing + // Narrowing. DEF_NARROW_METHODS1(AST_Root, AST_Module); DEF_NARROW_FROM_DECL(AST_Root); DEF_NARROW_FROM_SCOPE(AST_Root); - // AST Dumping - virtual void dump(ostream &o); + // AST Dumping. + virtual void dump (ostream &o); private: friend class FE_Declarator; - friend int tao_yyparse(); - // Add protocol + friend int tao_yyparse (void); - virtual AST_Sequence *fe_add_sequence(AST_Sequence *s); - virtual AST_String *fe_add_string(AST_String *s); - virtual AST_Array *fe_add_array(AST_Array *a); + // Add protocol. + virtual AST_Sequence *fe_add_sequence (AST_Sequence *s); + virtual AST_String *fe_add_string (AST_String *s); + virtual AST_Array *fe_add_array (AST_Array *a); }; #endif // _AST_ROOT_AST_ROOT_HH diff --git a/TAO/TAO_IDL/include/ast_string.h b/TAO/TAO_IDL/include/ast_string.h index d856c917244..4b7c475ee28 100644 --- a/TAO/TAO_IDL/include/ast_string.h +++ b/TAO/TAO_IDL/include/ast_string.h @@ -62,28 +62,21 @@ NOTE: SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are trademarks or registered trademarks of Sun Microsystems, Inc. - */ +*/ #ifndef _AST_STRING_AST_STRING_HH #define _AST_STRING_AST_STRING_HH -// Representation of string declaration -// -// A string type is represented by a maximum size - -/* -** DEPENDENCIES: ast_concrete_type.hh, ast_decl.hh, ast_expression.hh -** -** USE: Included from ast.hh -*/ +// Representation of string declaration. +// A string type is represented by a maximum size. class TAO_IDL_FE_Export AST_String : public virtual AST_ConcreteType { public: - // Operations + // Operations. - // Constructor(s) - AST_String (); + // Constructor(s) and destructor + AST_String (void); AST_String (AST_Expression *max_size); @@ -92,21 +85,25 @@ public: virtual ~AST_String (void); - // Data Accessors - AST_Expression *max_size(); - long width(); + // Data Accessors. + AST_Expression *max_size (void); + long width (void); - // Narrowing + // Narrowing. DEF_NARROW_METHODS1(AST_String, AST_ConcreteType); DEF_NARROW_FROM_DECL(AST_String); - // AST Dumping - virtual void dump(ostream &o); + // AST Dumping. + virtual void dump (ostream &o); private: - // Data - AST_Expression *pd_max_size; // String maximum size - long pd_width; // Width of string + // Data. + + AST_Expression *pd_max_size; + // String maximum size. + + long pd_width; + // Width of string. }; #endif // _AST_STRING_AST_STRING_HH diff --git a/TAO/TAO_IDL/include/ast_typedef.h b/TAO/TAO_IDL/include/ast_typedef.h index 1d38ab40695..ef3d6d396ce 100644 --- a/TAO/TAO_IDL/include/ast_typedef.h +++ b/TAO/TAO_IDL/include/ast_typedef.h @@ -62,28 +62,21 @@ NOTE: SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are trademarks or registered trademarks of Sun Microsystems, Inc. - */ +*/ #ifndef _AST_TYPEDEF_AST_TYPEDEF_HH #define _AST_TYPEDEF_AST_TYPEDEF_HH -// Representation of typedef declaration -// -// A typedef declaration is a renaming of a base type - -/* -** DEPENDENCIES: ast_decl.hh, ast_type.hh, utl_scoped_name.hh, utl_strlist.hh -** -** USE: Included from ast.hh -*/ +// Representation of typedef declaration. +// A typedef declaration is a renaming of a base type. class TAO_IDL_FE_Export AST_Typedef : public virtual AST_Type { public: - // Operations + // Operations. - // Constructor(s) - AST_Typedef (); + // Constructor(s) and destructor. + AST_Typedef (void); AST_Typedef (AST_Type *base_type, UTL_ScopedName *n, @@ -93,19 +86,21 @@ public: virtual ~AST_Typedef (void); - // Data Accessors - AST_Type *base_type(); + // Data Accessors. + AST_Type *base_type (void); - // Narrowing + // Narrowing. DEF_NARROW_METHODS1(AST_Typedef, AST_Type); DEF_NARROW_FROM_DECL(AST_Typedef); - // AST Dumping - virtual void dump(ostream &o); + // AST Dumping. + virtual void dump (ostream &o); private: - // Data - AST_Type *pd_base_type; // typedef base type + // Data. + + AST_Type *pd_base_type; + // Typedef base type. }; #endif // _AST_TYPEDEF_AST_TYPEDEF_HH diff --git a/TAO/TAO_IDL/include/ast_union_branch.h b/TAO/TAO_IDL/include/ast_union_branch.h index 4b56763b1af..46956cd97c8 100644 --- a/TAO/TAO_IDL/include/ast_union_branch.h +++ b/TAO/TAO_IDL/include/ast_union_branch.h @@ -62,29 +62,21 @@ NOTE: SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are trademarks or registered trademarks of Sun Microsystems, Inc. - */ +*/ #ifndef _AST_UNION_BRANCH_AST_UNION_BRAN_HH #define _AST_UNION_BRANCH_AST_UNION_BRAN_HH -// Representation of union branch declaration: -// -// A branch of a union is a field with a label - -/* -** DEPEndencies: ast_field.hh, ast_union_label.hh, ast_type.hh, -** utl_scoped_name.hh, utl_strlist.h, ast_decl.h -** -** USE: Included from ast.hh -*/ +// Representation of union branch declaration. +// A branch of a union is a field with a label. class TAO_IDL_FE_Export AST_UnionBranch : public virtual AST_Field { public: - // Operations + // Operations. - // Constructor(s) - AST_UnionBranch (); + // Constructor(s) and destructor. + AST_UnionBranch (void); AST_UnionBranch (UTL_LabelList *ll, AST_Type *ft, @@ -93,22 +85,23 @@ public: virtual ~AST_UnionBranch (void); - // Data Accessors + // Data Accessors. AST_UnionLabel *label (unsigned long index = 0); unsigned long label_list_length (void); - // Narrowing + // Narrowing. DEF_NARROW_METHODS1(AST_UnionBranch, AST_Field); DEF_NARROW_FROM_DECL(AST_UnionBranch); - // AST Dumping - virtual void dump(ostream &o); + // AST Dumping. + virtual void dump (ostream &o); private: - // Data - UTL_LabelList *pd_ll; // list of labels + // Data. + UTL_LabelList *pd_ll; + // list of labels. }; #endif // _AST_UNION_BRANCH_AST_UNION_BRAN_HH diff --git a/TAO/TAO_IDL/include/ast_union_label.h b/TAO/TAO_IDL/include/ast_union_label.h index 84fa692aa93..21971c596a5 100644 --- a/TAO/TAO_IDL/include/ast_union_label.h +++ b/TAO/TAO_IDL/include/ast_union_label.h @@ -62,52 +62,49 @@ NOTE: SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are trademarks or registered trademarks of Sun Microsystems, Inc. - */ +*/ #ifndef _AST_UNION_LABEL_AST_UNION_LABEL_HH #define _AST_UNION_LABEL_AST_UNION_LABEL_HH -// AST_UnionLabel.h -// -// Defines labels for unions - -/* -** DEPENDENCIES: ast_expression.hh -** -** USE: included from ast.hh -*/ +// Defines labels for unions. class TAO_IDL_FE_Export AST_UnionLabel { public: - // Define kind of label - enum UnionLabel { - UL_default // Label is "default" - , UL_label // Regular label - }; + // Define kind of label. + enum UnionLabel + { + UL_default // Label is "default". + , UL_label // Regular label. + }; - // Operations + // Operations. - // Constructor(s) - AST_UnionLabel (); + // Constructor(s) and destructor. + AST_UnionLabel (void); AST_UnionLabel (UnionLabel lk, AST_Expression *lv); virtual ~AST_UnionLabel (void); - // Data Accessors - UnionLabel label_kind(); - AST_Expression *label_val(); + // Data Accessors. + UnionLabel label_kind (void); + + AST_Expression *label_val (void); - // AST Dumping - virtual void dump(ostream &o); + // AST Dumping. + virtual void dump (ostream &o); private: - // Data - UnionLabel pd_label_kind; // Label kind - AST_Expression *pd_label_val; // Label expression + // Data. + + UnionLabel pd_label_kind; + // Label kind. + AST_Expression *pd_label_val; + // Label expression. }; #endif // _AST_UNION_LABEL_AST_UNION_LABEL_HH |