diff options
author | gokhale <asgokhale@users.noreply.github.com> | 1997-10-21 03:19:17 +0000 |
---|---|---|
committer | gokhale <asgokhale@users.noreply.github.com> | 1997-10-21 03:19:17 +0000 |
commit | 45f5f0a509f8cde98a1f3497e8f47287f088b78a (patch) | |
tree | 8a4c67b9b7de9353e23b6b884b0c15d5e085d75e /TAO/TAO_IDL/be_include | |
parent | dc518b2e924a54cb1f6c82c7c8e83b4dd1dbc281 (diff) | |
download | ATCD-45f5f0a509f8cde98a1f3497e8f47287f088b78a.tar.gz |
Lot of modifications to get the compiler going.
Diffstat (limited to 'TAO/TAO_IDL/be_include')
-rw-r--r-- | TAO/TAO_IDL/be_include/be.h | 1 | ||||
-rw-r--r-- | TAO/TAO_IDL/be_include/be_array.h | 12 | ||||
-rw-r--r-- | TAO/TAO_IDL/be_include/be_codegen.h | 190 | ||||
-rw-r--r-- | TAO/TAO_IDL/be_include/be_decl.h | 29 | ||||
-rw-r--r-- | TAO/TAO_IDL/be_include/be_enum.h | 8 | ||||
-rw-r--r-- | TAO/TAO_IDL/be_include/be_enum_val.h | 4 | ||||
-rw-r--r-- | TAO/TAO_IDL/be_include/be_exception.h | 16 | ||||
-rw-r--r-- | TAO/TAO_IDL/be_include/be_field.h | 2 | ||||
-rw-r--r-- | TAO/TAO_IDL/be_include/be_helper.h | 31 | ||||
-rw-r--r-- | TAO/TAO_IDL/be_include/be_interface.h | 8 | ||||
-rw-r--r-- | TAO/TAO_IDL/be_include/be_predefined_type.h | 4 | ||||
-rw-r--r-- | TAO/TAO_IDL/be_include/be_scope.h | 6 | ||||
-rw-r--r-- | TAO/TAO_IDL/be_include/be_sequence.h | 8 | ||||
-rw-r--r-- | TAO/TAO_IDL/be_include/be_state.h | 259 | ||||
-rw-r--r-- | TAO/TAO_IDL/be_include/be_string.h | 8 | ||||
-rw-r--r-- | TAO/TAO_IDL/be_include/be_structure.h | 8 | ||||
-rw-r--r-- | TAO/TAO_IDL/be_include/be_type.h | 43 | ||||
-rw-r--r-- | TAO/TAO_IDL/be_include/be_typedef.h | 13 | ||||
-rw-r--r-- | TAO/TAO_IDL/be_include/be_union.h | 8 | ||||
-rw-r--r-- | TAO/TAO_IDL/be_include/be_union_branch.h | 4 |
20 files changed, 572 insertions, 90 deletions
diff --git a/TAO/TAO_IDL/be_include/be.h b/TAO/TAO_IDL/be_include/be.h index cf2ef67dde2..e819a658648 100644 --- a/TAO/TAO_IDL/be_include/be.h +++ b/TAO/TAO_IDL/be_include/be.h @@ -110,6 +110,7 @@ trademarks or registered trademarks of Sun Microsystems, Inc. #include "be_root.h" // class BE_Root #include "be_helper.h" // helper functions +#include "be_state.h" // code generation states #include "be_codegen.h" // code generator #include "be_factory.h" // factory diff --git a/TAO/TAO_IDL/be_include/be_array.h b/TAO/TAO_IDL/be_include/be_array.h index 11608b56717..21ef94ba0aa 100644 --- a/TAO/TAO_IDL/be_include/be_array.h +++ b/TAO/TAO_IDL/be_include/be_array.h @@ -56,15 +56,21 @@ public: virtual int gen_typecode (void); // generate the typecode + virtual int gen_encapsulation (void); + // encapsulation for parameters + + virtual long tc_size (void); + // return typecode size + + virtual long tc_encap_len (void); + // return length of encapsulation + virtual int gen_forany_defn (void); // the forany class virtual int gen_forany_impl (void); // the forany impl - virtual long tc_encap_len (void); - // return the total byte length of ourselves represented as an encapsulation - // Narrowing DEF_NARROW_METHODS2 (be_array, AST_Array, be_type); DEF_NARROW_FROM_DECL (be_array); diff --git a/TAO/TAO_IDL/be_include/be_codegen.h b/TAO/TAO_IDL/be_include/be_codegen.h index 668cf30637e..1e081f9001d 100644 --- a/TAO/TAO_IDL/be_include/be_codegen.h +++ b/TAO/TAO_IDL/be_include/be_codegen.h @@ -27,31 +27,166 @@ class TAO_CodeGen // Holds global parameters for the Back End and generates the C++ mapping // public: - // define all the code generation states. - + // define all the code generation states. The first letter C/S of the suffix stands + // for client/server-side and the second letter H/I/S stands for + // header/inline/impl file. enum CG_STATE { + // initial state TAO_INITIAL, - TAO_ROOT, - TAO_MODULE, - TAO_INTERFACE, - TAO_CONSTANT, - TAO_SEQUENCE_BASE, - TAO_SEQUENCE_BODY, - TAO_UNION_DISCTYPEDEFN, // union has a different kind of mapping - TAO_UNION_PUBLIC, - TAO_UNION_PRIVATE, - TAO_STRUCT, - TAO_FIELD, - TAO_EXCEPTION, - TAO_ENUM, - TAO_ARRAY_DEFN, - TAO_ARRAY_OTHER, - TAO_STRING, - TAO_OPERATION, - TAO_ARGUMENT, - TAO_ATTRIBUTE, - TAO_TYPEDEF + + // emitting code for root + TAO_ROOT_CH, + TAO_ROOT_CI, + TAO_ROOT_CS, + TAO_ROOT_SH, + TAO_ROOT_SI, + TAO_ROOT_SS, + + // emitting code for the module + TAO_MODULE_CH, + TAO_MODULE_CI, + TAO_MODULE_CS, + TAO_MODULE_SH, + TAO_MODULE_SI, + TAO_MODULE_SS, + + // emitting code for the interface + TAO_INTERFACE_CH, + TAO_INTERFACE_CI, + TAO_INTERFACE_CS, + TAO_INTERFACE_SH, + TAO_INTERFACE_SI, + TAO_INTERFACE_SS, + + // emitting code for the constants + TAO_CONSTANT_CH, + TAO_CONSTANT_CI, + TAO_CONSTANT_CS, + TAO_CONSTANT_SH, + TAO_CONSTANT_SI, + TAO_CONSTANT_SS, + + // emitting code for sequence base type + TAO_SEQUENCE_BASE_CH, + TAO_SEQUENCE_BASE_CI, + TAO_SEQUENCE_BASE_CS, + TAO_SEQUENCE_BASE_SH, + TAO_SEQUENCE_BASE_SI, + TAO_SEQUENCE_BASE_SS, + + // emitting code for sequence body + TAO_SEQUENCE_BODY_CH, + TAO_SEQUENCE_BODY_CI, + TAO_SEQUENCE_BODY_CS, + TAO_SEQUENCE_BODY_SH, + TAO_SEQUENCE_BODY_SI, + TAO_SEQUENCE_BODY_SS, + + // emitting code for the discriminant + TAO_UNION_DISCTYPEDEFN_CH, + TAO_UNION_DISCTYPEDEFN_CI, + TAO_UNION_DISCTYPEDEFN_CS, + TAO_UNION_DISCTYPEDEFN_SH, + TAO_UNION_DISCTYPEDEFN_SI, + TAO_UNION_DISCTYPEDEFN_SS, + + // emitting code for the public members of the union + TAO_UNION_PUBLIC_CH, + TAO_UNION_PUBLIC_CI, + TAO_UNION_PUBLIC_CS, + TAO_UNION_PUBLIC_SH, + TAO_UNION_PUBLIC_SI, + TAO_UNION_PUBLIC_SS, + + // emitting code for private members of the union + TAO_UNION_PRIVATE_CH, + TAO_UNION_PRIVATE_CI, + TAO_UNION_PRIVATE_CS, + TAO_UNION_PRIVATE_SH, + TAO_UNION_PRIVATE_SI, + TAO_UNION_PRIVATE_SS, + + // emitting code for struct and its members + TAO_STRUCT_CH, + TAO_STRUCT_CI, + TAO_STRUCT_CS, + TAO_STRUCT_SH, + TAO_STRUCT_SI, + TAO_STRUCT_SS, + + // emitting code for exceptions + TAO_EXCEPTION_CH, + TAO_EXCEPTION_CI, + TAO_EXCEPTION_CS, + TAO_EXCEPTION_SH, + TAO_EXCEPTION_SI, + TAO_EXCEPTION_SS, + + // emitting code for enums + TAO_ENUM_CH, + TAO_ENUM_CI, + TAO_ENUM_CS, + TAO_ENUM_SH, + TAO_ENUM_SI, + TAO_ENUM_SS, + + // emitting code for array defn + TAO_ARRAY_DEFN_CH, + TAO_ARRAY_DEFN_CI, + TAO_ARRAY_DEFN_CS, + TAO_ARRAY_DEFN_SH, + TAO_ARRAY_DEFN_SI, + TAO_ARRAY_DEFN_SS, + + // emitting code for rest of the array decl + TAO_ARRAY_OTHER_CH, + TAO_ARRAY_OTHER_CI, + TAO_ARRAY_OTHER_CS, + TAO_ARRAY_OTHER_SH, + TAO_ARRAY_OTHER_SI, + TAO_ARRAY_OTHER_SS, + + // emitting code for strings + TAO_STRING_CH, + TAO_STRING_CI, + TAO_STRING_CS, + TAO_STRING_SH, + TAO_STRING_SI, + TAO_STRING_SS, + + // emitting code for an operation. + TAO_OPERATION_CH, + TAO_OPERATION_CI, + TAO_OPERATION_CS, + TAO_OPERATION_SH, + TAO_OPERATION_SI, + TAO_OPERATION_SS, + + // emitting code for arguments of an operation. No distinction between + // headers, inclines, stubs. + TAO_ARGUMENT_CH, + TAO_ARGUMENT_CI, + TAO_ARGUMENT_CS, + TAO_ARGUMENT_SH, + TAO_ARGUMENT_SI, + TAO_ARGUMENT_SS, + + // emitting code for attributes + TAO_ATTRIBUTE_CH, + TAO_ATTRIBUTE_CI, + TAO_ATTRIBUTE_CS, + TAO_ATTRIBUTE_SH, + TAO_ATTRIBUTE_SI, + TAO_ATTRIBUTE_SS, + + // emitting code for typedefs + TAO_TYPEDEF_CH, + TAO_TYPEDEF_CI, + TAO_TYPEDEF_CS, + TAO_TYPEDEF_SH, + TAO_TYPEDEF_SI, + TAO_TYPEDEF_SS }; TAO_CodeGen (void); @@ -60,6 +195,10 @@ public: ~TAO_CodeGen (void); // destructor + be_state *make_state (void); + // factory method returning appropriate subclass of the be_state object + // based on the current code generation state + int gen_cplusplus_mapping (void); // generate the C++ mapping for CORBA IDL @@ -123,10 +262,10 @@ public: CG_STATE state (void); // return the current state - void node (AST_Decl *n); + void node (be_decl *n); // pass info - AST_Decl *node (void); + be_decl *node (void); // retrieve passed info private: @@ -160,7 +299,8 @@ private: int size_; // size of allocated stack - AST_Decl *node_; + be_decl *node_; + // save current node in this }; typedef ACE_Singleton<TAO_CodeGen, ACE_SYNCH_MUTEX> TAO_CODEGEN; diff --git a/TAO/TAO_IDL/be_include/be_decl.h b/TAO/TAO_IDL/be_include/be_decl.h index f2ec78a4ad4..a8b9a425084 100644 --- a/TAO/TAO_IDL/be_include/be_decl.h +++ b/TAO/TAO_IDL/be_include/be_decl.h @@ -81,12 +81,6 @@ public: virtual int gen_server_inline (void) = 0; // Generates the server-side inlines for the decl - virtual int gen_typecode (void); - // generate the typecode data structure - - virtual long tc_encap_len (void); - // return the total byte length of ourselves represented as an encapsulation - virtual idl_bool lookup_seq_name (Identifier *); // lookup a name inside a list of generated seq names @@ -108,8 +102,14 @@ public: const char *flatname (void); // return the flattened full scoped name - UTL_ScopedName *tc_name (void); - // return the typecode name + virtual idl_bool is_nested (void); + // determines if we are inside of a nested scope or not + + virtual int gen_encapsulation (void); + // encapsulation of parameters + + virtual long tc_encap_len (void); + // return length of encapsulation // Narrowing DEF_NARROW_METHODS1 (be_decl, AST_Decl); @@ -124,15 +124,18 @@ protected: virtual void compute_fullname (void); // computes the fully scoped name - virtual void compute_tc_name (void); - // computes the fully scoped typecode name - virtual void compute_flatname (void); // compute the flattened fully scoped name virtual int tc_name2long (const char *name, long *&, long &); // name represented as a padded array of longs + virtual long repoID_encap_len (void); + // return encapsulation length required to hold repository ID + + virtual long name_encap_len (void); + // return encapsulation length required to hold IDL name + // variables that indicate if the code generation for that node is already // been done. This way we avoid regenerating same code. idl_bool cli_hdr_gen_; @@ -154,14 +157,12 @@ protected: char *repoID_; // repository ID - UTL_ScopedName *tc_name_; - // typecode name - SIZE_TYPE size_type_; // whether we are fixed or variable size (by default fixed) long encap_len_; // encapsulation length - required for typecodes + }; #endif // if !defined diff --git a/TAO/TAO_IDL/be_include/be_enum.h b/TAO/TAO_IDL/be_include/be_enum.h index 9250c3c7c95..9ae63caba05 100644 --- a/TAO/TAO_IDL/be_include/be_enum.h +++ b/TAO/TAO_IDL/be_include/be_enum.h @@ -58,8 +58,14 @@ public: virtual int gen_typecode (void); // generate the typecode + virtual int gen_encapsulation (void); + // encapsulation for parameters + + virtual long tc_size (void); + // return typecode size + virtual long tc_encap_len (void); - // return the total byte length of ourselves represented as an encapsulation + // return length of encapsulation virtual int member_count (void); // return the count of members diff --git a/TAO/TAO_IDL/be_include/be_enum_val.h b/TAO/TAO_IDL/be_include/be_enum_val.h index 872575a0437..4a52ea0501f 100644 --- a/TAO/TAO_IDL/be_include/be_enum_val.h +++ b/TAO/TAO_IDL/be_include/be_enum_val.h @@ -54,11 +54,11 @@ public: virtual int gen_server_inline (void); // Generates the server-side inlines for the EnumVal - virtual int gen_typecode (void); + virtual int gen_encapsulation (void); // generate the typecode virtual long tc_encap_len (void); - // return the total byte length of ourselves represented as an encapsulation + // return length of encapsulation // Narrowing DEF_NARROW_METHODS2 (be_enum_val, AST_EnumVal, be_decl); diff --git a/TAO/TAO_IDL/be_include/be_exception.h b/TAO/TAO_IDL/be_include/be_exception.h index 36318ce7ef6..d28a35f7389 100644 --- a/TAO/TAO_IDL/be_include/be_exception.h +++ b/TAO/TAO_IDL/be_include/be_exception.h @@ -1,4 +1,4 @@ -#if !defined(BE_EXCEPTION_H) +#if !defined (BE_EXCEPTION_H) #define BE_EXCEPTION_H /* @@ -6,7 +6,7 @@ */ class be_exception : public virtual AST_Exception, public virtual be_scope, - public virtual be_decl + public virtual be_type { public: @@ -40,14 +40,20 @@ public: virtual int gen_typecode (void); // generate the typecode + virtual int gen_encapsulation (void); + // encapsulation for parameters + + virtual long tc_size (void); + // return typecode size + virtual long tc_encap_len (void); - // return the total byte length of ourselves represented as an encapsulation + // return length of encapsulation virtual int member_count (void); // return the count of members // Narrowing - DEF_NARROW_METHODS3 (be_exception, AST_Exception, be_scope, be_decl); + DEF_NARROW_METHODS3 (be_exception, AST_Exception, be_scope, be_type); DEF_NARROW_FROM_DECL (be_exception); DEF_NARROW_FROM_SCOPE (be_exception); @@ -61,4 +67,4 @@ private: // number of members }; -#endif +#endif // end of if !defined (...) diff --git a/TAO/TAO_IDL/be_include/be_field.h b/TAO/TAO_IDL/be_include/be_field.h index 95e14f19759..1da3a2a23a8 100644 --- a/TAO/TAO_IDL/be_include/be_field.h +++ b/TAO/TAO_IDL/be_include/be_field.h @@ -53,7 +53,7 @@ public: virtual int gen_server_inline (void); // Generates the server-side inlines for the field - virtual int gen_typecode (void); + virtual int gen_encapsulation (void); // generate the typecode virtual long tc_encap_len (void); diff --git a/TAO/TAO_IDL/be_include/be_helper.h b/TAO/TAO_IDL/be_include/be_helper.h index 3a3740b52fc..77a37b3c243 100644 --- a/TAO/TAO_IDL/be_include/be_helper.h +++ b/TAO/TAO_IDL/be_include/be_helper.h @@ -30,7 +30,7 @@ public: class TAO_OutStream { // =TITLE - /// TAO_OutStream + // TAO_OutStream // =DESCRIPTION // Defines an interface by which the backend code generator can print its // output to the underlying I/O handle. This is a helper class that will be @@ -38,15 +38,33 @@ class TAO_OutStream // classes that understand specific front ends must derive from this // class. public: + + // Enumerated type to indicate the stream type + enum STREAM_TYPE + { + TAO_CLI_HDR, + TAO_CLI_INL, + TAO_CLI_IMPL, + TAO_SVR_HDR, + TAO_SVR_INL, + TAO_SVR_IMPL + }; + TAO_OutStream (void); // constructor. - + ~TAO_OutStream (void); // destructor - - int open (const char *fname); + + int open (const char *fname, TAO_OutStream::STREAM_TYPE st=TAO_OutStream::TAO_CLI_HDR); // open the underlying low-level handle for output + void stream_type (TAO_OutStream::STREAM_TYPE); + // set the stream type + + TAO_OutStream::STREAM_TYPE stream_type (void); + // return the stream type + int incr_indent (unsigned short flag=1); // increment the indentation level and by default actually indent the output // accordingly @@ -72,7 +90,7 @@ public: TAO_OutStream &operator<< (const char *str); // output the char string and return a reference to ourselves - TAO_OutStream &operator<< (const int num); + TAO_OutStream &operator<< (const long num); // output the integer and return a reference to ourselves TAO_OutStream &operator<< (const TAO_NL nl); @@ -98,6 +116,9 @@ protected: FILE *fp_; // the underlying low-level I/O handle + TAO_OutStream::STREAM_TYPE st_; + // stream type + int indent_level_; // indentation level diff --git a/TAO/TAO_IDL/be_include/be_interface.h b/TAO/TAO_IDL/be_include/be_interface.h index c4291663e74..8e14606c539 100644 --- a/TAO/TAO_IDL/be_include/be_interface.h +++ b/TAO/TAO_IDL/be_include/be_interface.h @@ -67,8 +67,14 @@ public: virtual int gen_typecode (void); // generate the typecode + virtual int gen_encapsulation (void); + // encapsulation for parameters + + virtual long tc_size (void); + // return typecode size + virtual long tc_encap_len (void); - // return the total byte length of ourselves represented as an encapsulation + // return length of encapsulation // Narrowing DEF_NARROW_METHODS3 (be_interface, AST_Interface, be_scope, be_type); diff --git a/TAO/TAO_IDL/be_include/be_predefined_type.h b/TAO/TAO_IDL/be_include/be_predefined_type.h index 81df502f216..cfa60e2b2cd 100644 --- a/TAO/TAO_IDL/be_include/be_predefined_type.h +++ b/TAO/TAO_IDL/be_include/be_predefined_type.h @@ -62,8 +62,8 @@ public: virtual int gen_typecode (void); // generate the typecode - const char *const gen_corba_mapping (void); - // helper for all the above virtual methods + virtual long tc_size (void); + // return typecode size // Narrowing DEF_NARROW_METHODS2 (be_predefined_type, AST_PredefinedType, be_type); diff --git a/TAO/TAO_IDL/be_include/be_scope.h b/TAO/TAO_IDL/be_include/be_scope.h index 5a63e7f31dc..d515264c238 100644 --- a/TAO/TAO_IDL/be_include/be_scope.h +++ b/TAO/TAO_IDL/be_include/be_scope.h @@ -60,11 +60,11 @@ public: virtual int gen_server_inline (void); // Generates the server-side inlines for the scope - virtual int gen_typecode (void); - // generate the typecode + virtual int gen_encapsulation (void); + // encapsulation for parameters virtual long tc_encap_len (void); - // return the total byte length of ourselves represented as an encapsulation + // return length of encapsulation // Narrowing DEF_NARROW_METHODS1 (be_scope, UTL_Scope); diff --git a/TAO/TAO_IDL/be_include/be_sequence.h b/TAO/TAO_IDL/be_include/be_sequence.h index 455cab25375..4cc345d0a72 100644 --- a/TAO/TAO_IDL/be_include/be_sequence.h +++ b/TAO/TAO_IDL/be_include/be_sequence.h @@ -56,8 +56,14 @@ public: virtual int gen_typecode (void); // generate the typecode + virtual int gen_encapsulation (void); + // encapsulation for parameters + + virtual long tc_size (void); + // return typecode size + virtual long tc_encap_len (void); - // return the total byte length of ourselves represented as an encapsulation + // return length of encapsulation // Narrowing DEF_NARROW_METHODS2 (be_sequence, AST_Sequence, be_type); diff --git a/TAO/TAO_IDL/be_include/be_state.h b/TAO/TAO_IDL/be_include/be_state.h new file mode 100644 index 00000000000..da2f786d95d --- /dev/null +++ b/TAO/TAO_IDL/be_include/be_state.h @@ -0,0 +1,259 @@ +/* -*- c++ -*- */ +// ============================================================================ +// +// = LIBRARY +// TAO IDL +// +// = FILENAME +// be_state.h +// +// = DESCRIPTION +// The Code generator state class and its subclasses +// +// = AUTHOR +// Aniruddha Gokhale +// +// ============================================================================ + +#if !defined (TAO_BE_STATE_H) +#define TAO_BE_STATE_H + +class be_state +{ + // =TITLE + // be_state + // =DESCRIPTION + // Emits code based on current state. This is an abstract base class. The + // task of code generation is handled by subclasses. +public: + virtual int gen_code (be_type *bt, be_decl *d, be_type *type=0) = 0; + // code generation for node "d" whose type is "bt". The third parameter is + // used for recursive invocation involving a typedef + + virtual ~be_state (void); + // destructor + +protected: + be_state (void); + // constructor +}; + +// ============== subclasses ==================== + +class be_state_struct_ch: public be_state +{ + // =TITLE + // be_state_struct_ch + // =DESCRIPTION + // struct generation in client header +public: + + be_state_struct_ch (void); + // constructor + + virtual int gen_code (be_type *bt, be_decl *d, be_type *type=0); + // code generation for node "d" whose type is "bt". The third parameter is + // used for recursive invocation involving a typedef +}; +typedef ACE_Singleton<be_state_struct_ch, ACE_SYNCH_MUTEX> TAO_BE_STATE_STRUCT_CH; + +class be_state_union_disctypedefn_ch: public be_state +{ + // =TITLE + // be_state_union_disctypedefn_ch + // =DESCRIPTION + // union discriminant defn generation in client header +public: + + be_state_union_disctypedefn_ch (void); + // constructor + + virtual int gen_code (be_type *bt, be_decl *d, be_type *type=0); + // code generation for node "d" whose type is "bt". The third parameter is + // used for recursive invocation involving a typedef +}; +typedef ACE_Singleton<be_state_union_disctypedefn_ch, ACE_SYNCH_MUTEX> + TAO_BE_STATE_UNION_DISCTYPEDEFN_CH; + +class be_state_union_disctypedefn_ci: public be_state +{ + // =TITLE + // be_state_union_disctypedefn_ci + // =DESCRIPTION + // union discriminant defn generation in client inline file +public: + + be_state_union_disctypedefn_ci (void); + // constructor + + virtual int gen_code (be_type *bt, be_decl *d, be_type *type=0); + // code generation for node "d" whose type is "bt". The third parameter is + // used for recursive invocation involving a typedef +}; +typedef ACE_Singleton<be_state_union_disctypedefn_ci, ACE_SYNCH_MUTEX> + TAO_BE_STATE_UNION_DISCTYPEDEFN_CI; + +class be_state_union_public_ch: public be_state +{ + // =TITLE + // be_state_union_public_ch + // =DESCRIPTION + // union discriminant defn generation in client header file +public: + + be_state_union_public_ch (void); + // constructor + + virtual int gen_code (be_type *bt, be_decl *d, be_type *type=0); + // code generation for node "d" whose type is "bt". The third parameter is + // used for recursive invocation involving a typedef +}; +typedef ACE_Singleton<be_state_union_public_ch, ACE_SYNCH_MUTEX> + TAO_BE_STATE_UNION_PUBLIC_CH; + +class be_state_union_public_ci: public be_state +{ + // =TITLE + // be_state_union_public_ci + // =DESCRIPTION + // union discriminant defn generation in client inline file +public: + + be_state_union_public_ci (void); + // constructor + + virtual int gen_code (be_type *bt, be_decl *d, be_type *type=0); + // code generation for node "d" whose type is "bt". The third parameter is + // used for recursive invocation involving a typedef +}; +typedef ACE_Singleton<be_state_union_public_ci, ACE_SYNCH_MUTEX> + TAO_BE_STATE_UNION_PUBLIC_CI; + +class be_state_union_private_ch: public be_state +{ + // =TITLE + // be_state_union_private_ch + // =DESCRIPTION + // union discriminant defn generation in client header file +public: + + be_state_union_private_ch (void); + // constructor + + virtual int gen_code (be_type *bt, be_decl *d, be_type *type=0); + // code generation for node "d" whose type is "bt". The third parameter is + // used for recursive invocation involving a typedef +}; +typedef ACE_Singleton<be_state_union_private_ch, ACE_SYNCH_MUTEX> + TAO_BE_STATE_UNION_PRIVATE_CH; + +class be_state_operation: public be_state +{ + // =TITLE + // be_state_operation + // =DESCRIPTION + // operation return type +public: + + be_state_operation (void); + // constructor + + virtual int gen_code (be_type *bt, be_decl *d, be_type *type=0); + // code generation for node "d" whose type is "bt". The third parameter is + // used for recursive invocation involving a typedef +}; +typedef ACE_Singleton<be_state_operation, ACE_SYNCH_MUTEX> + TAO_BE_STATE_OPERATION; + +class be_state_argument: public be_state +{ + // =TITLE + // be_state_argument + // =DESCRIPTION + // argument return type +public: + + be_state_argument (void); + // constructor + + virtual int gen_code (be_type *bt, be_decl *d, be_type *type=0); + // code generation for node "d" whose type is "bt". The third parameter is + // used for recursive invocation involving a typedef +}; +typedef ACE_Singleton<be_state_argument, ACE_SYNCH_MUTEX> + TAO_BE_STATE_ARGUMENT; + +class be_state_typedef: public be_state +{ + // =TITLE + // be_state_typedef + // =DESCRIPTION + // typedef code generation +public: + + be_state_typedef (void); + // constructor + + virtual int gen_code (be_type *bt, be_decl *d, be_type *type=0); + // code generation for node "d" whose type is "bt". The third parameter is + // used for recursive invocation involving a typedef +}; +typedef ACE_Singleton<be_state_typedef, ACE_SYNCH_MUTEX> + TAO_BE_STATE_TYPEDEF; + +class be_state_array: public be_state +{ + // =TITLE + // be_state_array + // =DESCRIPTION + // array code generation +public: + + be_state_array (void); + // constructor + + virtual int gen_code (be_type *bt, be_decl *d, be_type *type=0); + // code generation for node "d" whose type is "bt". The third parameter is + // used for recursive invocation involving a typedef +}; +typedef ACE_Singleton<be_state_array, ACE_SYNCH_MUTEX> + TAO_BE_STATE_ARRAY; + +class be_state_sequence: public be_state +{ + // =TITLE + // be_state_sequence + // =DESCRIPTION + // sequence code generation +public: + + be_state_sequence (void); + // constructor + + virtual int gen_code (be_type *bt, be_decl *d, be_type *type=0); + // code generation for node "d" whose type is "bt". The third parameter is + // used for recursive invocation involving a typedef +}; +typedef ACE_Singleton<be_state_sequence, ACE_SYNCH_MUTEX> + TAO_BE_STATE_SEQUENCE; + +class be_state_attribute: public be_state +{ + // =TITLE + // be_state_attribute + // =DESCRIPTION + // attribute code generation +public: + + be_state_attribute (void); + // constructor + + virtual int gen_code (be_type *bt, be_decl *d, be_type *type=0); + // code generation for node "d" whose type is "bt". The third parameter is + // used for recursive invocation involving a typedef +}; +typedef ACE_Singleton<be_state_attribute, ACE_SYNCH_MUTEX> + TAO_BE_STATE_ATTRIBUTE; + +#endif // end of be_state + diff --git a/TAO/TAO_IDL/be_include/be_string.h b/TAO/TAO_IDL/be_include/be_string.h index 9e3801d3e35..04ca868b940 100644 --- a/TAO/TAO_IDL/be_include/be_string.h +++ b/TAO/TAO_IDL/be_include/be_string.h @@ -59,8 +59,14 @@ public: virtual int gen_typecode (void); // generate the typecode + virtual int gen_encapsulation (void); + // encapsulation for parameters + + virtual long tc_size (void); + // return typecode size + virtual long tc_encap_len (void); - // return the total byte length of ourselves represented as an encapsulation + // return length of encapsulation // Narrowing DEF_NARROW_METHODS2 (be_string, AST_String, be_type); diff --git a/TAO/TAO_IDL/be_include/be_structure.h b/TAO/TAO_IDL/be_include/be_structure.h index fb317dd57dc..4ed579d3c00 100644 --- a/TAO/TAO_IDL/be_include/be_structure.h +++ b/TAO/TAO_IDL/be_include/be_structure.h @@ -58,8 +58,14 @@ public: virtual int gen_typecode (void); // generate the typecode + virtual int gen_encapsulation (void); + // encapsulation for parameters + + virtual long tc_size (void); + // return typecode size + virtual long tc_encap_len (void); - // return the total byte length of ourselves represented as an encapsulation + // return length of encapsulation virtual int member_count (void); // return the count of members diff --git a/TAO/TAO_IDL/be_include/be_type.h b/TAO/TAO_IDL/be_include/be_type.h index 80ee7bd7afe..112fd959c10 100644 --- a/TAO/TAO_IDL/be_include/be_type.h +++ b/TAO/TAO_IDL/be_include/be_type.h @@ -35,45 +35,44 @@ public: be_type (AST_Decl::NodeType nt, UTL_ScopedName *n, UTL_StrList *p); // constructor - virtual int gen_client_header (void); + virtual int gen_client_header (void) = 0; // Generates the client-side header information for the type - virtual int gen_client_stubs (void); + virtual int gen_client_stubs (void) = 0; // Generates the client-side stubs for the type - virtual int gen_server_header (void); + virtual int gen_server_header (void) = 0; // Generates the server-side header information for the type - virtual int gen_server_skeletons (void); + virtual int gen_server_skeletons (void) = 0; // Generates the server-side skeletons for the type - virtual int gen_client_inline (void); + virtual int gen_client_inline (void) = 0; // Generates the client-side inline for the type - virtual int gen_server_inline (void); + virtual int gen_server_inline (void) = 0; // Generates the server-side inlines for the type - virtual int gen_typecode (void); - // generate the typecode data structure + virtual int gen_typecode (void) = 0; + // generate the typecode description - virtual long tc_encap_len (void); - // return the total byte length of ourselves represented as an encapsulation + virtual long tc_size (void) = 0; + // return typecode size + + UTL_ScopedName *tc_name (void); + // return the typecode name // Narrowing DEF_NARROW_METHODS2 (be_type, AST_Type, be_decl); DEF_NARROW_FROM_DECL (be_type); -private: - // helpers - int gen_predefined_type (void); - int gen_string (void); - int gen_array (void); - int gen_sequence (void); - int gen_enum (void); - int gen_struct (void); - int gen_union (void); - int gen_typedef (void); - int gen_interface (void); +protected: + virtual void compute_tc_name (void); + // computes the fully scoped typecode name + + UTL_ScopedName *tc_name_; + // typecode name + }; -#endif +#endif // end of if !defined diff --git a/TAO/TAO_IDL/be_include/be_typedef.h b/TAO/TAO_IDL/be_include/be_typedef.h index d2327235bb2..2d446a81eac 100644 --- a/TAO/TAO_IDL/be_include/be_typedef.h +++ b/TAO/TAO_IDL/be_include/be_typedef.h @@ -35,6 +35,10 @@ public: be_typedef (AST_Type *bt, UTL_ScopedName *n, UTL_StrList *p); // constructor + be_type *primitive_base_type (void); + // return the most primitive base type by traversing the chain of typedefed + // base types + virtual int gen_client_header (void); // Generates the client-side header information for the typedef @@ -56,6 +60,15 @@ public: virtual int gen_typecode (void); // generate the typecode + virtual int gen_encapsulation (void); + // encapsulation for parameters + + virtual long tc_size (void); + // return typecode size + + virtual long tc_encap_len (void); + // return length of encapsulation + // Narrowing DEF_NARROW_METHODS2 (be_typedef, AST_Typedef, be_type); DEF_NARROW_FROM_DECL (be_typedef); diff --git a/TAO/TAO_IDL/be_include/be_union.h b/TAO/TAO_IDL/be_include/be_union.h index 7b461898e87..cc146acd9d6 100644 --- a/TAO/TAO_IDL/be_include/be_union.h +++ b/TAO/TAO_IDL/be_include/be_union.h @@ -57,8 +57,14 @@ public: virtual int gen_typecode (void); // generate the typecode + virtual int gen_encapsulation (void); + // encapsulation for parameters + + virtual long tc_size (void); + // return typecode size + virtual long tc_encap_len (void); - // return the total byte length of ourselves represented as an encapsulation + // return length of encapsulation virtual int member_count (void); // return the count of members diff --git a/TAO/TAO_IDL/be_include/be_union_branch.h b/TAO/TAO_IDL/be_include/be_union_branch.h index a8feadd19b1..81e512af36b 100644 --- a/TAO/TAO_IDL/be_include/be_union_branch.h +++ b/TAO/TAO_IDL/be_include/be_union_branch.h @@ -53,8 +53,8 @@ public: virtual int gen_server_inline (void); // Generates the server-side inlines for the union branch - virtual int gen_typecode (void); - // generate the typecode + virtual int gen_encapsulation (void); + // generate the encapsulation virtual long tc_encap_len (void); // return the total byte length of ourselves represented as an encapsulation |