diff options
Diffstat (limited to 'TAO/TAO_IDL/be')
44 files changed, 0 insertions, 25954 deletions
diff --git a/TAO/TAO_IDL/be/Makefile b/TAO/TAO_IDL/be/Makefile deleted file mode 100644 index cdc19049fb1..00000000000 --- a/TAO/TAO_IDL/be/Makefile +++ /dev/null @@ -1,3159 +0,0 @@ -#---------------------------------------------------------------------------- -# $Id$ -# -# Makefile for libbe -#---------------------------------------------------------------------------- - -MAKEFILE = Makefile -LIBNAME = libbe -LIB = $(LIBNAME).a -SHLIB = $(LIBNAME).$(SOEXT) -IDL_CFE_VERSION = \"1.3.0\" - -# These are components that are sources of -BE_FILES = \ - be_array \ - be_argument \ - be_attribute \ - be_constant \ - be_enum \ - be_enum_val \ - be_exception \ - be_expression \ - be_field \ - be_interface \ - be_interface_fwd \ - be_module \ - be_operation \ - be_predefined_type \ - be_root \ - be_sequence \ - be_string \ - be_structure \ - be_type \ - be_typedef \ - be_union \ - be_union_branch \ - be_union_label \ - be_generator \ - be_init \ - be_produce \ - be_args \ - be_helper \ - be_state \ - be_state_array \ - be_state_argument \ - be_state_attribute \ - be_state_exception \ - be_state_operation \ - be_state_sequence \ - be_state_structure \ - be_state_typedef \ - be_state_union \ - be_codegen \ - be_factory \ - be_sunsoft \ - be_decl \ - be_scope - -FILES = $(BE_FILES) - -LSRC = $(addsuffix .cpp,$(FILES)) -LOBJ = $(addsuffix .o,$(FILES)) -SHOBJ = $(addsuffix .so,$(FILES)) - - -LDLIBS = -lACE -LIBS = -lACE -VLDLIBS = $(LDLIBS:%=%$(VAR)) - -BUILD = $(VSHLIB) #$(VLIB) - -#---------------------------------------------------------------------------- -# Include macros and targets -#---------------------------------------------------------------------------- - -include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU -include $(ACE_ROOT)/include/makeinclude/macros.GNU -include $(ACE_ROOT)/include/makeinclude/rules.common.GNU -include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU -include $(ACE_ROOT)/include/makeinclude/rules.lib.GNU -include $(ACE_ROOT)/include/makeinclude/rules.bin.GNU -include $(ACE_ROOT)/include/makeinclude/rules.local.GNU - -#---------------------------------------------------------------------------- -# Local targets (and local hacks) -#---------------------------------------------------------------------------- - -ifeq ($(CXX),g++) -CCFLAGS += -Wno-switch -PIC = -fPIC -endif - -CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" \ - -DIDL_CFE_VERSION=$(IDL_CFE_VERSION) - -#---------------------------------------------------------------------------- -# Dependencies -#---------------------------------------------------------------------------- - -# DO NOT DELETE THIS LINE -- g++dep uses it. -# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. - -.obj/be_array.o .shobj/be_array.so: be_array.cpp ../include/idl.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/config.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ - ../include/intlmacros.h ../include/idl_narrow.h \ - ../include/idl_defines.h ../include/idl_fwd.h ../include/idl_bool.h \ - ../include/utl_string.h ../include/utl_identifier.h ../include/ast.h \ - ../include/utl_scoped_name.h ../include/ast_decl.h \ - ../include/ast_expression.h ../include/utl_scope.h \ - ../include/ast_type.h ../include/ast_concrete_type.h \ - ../include/ast_predefined_type.h ../include/ast_module.h \ - ../include/ast_root.h ../include/ast_interface.h \ - ../include/ast_interface_fwd.h ../include/ast_structure.h \ - ../include/ast_exception.h ../include/ast_enum.h \ - ../include/ast_operation.h ../include/utl_list.h \ - ../include/ast_field.h ../include/ast_argument.h \ - ../include/ast_attribute.h ../include/ast_union.h \ - ../include/ast_union_branch.h ../include/ast_union_label.h \ - ../include/ast_constant.h ../include/ast_enum_val.h \ - ../include/ast_array.h ../include/ast_sequence.h \ - ../include/ast_string.h ../include/ast_typedef.h \ - ../include/utl_strlist.h ../include/utl_exprlist.h \ - ../include/ast_generator.h ../include/util.h ../include/utl_stack.h \ - ../include/utl_idlist.h ../include/utl_exceptlist.h \ - ../include/utl_namelist.h ../include/utl_labellist.h \ - ../include/utl_decllist.h ../include/idl_global.h \ - ../include/utl_error.h ../include/utl_indenter.h \ - ../include/idl_extern.h ../include/fe_extern.h ../include/be_extern.h \ - ../include/drv_extern.h ../include/ast_extern.h \ - ../include/nr_extern.h ../include/global_extern.h ../be_include/be.h \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Containers.i \ - ../be_include/be_decl.h ../be_include/be_scope.h \ - ../be_include/be_generator.h ../be_include/be_type.h \ - ../be_include/be_predefined_type.h ../be_include/be_module.h \ - ../be_include/be_interface.h ../be_include/be_interface_fwd.h \ - ../be_include/be_structure.h ../be_include/be_exception.h \ - ../be_include/be_expression.h ../be_include/be_enum.h \ - ../be_include/be_operation.h ../be_include/be_field.h \ - ../be_include/be_argument.h ../be_include/be_attribute.h \ - ../be_include/be_union.h ../be_include/be_union_branch.h \ - ../be_include/be_union_label.h ../be_include/be_constant.h \ - ../be_include/be_enum_val.h ../be_include/be_array.h \ - ../be_include/be_sequence.h ../be_include/be_string.h \ - ../be_include/be_typedef.h ../be_include/be_root.h \ - ../be_include/be_helper.h ../be_include/be_state.h \ - ../be_include/be_codegen.h ../be_include/be_factory.h -.obj/be_argument.o .shobj/be_argument.so: be_argument.cpp ../include/idl.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/config.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ - ../include/intlmacros.h ../include/idl_narrow.h \ - ../include/idl_defines.h ../include/idl_fwd.h ../include/idl_bool.h \ - ../include/utl_string.h ../include/utl_identifier.h ../include/ast.h \ - ../include/utl_scoped_name.h ../include/ast_decl.h \ - ../include/ast_expression.h ../include/utl_scope.h \ - ../include/ast_type.h ../include/ast_concrete_type.h \ - ../include/ast_predefined_type.h ../include/ast_module.h \ - ../include/ast_root.h ../include/ast_interface.h \ - ../include/ast_interface_fwd.h ../include/ast_structure.h \ - ../include/ast_exception.h ../include/ast_enum.h \ - ../include/ast_operation.h ../include/utl_list.h \ - ../include/ast_field.h ../include/ast_argument.h \ - ../include/ast_attribute.h ../include/ast_union.h \ - ../include/ast_union_branch.h ../include/ast_union_label.h \ - ../include/ast_constant.h ../include/ast_enum_val.h \ - ../include/ast_array.h ../include/ast_sequence.h \ - ../include/ast_string.h ../include/ast_typedef.h \ - ../include/utl_strlist.h ../include/utl_exprlist.h \ - ../include/ast_generator.h ../include/util.h ../include/utl_stack.h \ - ../include/utl_idlist.h ../include/utl_exceptlist.h \ - ../include/utl_namelist.h ../include/utl_labellist.h \ - ../include/utl_decllist.h ../include/idl_global.h \ - ../include/utl_error.h ../include/utl_indenter.h \ - ../include/idl_extern.h ../include/fe_extern.h ../include/be_extern.h \ - ../include/drv_extern.h ../include/ast_extern.h \ - ../include/nr_extern.h ../include/global_extern.h ../be_include/be.h \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Containers.i \ - ../be_include/be_decl.h ../be_include/be_scope.h \ - ../be_include/be_generator.h ../be_include/be_type.h \ - ../be_include/be_predefined_type.h ../be_include/be_module.h \ - ../be_include/be_interface.h ../be_include/be_interface_fwd.h \ - ../be_include/be_structure.h ../be_include/be_exception.h \ - ../be_include/be_expression.h ../be_include/be_enum.h \ - ../be_include/be_operation.h ../be_include/be_field.h \ - ../be_include/be_argument.h ../be_include/be_attribute.h \ - ../be_include/be_union.h ../be_include/be_union_branch.h \ - ../be_include/be_union_label.h ../be_include/be_constant.h \ - ../be_include/be_enum_val.h ../be_include/be_array.h \ - ../be_include/be_sequence.h ../be_include/be_string.h \ - ../be_include/be_typedef.h ../be_include/be_root.h \ - ../be_include/be_helper.h ../be_include/be_state.h \ - ../be_include/be_codegen.h ../be_include/be_factory.h -.obj/be_attribute.o .shobj/be_attribute.so: be_attribute.cpp ../include/idl.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/config.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ - ../include/intlmacros.h ../include/idl_narrow.h \ - ../include/idl_defines.h ../include/idl_fwd.h ../include/idl_bool.h \ - ../include/utl_string.h ../include/utl_identifier.h ../include/ast.h \ - ../include/utl_scoped_name.h ../include/ast_decl.h \ - ../include/ast_expression.h ../include/utl_scope.h \ - ../include/ast_type.h ../include/ast_concrete_type.h \ - ../include/ast_predefined_type.h ../include/ast_module.h \ - ../include/ast_root.h ../include/ast_interface.h \ - ../include/ast_interface_fwd.h ../include/ast_structure.h \ - ../include/ast_exception.h ../include/ast_enum.h \ - ../include/ast_operation.h ../include/utl_list.h \ - ../include/ast_field.h ../include/ast_argument.h \ - ../include/ast_attribute.h ../include/ast_union.h \ - ../include/ast_union_branch.h ../include/ast_union_label.h \ - ../include/ast_constant.h ../include/ast_enum_val.h \ - ../include/ast_array.h ../include/ast_sequence.h \ - ../include/ast_string.h ../include/ast_typedef.h \ - ../include/utl_strlist.h ../include/utl_exprlist.h \ - ../include/ast_generator.h ../include/util.h ../include/utl_stack.h \ - ../include/utl_idlist.h ../include/utl_exceptlist.h \ - ../include/utl_namelist.h ../include/utl_labellist.h \ - ../include/utl_decllist.h ../include/idl_global.h \ - ../include/utl_error.h ../include/utl_indenter.h \ - ../include/idl_extern.h ../include/fe_extern.h ../include/be_extern.h \ - ../include/drv_extern.h ../include/ast_extern.h \ - ../include/nr_extern.h ../include/global_extern.h ../be_include/be.h \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Containers.i \ - ../be_include/be_decl.h ../be_include/be_scope.h \ - ../be_include/be_generator.h ../be_include/be_type.h \ - ../be_include/be_predefined_type.h ../be_include/be_module.h \ - ../be_include/be_interface.h ../be_include/be_interface_fwd.h \ - ../be_include/be_structure.h ../be_include/be_exception.h \ - ../be_include/be_expression.h ../be_include/be_enum.h \ - ../be_include/be_operation.h ../be_include/be_field.h \ - ../be_include/be_argument.h ../be_include/be_attribute.h \ - ../be_include/be_union.h ../be_include/be_union_branch.h \ - ../be_include/be_union_label.h ../be_include/be_constant.h \ - ../be_include/be_enum_val.h ../be_include/be_array.h \ - ../be_include/be_sequence.h ../be_include/be_string.h \ - ../be_include/be_typedef.h ../be_include/be_root.h \ - ../be_include/be_helper.h ../be_include/be_state.h \ - ../be_include/be_codegen.h ../be_include/be_factory.h -.obj/be_constant.o .shobj/be_constant.so: be_constant.cpp ../include/idl.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/config.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ - ../include/intlmacros.h ../include/idl_narrow.h \ - ../include/idl_defines.h ../include/idl_fwd.h ../include/idl_bool.h \ - ../include/utl_string.h ../include/utl_identifier.h ../include/ast.h \ - ../include/utl_scoped_name.h ../include/ast_decl.h \ - ../include/ast_expression.h ../include/utl_scope.h \ - ../include/ast_type.h ../include/ast_concrete_type.h \ - ../include/ast_predefined_type.h ../include/ast_module.h \ - ../include/ast_root.h ../include/ast_interface.h \ - ../include/ast_interface_fwd.h ../include/ast_structure.h \ - ../include/ast_exception.h ../include/ast_enum.h \ - ../include/ast_operation.h ../include/utl_list.h \ - ../include/ast_field.h ../include/ast_argument.h \ - ../include/ast_attribute.h ../include/ast_union.h \ - ../include/ast_union_branch.h ../include/ast_union_label.h \ - ../include/ast_constant.h ../include/ast_enum_val.h \ - ../include/ast_array.h ../include/ast_sequence.h \ - ../include/ast_string.h ../include/ast_typedef.h \ - ../include/utl_strlist.h ../include/utl_exprlist.h \ - ../include/ast_generator.h ../include/util.h ../include/utl_stack.h \ - ../include/utl_idlist.h ../include/utl_exceptlist.h \ - ../include/utl_namelist.h ../include/utl_labellist.h \ - ../include/utl_decllist.h ../include/idl_global.h \ - ../include/utl_error.h ../include/utl_indenter.h \ - ../include/idl_extern.h ../include/fe_extern.h ../include/be_extern.h \ - ../include/drv_extern.h ../include/ast_extern.h \ - ../include/nr_extern.h ../include/global_extern.h ../be_include/be.h \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Containers.i \ - ../be_include/be_decl.h ../be_include/be_scope.h \ - ../be_include/be_generator.h ../be_include/be_type.h \ - ../be_include/be_predefined_type.h ../be_include/be_module.h \ - ../be_include/be_interface.h ../be_include/be_interface_fwd.h \ - ../be_include/be_structure.h ../be_include/be_exception.h \ - ../be_include/be_expression.h ../be_include/be_enum.h \ - ../be_include/be_operation.h ../be_include/be_field.h \ - ../be_include/be_argument.h ../be_include/be_attribute.h \ - ../be_include/be_union.h ../be_include/be_union_branch.h \ - ../be_include/be_union_label.h ../be_include/be_constant.h \ - ../be_include/be_enum_val.h ../be_include/be_array.h \ - ../be_include/be_sequence.h ../be_include/be_string.h \ - ../be_include/be_typedef.h ../be_include/be_root.h \ - ../be_include/be_helper.h ../be_include/be_state.h \ - ../be_include/be_codegen.h ../be_include/be_factory.h -.obj/be_enum.o .shobj/be_enum.so: be_enum.cpp ../include/idl.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/config.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ - ../include/intlmacros.h ../include/idl_narrow.h \ - ../include/idl_defines.h ../include/idl_fwd.h ../include/idl_bool.h \ - ../include/utl_string.h ../include/utl_identifier.h ../include/ast.h \ - ../include/utl_scoped_name.h ../include/ast_decl.h \ - ../include/ast_expression.h ../include/utl_scope.h \ - ../include/ast_type.h ../include/ast_concrete_type.h \ - ../include/ast_predefined_type.h ../include/ast_module.h \ - ../include/ast_root.h ../include/ast_interface.h \ - ../include/ast_interface_fwd.h ../include/ast_structure.h \ - ../include/ast_exception.h ../include/ast_enum.h \ - ../include/ast_operation.h ../include/utl_list.h \ - ../include/ast_field.h ../include/ast_argument.h \ - ../include/ast_attribute.h ../include/ast_union.h \ - ../include/ast_union_branch.h ../include/ast_union_label.h \ - ../include/ast_constant.h ../include/ast_enum_val.h \ - ../include/ast_array.h ../include/ast_sequence.h \ - ../include/ast_string.h ../include/ast_typedef.h \ - ../include/utl_strlist.h ../include/utl_exprlist.h \ - ../include/ast_generator.h ../include/util.h ../include/utl_stack.h \ - ../include/utl_idlist.h ../include/utl_exceptlist.h \ - ../include/utl_namelist.h ../include/utl_labellist.h \ - ../include/utl_decllist.h ../include/idl_global.h \ - ../include/utl_error.h ../include/utl_indenter.h \ - ../include/idl_extern.h ../include/fe_extern.h ../include/be_extern.h \ - ../include/drv_extern.h ../include/ast_extern.h \ - ../include/nr_extern.h ../include/global_extern.h ../be_include/be.h \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Containers.i \ - ../be_include/be_decl.h ../be_include/be_scope.h \ - ../be_include/be_generator.h ../be_include/be_type.h \ - ../be_include/be_predefined_type.h ../be_include/be_module.h \ - ../be_include/be_interface.h ../be_include/be_interface_fwd.h \ - ../be_include/be_structure.h ../be_include/be_exception.h \ - ../be_include/be_expression.h ../be_include/be_enum.h \ - ../be_include/be_operation.h ../be_include/be_field.h \ - ../be_include/be_argument.h ../be_include/be_attribute.h \ - ../be_include/be_union.h ../be_include/be_union_branch.h \ - ../be_include/be_union_label.h ../be_include/be_constant.h \ - ../be_include/be_enum_val.h ../be_include/be_array.h \ - ../be_include/be_sequence.h ../be_include/be_string.h \ - ../be_include/be_typedef.h ../be_include/be_root.h \ - ../be_include/be_helper.h ../be_include/be_state.h \ - ../be_include/be_codegen.h ../be_include/be_factory.h -.obj/be_enum_val.o .shobj/be_enum_val.so: be_enum_val.cpp ../include/idl.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/config.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ - ../include/intlmacros.h ../include/idl_narrow.h \ - ../include/idl_defines.h ../include/idl_fwd.h ../include/idl_bool.h \ - ../include/utl_string.h ../include/utl_identifier.h ../include/ast.h \ - ../include/utl_scoped_name.h ../include/ast_decl.h \ - ../include/ast_expression.h ../include/utl_scope.h \ - ../include/ast_type.h ../include/ast_concrete_type.h \ - ../include/ast_predefined_type.h ../include/ast_module.h \ - ../include/ast_root.h ../include/ast_interface.h \ - ../include/ast_interface_fwd.h ../include/ast_structure.h \ - ../include/ast_exception.h ../include/ast_enum.h \ - ../include/ast_operation.h ../include/utl_list.h \ - ../include/ast_field.h ../include/ast_argument.h \ - ../include/ast_attribute.h ../include/ast_union.h \ - ../include/ast_union_branch.h ../include/ast_union_label.h \ - ../include/ast_constant.h ../include/ast_enum_val.h \ - ../include/ast_array.h ../include/ast_sequence.h \ - ../include/ast_string.h ../include/ast_typedef.h \ - ../include/utl_strlist.h ../include/utl_exprlist.h \ - ../include/ast_generator.h ../include/util.h ../include/utl_stack.h \ - ../include/utl_idlist.h ../include/utl_exceptlist.h \ - ../include/utl_namelist.h ../include/utl_labellist.h \ - ../include/utl_decllist.h ../include/idl_global.h \ - ../include/utl_error.h ../include/utl_indenter.h \ - ../include/idl_extern.h ../include/fe_extern.h ../include/be_extern.h \ - ../include/drv_extern.h ../include/ast_extern.h \ - ../include/nr_extern.h ../include/global_extern.h ../be_include/be.h \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Containers.i \ - ../be_include/be_decl.h ../be_include/be_scope.h \ - ../be_include/be_generator.h ../be_include/be_type.h \ - ../be_include/be_predefined_type.h ../be_include/be_module.h \ - ../be_include/be_interface.h ../be_include/be_interface_fwd.h \ - ../be_include/be_structure.h ../be_include/be_exception.h \ - ../be_include/be_expression.h ../be_include/be_enum.h \ - ../be_include/be_operation.h ../be_include/be_field.h \ - ../be_include/be_argument.h ../be_include/be_attribute.h \ - ../be_include/be_union.h ../be_include/be_union_branch.h \ - ../be_include/be_union_label.h ../be_include/be_constant.h \ - ../be_include/be_enum_val.h ../be_include/be_array.h \ - ../be_include/be_sequence.h ../be_include/be_string.h \ - ../be_include/be_typedef.h ../be_include/be_root.h \ - ../be_include/be_helper.h ../be_include/be_state.h \ - ../be_include/be_codegen.h ../be_include/be_factory.h -.obj/be_exception.o .shobj/be_exception.so: be_exception.cpp ../include/idl.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/config.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ - ../include/intlmacros.h ../include/idl_narrow.h \ - ../include/idl_defines.h ../include/idl_fwd.h ../include/idl_bool.h \ - ../include/utl_string.h ../include/utl_identifier.h ../include/ast.h \ - ../include/utl_scoped_name.h ../include/ast_decl.h \ - ../include/ast_expression.h ../include/utl_scope.h \ - ../include/ast_type.h ../include/ast_concrete_type.h \ - ../include/ast_predefined_type.h ../include/ast_module.h \ - ../include/ast_root.h ../include/ast_interface.h \ - ../include/ast_interface_fwd.h ../include/ast_structure.h \ - ../include/ast_exception.h ../include/ast_enum.h \ - ../include/ast_operation.h ../include/utl_list.h \ - ../include/ast_field.h ../include/ast_argument.h \ - ../include/ast_attribute.h ../include/ast_union.h \ - ../include/ast_union_branch.h ../include/ast_union_label.h \ - ../include/ast_constant.h ../include/ast_enum_val.h \ - ../include/ast_array.h ../include/ast_sequence.h \ - ../include/ast_string.h ../include/ast_typedef.h \ - ../include/utl_strlist.h ../include/utl_exprlist.h \ - ../include/ast_generator.h ../include/util.h ../include/utl_stack.h \ - ../include/utl_idlist.h ../include/utl_exceptlist.h \ - ../include/utl_namelist.h ../include/utl_labellist.h \ - ../include/utl_decllist.h ../include/idl_global.h \ - ../include/utl_error.h ../include/utl_indenter.h \ - ../include/idl_extern.h ../include/fe_extern.h ../include/be_extern.h \ - ../include/drv_extern.h ../include/ast_extern.h \ - ../include/nr_extern.h ../include/global_extern.h ../be_include/be.h \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Containers.i \ - ../be_include/be_decl.h ../be_include/be_scope.h \ - ../be_include/be_generator.h ../be_include/be_type.h \ - ../be_include/be_predefined_type.h ../be_include/be_module.h \ - ../be_include/be_interface.h ../be_include/be_interface_fwd.h \ - ../be_include/be_structure.h ../be_include/be_exception.h \ - ../be_include/be_expression.h ../be_include/be_enum.h \ - ../be_include/be_operation.h ../be_include/be_field.h \ - ../be_include/be_argument.h ../be_include/be_attribute.h \ - ../be_include/be_union.h ../be_include/be_union_branch.h \ - ../be_include/be_union_label.h ../be_include/be_constant.h \ - ../be_include/be_enum_val.h ../be_include/be_array.h \ - ../be_include/be_sequence.h ../be_include/be_string.h \ - ../be_include/be_typedef.h ../be_include/be_root.h \ - ../be_include/be_helper.h ../be_include/be_state.h \ - ../be_include/be_codegen.h ../be_include/be_factory.h -.obj/be_expression.o .shobj/be_expression.so: be_expression.cpp ../include/idl.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/config.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ - ../include/intlmacros.h ../include/idl_narrow.h \ - ../include/idl_defines.h ../include/idl_fwd.h ../include/idl_bool.h \ - ../include/utl_string.h ../include/utl_identifier.h ../include/ast.h \ - ../include/utl_scoped_name.h ../include/ast_decl.h \ - ../include/ast_expression.h ../include/utl_scope.h \ - ../include/ast_type.h ../include/ast_concrete_type.h \ - ../include/ast_predefined_type.h ../include/ast_module.h \ - ../include/ast_root.h ../include/ast_interface.h \ - ../include/ast_interface_fwd.h ../include/ast_structure.h \ - ../include/ast_exception.h ../include/ast_enum.h \ - ../include/ast_operation.h ../include/utl_list.h \ - ../include/ast_field.h ../include/ast_argument.h \ - ../include/ast_attribute.h ../include/ast_union.h \ - ../include/ast_union_branch.h ../include/ast_union_label.h \ - ../include/ast_constant.h ../include/ast_enum_val.h \ - ../include/ast_array.h ../include/ast_sequence.h \ - ../include/ast_string.h ../include/ast_typedef.h \ - ../include/utl_strlist.h ../include/utl_exprlist.h \ - ../include/ast_generator.h ../include/util.h ../include/utl_stack.h \ - ../include/utl_idlist.h ../include/utl_exceptlist.h \ - ../include/utl_namelist.h ../include/utl_labellist.h \ - ../include/utl_decllist.h ../include/idl_global.h \ - ../include/utl_error.h ../include/utl_indenter.h \ - ../include/idl_extern.h ../include/fe_extern.h ../include/be_extern.h \ - ../include/drv_extern.h ../include/ast_extern.h \ - ../include/nr_extern.h ../include/global_extern.h ../be_include/be.h \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Containers.i \ - ../be_include/be_decl.h ../be_include/be_scope.h \ - ../be_include/be_generator.h ../be_include/be_type.h \ - ../be_include/be_predefined_type.h ../be_include/be_module.h \ - ../be_include/be_interface.h ../be_include/be_interface_fwd.h \ - ../be_include/be_structure.h ../be_include/be_exception.h \ - ../be_include/be_expression.h ../be_include/be_enum.h \ - ../be_include/be_operation.h ../be_include/be_field.h \ - ../be_include/be_argument.h ../be_include/be_attribute.h \ - ../be_include/be_union.h ../be_include/be_union_branch.h \ - ../be_include/be_union_label.h ../be_include/be_constant.h \ - ../be_include/be_enum_val.h ../be_include/be_array.h \ - ../be_include/be_sequence.h ../be_include/be_string.h \ - ../be_include/be_typedef.h ../be_include/be_root.h \ - ../be_include/be_helper.h ../be_include/be_state.h \ - ../be_include/be_codegen.h ../be_include/be_factory.h -.obj/be_field.o .shobj/be_field.so: be_field.cpp ../include/idl.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/config.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ - ../include/intlmacros.h ../include/idl_narrow.h \ - ../include/idl_defines.h ../include/idl_fwd.h ../include/idl_bool.h \ - ../include/utl_string.h ../include/utl_identifier.h ../include/ast.h \ - ../include/utl_scoped_name.h ../include/ast_decl.h \ - ../include/ast_expression.h ../include/utl_scope.h \ - ../include/ast_type.h ../include/ast_concrete_type.h \ - ../include/ast_predefined_type.h ../include/ast_module.h \ - ../include/ast_root.h ../include/ast_interface.h \ - ../include/ast_interface_fwd.h ../include/ast_structure.h \ - ../include/ast_exception.h ../include/ast_enum.h \ - ../include/ast_operation.h ../include/utl_list.h \ - ../include/ast_field.h ../include/ast_argument.h \ - ../include/ast_attribute.h ../include/ast_union.h \ - ../include/ast_union_branch.h ../include/ast_union_label.h \ - ../include/ast_constant.h ../include/ast_enum_val.h \ - ../include/ast_array.h ../include/ast_sequence.h \ - ../include/ast_string.h ../include/ast_typedef.h \ - ../include/utl_strlist.h ../include/utl_exprlist.h \ - ../include/ast_generator.h ../include/util.h ../include/utl_stack.h \ - ../include/utl_idlist.h ../include/utl_exceptlist.h \ - ../include/utl_namelist.h ../include/utl_labellist.h \ - ../include/utl_decllist.h ../include/idl_global.h \ - ../include/utl_error.h ../include/utl_indenter.h \ - ../include/idl_extern.h ../include/fe_extern.h ../include/be_extern.h \ - ../include/drv_extern.h ../include/ast_extern.h \ - ../include/nr_extern.h ../include/global_extern.h ../be_include/be.h \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Containers.i \ - ../be_include/be_decl.h ../be_include/be_scope.h \ - ../be_include/be_generator.h ../be_include/be_type.h \ - ../be_include/be_predefined_type.h ../be_include/be_module.h \ - ../be_include/be_interface.h ../be_include/be_interface_fwd.h \ - ../be_include/be_structure.h ../be_include/be_exception.h \ - ../be_include/be_expression.h ../be_include/be_enum.h \ - ../be_include/be_operation.h ../be_include/be_field.h \ - ../be_include/be_argument.h ../be_include/be_attribute.h \ - ../be_include/be_union.h ../be_include/be_union_branch.h \ - ../be_include/be_union_label.h ../be_include/be_constant.h \ - ../be_include/be_enum_val.h ../be_include/be_array.h \ - ../be_include/be_sequence.h ../be_include/be_string.h \ - ../be_include/be_typedef.h ../be_include/be_root.h \ - ../be_include/be_helper.h ../be_include/be_state.h \ - ../be_include/be_codegen.h ../be_include/be_factory.h -.obj/be_interface.o .shobj/be_interface.so: be_interface.cpp ../include/idl.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/config.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ - ../include/intlmacros.h ../include/idl_narrow.h \ - ../include/idl_defines.h ../include/idl_fwd.h ../include/idl_bool.h \ - ../include/utl_string.h ../include/utl_identifier.h ../include/ast.h \ - ../include/utl_scoped_name.h ../include/ast_decl.h \ - ../include/ast_expression.h ../include/utl_scope.h \ - ../include/ast_type.h ../include/ast_concrete_type.h \ - ../include/ast_predefined_type.h ../include/ast_module.h \ - ../include/ast_root.h ../include/ast_interface.h \ - ../include/ast_interface_fwd.h ../include/ast_structure.h \ - ../include/ast_exception.h ../include/ast_enum.h \ - ../include/ast_operation.h ../include/utl_list.h \ - ../include/ast_field.h ../include/ast_argument.h \ - ../include/ast_attribute.h ../include/ast_union.h \ - ../include/ast_union_branch.h ../include/ast_union_label.h \ - ../include/ast_constant.h ../include/ast_enum_val.h \ - ../include/ast_array.h ../include/ast_sequence.h \ - ../include/ast_string.h ../include/ast_typedef.h \ - ../include/utl_strlist.h ../include/utl_exprlist.h \ - ../include/ast_generator.h ../include/util.h ../include/utl_stack.h \ - ../include/utl_idlist.h ../include/utl_exceptlist.h \ - ../include/utl_namelist.h ../include/utl_labellist.h \ - ../include/utl_decllist.h ../include/idl_global.h \ - ../include/utl_error.h ../include/utl_indenter.h \ - ../include/idl_extern.h ../include/fe_extern.h ../include/be_extern.h \ - ../include/drv_extern.h ../include/ast_extern.h \ - ../include/nr_extern.h ../include/global_extern.h ../be_include/be.h \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Containers.i \ - ../be_include/be_decl.h ../be_include/be_scope.h \ - ../be_include/be_generator.h ../be_include/be_type.h \ - ../be_include/be_predefined_type.h ../be_include/be_module.h \ - ../be_include/be_interface.h ../be_include/be_interface_fwd.h \ - ../be_include/be_structure.h ../be_include/be_exception.h \ - ../be_include/be_expression.h ../be_include/be_enum.h \ - ../be_include/be_operation.h ../be_include/be_field.h \ - ../be_include/be_argument.h ../be_include/be_attribute.h \ - ../be_include/be_union.h ../be_include/be_union_branch.h \ - ../be_include/be_union_label.h ../be_include/be_constant.h \ - ../be_include/be_enum_val.h ../be_include/be_array.h \ - ../be_include/be_sequence.h ../be_include/be_string.h \ - ../be_include/be_typedef.h ../be_include/be_root.h \ - ../be_include/be_helper.h ../be_include/be_state.h \ - ../be_include/be_codegen.h ../be_include/be_factory.h -.obj/be_interface_fwd.o .shobj/be_interface_fwd.so: be_interface_fwd.cpp ../include/idl.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/config.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ - ../include/intlmacros.h ../include/idl_narrow.h \ - ../include/idl_defines.h ../include/idl_fwd.h ../include/idl_bool.h \ - ../include/utl_string.h ../include/utl_identifier.h ../include/ast.h \ - ../include/utl_scoped_name.h ../include/ast_decl.h \ - ../include/ast_expression.h ../include/utl_scope.h \ - ../include/ast_type.h ../include/ast_concrete_type.h \ - ../include/ast_predefined_type.h ../include/ast_module.h \ - ../include/ast_root.h ../include/ast_interface.h \ - ../include/ast_interface_fwd.h ../include/ast_structure.h \ - ../include/ast_exception.h ../include/ast_enum.h \ - ../include/ast_operation.h ../include/utl_list.h \ - ../include/ast_field.h ../include/ast_argument.h \ - ../include/ast_attribute.h ../include/ast_union.h \ - ../include/ast_union_branch.h ../include/ast_union_label.h \ - ../include/ast_constant.h ../include/ast_enum_val.h \ - ../include/ast_array.h ../include/ast_sequence.h \ - ../include/ast_string.h ../include/ast_typedef.h \ - ../include/utl_strlist.h ../include/utl_exprlist.h \ - ../include/ast_generator.h ../include/util.h ../include/utl_stack.h \ - ../include/utl_idlist.h ../include/utl_exceptlist.h \ - ../include/utl_namelist.h ../include/utl_labellist.h \ - ../include/utl_decllist.h ../include/idl_global.h \ - ../include/utl_error.h ../include/utl_indenter.h \ - ../include/idl_extern.h ../include/fe_extern.h ../include/be_extern.h \ - ../include/drv_extern.h ../include/ast_extern.h \ - ../include/nr_extern.h ../include/global_extern.h ../be_include/be.h \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Containers.i \ - ../be_include/be_decl.h ../be_include/be_scope.h \ - ../be_include/be_generator.h ../be_include/be_type.h \ - ../be_include/be_predefined_type.h ../be_include/be_module.h \ - ../be_include/be_interface.h ../be_include/be_interface_fwd.h \ - ../be_include/be_structure.h ../be_include/be_exception.h \ - ../be_include/be_expression.h ../be_include/be_enum.h \ - ../be_include/be_operation.h ../be_include/be_field.h \ - ../be_include/be_argument.h ../be_include/be_attribute.h \ - ../be_include/be_union.h ../be_include/be_union_branch.h \ - ../be_include/be_union_label.h ../be_include/be_constant.h \ - ../be_include/be_enum_val.h ../be_include/be_array.h \ - ../be_include/be_sequence.h ../be_include/be_string.h \ - ../be_include/be_typedef.h ../be_include/be_root.h \ - ../be_include/be_helper.h ../be_include/be_state.h \ - ../be_include/be_codegen.h ../be_include/be_factory.h -.obj/be_module.o .shobj/be_module.so: be_module.cpp ../include/idl.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/config.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ - ../include/intlmacros.h ../include/idl_narrow.h \ - ../include/idl_defines.h ../include/idl_fwd.h ../include/idl_bool.h \ - ../include/utl_string.h ../include/utl_identifier.h ../include/ast.h \ - ../include/utl_scoped_name.h ../include/ast_decl.h \ - ../include/ast_expression.h ../include/utl_scope.h \ - ../include/ast_type.h ../include/ast_concrete_type.h \ - ../include/ast_predefined_type.h ../include/ast_module.h \ - ../include/ast_root.h ../include/ast_interface.h \ - ../include/ast_interface_fwd.h ../include/ast_structure.h \ - ../include/ast_exception.h ../include/ast_enum.h \ - ../include/ast_operation.h ../include/utl_list.h \ - ../include/ast_field.h ../include/ast_argument.h \ - ../include/ast_attribute.h ../include/ast_union.h \ - ../include/ast_union_branch.h ../include/ast_union_label.h \ - ../include/ast_constant.h ../include/ast_enum_val.h \ - ../include/ast_array.h ../include/ast_sequence.h \ - ../include/ast_string.h ../include/ast_typedef.h \ - ../include/utl_strlist.h ../include/utl_exprlist.h \ - ../include/ast_generator.h ../include/util.h ../include/utl_stack.h \ - ../include/utl_idlist.h ../include/utl_exceptlist.h \ - ../include/utl_namelist.h ../include/utl_labellist.h \ - ../include/utl_decllist.h ../include/idl_global.h \ - ../include/utl_error.h ../include/utl_indenter.h \ - ../include/idl_extern.h ../include/fe_extern.h ../include/be_extern.h \ - ../include/drv_extern.h ../include/ast_extern.h \ - ../include/nr_extern.h ../include/global_extern.h ../be_include/be.h \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Containers.i \ - ../be_include/be_decl.h ../be_include/be_scope.h \ - ../be_include/be_generator.h ../be_include/be_type.h \ - ../be_include/be_predefined_type.h ../be_include/be_module.h \ - ../be_include/be_interface.h ../be_include/be_interface_fwd.h \ - ../be_include/be_structure.h ../be_include/be_exception.h \ - ../be_include/be_expression.h ../be_include/be_enum.h \ - ../be_include/be_operation.h ../be_include/be_field.h \ - ../be_include/be_argument.h ../be_include/be_attribute.h \ - ../be_include/be_union.h ../be_include/be_union_branch.h \ - ../be_include/be_union_label.h ../be_include/be_constant.h \ - ../be_include/be_enum_val.h ../be_include/be_array.h \ - ../be_include/be_sequence.h ../be_include/be_string.h \ - ../be_include/be_typedef.h ../be_include/be_root.h \ - ../be_include/be_helper.h ../be_include/be_state.h \ - ../be_include/be_codegen.h ../be_include/be_factory.h -.obj/be_operation.o .shobj/be_operation.so: be_operation.cpp ../include/idl.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/config.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ - ../include/intlmacros.h ../include/idl_narrow.h \ - ../include/idl_defines.h ../include/idl_fwd.h ../include/idl_bool.h \ - ../include/utl_string.h ../include/utl_identifier.h ../include/ast.h \ - ../include/utl_scoped_name.h ../include/ast_decl.h \ - ../include/ast_expression.h ../include/utl_scope.h \ - ../include/ast_type.h ../include/ast_concrete_type.h \ - ../include/ast_predefined_type.h ../include/ast_module.h \ - ../include/ast_root.h ../include/ast_interface.h \ - ../include/ast_interface_fwd.h ../include/ast_structure.h \ - ../include/ast_exception.h ../include/ast_enum.h \ - ../include/ast_operation.h ../include/utl_list.h \ - ../include/ast_field.h ../include/ast_argument.h \ - ../include/ast_attribute.h ../include/ast_union.h \ - ../include/ast_union_branch.h ../include/ast_union_label.h \ - ../include/ast_constant.h ../include/ast_enum_val.h \ - ../include/ast_array.h ../include/ast_sequence.h \ - ../include/ast_string.h ../include/ast_typedef.h \ - ../include/utl_strlist.h ../include/utl_exprlist.h \ - ../include/ast_generator.h ../include/util.h ../include/utl_stack.h \ - ../include/utl_idlist.h ../include/utl_exceptlist.h \ - ../include/utl_namelist.h ../include/utl_labellist.h \ - ../include/utl_decllist.h ../include/idl_global.h \ - ../include/utl_error.h ../include/utl_indenter.h \ - ../include/idl_extern.h ../include/fe_extern.h ../include/be_extern.h \ - ../include/drv_extern.h ../include/ast_extern.h \ - ../include/nr_extern.h ../include/global_extern.h ../be_include/be.h \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Containers.i \ - ../be_include/be_decl.h ../be_include/be_scope.h \ - ../be_include/be_generator.h ../be_include/be_type.h \ - ../be_include/be_predefined_type.h ../be_include/be_module.h \ - ../be_include/be_interface.h ../be_include/be_interface_fwd.h \ - ../be_include/be_structure.h ../be_include/be_exception.h \ - ../be_include/be_expression.h ../be_include/be_enum.h \ - ../be_include/be_operation.h ../be_include/be_field.h \ - ../be_include/be_argument.h ../be_include/be_attribute.h \ - ../be_include/be_union.h ../be_include/be_union_branch.h \ - ../be_include/be_union_label.h ../be_include/be_constant.h \ - ../be_include/be_enum_val.h ../be_include/be_array.h \ - ../be_include/be_sequence.h ../be_include/be_string.h \ - ../be_include/be_typedef.h ../be_include/be_root.h \ - ../be_include/be_helper.h ../be_include/be_state.h \ - ../be_include/be_codegen.h ../be_include/be_factory.h -.obj/be_predefined_type.o .shobj/be_predefined_type.so: be_predefined_type.cpp ../include/idl.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/config.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ - ../include/intlmacros.h ../include/idl_narrow.h \ - ../include/idl_defines.h ../include/idl_fwd.h ../include/idl_bool.h \ - ../include/utl_string.h ../include/utl_identifier.h ../include/ast.h \ - ../include/utl_scoped_name.h ../include/ast_decl.h \ - ../include/ast_expression.h ../include/utl_scope.h \ - ../include/ast_type.h ../include/ast_concrete_type.h \ - ../include/ast_predefined_type.h ../include/ast_module.h \ - ../include/ast_root.h ../include/ast_interface.h \ - ../include/ast_interface_fwd.h ../include/ast_structure.h \ - ../include/ast_exception.h ../include/ast_enum.h \ - ../include/ast_operation.h ../include/utl_list.h \ - ../include/ast_field.h ../include/ast_argument.h \ - ../include/ast_attribute.h ../include/ast_union.h \ - ../include/ast_union_branch.h ../include/ast_union_label.h \ - ../include/ast_constant.h ../include/ast_enum_val.h \ - ../include/ast_array.h ../include/ast_sequence.h \ - ../include/ast_string.h ../include/ast_typedef.h \ - ../include/utl_strlist.h ../include/utl_exprlist.h \ - ../include/ast_generator.h ../include/util.h ../include/utl_stack.h \ - ../include/utl_idlist.h ../include/utl_exceptlist.h \ - ../include/utl_namelist.h ../include/utl_labellist.h \ - ../include/utl_decllist.h ../include/idl_global.h \ - ../include/utl_error.h ../include/utl_indenter.h \ - ../include/idl_extern.h ../include/fe_extern.h ../include/be_extern.h \ - ../include/drv_extern.h ../include/ast_extern.h \ - ../include/nr_extern.h ../include/global_extern.h ../be_include/be.h \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Containers.i \ - ../be_include/be_decl.h ../be_include/be_scope.h \ - ../be_include/be_generator.h ../be_include/be_type.h \ - ../be_include/be_predefined_type.h ../be_include/be_module.h \ - ../be_include/be_interface.h ../be_include/be_interface_fwd.h \ - ../be_include/be_structure.h ../be_include/be_exception.h \ - ../be_include/be_expression.h ../be_include/be_enum.h \ - ../be_include/be_operation.h ../be_include/be_field.h \ - ../be_include/be_argument.h ../be_include/be_attribute.h \ - ../be_include/be_union.h ../be_include/be_union_branch.h \ - ../be_include/be_union_label.h ../be_include/be_constant.h \ - ../be_include/be_enum_val.h ../be_include/be_array.h \ - ../be_include/be_sequence.h ../be_include/be_string.h \ - ../be_include/be_typedef.h ../be_include/be_root.h \ - ../be_include/be_helper.h ../be_include/be_state.h \ - ../be_include/be_codegen.h ../be_include/be_factory.h -.obj/be_root.o .shobj/be_root.so: be_root.cpp ../include/idl.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/config.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ - ../include/intlmacros.h ../include/idl_narrow.h \ - ../include/idl_defines.h ../include/idl_fwd.h ../include/idl_bool.h \ - ../include/utl_string.h ../include/utl_identifier.h ../include/ast.h \ - ../include/utl_scoped_name.h ../include/ast_decl.h \ - ../include/ast_expression.h ../include/utl_scope.h \ - ../include/ast_type.h ../include/ast_concrete_type.h \ - ../include/ast_predefined_type.h ../include/ast_module.h \ - ../include/ast_root.h ../include/ast_interface.h \ - ../include/ast_interface_fwd.h ../include/ast_structure.h \ - ../include/ast_exception.h ../include/ast_enum.h \ - ../include/ast_operation.h ../include/utl_list.h \ - ../include/ast_field.h ../include/ast_argument.h \ - ../include/ast_attribute.h ../include/ast_union.h \ - ../include/ast_union_branch.h ../include/ast_union_label.h \ - ../include/ast_constant.h ../include/ast_enum_val.h \ - ../include/ast_array.h ../include/ast_sequence.h \ - ../include/ast_string.h ../include/ast_typedef.h \ - ../include/utl_strlist.h ../include/utl_exprlist.h \ - ../include/ast_generator.h ../include/util.h ../include/utl_stack.h \ - ../include/utl_idlist.h ../include/utl_exceptlist.h \ - ../include/utl_namelist.h ../include/utl_labellist.h \ - ../include/utl_decllist.h ../include/idl_global.h \ - ../include/utl_error.h ../include/utl_indenter.h \ - ../include/idl_extern.h ../include/fe_extern.h ../include/be_extern.h \ - ../include/drv_extern.h ../include/ast_extern.h \ - ../include/nr_extern.h ../include/global_extern.h ../be_include/be.h \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Containers.i \ - ../be_include/be_decl.h ../be_include/be_scope.h \ - ../be_include/be_generator.h ../be_include/be_type.h \ - ../be_include/be_predefined_type.h ../be_include/be_module.h \ - ../be_include/be_interface.h ../be_include/be_interface_fwd.h \ - ../be_include/be_structure.h ../be_include/be_exception.h \ - ../be_include/be_expression.h ../be_include/be_enum.h \ - ../be_include/be_operation.h ../be_include/be_field.h \ - ../be_include/be_argument.h ../be_include/be_attribute.h \ - ../be_include/be_union.h ../be_include/be_union_branch.h \ - ../be_include/be_union_label.h ../be_include/be_constant.h \ - ../be_include/be_enum_val.h ../be_include/be_array.h \ - ../be_include/be_sequence.h ../be_include/be_string.h \ - ../be_include/be_typedef.h ../be_include/be_root.h \ - ../be_include/be_helper.h ../be_include/be_state.h \ - ../be_include/be_codegen.h ../be_include/be_factory.h -.obj/be_sequence.o .shobj/be_sequence.so: be_sequence.cpp ../include/idl.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/config.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ - ../include/intlmacros.h ../include/idl_narrow.h \ - ../include/idl_defines.h ../include/idl_fwd.h ../include/idl_bool.h \ - ../include/utl_string.h ../include/utl_identifier.h ../include/ast.h \ - ../include/utl_scoped_name.h ../include/ast_decl.h \ - ../include/ast_expression.h ../include/utl_scope.h \ - ../include/ast_type.h ../include/ast_concrete_type.h \ - ../include/ast_predefined_type.h ../include/ast_module.h \ - ../include/ast_root.h ../include/ast_interface.h \ - ../include/ast_interface_fwd.h ../include/ast_structure.h \ - ../include/ast_exception.h ../include/ast_enum.h \ - ../include/ast_operation.h ../include/utl_list.h \ - ../include/ast_field.h ../include/ast_argument.h \ - ../include/ast_attribute.h ../include/ast_union.h \ - ../include/ast_union_branch.h ../include/ast_union_label.h \ - ../include/ast_constant.h ../include/ast_enum_val.h \ - ../include/ast_array.h ../include/ast_sequence.h \ - ../include/ast_string.h ../include/ast_typedef.h \ - ../include/utl_strlist.h ../include/utl_exprlist.h \ - ../include/ast_generator.h ../include/util.h ../include/utl_stack.h \ - ../include/utl_idlist.h ../include/utl_exceptlist.h \ - ../include/utl_namelist.h ../include/utl_labellist.h \ - ../include/utl_decllist.h ../include/idl_global.h \ - ../include/utl_error.h ../include/utl_indenter.h \ - ../include/idl_extern.h ../include/fe_extern.h ../include/be_extern.h \ - ../include/drv_extern.h ../include/ast_extern.h \ - ../include/nr_extern.h ../include/global_extern.h ../be_include/be.h \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Containers.i \ - ../be_include/be_decl.h ../be_include/be_scope.h \ - ../be_include/be_generator.h ../be_include/be_type.h \ - ../be_include/be_predefined_type.h ../be_include/be_module.h \ - ../be_include/be_interface.h ../be_include/be_interface_fwd.h \ - ../be_include/be_structure.h ../be_include/be_exception.h \ - ../be_include/be_expression.h ../be_include/be_enum.h \ - ../be_include/be_operation.h ../be_include/be_field.h \ - ../be_include/be_argument.h ../be_include/be_attribute.h \ - ../be_include/be_union.h ../be_include/be_union_branch.h \ - ../be_include/be_union_label.h ../be_include/be_constant.h \ - ../be_include/be_enum_val.h ../be_include/be_array.h \ - ../be_include/be_sequence.h ../be_include/be_string.h \ - ../be_include/be_typedef.h ../be_include/be_root.h \ - ../be_include/be_helper.h ../be_include/be_state.h \ - ../be_include/be_codegen.h ../be_include/be_factory.h -.obj/be_string.o .shobj/be_string.so: be_string.cpp ../include/idl.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/config.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ - ../include/intlmacros.h ../include/idl_narrow.h \ - ../include/idl_defines.h ../include/idl_fwd.h ../include/idl_bool.h \ - ../include/utl_string.h ../include/utl_identifier.h ../include/ast.h \ - ../include/utl_scoped_name.h ../include/ast_decl.h \ - ../include/ast_expression.h ../include/utl_scope.h \ - ../include/ast_type.h ../include/ast_concrete_type.h \ - ../include/ast_predefined_type.h ../include/ast_module.h \ - ../include/ast_root.h ../include/ast_interface.h \ - ../include/ast_interface_fwd.h ../include/ast_structure.h \ - ../include/ast_exception.h ../include/ast_enum.h \ - ../include/ast_operation.h ../include/utl_list.h \ - ../include/ast_field.h ../include/ast_argument.h \ - ../include/ast_attribute.h ../include/ast_union.h \ - ../include/ast_union_branch.h ../include/ast_union_label.h \ - ../include/ast_constant.h ../include/ast_enum_val.h \ - ../include/ast_array.h ../include/ast_sequence.h \ - ../include/ast_string.h ../include/ast_typedef.h \ - ../include/utl_strlist.h ../include/utl_exprlist.h \ - ../include/ast_generator.h ../include/util.h ../include/utl_stack.h \ - ../include/utl_idlist.h ../include/utl_exceptlist.h \ - ../include/utl_namelist.h ../include/utl_labellist.h \ - ../include/utl_decllist.h ../include/idl_global.h \ - ../include/utl_error.h ../include/utl_indenter.h \ - ../include/idl_extern.h ../include/fe_extern.h ../include/be_extern.h \ - ../include/drv_extern.h ../include/ast_extern.h \ - ../include/nr_extern.h ../include/global_extern.h ../be_include/be.h \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Containers.i \ - ../be_include/be_decl.h ../be_include/be_scope.h \ - ../be_include/be_generator.h ../be_include/be_type.h \ - ../be_include/be_predefined_type.h ../be_include/be_module.h \ - ../be_include/be_interface.h ../be_include/be_interface_fwd.h \ - ../be_include/be_structure.h ../be_include/be_exception.h \ - ../be_include/be_expression.h ../be_include/be_enum.h \ - ../be_include/be_operation.h ../be_include/be_field.h \ - ../be_include/be_argument.h ../be_include/be_attribute.h \ - ../be_include/be_union.h ../be_include/be_union_branch.h \ - ../be_include/be_union_label.h ../be_include/be_constant.h \ - ../be_include/be_enum_val.h ../be_include/be_array.h \ - ../be_include/be_sequence.h ../be_include/be_string.h \ - ../be_include/be_typedef.h ../be_include/be_root.h \ - ../be_include/be_helper.h ../be_include/be_state.h \ - ../be_include/be_codegen.h ../be_include/be_factory.h -.obj/be_structure.o .shobj/be_structure.so: be_structure.cpp ../include/idl.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/config.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ - ../include/intlmacros.h ../include/idl_narrow.h \ - ../include/idl_defines.h ../include/idl_fwd.h ../include/idl_bool.h \ - ../include/utl_string.h ../include/utl_identifier.h ../include/ast.h \ - ../include/utl_scoped_name.h ../include/ast_decl.h \ - ../include/ast_expression.h ../include/utl_scope.h \ - ../include/ast_type.h ../include/ast_concrete_type.h \ - ../include/ast_predefined_type.h ../include/ast_module.h \ - ../include/ast_root.h ../include/ast_interface.h \ - ../include/ast_interface_fwd.h ../include/ast_structure.h \ - ../include/ast_exception.h ../include/ast_enum.h \ - ../include/ast_operation.h ../include/utl_list.h \ - ../include/ast_field.h ../include/ast_argument.h \ - ../include/ast_attribute.h ../include/ast_union.h \ - ../include/ast_union_branch.h ../include/ast_union_label.h \ - ../include/ast_constant.h ../include/ast_enum_val.h \ - ../include/ast_array.h ../include/ast_sequence.h \ - ../include/ast_string.h ../include/ast_typedef.h \ - ../include/utl_strlist.h ../include/utl_exprlist.h \ - ../include/ast_generator.h ../include/util.h ../include/utl_stack.h \ - ../include/utl_idlist.h ../include/utl_exceptlist.h \ - ../include/utl_namelist.h ../include/utl_labellist.h \ - ../include/utl_decllist.h ../include/idl_global.h \ - ../include/utl_error.h ../include/utl_indenter.h \ - ../include/idl_extern.h ../include/fe_extern.h ../include/be_extern.h \ - ../include/drv_extern.h ../include/ast_extern.h \ - ../include/nr_extern.h ../include/global_extern.h ../be_include/be.h \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Containers.i \ - ../be_include/be_decl.h ../be_include/be_scope.h \ - ../be_include/be_generator.h ../be_include/be_type.h \ - ../be_include/be_predefined_type.h ../be_include/be_module.h \ - ../be_include/be_interface.h ../be_include/be_interface_fwd.h \ - ../be_include/be_structure.h ../be_include/be_exception.h \ - ../be_include/be_expression.h ../be_include/be_enum.h \ - ../be_include/be_operation.h ../be_include/be_field.h \ - ../be_include/be_argument.h ../be_include/be_attribute.h \ - ../be_include/be_union.h ../be_include/be_union_branch.h \ - ../be_include/be_union_label.h ../be_include/be_constant.h \ - ../be_include/be_enum_val.h ../be_include/be_array.h \ - ../be_include/be_sequence.h ../be_include/be_string.h \ - ../be_include/be_typedef.h ../be_include/be_root.h \ - ../be_include/be_helper.h ../be_include/be_state.h \ - ../be_include/be_codegen.h ../be_include/be_factory.h -.obj/be_type.o .shobj/be_type.so: be_type.cpp ../include/idl.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/config.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ - ../include/intlmacros.h ../include/idl_narrow.h \ - ../include/idl_defines.h ../include/idl_fwd.h ../include/idl_bool.h \ - ../include/utl_string.h ../include/utl_identifier.h ../include/ast.h \ - ../include/utl_scoped_name.h ../include/ast_decl.h \ - ../include/ast_expression.h ../include/utl_scope.h \ - ../include/ast_type.h ../include/ast_concrete_type.h \ - ../include/ast_predefined_type.h ../include/ast_module.h \ - ../include/ast_root.h ../include/ast_interface.h \ - ../include/ast_interface_fwd.h ../include/ast_structure.h \ - ../include/ast_exception.h ../include/ast_enum.h \ - ../include/ast_operation.h ../include/utl_list.h \ - ../include/ast_field.h ../include/ast_argument.h \ - ../include/ast_attribute.h ../include/ast_union.h \ - ../include/ast_union_branch.h ../include/ast_union_label.h \ - ../include/ast_constant.h ../include/ast_enum_val.h \ - ../include/ast_array.h ../include/ast_sequence.h \ - ../include/ast_string.h ../include/ast_typedef.h \ - ../include/utl_strlist.h ../include/utl_exprlist.h \ - ../include/ast_generator.h ../include/util.h ../include/utl_stack.h \ - ../include/utl_idlist.h ../include/utl_exceptlist.h \ - ../include/utl_namelist.h ../include/utl_labellist.h \ - ../include/utl_decllist.h ../include/idl_global.h \ - ../include/utl_error.h ../include/utl_indenter.h \ - ../include/idl_extern.h ../include/fe_extern.h ../include/be_extern.h \ - ../include/drv_extern.h ../include/ast_extern.h \ - ../include/nr_extern.h ../include/global_extern.h ../be_include/be.h \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Containers.i \ - ../be_include/be_decl.h ../be_include/be_scope.h \ - ../be_include/be_generator.h ../be_include/be_type.h \ - ../be_include/be_predefined_type.h ../be_include/be_module.h \ - ../be_include/be_interface.h ../be_include/be_interface_fwd.h \ - ../be_include/be_structure.h ../be_include/be_exception.h \ - ../be_include/be_expression.h ../be_include/be_enum.h \ - ../be_include/be_operation.h ../be_include/be_field.h \ - ../be_include/be_argument.h ../be_include/be_attribute.h \ - ../be_include/be_union.h ../be_include/be_union_branch.h \ - ../be_include/be_union_label.h ../be_include/be_constant.h \ - ../be_include/be_enum_val.h ../be_include/be_array.h \ - ../be_include/be_sequence.h ../be_include/be_string.h \ - ../be_include/be_typedef.h ../be_include/be_root.h \ - ../be_include/be_helper.h ../be_include/be_state.h \ - ../be_include/be_codegen.h ../be_include/be_factory.h -.obj/be_typedef.o .shobj/be_typedef.so: be_typedef.cpp ../include/idl.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/config.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ - ../include/intlmacros.h ../include/idl_narrow.h \ - ../include/idl_defines.h ../include/idl_fwd.h ../include/idl_bool.h \ - ../include/utl_string.h ../include/utl_identifier.h ../include/ast.h \ - ../include/utl_scoped_name.h ../include/ast_decl.h \ - ../include/ast_expression.h ../include/utl_scope.h \ - ../include/ast_type.h ../include/ast_concrete_type.h \ - ../include/ast_predefined_type.h ../include/ast_module.h \ - ../include/ast_root.h ../include/ast_interface.h \ - ../include/ast_interface_fwd.h ../include/ast_structure.h \ - ../include/ast_exception.h ../include/ast_enum.h \ - ../include/ast_operation.h ../include/utl_list.h \ - ../include/ast_field.h ../include/ast_argument.h \ - ../include/ast_attribute.h ../include/ast_union.h \ - ../include/ast_union_branch.h ../include/ast_union_label.h \ - ../include/ast_constant.h ../include/ast_enum_val.h \ - ../include/ast_array.h ../include/ast_sequence.h \ - ../include/ast_string.h ../include/ast_typedef.h \ - ../include/utl_strlist.h ../include/utl_exprlist.h \ - ../include/ast_generator.h ../include/util.h ../include/utl_stack.h \ - ../include/utl_idlist.h ../include/utl_exceptlist.h \ - ../include/utl_namelist.h ../include/utl_labellist.h \ - ../include/utl_decllist.h ../include/idl_global.h \ - ../include/utl_error.h ../include/utl_indenter.h \ - ../include/idl_extern.h ../include/fe_extern.h ../include/be_extern.h \ - ../include/drv_extern.h ../include/ast_extern.h \ - ../include/nr_extern.h ../include/global_extern.h ../be_include/be.h \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Containers.i \ - ../be_include/be_decl.h ../be_include/be_scope.h \ - ../be_include/be_generator.h ../be_include/be_type.h \ - ../be_include/be_predefined_type.h ../be_include/be_module.h \ - ../be_include/be_interface.h ../be_include/be_interface_fwd.h \ - ../be_include/be_structure.h ../be_include/be_exception.h \ - ../be_include/be_expression.h ../be_include/be_enum.h \ - ../be_include/be_operation.h ../be_include/be_field.h \ - ../be_include/be_argument.h ../be_include/be_attribute.h \ - ../be_include/be_union.h ../be_include/be_union_branch.h \ - ../be_include/be_union_label.h ../be_include/be_constant.h \ - ../be_include/be_enum_val.h ../be_include/be_array.h \ - ../be_include/be_sequence.h ../be_include/be_string.h \ - ../be_include/be_typedef.h ../be_include/be_root.h \ - ../be_include/be_helper.h ../be_include/be_state.h \ - ../be_include/be_codegen.h ../be_include/be_factory.h -.obj/be_union.o .shobj/be_union.so: be_union.cpp ../include/idl.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/config.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ - ../include/intlmacros.h ../include/idl_narrow.h \ - ../include/idl_defines.h ../include/idl_fwd.h ../include/idl_bool.h \ - ../include/utl_string.h ../include/utl_identifier.h ../include/ast.h \ - ../include/utl_scoped_name.h ../include/ast_decl.h \ - ../include/ast_expression.h ../include/utl_scope.h \ - ../include/ast_type.h ../include/ast_concrete_type.h \ - ../include/ast_predefined_type.h ../include/ast_module.h \ - ../include/ast_root.h ../include/ast_interface.h \ - ../include/ast_interface_fwd.h ../include/ast_structure.h \ - ../include/ast_exception.h ../include/ast_enum.h \ - ../include/ast_operation.h ../include/utl_list.h \ - ../include/ast_field.h ../include/ast_argument.h \ - ../include/ast_attribute.h ../include/ast_union.h \ - ../include/ast_union_branch.h ../include/ast_union_label.h \ - ../include/ast_constant.h ../include/ast_enum_val.h \ - ../include/ast_array.h ../include/ast_sequence.h \ - ../include/ast_string.h ../include/ast_typedef.h \ - ../include/utl_strlist.h ../include/utl_exprlist.h \ - ../include/ast_generator.h ../include/util.h ../include/utl_stack.h \ - ../include/utl_idlist.h ../include/utl_exceptlist.h \ - ../include/utl_namelist.h ../include/utl_labellist.h \ - ../include/utl_decllist.h ../include/idl_global.h \ - ../include/utl_error.h ../include/utl_indenter.h \ - ../include/idl_extern.h ../include/fe_extern.h ../include/be_extern.h \ - ../include/drv_extern.h ../include/ast_extern.h \ - ../include/nr_extern.h ../include/global_extern.h ../be_include/be.h \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Containers.i \ - ../be_include/be_decl.h ../be_include/be_scope.h \ - ../be_include/be_generator.h ../be_include/be_type.h \ - ../be_include/be_predefined_type.h ../be_include/be_module.h \ - ../be_include/be_interface.h ../be_include/be_interface_fwd.h \ - ../be_include/be_structure.h ../be_include/be_exception.h \ - ../be_include/be_expression.h ../be_include/be_enum.h \ - ../be_include/be_operation.h ../be_include/be_field.h \ - ../be_include/be_argument.h ../be_include/be_attribute.h \ - ../be_include/be_union.h ../be_include/be_union_branch.h \ - ../be_include/be_union_label.h ../be_include/be_constant.h \ - ../be_include/be_enum_val.h ../be_include/be_array.h \ - ../be_include/be_sequence.h ../be_include/be_string.h \ - ../be_include/be_typedef.h ../be_include/be_root.h \ - ../be_include/be_helper.h ../be_include/be_state.h \ - ../be_include/be_codegen.h ../be_include/be_factory.h -.obj/be_union_branch.o .shobj/be_union_branch.so: be_union_branch.cpp ../include/idl.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/config.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ - ../include/intlmacros.h ../include/idl_narrow.h \ - ../include/idl_defines.h ../include/idl_fwd.h ../include/idl_bool.h \ - ../include/utl_string.h ../include/utl_identifier.h ../include/ast.h \ - ../include/utl_scoped_name.h ../include/ast_decl.h \ - ../include/ast_expression.h ../include/utl_scope.h \ - ../include/ast_type.h ../include/ast_concrete_type.h \ - ../include/ast_predefined_type.h ../include/ast_module.h \ - ../include/ast_root.h ../include/ast_interface.h \ - ../include/ast_interface_fwd.h ../include/ast_structure.h \ - ../include/ast_exception.h ../include/ast_enum.h \ - ../include/ast_operation.h ../include/utl_list.h \ - ../include/ast_field.h ../include/ast_argument.h \ - ../include/ast_attribute.h ../include/ast_union.h \ - ../include/ast_union_branch.h ../include/ast_union_label.h \ - ../include/ast_constant.h ../include/ast_enum_val.h \ - ../include/ast_array.h ../include/ast_sequence.h \ - ../include/ast_string.h ../include/ast_typedef.h \ - ../include/utl_strlist.h ../include/utl_exprlist.h \ - ../include/ast_generator.h ../include/util.h ../include/utl_stack.h \ - ../include/utl_idlist.h ../include/utl_exceptlist.h \ - ../include/utl_namelist.h ../include/utl_labellist.h \ - ../include/utl_decllist.h ../include/idl_global.h \ - ../include/utl_error.h ../include/utl_indenter.h \ - ../include/idl_extern.h ../include/fe_extern.h ../include/be_extern.h \ - ../include/drv_extern.h ../include/ast_extern.h \ - ../include/nr_extern.h ../include/global_extern.h ../be_include/be.h \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Containers.i \ - ../be_include/be_decl.h ../be_include/be_scope.h \ - ../be_include/be_generator.h ../be_include/be_type.h \ - ../be_include/be_predefined_type.h ../be_include/be_module.h \ - ../be_include/be_interface.h ../be_include/be_interface_fwd.h \ - ../be_include/be_structure.h ../be_include/be_exception.h \ - ../be_include/be_expression.h ../be_include/be_enum.h \ - ../be_include/be_operation.h ../be_include/be_field.h \ - ../be_include/be_argument.h ../be_include/be_attribute.h \ - ../be_include/be_union.h ../be_include/be_union_branch.h \ - ../be_include/be_union_label.h ../be_include/be_constant.h \ - ../be_include/be_enum_val.h ../be_include/be_array.h \ - ../be_include/be_sequence.h ../be_include/be_string.h \ - ../be_include/be_typedef.h ../be_include/be_root.h \ - ../be_include/be_helper.h ../be_include/be_state.h \ - ../be_include/be_codegen.h ../be_include/be_factory.h -.obj/be_union_label.o .shobj/be_union_label.so: be_union_label.cpp ../include/idl.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/config.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ - ../include/intlmacros.h ../include/idl_narrow.h \ - ../include/idl_defines.h ../include/idl_fwd.h ../include/idl_bool.h \ - ../include/utl_string.h ../include/utl_identifier.h ../include/ast.h \ - ../include/utl_scoped_name.h ../include/ast_decl.h \ - ../include/ast_expression.h ../include/utl_scope.h \ - ../include/ast_type.h ../include/ast_concrete_type.h \ - ../include/ast_predefined_type.h ../include/ast_module.h \ - ../include/ast_root.h ../include/ast_interface.h \ - ../include/ast_interface_fwd.h ../include/ast_structure.h \ - ../include/ast_exception.h ../include/ast_enum.h \ - ../include/ast_operation.h ../include/utl_list.h \ - ../include/ast_field.h ../include/ast_argument.h \ - ../include/ast_attribute.h ../include/ast_union.h \ - ../include/ast_union_branch.h ../include/ast_union_label.h \ - ../include/ast_constant.h ../include/ast_enum_val.h \ - ../include/ast_array.h ../include/ast_sequence.h \ - ../include/ast_string.h ../include/ast_typedef.h \ - ../include/utl_strlist.h ../include/utl_exprlist.h \ - ../include/ast_generator.h ../include/util.h ../include/utl_stack.h \ - ../include/utl_idlist.h ../include/utl_exceptlist.h \ - ../include/utl_namelist.h ../include/utl_labellist.h \ - ../include/utl_decllist.h ../include/idl_global.h \ - ../include/utl_error.h ../include/utl_indenter.h \ - ../include/idl_extern.h ../include/fe_extern.h ../include/be_extern.h \ - ../include/drv_extern.h ../include/ast_extern.h \ - ../include/nr_extern.h ../include/global_extern.h ../be_include/be.h \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Containers.i \ - ../be_include/be_decl.h ../be_include/be_scope.h \ - ../be_include/be_generator.h ../be_include/be_type.h \ - ../be_include/be_predefined_type.h ../be_include/be_module.h \ - ../be_include/be_interface.h ../be_include/be_interface_fwd.h \ - ../be_include/be_structure.h ../be_include/be_exception.h \ - ../be_include/be_expression.h ../be_include/be_enum.h \ - ../be_include/be_operation.h ../be_include/be_field.h \ - ../be_include/be_argument.h ../be_include/be_attribute.h \ - ../be_include/be_union.h ../be_include/be_union_branch.h \ - ../be_include/be_union_label.h ../be_include/be_constant.h \ - ../be_include/be_enum_val.h ../be_include/be_array.h \ - ../be_include/be_sequence.h ../be_include/be_string.h \ - ../be_include/be_typedef.h ../be_include/be_root.h \ - ../be_include/be_helper.h ../be_include/be_state.h \ - ../be_include/be_codegen.h ../be_include/be_factory.h -.obj/be_generator.o .shobj/be_generator.so: be_generator.cpp ../include/idl.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/config.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ - ../include/intlmacros.h ../include/idl_narrow.h \ - ../include/idl_defines.h ../include/idl_fwd.h ../include/idl_bool.h \ - ../include/utl_string.h ../include/utl_identifier.h ../include/ast.h \ - ../include/utl_scoped_name.h ../include/ast_decl.h \ - ../include/ast_expression.h ../include/utl_scope.h \ - ../include/ast_type.h ../include/ast_concrete_type.h \ - ../include/ast_predefined_type.h ../include/ast_module.h \ - ../include/ast_root.h ../include/ast_interface.h \ - ../include/ast_interface_fwd.h ../include/ast_structure.h \ - ../include/ast_exception.h ../include/ast_enum.h \ - ../include/ast_operation.h ../include/utl_list.h \ - ../include/ast_field.h ../include/ast_argument.h \ - ../include/ast_attribute.h ../include/ast_union.h \ - ../include/ast_union_branch.h ../include/ast_union_label.h \ - ../include/ast_constant.h ../include/ast_enum_val.h \ - ../include/ast_array.h ../include/ast_sequence.h \ - ../include/ast_string.h ../include/ast_typedef.h \ - ../include/utl_strlist.h ../include/utl_exprlist.h \ - ../include/ast_generator.h ../include/util.h ../include/utl_stack.h \ - ../include/utl_idlist.h ../include/utl_exceptlist.h \ - ../include/utl_namelist.h ../include/utl_labellist.h \ - ../include/utl_decllist.h ../include/idl_global.h \ - ../include/utl_error.h ../include/utl_indenter.h \ - ../include/idl_extern.h ../include/fe_extern.h ../include/be_extern.h \ - ../include/drv_extern.h ../include/ast_extern.h \ - ../include/nr_extern.h ../include/global_extern.h ../be_include/be.h \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Containers.i \ - ../be_include/be_decl.h ../be_include/be_scope.h \ - ../be_include/be_generator.h ../be_include/be_type.h \ - ../be_include/be_predefined_type.h ../be_include/be_module.h \ - ../be_include/be_interface.h ../be_include/be_interface_fwd.h \ - ../be_include/be_structure.h ../be_include/be_exception.h \ - ../be_include/be_expression.h ../be_include/be_enum.h \ - ../be_include/be_operation.h ../be_include/be_field.h \ - ../be_include/be_argument.h ../be_include/be_attribute.h \ - ../be_include/be_union.h ../be_include/be_union_branch.h \ - ../be_include/be_union_label.h ../be_include/be_constant.h \ - ../be_include/be_enum_val.h ../be_include/be_array.h \ - ../be_include/be_sequence.h ../be_include/be_string.h \ - ../be_include/be_typedef.h ../be_include/be_root.h \ - ../be_include/be_helper.h ../be_include/be_state.h \ - ../be_include/be_codegen.h ../be_include/be_factory.h -.obj/be_init.o .shobj/be_init.so: be_init.cpp ../include/idl.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/config.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ - ../include/intlmacros.h ../include/idl_narrow.h \ - ../include/idl_defines.h ../include/idl_fwd.h ../include/idl_bool.h \ - ../include/utl_string.h ../include/utl_identifier.h ../include/ast.h \ - ../include/utl_scoped_name.h ../include/ast_decl.h \ - ../include/ast_expression.h ../include/utl_scope.h \ - ../include/ast_type.h ../include/ast_concrete_type.h \ - ../include/ast_predefined_type.h ../include/ast_module.h \ - ../include/ast_root.h ../include/ast_interface.h \ - ../include/ast_interface_fwd.h ../include/ast_structure.h \ - ../include/ast_exception.h ../include/ast_enum.h \ - ../include/ast_operation.h ../include/utl_list.h \ - ../include/ast_field.h ../include/ast_argument.h \ - ../include/ast_attribute.h ../include/ast_union.h \ - ../include/ast_union_branch.h ../include/ast_union_label.h \ - ../include/ast_constant.h ../include/ast_enum_val.h \ - ../include/ast_array.h ../include/ast_sequence.h \ - ../include/ast_string.h ../include/ast_typedef.h \ - ../include/utl_strlist.h ../include/utl_exprlist.h \ - ../include/ast_generator.h ../include/util.h ../include/utl_stack.h \ - ../include/utl_idlist.h ../include/utl_exceptlist.h \ - ../include/utl_namelist.h ../include/utl_labellist.h \ - ../include/utl_decllist.h ../include/idl_global.h \ - ../include/utl_error.h ../include/utl_indenter.h \ - ../include/idl_extern.h ../include/fe_extern.h ../include/be_extern.h \ - ../include/drv_extern.h ../include/ast_extern.h \ - ../include/nr_extern.h ../include/global_extern.h ../be_include/be.h \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Containers.i \ - ../be_include/be_decl.h ../be_include/be_scope.h \ - ../be_include/be_generator.h ../be_include/be_type.h \ - ../be_include/be_predefined_type.h ../be_include/be_module.h \ - ../be_include/be_interface.h ../be_include/be_interface_fwd.h \ - ../be_include/be_structure.h ../be_include/be_exception.h \ - ../be_include/be_expression.h ../be_include/be_enum.h \ - ../be_include/be_operation.h ../be_include/be_field.h \ - ../be_include/be_argument.h ../be_include/be_attribute.h \ - ../be_include/be_union.h ../be_include/be_union_branch.h \ - ../be_include/be_union_label.h ../be_include/be_constant.h \ - ../be_include/be_enum_val.h ../be_include/be_array.h \ - ../be_include/be_sequence.h ../be_include/be_string.h \ - ../be_include/be_typedef.h ../be_include/be_root.h \ - ../be_include/be_helper.h ../be_include/be_state.h \ - ../be_include/be_codegen.h ../be_include/be_factory.h -.obj/be_produce.o .shobj/be_produce.so: be_produce.cpp ../include/idl.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/config.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ - ../include/intlmacros.h ../include/idl_narrow.h \ - ../include/idl_defines.h ../include/idl_fwd.h ../include/idl_bool.h \ - ../include/utl_string.h ../include/utl_identifier.h ../include/ast.h \ - ../include/utl_scoped_name.h ../include/ast_decl.h \ - ../include/ast_expression.h ../include/utl_scope.h \ - ../include/ast_type.h ../include/ast_concrete_type.h \ - ../include/ast_predefined_type.h ../include/ast_module.h \ - ../include/ast_root.h ../include/ast_interface.h \ - ../include/ast_interface_fwd.h ../include/ast_structure.h \ - ../include/ast_exception.h ../include/ast_enum.h \ - ../include/ast_operation.h ../include/utl_list.h \ - ../include/ast_field.h ../include/ast_argument.h \ - ../include/ast_attribute.h ../include/ast_union.h \ - ../include/ast_union_branch.h ../include/ast_union_label.h \ - ../include/ast_constant.h ../include/ast_enum_val.h \ - ../include/ast_array.h ../include/ast_sequence.h \ - ../include/ast_string.h ../include/ast_typedef.h \ - ../include/utl_strlist.h ../include/utl_exprlist.h \ - ../include/ast_generator.h ../include/util.h ../include/utl_stack.h \ - ../include/utl_idlist.h ../include/utl_exceptlist.h \ - ../include/utl_namelist.h ../include/utl_labellist.h \ - ../include/utl_decllist.h ../include/idl_global.h \ - ../include/utl_error.h ../include/utl_indenter.h \ - ../include/idl_extern.h ../include/fe_extern.h ../include/be_extern.h \ - ../include/drv_extern.h ../include/ast_extern.h \ - ../include/nr_extern.h ../include/global_extern.h ../be_include/be.h \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Containers.i \ - ../be_include/be_decl.h ../be_include/be_scope.h \ - ../be_include/be_generator.h ../be_include/be_type.h \ - ../be_include/be_predefined_type.h ../be_include/be_module.h \ - ../be_include/be_interface.h ../be_include/be_interface_fwd.h \ - ../be_include/be_structure.h ../be_include/be_exception.h \ - ../be_include/be_expression.h ../be_include/be_enum.h \ - ../be_include/be_operation.h ../be_include/be_field.h \ - ../be_include/be_argument.h ../be_include/be_attribute.h \ - ../be_include/be_union.h ../be_include/be_union_branch.h \ - ../be_include/be_union_label.h ../be_include/be_constant.h \ - ../be_include/be_enum_val.h ../be_include/be_array.h \ - ../be_include/be_sequence.h ../be_include/be_string.h \ - ../be_include/be_typedef.h ../be_include/be_root.h \ - ../be_include/be_helper.h ../be_include/be_state.h \ - ../be_include/be_codegen.h ../be_include/be_factory.h -.obj/be_args.o .shobj/be_args.so: be_args.cpp ../include/idl.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/config.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ - ../include/intlmacros.h ../include/idl_narrow.h \ - ../include/idl_defines.h ../include/idl_fwd.h ../include/idl_bool.h \ - ../include/utl_string.h ../include/utl_identifier.h ../include/ast.h \ - ../include/utl_scoped_name.h ../include/ast_decl.h \ - ../include/ast_expression.h ../include/utl_scope.h \ - ../include/ast_type.h ../include/ast_concrete_type.h \ - ../include/ast_predefined_type.h ../include/ast_module.h \ - ../include/ast_root.h ../include/ast_interface.h \ - ../include/ast_interface_fwd.h ../include/ast_structure.h \ - ../include/ast_exception.h ../include/ast_enum.h \ - ../include/ast_operation.h ../include/utl_list.h \ - ../include/ast_field.h ../include/ast_argument.h \ - ../include/ast_attribute.h ../include/ast_union.h \ - ../include/ast_union_branch.h ../include/ast_union_label.h \ - ../include/ast_constant.h ../include/ast_enum_val.h \ - ../include/ast_array.h ../include/ast_sequence.h \ - ../include/ast_string.h ../include/ast_typedef.h \ - ../include/utl_strlist.h ../include/utl_exprlist.h \ - ../include/ast_generator.h ../include/util.h ../include/utl_stack.h \ - ../include/utl_idlist.h ../include/utl_exceptlist.h \ - ../include/utl_namelist.h ../include/utl_labellist.h \ - ../include/utl_decllist.h ../include/idl_global.h \ - ../include/utl_error.h ../include/utl_indenter.h \ - ../include/idl_extern.h ../include/fe_extern.h ../include/be_extern.h \ - ../include/drv_extern.h ../include/ast_extern.h \ - ../include/nr_extern.h ../include/global_extern.h ../be_include/be.h \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Containers.i \ - ../be_include/be_decl.h ../be_include/be_scope.h \ - ../be_include/be_generator.h ../be_include/be_type.h \ - ../be_include/be_predefined_type.h ../be_include/be_module.h \ - ../be_include/be_interface.h ../be_include/be_interface_fwd.h \ - ../be_include/be_structure.h ../be_include/be_exception.h \ - ../be_include/be_expression.h ../be_include/be_enum.h \ - ../be_include/be_operation.h ../be_include/be_field.h \ - ../be_include/be_argument.h ../be_include/be_attribute.h \ - ../be_include/be_union.h ../be_include/be_union_branch.h \ - ../be_include/be_union_label.h ../be_include/be_constant.h \ - ../be_include/be_enum_val.h ../be_include/be_array.h \ - ../be_include/be_sequence.h ../be_include/be_string.h \ - ../be_include/be_typedef.h ../be_include/be_root.h \ - ../be_include/be_helper.h ../be_include/be_state.h \ - ../be_include/be_codegen.h ../be_include/be_factory.h -.obj/be_helper.o .shobj/be_helper.so: be_helper.cpp ../include/idl.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/config.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ - ../include/intlmacros.h ../include/idl_narrow.h \ - ../include/idl_defines.h ../include/idl_fwd.h ../include/idl_bool.h \ - ../include/utl_string.h ../include/utl_identifier.h ../include/ast.h \ - ../include/utl_scoped_name.h ../include/ast_decl.h \ - ../include/ast_expression.h ../include/utl_scope.h \ - ../include/ast_type.h ../include/ast_concrete_type.h \ - ../include/ast_predefined_type.h ../include/ast_module.h \ - ../include/ast_root.h ../include/ast_interface.h \ - ../include/ast_interface_fwd.h ../include/ast_structure.h \ - ../include/ast_exception.h ../include/ast_enum.h \ - ../include/ast_operation.h ../include/utl_list.h \ - ../include/ast_field.h ../include/ast_argument.h \ - ../include/ast_attribute.h ../include/ast_union.h \ - ../include/ast_union_branch.h ../include/ast_union_label.h \ - ../include/ast_constant.h ../include/ast_enum_val.h \ - ../include/ast_array.h ../include/ast_sequence.h \ - ../include/ast_string.h ../include/ast_typedef.h \ - ../include/utl_strlist.h ../include/utl_exprlist.h \ - ../include/ast_generator.h ../include/util.h ../include/utl_stack.h \ - ../include/utl_idlist.h ../include/utl_exceptlist.h \ - ../include/utl_namelist.h ../include/utl_labellist.h \ - ../include/utl_decllist.h ../include/idl_global.h \ - ../include/utl_error.h ../include/utl_indenter.h \ - ../include/idl_extern.h ../include/fe_extern.h ../include/be_extern.h \ - ../include/drv_extern.h ../include/ast_extern.h \ - ../include/nr_extern.h ../include/global_extern.h ../be_include/be.h \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Containers.i \ - ../be_include/be_decl.h ../be_include/be_scope.h \ - ../be_include/be_generator.h ../be_include/be_type.h \ - ../be_include/be_predefined_type.h ../be_include/be_module.h \ - ../be_include/be_interface.h ../be_include/be_interface_fwd.h \ - ../be_include/be_structure.h ../be_include/be_exception.h \ - ../be_include/be_expression.h ../be_include/be_enum.h \ - ../be_include/be_operation.h ../be_include/be_field.h \ - ../be_include/be_argument.h ../be_include/be_attribute.h \ - ../be_include/be_union.h ../be_include/be_union_branch.h \ - ../be_include/be_union_label.h ../be_include/be_constant.h \ - ../be_include/be_enum_val.h ../be_include/be_array.h \ - ../be_include/be_sequence.h ../be_include/be_string.h \ - ../be_include/be_typedef.h ../be_include/be_root.h \ - ../be_include/be_helper.h ../be_include/be_state.h \ - ../be_include/be_codegen.h ../be_include/be_factory.h -.obj/be_state.o .shobj/be_state.so: be_state.cpp ../include/idl.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/config.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ - ../include/intlmacros.h ../include/idl_narrow.h \ - ../include/idl_defines.h ../include/idl_fwd.h ../include/idl_bool.h \ - ../include/utl_string.h ../include/utl_identifier.h ../include/ast.h \ - ../include/utl_scoped_name.h ../include/ast_decl.h \ - ../include/ast_expression.h ../include/utl_scope.h \ - ../include/ast_type.h ../include/ast_concrete_type.h \ - ../include/ast_predefined_type.h ../include/ast_module.h \ - ../include/ast_root.h ../include/ast_interface.h \ - ../include/ast_interface_fwd.h ../include/ast_structure.h \ - ../include/ast_exception.h ../include/ast_enum.h \ - ../include/ast_operation.h ../include/utl_list.h \ - ../include/ast_field.h ../include/ast_argument.h \ - ../include/ast_attribute.h ../include/ast_union.h \ - ../include/ast_union_branch.h ../include/ast_union_label.h \ - ../include/ast_constant.h ../include/ast_enum_val.h \ - ../include/ast_array.h ../include/ast_sequence.h \ - ../include/ast_string.h ../include/ast_typedef.h \ - ../include/utl_strlist.h ../include/utl_exprlist.h \ - ../include/ast_generator.h ../include/util.h ../include/utl_stack.h \ - ../include/utl_idlist.h ../include/utl_exceptlist.h \ - ../include/utl_namelist.h ../include/utl_labellist.h \ - ../include/utl_decllist.h ../include/idl_global.h \ - ../include/utl_error.h ../include/utl_indenter.h \ - ../include/idl_extern.h ../include/fe_extern.h ../include/be_extern.h \ - ../include/drv_extern.h ../include/ast_extern.h \ - ../include/nr_extern.h ../include/global_extern.h ../be_include/be.h \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Containers.i \ - ../be_include/be_decl.h ../be_include/be_scope.h \ - ../be_include/be_generator.h ../be_include/be_type.h \ - ../be_include/be_predefined_type.h ../be_include/be_module.h \ - ../be_include/be_interface.h ../be_include/be_interface_fwd.h \ - ../be_include/be_structure.h ../be_include/be_exception.h \ - ../be_include/be_expression.h ../be_include/be_enum.h \ - ../be_include/be_operation.h ../be_include/be_field.h \ - ../be_include/be_argument.h ../be_include/be_attribute.h \ - ../be_include/be_union.h ../be_include/be_union_branch.h \ - ../be_include/be_union_label.h ../be_include/be_constant.h \ - ../be_include/be_enum_val.h ../be_include/be_array.h \ - ../be_include/be_sequence.h ../be_include/be_string.h \ - ../be_include/be_typedef.h ../be_include/be_root.h \ - ../be_include/be_helper.h ../be_include/be_state.h \ - ../be_include/be_codegen.h ../be_include/be_factory.h -.obj/be_state_array.o .shobj/be_state_array.so: be_state_array.cpp ../include/idl.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/config.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ - ../include/intlmacros.h ../include/idl_narrow.h \ - ../include/idl_defines.h ../include/idl_fwd.h ../include/idl_bool.h \ - ../include/utl_string.h ../include/utl_identifier.h ../include/ast.h \ - ../include/utl_scoped_name.h ../include/ast_decl.h \ - ../include/ast_expression.h ../include/utl_scope.h \ - ../include/ast_type.h ../include/ast_concrete_type.h \ - ../include/ast_predefined_type.h ../include/ast_module.h \ - ../include/ast_root.h ../include/ast_interface.h \ - ../include/ast_interface_fwd.h ../include/ast_structure.h \ - ../include/ast_exception.h ../include/ast_enum.h \ - ../include/ast_operation.h ../include/utl_list.h \ - ../include/ast_field.h ../include/ast_argument.h \ - ../include/ast_attribute.h ../include/ast_union.h \ - ../include/ast_union_branch.h ../include/ast_union_label.h \ - ../include/ast_constant.h ../include/ast_enum_val.h \ - ../include/ast_array.h ../include/ast_sequence.h \ - ../include/ast_string.h ../include/ast_typedef.h \ - ../include/utl_strlist.h ../include/utl_exprlist.h \ - ../include/ast_generator.h ../include/util.h ../include/utl_stack.h \ - ../include/utl_idlist.h ../include/utl_exceptlist.h \ - ../include/utl_namelist.h ../include/utl_labellist.h \ - ../include/utl_decllist.h ../include/idl_global.h \ - ../include/utl_error.h ../include/utl_indenter.h \ - ../include/idl_extern.h ../include/fe_extern.h ../include/be_extern.h \ - ../include/drv_extern.h ../include/ast_extern.h \ - ../include/nr_extern.h ../include/global_extern.h ../be_include/be.h \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Containers.i \ - ../be_include/be_decl.h ../be_include/be_scope.h \ - ../be_include/be_generator.h ../be_include/be_type.h \ - ../be_include/be_predefined_type.h ../be_include/be_module.h \ - ../be_include/be_interface.h ../be_include/be_interface_fwd.h \ - ../be_include/be_structure.h ../be_include/be_exception.h \ - ../be_include/be_expression.h ../be_include/be_enum.h \ - ../be_include/be_operation.h ../be_include/be_field.h \ - ../be_include/be_argument.h ../be_include/be_attribute.h \ - ../be_include/be_union.h ../be_include/be_union_branch.h \ - ../be_include/be_union_label.h ../be_include/be_constant.h \ - ../be_include/be_enum_val.h ../be_include/be_array.h \ - ../be_include/be_sequence.h ../be_include/be_string.h \ - ../be_include/be_typedef.h ../be_include/be_root.h \ - ../be_include/be_helper.h ../be_include/be_state.h \ - ../be_include/be_codegen.h ../be_include/be_factory.h -.obj/be_state_argument.o .shobj/be_state_argument.so: be_state_argument.cpp ../include/idl.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/config.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ - ../include/intlmacros.h ../include/idl_narrow.h \ - ../include/idl_defines.h ../include/idl_fwd.h ../include/idl_bool.h \ - ../include/utl_string.h ../include/utl_identifier.h ../include/ast.h \ - ../include/utl_scoped_name.h ../include/ast_decl.h \ - ../include/ast_expression.h ../include/utl_scope.h \ - ../include/ast_type.h ../include/ast_concrete_type.h \ - ../include/ast_predefined_type.h ../include/ast_module.h \ - ../include/ast_root.h ../include/ast_interface.h \ - ../include/ast_interface_fwd.h ../include/ast_structure.h \ - ../include/ast_exception.h ../include/ast_enum.h \ - ../include/ast_operation.h ../include/utl_list.h \ - ../include/ast_field.h ../include/ast_argument.h \ - ../include/ast_attribute.h ../include/ast_union.h \ - ../include/ast_union_branch.h ../include/ast_union_label.h \ - ../include/ast_constant.h ../include/ast_enum_val.h \ - ../include/ast_array.h ../include/ast_sequence.h \ - ../include/ast_string.h ../include/ast_typedef.h \ - ../include/utl_strlist.h ../include/utl_exprlist.h \ - ../include/ast_generator.h ../include/util.h ../include/utl_stack.h \ - ../include/utl_idlist.h ../include/utl_exceptlist.h \ - ../include/utl_namelist.h ../include/utl_labellist.h \ - ../include/utl_decllist.h ../include/idl_global.h \ - ../include/utl_error.h ../include/utl_indenter.h \ - ../include/idl_extern.h ../include/fe_extern.h ../include/be_extern.h \ - ../include/drv_extern.h ../include/ast_extern.h \ - ../include/nr_extern.h ../include/global_extern.h ../be_include/be.h \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Containers.i \ - ../be_include/be_decl.h ../be_include/be_scope.h \ - ../be_include/be_generator.h ../be_include/be_type.h \ - ../be_include/be_predefined_type.h ../be_include/be_module.h \ - ../be_include/be_interface.h ../be_include/be_interface_fwd.h \ - ../be_include/be_structure.h ../be_include/be_exception.h \ - ../be_include/be_expression.h ../be_include/be_enum.h \ - ../be_include/be_operation.h ../be_include/be_field.h \ - ../be_include/be_argument.h ../be_include/be_attribute.h \ - ../be_include/be_union.h ../be_include/be_union_branch.h \ - ../be_include/be_union_label.h ../be_include/be_constant.h \ - ../be_include/be_enum_val.h ../be_include/be_array.h \ - ../be_include/be_sequence.h ../be_include/be_string.h \ - ../be_include/be_typedef.h ../be_include/be_root.h \ - ../be_include/be_helper.h ../be_include/be_state.h \ - ../be_include/be_codegen.h ../be_include/be_factory.h -.obj/be_state_attribute.o .shobj/be_state_attribute.so: be_state_attribute.cpp ../include/idl.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/config.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ - ../include/intlmacros.h ../include/idl_narrow.h \ - ../include/idl_defines.h ../include/idl_fwd.h ../include/idl_bool.h \ - ../include/utl_string.h ../include/utl_identifier.h ../include/ast.h \ - ../include/utl_scoped_name.h ../include/ast_decl.h \ - ../include/ast_expression.h ../include/utl_scope.h \ - ../include/ast_type.h ../include/ast_concrete_type.h \ - ../include/ast_predefined_type.h ../include/ast_module.h \ - ../include/ast_root.h ../include/ast_interface.h \ - ../include/ast_interface_fwd.h ../include/ast_structure.h \ - ../include/ast_exception.h ../include/ast_enum.h \ - ../include/ast_operation.h ../include/utl_list.h \ - ../include/ast_field.h ../include/ast_argument.h \ - ../include/ast_attribute.h ../include/ast_union.h \ - ../include/ast_union_branch.h ../include/ast_union_label.h \ - ../include/ast_constant.h ../include/ast_enum_val.h \ - ../include/ast_array.h ../include/ast_sequence.h \ - ../include/ast_string.h ../include/ast_typedef.h \ - ../include/utl_strlist.h ../include/utl_exprlist.h \ - ../include/ast_generator.h ../include/util.h ../include/utl_stack.h \ - ../include/utl_idlist.h ../include/utl_exceptlist.h \ - ../include/utl_namelist.h ../include/utl_labellist.h \ - ../include/utl_decllist.h ../include/idl_global.h \ - ../include/utl_error.h ../include/utl_indenter.h \ - ../include/idl_extern.h ../include/fe_extern.h ../include/be_extern.h \ - ../include/drv_extern.h ../include/ast_extern.h \ - ../include/nr_extern.h ../include/global_extern.h ../be_include/be.h \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Containers.i \ - ../be_include/be_decl.h ../be_include/be_scope.h \ - ../be_include/be_generator.h ../be_include/be_type.h \ - ../be_include/be_predefined_type.h ../be_include/be_module.h \ - ../be_include/be_interface.h ../be_include/be_interface_fwd.h \ - ../be_include/be_structure.h ../be_include/be_exception.h \ - ../be_include/be_expression.h ../be_include/be_enum.h \ - ../be_include/be_operation.h ../be_include/be_field.h \ - ../be_include/be_argument.h ../be_include/be_attribute.h \ - ../be_include/be_union.h ../be_include/be_union_branch.h \ - ../be_include/be_union_label.h ../be_include/be_constant.h \ - ../be_include/be_enum_val.h ../be_include/be_array.h \ - ../be_include/be_sequence.h ../be_include/be_string.h \ - ../be_include/be_typedef.h ../be_include/be_root.h \ - ../be_include/be_helper.h ../be_include/be_state.h \ - ../be_include/be_codegen.h ../be_include/be_factory.h -.obj/be_state_exception.o .shobj/be_state_exception.so: be_state_exception.cpp ../include/idl.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/config.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ - ../include/intlmacros.h ../include/idl_narrow.h \ - ../include/idl_defines.h ../include/idl_fwd.h ../include/idl_bool.h \ - ../include/utl_string.h ../include/utl_identifier.h ../include/ast.h \ - ../include/utl_scoped_name.h ../include/ast_decl.h \ - ../include/ast_expression.h ../include/utl_scope.h \ - ../include/ast_type.h ../include/ast_concrete_type.h \ - ../include/ast_predefined_type.h ../include/ast_module.h \ - ../include/ast_root.h ../include/ast_interface.h \ - ../include/ast_interface_fwd.h ../include/ast_structure.h \ - ../include/ast_exception.h ../include/ast_enum.h \ - ../include/ast_operation.h ../include/utl_list.h \ - ../include/ast_field.h ../include/ast_argument.h \ - ../include/ast_attribute.h ../include/ast_union.h \ - ../include/ast_union_branch.h ../include/ast_union_label.h \ - ../include/ast_constant.h ../include/ast_enum_val.h \ - ../include/ast_array.h ../include/ast_sequence.h \ - ../include/ast_string.h ../include/ast_typedef.h \ - ../include/utl_strlist.h ../include/utl_exprlist.h \ - ../include/ast_generator.h ../include/util.h ../include/utl_stack.h \ - ../include/utl_idlist.h ../include/utl_exceptlist.h \ - ../include/utl_namelist.h ../include/utl_labellist.h \ - ../include/utl_decllist.h ../include/idl_global.h \ - ../include/utl_error.h ../include/utl_indenter.h \ - ../include/idl_extern.h ../include/fe_extern.h ../include/be_extern.h \ - ../include/drv_extern.h ../include/ast_extern.h \ - ../include/nr_extern.h ../include/global_extern.h ../be_include/be.h \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Containers.i \ - ../be_include/be_decl.h ../be_include/be_scope.h \ - ../be_include/be_generator.h ../be_include/be_type.h \ - ../be_include/be_predefined_type.h ../be_include/be_module.h \ - ../be_include/be_interface.h ../be_include/be_interface_fwd.h \ - ../be_include/be_structure.h ../be_include/be_exception.h \ - ../be_include/be_expression.h ../be_include/be_enum.h \ - ../be_include/be_operation.h ../be_include/be_field.h \ - ../be_include/be_argument.h ../be_include/be_attribute.h \ - ../be_include/be_union.h ../be_include/be_union_branch.h \ - ../be_include/be_union_label.h ../be_include/be_constant.h \ - ../be_include/be_enum_val.h ../be_include/be_array.h \ - ../be_include/be_sequence.h ../be_include/be_string.h \ - ../be_include/be_typedef.h ../be_include/be_root.h \ - ../be_include/be_helper.h ../be_include/be_state.h \ - ../be_include/be_codegen.h ../be_include/be_factory.h -.obj/be_state_operation.o .shobj/be_state_operation.so: be_state_operation.cpp ../include/idl.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/config.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ - ../include/intlmacros.h ../include/idl_narrow.h \ - ../include/idl_defines.h ../include/idl_fwd.h ../include/idl_bool.h \ - ../include/utl_string.h ../include/utl_identifier.h ../include/ast.h \ - ../include/utl_scoped_name.h ../include/ast_decl.h \ - ../include/ast_expression.h ../include/utl_scope.h \ - ../include/ast_type.h ../include/ast_concrete_type.h \ - ../include/ast_predefined_type.h ../include/ast_module.h \ - ../include/ast_root.h ../include/ast_interface.h \ - ../include/ast_interface_fwd.h ../include/ast_structure.h \ - ../include/ast_exception.h ../include/ast_enum.h \ - ../include/ast_operation.h ../include/utl_list.h \ - ../include/ast_field.h ../include/ast_argument.h \ - ../include/ast_attribute.h ../include/ast_union.h \ - ../include/ast_union_branch.h ../include/ast_union_label.h \ - ../include/ast_constant.h ../include/ast_enum_val.h \ - ../include/ast_array.h ../include/ast_sequence.h \ - ../include/ast_string.h ../include/ast_typedef.h \ - ../include/utl_strlist.h ../include/utl_exprlist.h \ - ../include/ast_generator.h ../include/util.h ../include/utl_stack.h \ - ../include/utl_idlist.h ../include/utl_exceptlist.h \ - ../include/utl_namelist.h ../include/utl_labellist.h \ - ../include/utl_decllist.h ../include/idl_global.h \ - ../include/utl_error.h ../include/utl_indenter.h \ - ../include/idl_extern.h ../include/fe_extern.h ../include/be_extern.h \ - ../include/drv_extern.h ../include/ast_extern.h \ - ../include/nr_extern.h ../include/global_extern.h ../be_include/be.h \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Containers.i \ - ../be_include/be_decl.h ../be_include/be_scope.h \ - ../be_include/be_generator.h ../be_include/be_type.h \ - ../be_include/be_predefined_type.h ../be_include/be_module.h \ - ../be_include/be_interface.h ../be_include/be_interface_fwd.h \ - ../be_include/be_structure.h ../be_include/be_exception.h \ - ../be_include/be_expression.h ../be_include/be_enum.h \ - ../be_include/be_operation.h ../be_include/be_field.h \ - ../be_include/be_argument.h ../be_include/be_attribute.h \ - ../be_include/be_union.h ../be_include/be_union_branch.h \ - ../be_include/be_union_label.h ../be_include/be_constant.h \ - ../be_include/be_enum_val.h ../be_include/be_array.h \ - ../be_include/be_sequence.h ../be_include/be_string.h \ - ../be_include/be_typedef.h ../be_include/be_root.h \ - ../be_include/be_helper.h ../be_include/be_state.h \ - ../be_include/be_codegen.h ../be_include/be_factory.h -.obj/be_state_sequence.o .shobj/be_state_sequence.so: be_state_sequence.cpp ../include/idl.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/config.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ - ../include/intlmacros.h ../include/idl_narrow.h \ - ../include/idl_defines.h ../include/idl_fwd.h ../include/idl_bool.h \ - ../include/utl_string.h ../include/utl_identifier.h ../include/ast.h \ - ../include/utl_scoped_name.h ../include/ast_decl.h \ - ../include/ast_expression.h ../include/utl_scope.h \ - ../include/ast_type.h ../include/ast_concrete_type.h \ - ../include/ast_predefined_type.h ../include/ast_module.h \ - ../include/ast_root.h ../include/ast_interface.h \ - ../include/ast_interface_fwd.h ../include/ast_structure.h \ - ../include/ast_exception.h ../include/ast_enum.h \ - ../include/ast_operation.h ../include/utl_list.h \ - ../include/ast_field.h ../include/ast_argument.h \ - ../include/ast_attribute.h ../include/ast_union.h \ - ../include/ast_union_branch.h ../include/ast_union_label.h \ - ../include/ast_constant.h ../include/ast_enum_val.h \ - ../include/ast_array.h ../include/ast_sequence.h \ - ../include/ast_string.h ../include/ast_typedef.h \ - ../include/utl_strlist.h ../include/utl_exprlist.h \ - ../include/ast_generator.h ../include/util.h ../include/utl_stack.h \ - ../include/utl_idlist.h ../include/utl_exceptlist.h \ - ../include/utl_namelist.h ../include/utl_labellist.h \ - ../include/utl_decllist.h ../include/idl_global.h \ - ../include/utl_error.h ../include/utl_indenter.h \ - ../include/idl_extern.h ../include/fe_extern.h ../include/be_extern.h \ - ../include/drv_extern.h ../include/ast_extern.h \ - ../include/nr_extern.h ../include/global_extern.h ../be_include/be.h \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Containers.i \ - ../be_include/be_decl.h ../be_include/be_scope.h \ - ../be_include/be_generator.h ../be_include/be_type.h \ - ../be_include/be_predefined_type.h ../be_include/be_module.h \ - ../be_include/be_interface.h ../be_include/be_interface_fwd.h \ - ../be_include/be_structure.h ../be_include/be_exception.h \ - ../be_include/be_expression.h ../be_include/be_enum.h \ - ../be_include/be_operation.h ../be_include/be_field.h \ - ../be_include/be_argument.h ../be_include/be_attribute.h \ - ../be_include/be_union.h ../be_include/be_union_branch.h \ - ../be_include/be_union_label.h ../be_include/be_constant.h \ - ../be_include/be_enum_val.h ../be_include/be_array.h \ - ../be_include/be_sequence.h ../be_include/be_string.h \ - ../be_include/be_typedef.h ../be_include/be_root.h \ - ../be_include/be_helper.h ../be_include/be_state.h \ - ../be_include/be_codegen.h ../be_include/be_factory.h -.obj/be_state_structure.o .shobj/be_state_structure.so: be_state_structure.cpp ../include/idl.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/config.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ - ../include/intlmacros.h ../include/idl_narrow.h \ - ../include/idl_defines.h ../include/idl_fwd.h ../include/idl_bool.h \ - ../include/utl_string.h ../include/utl_identifier.h ../include/ast.h \ - ../include/utl_scoped_name.h ../include/ast_decl.h \ - ../include/ast_expression.h ../include/utl_scope.h \ - ../include/ast_type.h ../include/ast_concrete_type.h \ - ../include/ast_predefined_type.h ../include/ast_module.h \ - ../include/ast_root.h ../include/ast_interface.h \ - ../include/ast_interface_fwd.h ../include/ast_structure.h \ - ../include/ast_exception.h ../include/ast_enum.h \ - ../include/ast_operation.h ../include/utl_list.h \ - ../include/ast_field.h ../include/ast_argument.h \ - ../include/ast_attribute.h ../include/ast_union.h \ - ../include/ast_union_branch.h ../include/ast_union_label.h \ - ../include/ast_constant.h ../include/ast_enum_val.h \ - ../include/ast_array.h ../include/ast_sequence.h \ - ../include/ast_string.h ../include/ast_typedef.h \ - ../include/utl_strlist.h ../include/utl_exprlist.h \ - ../include/ast_generator.h ../include/util.h ../include/utl_stack.h \ - ../include/utl_idlist.h ../include/utl_exceptlist.h \ - ../include/utl_namelist.h ../include/utl_labellist.h \ - ../include/utl_decllist.h ../include/idl_global.h \ - ../include/utl_error.h ../include/utl_indenter.h \ - ../include/idl_extern.h ../include/fe_extern.h ../include/be_extern.h \ - ../include/drv_extern.h ../include/ast_extern.h \ - ../include/nr_extern.h ../include/global_extern.h ../be_include/be.h \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Containers.i \ - ../be_include/be_decl.h ../be_include/be_scope.h \ - ../be_include/be_generator.h ../be_include/be_type.h \ - ../be_include/be_predefined_type.h ../be_include/be_module.h \ - ../be_include/be_interface.h ../be_include/be_interface_fwd.h \ - ../be_include/be_structure.h ../be_include/be_exception.h \ - ../be_include/be_expression.h ../be_include/be_enum.h \ - ../be_include/be_operation.h ../be_include/be_field.h \ - ../be_include/be_argument.h ../be_include/be_attribute.h \ - ../be_include/be_union.h ../be_include/be_union_branch.h \ - ../be_include/be_union_label.h ../be_include/be_constant.h \ - ../be_include/be_enum_val.h ../be_include/be_array.h \ - ../be_include/be_sequence.h ../be_include/be_string.h \ - ../be_include/be_typedef.h ../be_include/be_root.h \ - ../be_include/be_helper.h ../be_include/be_state.h \ - ../be_include/be_codegen.h ../be_include/be_factory.h -.obj/be_state_typedef.o .shobj/be_state_typedef.so: be_state_typedef.cpp ../include/idl.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/config.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ - ../include/intlmacros.h ../include/idl_narrow.h \ - ../include/idl_defines.h ../include/idl_fwd.h ../include/idl_bool.h \ - ../include/utl_string.h ../include/utl_identifier.h ../include/ast.h \ - ../include/utl_scoped_name.h ../include/ast_decl.h \ - ../include/ast_expression.h ../include/utl_scope.h \ - ../include/ast_type.h ../include/ast_concrete_type.h \ - ../include/ast_predefined_type.h ../include/ast_module.h \ - ../include/ast_root.h ../include/ast_interface.h \ - ../include/ast_interface_fwd.h ../include/ast_structure.h \ - ../include/ast_exception.h ../include/ast_enum.h \ - ../include/ast_operation.h ../include/utl_list.h \ - ../include/ast_field.h ../include/ast_argument.h \ - ../include/ast_attribute.h ../include/ast_union.h \ - ../include/ast_union_branch.h ../include/ast_union_label.h \ - ../include/ast_constant.h ../include/ast_enum_val.h \ - ../include/ast_array.h ../include/ast_sequence.h \ - ../include/ast_string.h ../include/ast_typedef.h \ - ../include/utl_strlist.h ../include/utl_exprlist.h \ - ../include/ast_generator.h ../include/util.h ../include/utl_stack.h \ - ../include/utl_idlist.h ../include/utl_exceptlist.h \ - ../include/utl_namelist.h ../include/utl_labellist.h \ - ../include/utl_decllist.h ../include/idl_global.h \ - ../include/utl_error.h ../include/utl_indenter.h \ - ../include/idl_extern.h ../include/fe_extern.h ../include/be_extern.h \ - ../include/drv_extern.h ../include/ast_extern.h \ - ../include/nr_extern.h ../include/global_extern.h ../be_include/be.h \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Containers.i \ - ../be_include/be_decl.h ../be_include/be_scope.h \ - ../be_include/be_generator.h ../be_include/be_type.h \ - ../be_include/be_predefined_type.h ../be_include/be_module.h \ - ../be_include/be_interface.h ../be_include/be_interface_fwd.h \ - ../be_include/be_structure.h ../be_include/be_exception.h \ - ../be_include/be_expression.h ../be_include/be_enum.h \ - ../be_include/be_operation.h ../be_include/be_field.h \ - ../be_include/be_argument.h ../be_include/be_attribute.h \ - ../be_include/be_union.h ../be_include/be_union_branch.h \ - ../be_include/be_union_label.h ../be_include/be_constant.h \ - ../be_include/be_enum_val.h ../be_include/be_array.h \ - ../be_include/be_sequence.h ../be_include/be_string.h \ - ../be_include/be_typedef.h ../be_include/be_root.h \ - ../be_include/be_helper.h ../be_include/be_state.h \ - ../be_include/be_codegen.h ../be_include/be_factory.h -.obj/be_state_union.o .shobj/be_state_union.so: be_state_union.cpp ../include/idl.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/config.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ - ../include/intlmacros.h ../include/idl_narrow.h \ - ../include/idl_defines.h ../include/idl_fwd.h ../include/idl_bool.h \ - ../include/utl_string.h ../include/utl_identifier.h ../include/ast.h \ - ../include/utl_scoped_name.h ../include/ast_decl.h \ - ../include/ast_expression.h ../include/utl_scope.h \ - ../include/ast_type.h ../include/ast_concrete_type.h \ - ../include/ast_predefined_type.h ../include/ast_module.h \ - ../include/ast_root.h ../include/ast_interface.h \ - ../include/ast_interface_fwd.h ../include/ast_structure.h \ - ../include/ast_exception.h ../include/ast_enum.h \ - ../include/ast_operation.h ../include/utl_list.h \ - ../include/ast_field.h ../include/ast_argument.h \ - ../include/ast_attribute.h ../include/ast_union.h \ - ../include/ast_union_branch.h ../include/ast_union_label.h \ - ../include/ast_constant.h ../include/ast_enum_val.h \ - ../include/ast_array.h ../include/ast_sequence.h \ - ../include/ast_string.h ../include/ast_typedef.h \ - ../include/utl_strlist.h ../include/utl_exprlist.h \ - ../include/ast_generator.h ../include/util.h ../include/utl_stack.h \ - ../include/utl_idlist.h ../include/utl_exceptlist.h \ - ../include/utl_namelist.h ../include/utl_labellist.h \ - ../include/utl_decllist.h ../include/idl_global.h \ - ../include/utl_error.h ../include/utl_indenter.h \ - ../include/idl_extern.h ../include/fe_extern.h ../include/be_extern.h \ - ../include/drv_extern.h ../include/ast_extern.h \ - ../include/nr_extern.h ../include/global_extern.h ../be_include/be.h \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Containers.i \ - ../be_include/be_decl.h ../be_include/be_scope.h \ - ../be_include/be_generator.h ../be_include/be_type.h \ - ../be_include/be_predefined_type.h ../be_include/be_module.h \ - ../be_include/be_interface.h ../be_include/be_interface_fwd.h \ - ../be_include/be_structure.h ../be_include/be_exception.h \ - ../be_include/be_expression.h ../be_include/be_enum.h \ - ../be_include/be_operation.h ../be_include/be_field.h \ - ../be_include/be_argument.h ../be_include/be_attribute.h \ - ../be_include/be_union.h ../be_include/be_union_branch.h \ - ../be_include/be_union_label.h ../be_include/be_constant.h \ - ../be_include/be_enum_val.h ../be_include/be_array.h \ - ../be_include/be_sequence.h ../be_include/be_string.h \ - ../be_include/be_typedef.h ../be_include/be_root.h \ - ../be_include/be_helper.h ../be_include/be_state.h \ - ../be_include/be_codegen.h ../be_include/be_factory.h -.obj/be_codegen.o .shobj/be_codegen.so: be_codegen.cpp ../include/idl.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/config.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ - ../include/intlmacros.h ../include/idl_narrow.h \ - ../include/idl_defines.h ../include/idl_fwd.h ../include/idl_bool.h \ - ../include/utl_string.h ../include/utl_identifier.h ../include/ast.h \ - ../include/utl_scoped_name.h ../include/ast_decl.h \ - ../include/ast_expression.h ../include/utl_scope.h \ - ../include/ast_type.h ../include/ast_concrete_type.h \ - ../include/ast_predefined_type.h ../include/ast_module.h \ - ../include/ast_root.h ../include/ast_interface.h \ - ../include/ast_interface_fwd.h ../include/ast_structure.h \ - ../include/ast_exception.h ../include/ast_enum.h \ - ../include/ast_operation.h ../include/utl_list.h \ - ../include/ast_field.h ../include/ast_argument.h \ - ../include/ast_attribute.h ../include/ast_union.h \ - ../include/ast_union_branch.h ../include/ast_union_label.h \ - ../include/ast_constant.h ../include/ast_enum_val.h \ - ../include/ast_array.h ../include/ast_sequence.h \ - ../include/ast_string.h ../include/ast_typedef.h \ - ../include/utl_strlist.h ../include/utl_exprlist.h \ - ../include/ast_generator.h ../include/util.h ../include/utl_stack.h \ - ../include/utl_idlist.h ../include/utl_exceptlist.h \ - ../include/utl_namelist.h ../include/utl_labellist.h \ - ../include/utl_decllist.h ../include/idl_global.h \ - ../include/utl_error.h ../include/utl_indenter.h \ - ../include/idl_extern.h ../include/fe_extern.h ../include/be_extern.h \ - ../include/drv_extern.h ../include/ast_extern.h \ - ../include/nr_extern.h ../include/global_extern.h ../be_include/be.h \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Containers.i \ - ../be_include/be_decl.h ../be_include/be_scope.h \ - ../be_include/be_generator.h ../be_include/be_type.h \ - ../be_include/be_predefined_type.h ../be_include/be_module.h \ - ../be_include/be_interface.h ../be_include/be_interface_fwd.h \ - ../be_include/be_structure.h ../be_include/be_exception.h \ - ../be_include/be_expression.h ../be_include/be_enum.h \ - ../be_include/be_operation.h ../be_include/be_field.h \ - ../be_include/be_argument.h ../be_include/be_attribute.h \ - ../be_include/be_union.h ../be_include/be_union_branch.h \ - ../be_include/be_union_label.h ../be_include/be_constant.h \ - ../be_include/be_enum_val.h ../be_include/be_array.h \ - ../be_include/be_sequence.h ../be_include/be_string.h \ - ../be_include/be_typedef.h ../be_include/be_root.h \ - ../be_include/be_helper.h ../be_include/be_state.h \ - ../be_include/be_codegen.h ../be_include/be_factory.h -.obj/be_factory.o .shobj/be_factory.so: be_factory.cpp ../include/idl.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/config.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ - ../include/intlmacros.h ../include/idl_narrow.h \ - ../include/idl_defines.h ../include/idl_fwd.h ../include/idl_bool.h \ - ../include/utl_string.h ../include/utl_identifier.h ../include/ast.h \ - ../include/utl_scoped_name.h ../include/ast_decl.h \ - ../include/ast_expression.h ../include/utl_scope.h \ - ../include/ast_type.h ../include/ast_concrete_type.h \ - ../include/ast_predefined_type.h ../include/ast_module.h \ - ../include/ast_root.h ../include/ast_interface.h \ - ../include/ast_interface_fwd.h ../include/ast_structure.h \ - ../include/ast_exception.h ../include/ast_enum.h \ - ../include/ast_operation.h ../include/utl_list.h \ - ../include/ast_field.h ../include/ast_argument.h \ - ../include/ast_attribute.h ../include/ast_union.h \ - ../include/ast_union_branch.h ../include/ast_union_label.h \ - ../include/ast_constant.h ../include/ast_enum_val.h \ - ../include/ast_array.h ../include/ast_sequence.h \ - ../include/ast_string.h ../include/ast_typedef.h \ - ../include/utl_strlist.h ../include/utl_exprlist.h \ - ../include/ast_generator.h ../include/util.h ../include/utl_stack.h \ - ../include/utl_idlist.h ../include/utl_exceptlist.h \ - ../include/utl_namelist.h ../include/utl_labellist.h \ - ../include/utl_decllist.h ../include/idl_global.h \ - ../include/utl_error.h ../include/utl_indenter.h \ - ../include/idl_extern.h ../include/fe_extern.h ../include/be_extern.h \ - ../include/drv_extern.h ../include/ast_extern.h \ - ../include/nr_extern.h ../include/global_extern.h ../be_include/be.h \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Containers.i \ - ../be_include/be_decl.h ../be_include/be_scope.h \ - ../be_include/be_generator.h ../be_include/be_type.h \ - ../be_include/be_predefined_type.h ../be_include/be_module.h \ - ../be_include/be_interface.h ../be_include/be_interface_fwd.h \ - ../be_include/be_structure.h ../be_include/be_exception.h \ - ../be_include/be_expression.h ../be_include/be_enum.h \ - ../be_include/be_operation.h ../be_include/be_field.h \ - ../be_include/be_argument.h ../be_include/be_attribute.h \ - ../be_include/be_union.h ../be_include/be_union_branch.h \ - ../be_include/be_union_label.h ../be_include/be_constant.h \ - ../be_include/be_enum_val.h ../be_include/be_array.h \ - ../be_include/be_sequence.h ../be_include/be_string.h \ - ../be_include/be_typedef.h ../be_include/be_root.h \ - ../be_include/be_helper.h ../be_include/be_state.h \ - ../be_include/be_codegen.h ../be_include/be_factory.h \ - ../be_include/be_sunsoft.h -.obj/be_sunsoft.o .shobj/be_sunsoft.so: be_sunsoft.cpp ../include/idl.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/config.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ - ../include/intlmacros.h ../include/idl_narrow.h \ - ../include/idl_defines.h ../include/idl_fwd.h ../include/idl_bool.h \ - ../include/utl_string.h ../include/utl_identifier.h ../include/ast.h \ - ../include/utl_scoped_name.h ../include/ast_decl.h \ - ../include/ast_expression.h ../include/utl_scope.h \ - ../include/ast_type.h ../include/ast_concrete_type.h \ - ../include/ast_predefined_type.h ../include/ast_module.h \ - ../include/ast_root.h ../include/ast_interface.h \ - ../include/ast_interface_fwd.h ../include/ast_structure.h \ - ../include/ast_exception.h ../include/ast_enum.h \ - ../include/ast_operation.h ../include/utl_list.h \ - ../include/ast_field.h ../include/ast_argument.h \ - ../include/ast_attribute.h ../include/ast_union.h \ - ../include/ast_union_branch.h ../include/ast_union_label.h \ - ../include/ast_constant.h ../include/ast_enum_val.h \ - ../include/ast_array.h ../include/ast_sequence.h \ - ../include/ast_string.h ../include/ast_typedef.h \ - ../include/utl_strlist.h ../include/utl_exprlist.h \ - ../include/ast_generator.h ../include/util.h ../include/utl_stack.h \ - ../include/utl_idlist.h ../include/utl_exceptlist.h \ - ../include/utl_namelist.h ../include/utl_labellist.h \ - ../include/utl_decllist.h ../include/idl_global.h \ - ../include/utl_error.h ../include/utl_indenter.h \ - ../include/idl_extern.h ../include/fe_extern.h ../include/be_extern.h \ - ../include/drv_extern.h ../include/ast_extern.h \ - ../include/nr_extern.h ../include/global_extern.h ../be_include/be.h \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Containers.i \ - ../be_include/be_decl.h ../be_include/be_scope.h \ - ../be_include/be_generator.h ../be_include/be_type.h \ - ../be_include/be_predefined_type.h ../be_include/be_module.h \ - ../be_include/be_interface.h ../be_include/be_interface_fwd.h \ - ../be_include/be_structure.h ../be_include/be_exception.h \ - ../be_include/be_expression.h ../be_include/be_enum.h \ - ../be_include/be_operation.h ../be_include/be_field.h \ - ../be_include/be_argument.h ../be_include/be_attribute.h \ - ../be_include/be_union.h ../be_include/be_union_branch.h \ - ../be_include/be_union_label.h ../be_include/be_constant.h \ - ../be_include/be_enum_val.h ../be_include/be_array.h \ - ../be_include/be_sequence.h ../be_include/be_string.h \ - ../be_include/be_typedef.h ../be_include/be_root.h \ - ../be_include/be_helper.h ../be_include/be_state.h \ - ../be_include/be_codegen.h ../be_include/be_factory.h \ - ../be_include/be_sunsoft.h -.obj/be_decl.o .shobj/be_decl.so: be_decl.cpp ../include/idl.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/config.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ - ../include/intlmacros.h ../include/idl_narrow.h \ - ../include/idl_defines.h ../include/idl_fwd.h ../include/idl_bool.h \ - ../include/utl_string.h ../include/utl_identifier.h ../include/ast.h \ - ../include/utl_scoped_name.h ../include/ast_decl.h \ - ../include/ast_expression.h ../include/utl_scope.h \ - ../include/ast_type.h ../include/ast_concrete_type.h \ - ../include/ast_predefined_type.h ../include/ast_module.h \ - ../include/ast_root.h ../include/ast_interface.h \ - ../include/ast_interface_fwd.h ../include/ast_structure.h \ - ../include/ast_exception.h ../include/ast_enum.h \ - ../include/ast_operation.h ../include/utl_list.h \ - ../include/ast_field.h ../include/ast_argument.h \ - ../include/ast_attribute.h ../include/ast_union.h \ - ../include/ast_union_branch.h ../include/ast_union_label.h \ - ../include/ast_constant.h ../include/ast_enum_val.h \ - ../include/ast_array.h ../include/ast_sequence.h \ - ../include/ast_string.h ../include/ast_typedef.h \ - ../include/utl_strlist.h ../include/utl_exprlist.h \ - ../include/ast_generator.h ../include/util.h ../include/utl_stack.h \ - ../include/utl_idlist.h ../include/utl_exceptlist.h \ - ../include/utl_namelist.h ../include/utl_labellist.h \ - ../include/utl_decllist.h ../include/idl_global.h \ - ../include/utl_error.h ../include/utl_indenter.h \ - ../include/idl_extern.h ../include/fe_extern.h ../include/be_extern.h \ - ../include/drv_extern.h ../include/ast_extern.h \ - ../include/nr_extern.h ../include/global_extern.h ../be_include/be.h \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Containers.i \ - ../be_include/be_decl.h ../be_include/be_scope.h \ - ../be_include/be_generator.h ../be_include/be_type.h \ - ../be_include/be_predefined_type.h ../be_include/be_module.h \ - ../be_include/be_interface.h ../be_include/be_interface_fwd.h \ - ../be_include/be_structure.h ../be_include/be_exception.h \ - ../be_include/be_expression.h ../be_include/be_enum.h \ - ../be_include/be_operation.h ../be_include/be_field.h \ - ../be_include/be_argument.h ../be_include/be_attribute.h \ - ../be_include/be_union.h ../be_include/be_union_branch.h \ - ../be_include/be_union_label.h ../be_include/be_constant.h \ - ../be_include/be_enum_val.h ../be_include/be_array.h \ - ../be_include/be_sequence.h ../be_include/be_string.h \ - ../be_include/be_typedef.h ../be_include/be_root.h \ - ../be_include/be_helper.h ../be_include/be_state.h \ - ../be_include/be_codegen.h ../be_include/be_factory.h -.obj/be_scope.o .shobj/be_scope.so: be_scope.cpp ../include/idl.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/OS.h \ - $(ACE_ROOT)/ace/config.h \ - $(ACE_ROOT)/ace/streams.h \ - $(ACE_ROOT)/ace/OS.i \ - $(ACE_ROOT)/ace/Trace.h \ - $(ACE_ROOT)/ace/Log_Msg.h \ - $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/Log_Priority.h \ - $(ACE_ROOT)/ace/Log_Record.i \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ - ../include/intlmacros.h ../include/idl_narrow.h \ - ../include/idl_defines.h ../include/idl_fwd.h ../include/idl_bool.h \ - ../include/utl_string.h ../include/utl_identifier.h ../include/ast.h \ - ../include/utl_scoped_name.h ../include/ast_decl.h \ - ../include/ast_expression.h ../include/utl_scope.h \ - ../include/ast_type.h ../include/ast_concrete_type.h \ - ../include/ast_predefined_type.h ../include/ast_module.h \ - ../include/ast_root.h ../include/ast_interface.h \ - ../include/ast_interface_fwd.h ../include/ast_structure.h \ - ../include/ast_exception.h ../include/ast_enum.h \ - ../include/ast_operation.h ../include/utl_list.h \ - ../include/ast_field.h ../include/ast_argument.h \ - ../include/ast_attribute.h ../include/ast_union.h \ - ../include/ast_union_branch.h ../include/ast_union_label.h \ - ../include/ast_constant.h ../include/ast_enum_val.h \ - ../include/ast_array.h ../include/ast_sequence.h \ - ../include/ast_string.h ../include/ast_typedef.h \ - ../include/utl_strlist.h ../include/utl_exprlist.h \ - ../include/ast_generator.h ../include/util.h ../include/utl_stack.h \ - ../include/utl_idlist.h ../include/utl_exceptlist.h \ - ../include/utl_namelist.h ../include/utl_labellist.h \ - ../include/utl_decllist.h ../include/idl_global.h \ - ../include/utl_error.h ../include/utl_indenter.h \ - ../include/idl_extern.h ../include/fe_extern.h ../include/be_extern.h \ - ../include/drv_extern.h ../include/ast_extern.h \ - ../include/nr_extern.h ../include/global_extern.h ../be_include/be.h \ - $(ACE_ROOT)/ace/Singleton.h \ - $(ACE_ROOT)/ace/Synch.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ - $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ - $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ - $(ACE_ROOT)/ace/Synch.i \ - $(ACE_ROOT)/ace/Synch_T.h \ - $(ACE_ROOT)/ace/Event_Handler.h \ - $(ACE_ROOT)/ace/Event_Handler.i \ - $(ACE_ROOT)/ace/Synch_T.i \ - $(ACE_ROOT)/ace/Thread.h \ - $(ACE_ROOT)/ace/Thread.i \ - $(ACE_ROOT)/ace/Atomic_Op.i \ - $(ACE_ROOT)/ace/Singleton.i \ - $(ACE_ROOT)/ace/Containers.h \ - $(ACE_ROOT)/ace/Containers.i \ - ../be_include/be_decl.h ../be_include/be_scope.h \ - ../be_include/be_generator.h ../be_include/be_type.h \ - ../be_include/be_predefined_type.h ../be_include/be_module.h \ - ../be_include/be_interface.h ../be_include/be_interface_fwd.h \ - ../be_include/be_structure.h ../be_include/be_exception.h \ - ../be_include/be_expression.h ../be_include/be_enum.h \ - ../be_include/be_operation.h ../be_include/be_field.h \ - ../be_include/be_argument.h ../be_include/be_attribute.h \ - ../be_include/be_union.h ../be_include/be_union_branch.h \ - ../be_include/be_union_label.h ../be_include/be_constant.h \ - ../be_include/be_enum_val.h ../be_include/be_array.h \ - ../be_include/be_sequence.h ../be_include/be_string.h \ - ../be_include/be_typedef.h ../be_include/be_root.h \ - ../be_include/be_helper.h ../be_include/be_state.h \ - ../be_include/be_codegen.h ../be_include/be_factory.h - -# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/TAO/TAO_IDL/be/be_args.cpp b/TAO/TAO_IDL/be/be_args.cpp deleted file mode 100644 index f4ee9159feb..00000000000 --- a/TAO/TAO_IDL/be/be_args.cpp +++ /dev/null @@ -1,79 +0,0 @@ -/* - -COPYRIGHT - -Copyright 1992, 1993, 1994 Sun Microsystems, Inc. Printed in the United -States of America. All Rights Reserved. - -This product is protected by copyright and distributed under the following -license restricting its use. - -The Interface Definition Language Compiler Front End (CFE) is made -available for your use provided that you include this license and copyright -notice on all media and documentation and the software program in which -this product is incorporated in whole or part. You may copy and extend -functionality (but may not remove functionality) of the Interface -Definition Language CFE without charge, but you are not authorized to -license or distribute it to anyone else except as part of a product or -program developed by you or with the express written consent of Sun -Microsystems, Inc. ("Sun"). - -The names of Sun Microsystems, Inc. and any of its subsidiaries or -affiliates may not be used in advertising or publicity pertaining to -distribution of Interface Definition Language CFE as permitted herein. - -This license is effective until terminated by Sun for failure to comply -with this license. Upon termination, you shall destroy or return all code -and documentation for the Interface Definition Language CFE. - -INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED AS IS WITH NO WARRANTIES OF -ANY KIND INCLUDING THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS -FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR ARISING FROM A COURSE OF -DEALING, USAGE OR TRADE PRACTICE. - -INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED WITH NO SUPPORT AND WITHOUT -ANY OBLIGATION ON THE PART OF Sun OR ANY OF ITS SUBSIDIARIES OR AFFILIATES -TO ASSIST IN ITS USE, CORRECTION, MODIFICATION OR ENHANCEMENT. - -SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES SHALL HAVE NO LIABILITY WITH -RESPECT TO THE INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY -INTERFACE DEFINITION LANGUAGE CFE OR ANY PART THEREOF. - -IN NO EVENT WILL SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES BE LIABLE FOR -ANY LOST REVENUE OR PROFITS OR OTHER SPECIAL, INDIRECT AND CONSEQUENTIAL -DAMAGES, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -Use, duplication, or disclosure by the government is subject to -restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in -Technical Data and Computer Software clause at DFARS 252.227-7013 and FAR -52.227-19. - -Sun, Sun Microsystems and the Sun logo are trademarks or registered -trademarks of Sun Microsystems, Inc. - -SunSoft, Inc. -2550 Garcia Avenue -Mountain View, California 94043 - -NOTE: - -SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are -trademarks or registered trademarks of Sun Microsystems, Inc. - - */ - -// be_args.cc - Collect command line arguments for the BE - -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -/* - * Prepare an argument for a BE - * - * Since this is the dummy BE, it doesn't do anything with the passed string - */ -void -BE_prep_arg(char *, idl_bool) -{ -} diff --git a/TAO/TAO_IDL/be/be_argument.cpp b/TAO/TAO_IDL/be/be_argument.cpp deleted file mode 100644 index 5fbd90661be..00000000000 --- a/TAO/TAO_IDL/be/be_argument.cpp +++ /dev/null @@ -1,152 +0,0 @@ -// ============================================================================ -// -// = LIBRARY -// TAO IDL -// -// = FILENAME -// be_argument.cpp -// -// = DESCRIPTION -// Extension of class AST_Argument that provides additional means for C++ -// mapping. -// -// = AUTHOR -// Copyright 1994-1995 by Sun Microsystems, Inc. -// and -// Aniruddha Gokhale -// -// ============================================================================ - -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -/* - * BE_Argument - */ - -be_argument::be_argument (void) -{ -} - -be_argument::be_argument (AST_Argument::Direction d, AST_Type *ft, - UTL_ScopedName *n, UTL_StrList *p) - : AST_Argument (d, ft, n, p), - AST_Field (AST_Decl::NT_argument, ft, n, p), - AST_Decl (AST_Decl::NT_argument, n, p) -{ -} - - -// All the methods here are very similar. The state is set by the be_operation -// method which then invokes its scope which inturn calls one of these methods -// with the state that was set. - - -int -be_argument::gen_client_header (void) -{ - be_type *bt; // the field type - be_state *s; // state based code gen object - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - bt = be_type::narrow_from_decl (this->field_type ()); - s = cg->make_state (); - - if (!s || !bt || (s->gen_code (bt, this) == -1)) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_argument::gen_client_header - " - "error generating type\n"), - -1); - } - return 0; -} - -int -be_argument::gen_client_stubs (void) -{ - be_type *bt; // the field type - be_state *s; // state based code gen object - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - bt = be_type::narrow_from_decl (this->field_type ()); - s = cg->make_state (); - - if (!s || !bt || (s->gen_code (bt, this) == -1)) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_argument::gen_client_stubs - " - "error generating type\n"), - -1); - } - return 0; -} - -int -be_argument::gen_server_header (void) -{ - be_type *bt; // the field type - be_state *s; // state based code gen object - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - bt = be_type::narrow_from_decl (this->field_type ()); - s = cg->make_state (); - - if (!s || !bt || (s->gen_code (bt, this) == -1)) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_argument::gen_server_header - " - "error generating type\n"), - -1); - } - return 0; -} - -int -be_argument::gen_server_skeletons (void) -{ - be_type *bt; // the field type - be_state *s; // state based code gen object - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - bt = be_type::narrow_from_decl (this->field_type ()); - s = cg->make_state (); - - if (!s || !bt || (s->gen_code (bt, this) == -1)) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_argument::gen_server_skeletons - " - "error generating type\n"), - -1); - } - return 0; -} - -// Generates the client-side inline information -int -be_argument::gen_client_inline (void) -{ - // nothing to be done - return 0; -} - -// Generates the server-side inline -int -be_argument::gen_server_inline (void) -{ - // nothing to be done - return 0; -} - -// Narrowing -IMPL_NARROW_METHODS2 (be_argument, AST_Argument, be_decl) -IMPL_NARROW_FROM_DECL (be_argument) diff --git a/TAO/TAO_IDL/be/be_array.cpp b/TAO/TAO_IDL/be/be_array.cpp deleted file mode 100644 index 02ba86dde28..00000000000 --- a/TAO/TAO_IDL/be/be_array.cpp +++ /dev/null @@ -1,1438 +0,0 @@ -// ============================================================================ -// -// = LIBRARY -// TAO IDL -// -// = FILENAME -// be_array.cpp -// -// = DESCRIPTION -// Extension of class AST_Array that provides additional means for C++ -// mapping. -// -// = AUTHOR -// Copyright 1994-1995 by Sun Microsystems, Inc. -// and -// Aniruddha Gokhale -// -// ============================================================================ - -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -/* - * BE_Array - */ -be_array::be_array (void) -{ -} - -be_array::be_array (UTL_ScopedName *n, unsigned long ndims, UTL_ExprList *dims) - : AST_Array (n, ndims, dims), - AST_Decl (AST_Decl::NT_array, n, NULL) -{ -#if 0 - // if we are inside of a union, we change our local name to have an - // underscore before us - AST_Decl *d = ScopeAsDecl (this->defined_in ()); - if (d && (d->node_type () == AST_Decl::NT_union)) - { - static char namebuf [200]; - UTL_ScopedName *myname; - - ACE_OS::memset (namebuf, '\0', 200); - - // make a copy of our parent's name - myname = (UTL_ScopedName *)d->name ()->copy (); - ACE_OS::sprintf (namebuf, "_%s", this->local_name ()->get_string ()); - myname->nconc (new UTL_ScopedName (new Identifier (ACE_OS::strdup - (namebuf), 1, 0, - I_FALSE), NULL)); - this->set_name (myname); - } -#endif -} - -// create a name for ourselves -int -be_array::create_name (void) -{ - char namebuf [NAMEBUFSIZE]; - be_type *bt; // base type; - unsigned long i; - UTL_ScopedName *n = NULL; - be_decl *scope; // scope in which we are defined - - ACE_OS::memset (namebuf, '\0', NAMEBUFSIZE); // reset the buffer - // retrieve the base type - bt = be_type::narrow_from_decl (this->base_type ()); - if (!bt) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_array::" - "create_name - " - "bad base type\n"), - 0); - } - // the name always starts this way - ACE_OS::sprintf (namebuf, "_tao_array_%s", bt->local_name ()->get_string ()); - // now append dimensions - for (i = 0; i < this->n_dims (); i++) - { - AST_Expression *expr = this->dims ()[i]; // retrieve the ith - - // dimension value - if ((expr == NULL) || ((expr != NULL) && (expr->ev () == NULL))) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_array::" - "create_name - " - "bad array dimension\n"), - -1); - } - if (expr->ev ()->et == AST_Expression::EV_ulong) - { - ACE_OS::sprintf (namebuf, "%s_%d", namebuf, ((int)expr->ev ()->u.ulval)); - } - else - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_array::" - "create_name - " - "bad dimension value\n"), - -1); - } - } - - // now see if we have a fully scoped name and if so, generate one - scope = be_scope::narrow_from_scope (this->defined_in ())->decl (); - if (scope) - { - // make a copy of the enclosing scope's name - n = (UTL_ScopedName *)scope->name ()->copy () ; - - // add our local name as the last component - n->nconc (new UTL_ScopedName (new Identifier (ACE_OS::strdup - (namebuf), 1, - 0, I_FALSE), - NULL)); - // set the fully scoped name - this->set_name (n); - } - else - { - // We better be not here because we must be inside some scope, - // atleast the ROOT scope. - return -1; - } - return 0; -} - -// Code generation - -int -be_array::gen_dimensions (TAO_OutStream *os, unsigned short slice) -{ - unsigned long i; // loop index - - // print our dimensions - for (i = (slice?1:0); i < this->n_dims (); i++) - { - AST_Expression *expr = this->dims ()[i]; // retrieve the ith - - // dimension value - if ((expr == NULL) || ((expr != NULL) && (expr->ev () == NULL))) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_array::" - "gen_dimensions - " - "bad array dimension\n"), - -1); - } - if (expr->ev ()->et == AST_Expression::EV_ulong) - { - *os << "[" << ((int)expr->ev ()->u.ulval) << "]"; - } - else - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_array::" - "gen_dimensions - " - "bad dimension value\n"), - -1); - } - } - return 0; -} - -int -be_array::gen_client_header (void) -{ - TAO_OutStream *ch; // output stream - TAO_NL nl; // end line - be_type *bt; // our base type - be_state *s; // state based code gen object - - if (!this->cli_hdr_gen_) // not already generated - { - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - cg->push (TAO_CodeGen::TAO_ARRAY_DEFN_CH); // set current code gen state - - ch = cg->client_header (); // retrieve client hdr stream - -#if 0 - if (this->create_name () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_array::" - "gen_client_header - " - "name creation failed\n"), - 0); - } -#endif - s = cg->make_state (); // get the state-based code generation object - if (!s) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_array::" - "gen_client_header - " - "Bad state\n"), - -1); - } - - // retrieve the base type - bt = be_type::narrow_from_decl (this->base_type ()); - if (!bt) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_array::" - "gen_client_header - " - "Bad type\n"), - -1); - } - - // generate the ifdefined macro for the array type - ch->gen_ifdef_macro (this->flatname ()); - - ch->indent (); // start from current indentation - // generate code for our base type if required and then print the type - // name - if (s->gen_code (bt, this) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_array::" - "gen_client_header - " - "state based codegen failed\n"), - -1); - } - - // print our name - *ch << " " << this->local_name (); - // print our dimensions - if (this->gen_dimensions (ch) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_array::" - "gen_client_header - " - "dimension codegen failed\n"), - -1); - } - - *ch << ";" << nl; - - // if our base type is VARIABLE length, then we are variable length too - this->size_type (bt->size_type ()); - cg->pop (); - - cg->push (TAO_CodeGen::TAO_ARRAY_OTHER_CH); // rest of the array defn - s = cg->make_state (); - if (!s) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_array::" - "gen_client_header - " - "bad state\n"), - -1); - } - - // now generate the slice definition - *ch << "typedef "; - if (s->gen_code (bt, this) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_array::" - "gen_client_header - " - "state based codegen failed\n"), - -1); - } - - *ch << " " << this->local_name () << "_slice"; - // print dimensions except first one - if (this->gen_dimensions (ch, 1) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_array::" - "gen_client_header - " - "slice dimensions codegen failed\n"), - -1); - } - *ch << ";" << nl; - - // memory management functions - - // The T_alloc method - // first find if we are inside a scope - if (this->is_nested ()) // we were defined inside a scope. Hence the - // memory management functions become static - // members of the enclosing class - *ch << "static "; - - // the return type is a pointer to slice - *ch << this->local_name () << "_slice *" << this->local_name () << - "_alloc (void);" << nl; - // the T_dup method - if (this->is_nested ()) - *ch << "static "; - *ch << this->local_name () << "_slice *" << this->local_name () << - "_dup (const " << this->local_name () << "_slice *);" << nl; - // the T_free method - if (this->is_nested ()) - *ch << "static "; - *ch << "void " << this->local_name () << "_free (" << this->local_name () - << "_slice *);\n\n"; - - // Generate the typecode decl - if (this->is_nested ()) - { - // we have a scoped name - ch->indent (); - *ch << "static CORBA::TypeCode_ptr " << this->tc_name - ()->last_component () << ";\n\n"; - } - else - { - // we are in the ROOT scope - ch->indent (); - *ch << "extern CORBA::TypeCode_ptr " << this->tc_name - ()->last_component () << ";\n\n"; - } - ch->gen_endif (); - - // generate the ifdefined macro - ch->gen_ifdef_macro (this->flatname (), "_var"); - // generate the _var, _out, and _forany definition - if (this->gen_var_defn () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_array::" - "gen_client_header - " - "error generating _var class\n"), - -1); - } - ch->gen_endif (); - - // generate the ifdefined macro - ch->gen_ifdef_macro (this->flatname (), "_out"); - if (this->gen_out_defn () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_array::" - "gen_client_header - " - "error generating _out class\n"), - -1); - } - ch->gen_endif (); - - // generate the ifdefined macro - ch->gen_ifdef_macro (this->flatname (), "_forany"); - if (this->gen_forany_defn () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_array::" - "gen_client_header - " - "error generating _forany class\n"), - -1); - } - ch->gen_endif (); - - this->cli_hdr_gen_ = I_TRUE; - cg->pop (); - } - return 0; -} - -int -be_array::gen_client_stubs (void) -{ - TAO_OutStream *cs; // output stream - TAO_NL nl; // end line - unsigned long i; - - if (!this->cli_stub_gen_) - { - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - cg->push (TAO_CodeGen::TAO_SEQUENCE_BODY_CS); // set current code gen state - - cs = cg->client_stubs (); - - // generate the typecode information here - cs->indent (); // start from current indentation level - *cs << "static const CORBA::Long _oc_" << this->flatname () << "[] =" << - nl; - *cs << "{\n"; - cs->incr_indent (0); - if (this->gen_encapsulation () == -1) - { - ACE_ERROR ((LM_ERROR, "be_array:Error generating encapsulation\n\n")); - return -1; - } - cs->decr_indent (); - *cs << "};" << nl; - - *cs << "static CORBA::TypeCode _tc__tc_" << this->flatname () << - " (CORBA::tk_sequence, sizeof (_oc_" << this->flatname () << - "), (unsigned char *) &_oc_" << this->flatname () << - ", CORBA::B_FALSE);" << nl; - *cs << "CORBA::TypeCode_ptr " << this->tc_name () << " = &_tc__tc_" << - this->flatname () << ";\n\n"; - - cg->pop (); - this->cli_stub_gen_ = I_TRUE; - - // T_dup method - *cs << this->name () << "_slice *" << nl; - *cs << this->name () << "_dup (" << this->name () << "_slice * s)" << nl; - *cs << "{\n"; - cs->incr_indent (); - *cs << this->name () << "_slice *temp;" << nl; - *cs << "// alloc an array" << nl; - *cs << "temp = " << this->name () << "_alloc ();" << nl; - *cs << "// copy each individual elements" << nl; - // generate nested loops for as many dimensions as there are - for (i = 0; i < this->n_dims (); i++) - { - AST_Expression *expr = this->dims ()[i]; // retrieve the ith - // dimension value - if ((expr == NULL) || ((expr != NULL) && (expr->ev () == NULL))) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_array::" - "gen_client_stubs - " - "bad array dimension\n"), - -1); - } - if (expr->ev ()->et == AST_Expression::EV_ulong) - { - // generate a loop for each dimension - *cs << "for (CORBA::ULong i" << i << " = 0; i" << i << " < " << - expr->ev ()->u.ulval << "; i" << i << "++)\n"; - cs->incr_indent (); - } - else - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_array::" - "gen_client_stubs - " - "bad array dimension value\n"), - -1); - } - } - - // now generate code such that every element of the array gets assigned - // inside the innermost level of the nested loops generated above - *cs << "temp"; // generate the lvalue - for (i = 0; i < this->n_dims (); i++) - { - *cs << "[i" << i << "]"; - } - *cs << " = "; - *cs << "s"; // generate the rvalue - for (i = 0; i < this->n_dims (); i++) - { - *cs << "[i" << i << "]"; - } - *cs << ";\n"; - for (i = 0; i < this->n_dims (); i++) - { - // decrement indentation as many times as the number of dimensions - cs->decr_indent (0); - } - cs->indent (); - *cs << "return temp;\n"; - // one more to get to the outermost level - cs->decr_indent (); - *cs << "}\n\n"; - } - return 0; -} - -// Generates the client-side inline information -int -be_array::gen_client_inline (void) -{ - if (!this->cli_inline_gen_) - { - TAO_OutStream *ci; // output stream - TAO_NL nl; // end line - be_type *bt; // our base type - be_state *s; // state based code gen obj - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - ci = cg->client_inline (); - cg->push (TAO_CodeGen::TAO_ARRAY_DEFN_CI); - s = cg->make_state (); - if (!s) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_array::" - "gen_client_inline - " - "bad state\n"), - -1); - } - - // retrieve our base type - bt = be_type::narrow_from_decl (this->base_type ()); - if (!bt) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_array::" - "gen_client_inline - " - "bad base type\n"), - -1); - } - - // first define the _alloc, _dup and _free methods - // If we are defined inside some scope, these methods become static - // members of the enclosing scope - - // alloc method - ci->indent (); // start from current indentation - *ci << "ACE_INLINE " << this->name () << "_slice *" << nl; - *ci << this->name () << "_alloc (void)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return new "; - if (s->gen_code (bt, this) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_array::" - "gen_client_inline - " - "state based codegen failed\n"), - -1); - } - if (this->gen_dimensions (ci) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_array::" - "gen_client_inline - " - "dimensions codegen failed\n"), - -1); - } - - *ci << ";\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // free method - *ci << this->name () << "_free (" << this->name () << "_slice *s)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "delete [] s;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // emit implementations of methods of the _var, _out, and _forany classes - if (this->gen_var_impl () == -1) - { - ACE_ERROR ((LM_ERROR, "be_array: _var impl code gen failed\n")); - return -1; - } - if (this->gen_out_impl () == -1) - { - ACE_ERROR ((LM_ERROR, "be_array: _out impl code gen failed\n")); - return -1; - } - if (this->gen_forany_impl () == -1) - { - ACE_ERROR ((LM_ERROR, "be_array: _forany impl code gen failed\n")); - return -1; - } - - // generate client inline for base type - if (bt->gen_client_inline () == -1) - { - ACE_ERROR ((LM_ERROR, "be_array: base type inline code gen failed\n")); - return -1; - } - - cg->pop (); - this->cli_inline_gen_ = I_TRUE; - } - - return 0; -} - -int -be_array::gen_server_header (void) -{ - return 0; -} - -int -be_array::gen_server_skeletons (void) -{ - return 0; -} - -int -be_array::gen_server_inline (void) -{ - // nothing to be done - return 0; -} - -// generate the var defn -int -be_array::gen_var_defn (void) -{ - TAO_OutStream *ch; // output stream - TAO_NL nl; // end line - char namebuf [NAMEBUFSIZE]; // names - - ACE_OS::memset (namebuf, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (namebuf, "%s_var", this->local_name ()->get_string ()); - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - ch = cg->client_header (); - - // generate the var definition (always in the client header). - // Depending upon the data type, there are some differences which we account - // for over here. - - ch->indent (); // start with whatever was our current indent level - *ch << "class " << namebuf << nl; - *ch << "{" << nl; - *ch << "public:\n"; - ch->incr_indent (); - // default constr - *ch << namebuf << " (void); // default constructor" << nl; - // constr from pointer to slice - *ch << namebuf << " (" << this->local_name () << "_slice *);" << nl; - // copy constructor - *ch << namebuf << " (const " << namebuf << - " &); // copy constructor" << nl; - // destructor - *ch << "~" << namebuf << " (void); // destructor" << nl; - *ch << nl; - // assignment operator from a pointer to slice - *ch << namebuf << " &operator= (" << this->local_name () << "_slice *);" << - nl; - // assignment from _var - *ch << namebuf << " &operator= (const " << namebuf << " &);" << nl; - - // arrow operator - // nothing here - *ch << nl; - - // other extra types (cast operators, [] operator, and others) - // overloaded [] operator - *ch << this->local_name () << "_slice &operator[] (CORBA::ULong index);" << - nl; - *ch << "const " << this->local_name () << - "_slice &operator[] (CORBA::ULong index) const;" << nl; - - // cast operators - *ch << "operator const " << this->local_name () << "_slice *&() const;" << - nl; - *ch << "operator " << this->local_name () << "_slice *&();" << nl; - - // in, inout, out and _retn - *ch << "// in, inout, out, _retn " << nl; - *ch << "const " << this->local_name () << "_slice *in (void) const;" << nl; - *ch << this->local_name () << "_slice *inout (void);" << nl; - *ch << this->local_name () << "_slice *&out (void);" << nl; - *ch << this->local_name () << "_slice *_retn (void);" << nl; - - // generate an additional member function that returns the underlying pointer - *ch << this->local_name () << "_slice *ptr (void) const;\n"; - - *ch << "\n"; - ch->decr_indent (); - - // generate the private section - *ch << "private:\n"; - ch->incr_indent (); - *ch << local_name () << "_slice *ptr_;\n"; - - ch->decr_indent (); - *ch << "};\n\n"; - - return 0; -} - -// implementation of the _var class. All of these get generated in the inline -// file -int -be_array::gen_var_impl (void) -{ - TAO_OutStream *ci; // output stream - TAO_NL nl; // end line - char fname [NAMEBUFSIZE]; // to hold the full and - char lname [NAMEBUFSIZE]; // local _var names - - ACE_OS::memset (fname, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (fname, "%s_var", this->fullname ()); - - ACE_OS::memset (lname, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (lname, "%s_var", this->local_name ()->get_string ()); - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - ci = cg->client_inline (); - - // generate the var implementation in the inline file - - ci->indent (); // start with whatever was our current indent level - - *ci << "// *************************************************************" - << nl; - *ci << "// Inline operations for class " << fname << nl; - *ci << "// *************************************************************\n\n"; - - // default constr - *ci << "ACE_INLINE" << nl; - *ci << fname << "::" << lname << - " (void) // default constructor" << nl; - *ci << "\t" << ": ptr_ ((" << this->name () << "_slice *)0)" << nl; - *ci << "{}\n\n"; - - // constr from a _slice * - ci->indent (); - *ci << "ACE_INLINE" << nl; - *ci << fname << "::" << lname << " (" << name () << "_slice *p)" << nl; - *ci << "\t: ptr_ (p)" << nl; - *ci << "{}\n\n"; - - // copy constructor (deep copy) - ci->indent (); - *ci << "ACE_INLINE" << nl; - *ci << fname << "::" << lname << " (const " << fname << - " &p) // copy constructor" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "this->ptr_ = " << this->name () << "_dup (p.ptr_);\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // destructor - ci->indent (); - *ci << "ACE_INLINE" << nl; - *ci << fname << "::~" << lname << " (void) // destructor" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << this->name () << "_free (this->ptr_);\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // assignment operator - ci->indent (); - *ci << "ACE_INLINE " << fname << " &" << nl; - *ci << fname << "::operator= (" << this->name () << - "_slice *p)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "// is what we own the same that is being assigned to us?" << - nl; - *ci << "if (this->ptr_ != p)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "// delete our stuff and assume ownership of p" << nl; - *ci << this->name () << "_free (this->ptr_);" << nl; - *ci << "this->ptr_ = p;\n"; - ci->decr_indent (); - *ci << "}" << nl; - *ci << "return *this;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // assignment operator from _var - ci->indent (); - *ci << "ACE_INLINE " << fname << " &" << nl; - *ci << fname << "::operator= (const " << fname << - " &p)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "if (this != &p)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "// not assigning to ourselves" << nl; - *ci << this->name () << "_free (this->ptr_); // free old stuff" << nl; - *ci << "this->ptr_ = " << this->name () << - "_dup (p.ptr_);// deep copy\n"; - ci->decr_indent (); - *ci << "}" << nl; - *ci << "return *this;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // other extra methods - cast operators () - ci->indent (); - *ci << "ACE_INLINE " << nl; - *ci << fname << "::operator const " << this->name () << - "_slice *&() const // cast" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - ci->indent (); - *ci << "ACE_INLINE " << nl; - *ci << fname << "::operator " << name () << "_slice *&() // cast " << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // two operator []s instead of -> - ci->indent (); - *ci << "ACE_INLINE const" << name () << "_slice &" << nl; - *ci << fname << "::operator[] (CORBA::ULong index) const" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->ptr_[index];\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - ci->indent (); - *ci << "ACE_INLINE " << name () << "_slice &" << nl; - *ci << fname << "::operator[] (CORBA::ULong index)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->ptr_[index];\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // in, inout, out, and _retn - ci->indent (); - *ci << "ACE_INLINE " << this->name () << "_slice *" << nl; - *ci << fname << "::in (void) const" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - ci->indent (); - *ci << "ACE_INLINE " << this->name () << "_slice *" << nl; - *ci << fname << "::inout (void)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - ci->indent (); - *ci << "ACE_INLINE " << this->name () << "_slice *" << nl; - *ci << fname << "::out (void)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - ci->indent (); - *ci << "ACE_INLINE " << this->name () << "_slice *" << nl; - *ci << fname << "::_retn (void)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->val;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // the additional ptr () member function - ci->indent (); - *ci << "ACE_INLINE " << this->name () << "_slice *" << nl; - *ci << fname << "::ptr (void) const" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - return 0; -} - -// generate the _out definition -int -be_array::gen_out_defn (void) -{ - TAO_OutStream *ch; // output stream - TAO_NL nl; // end line - char namebuf [NAMEBUFSIZE]; // to hold the _out name - - ACE_OS::memset (namebuf, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (namebuf, "%s_out", local_name ()->get_string ()); - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - ch = cg->client_header (); - - // generate the out definition (always in the client header) - ch->indent (); // start with whatever was our current indent level - - *ch << "class " << namebuf << nl; - *ch << "{" << nl; - *ch << "public:\n"; - ch->incr_indent (); - - // No default constructor - - // constructor from a pointer to slice - *ch << namebuf << " (" << this->local_name () << "_slice *&);" << nl; - // constructor from a _var & - *ch << namebuf << " (" << this->local_name () << "_var &);" << nl; - // constructor from a _out & - *ch << namebuf << " (" << namebuf << " &);" << nl; - // assignment operator from a _out & - *ch << namebuf << " &operator= (" << namebuf << " &);" << nl; - // assignment from slice * - *ch << namebuf << " &operator= (" << this->local_name () << "_slice *);" << - nl; - // cast - *ch << "operator " << this->local_name () << "_slice *&();" << nl; - // ptr fn - *ch << this->local_name () << "_slice *&ptr (void);" << nl; - // operator [] instead of -> - *ch << this->local_name () << "_slice &operator[] (CORBA::ULong index);" << nl; - *ch << "const " << this->local_name () << "_slice &operator[] " << - "(CORBA::ULong index) const;" << nl; - - *ch << "\n"; - ch->decr_indent (); - *ch << "private:\n"; - ch->incr_indent (); - *ch << local_name () << "_slice *&ptr_;" << nl; - *ch << "// assignment from T_var not allowed" << nl; - *ch << "void operator= (const " << this->local_name () << "_var &);\n"; - - ch->decr_indent (); - *ch << "};\n\n"; - return 0; -} - -int -be_array::gen_out_impl (void) -{ - TAO_OutStream *ci; // output stream - TAO_NL nl; // end line - char fname [NAMEBUFSIZE]; // to hold the full and - char lname [NAMEBUFSIZE]; // local _out names - - ACE_OS::memset (fname, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (fname, "%s_out", this->fullname ()); - - ACE_OS::memset (lname, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (lname, "%s_out", local_name ()->get_string ()); - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - ci = cg->client_inline (); - - // generate the out implementation in the inline file - - ci->indent (); // start with whatever was our current indent level - - *ci << "// *************************************************************" - << nl; - *ci << "// Inline operations for class " << fname << nl; - *ci << "// *************************************************************\n\n"; - - // constr from a pointer to slice - ci->indent (); - *ci << "ACE_INLINE" << nl; - *ci << fname << "::" << lname << " (" << this->name () << "_slice *&p)" << nl; - *ci << "\t: ptr_ (p)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "this->ptr_ = 0;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // constructor from _var & - ci->indent (); - *ci << "ACE_INLINE" << nl; - *ci << fname << "::" << lname << " (" << this->name () << - "_var &p) // constructor from _var" << nl; - *ci << "\t: ptr_ (p.out ())" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << this->name () << "_free (this->ptr_);" << nl; - *ci << "this->ptr_ = 0;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // copy constructor - ci->indent (); - *ci << "ACE_INLINE" << nl; - *ci << fname << "::" << lname << " (" << fname << - " &p) // copy constructor" << nl; - *ci << "\t: ptr_ (p.ptr_)" << nl; - *ci << "{}\n\n"; - - // assignment operator from _out & - ci->indent (); - *ci << "ACE_INLINE " << fname << " &" << nl; - *ci << fname << "::operator= (" << fname << - " &p)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "this->ptr_ = p.ptr_;" << nl; - *ci << "return *this;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // assignment from _var is not allowed by a private declaration - - // assignment operator from _ptr - ci->indent (); - *ci << "ACE_INLINE " << fname << " &" << nl; - *ci << fname << "::operator= (" << this->name () << - "_slice *p)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "this->ptr_ = p;" << nl; - *ci << "return *this;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // other extra methods - cast operator () - ci->indent (); - *ci << "ACE_INLINE " << nl; - *ci << fname << "::operator " << this->name () << - "_slice *&() // cast" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // ptr function - ci->indent (); - *ci << "ACE_INLINE " << this->name () << "_slice *&" << nl; - *ci << fname << "::ptr (void) // ptr" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // operator [] instead of -> - ci->indent (); - *ci << "ACE_INLINE " << this->name () << "_slice &" << nl; - *ci << fname << "::operator[] (CORBA::ULong index)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->ptr_[index];\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - return 0; -} - -// generate the _var definition for ourself -int -be_array::gen_forany_defn (void) -{ - TAO_OutStream *ch; // output stream - TAO_NL nl; // end line - char namebuf [NAMEBUFSIZE]; // names - - ACE_OS::memset (namebuf, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (namebuf, "%s_forany", this->local_name ()->get_string ()); - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - ch = cg->client_header (); - - // generate the var definition (always in the client header). - // Depending upon the data type, there are some differences which we account - // for over here. - - ch->indent (); // start with whatever was our current indent level - *ch << "class " << namebuf << nl; - *ch << "{" << nl; - *ch << "public:\n"; - ch->incr_indent (); - // default constr - *ch << namebuf << " (void); // default constructor" << nl; - // constr from pointer to slice - *ch << namebuf << " (" << this->local_name () << "_slice *, " << - "CORBA::Boolean nocopy=0);" << nl; - // copy constructor - *ch << namebuf << " (const " << namebuf << - " &); // copy constructor" << nl; - // destructor - *ch << "~" << namebuf << " (void); // destructor" << nl; - *ch << nl; - // assignment operator from a pointer to slice - *ch << namebuf << " &operator= (" << this->local_name () << "_slice *);" << - nl; - // assignment from _var - *ch << namebuf << " &operator= (const " << namebuf << " &);" << nl; - - // arrow operator - // nothing here - *ch << nl; - - // other extra types (cast operators, [] operator, and others) - // overloaded [] operator - *ch << this->local_name () << "_slice &operator[] (CORBA::ULong index);" << - nl; - *ch << "const " << this->local_name () << - "_slice &operator[] (CORBA::ULong index) const;" << nl; - - // cast operators - *ch << "operator const " << this->local_name () << "_slice *&() const;" << - nl; - *ch << "operator " << this->local_name () << "_slice *&();" << nl; - - // in, inout, out and _retn - *ch << "// in, inout, out, _retn " << nl; - *ch << "const " << this->local_name () << "_slice *in (void) const;" << nl; - *ch << this->local_name () << "_slice *inout (void);" << nl; - *ch << this->local_name () << "_slice *&out (void);" << nl; - *ch << this->local_name () << "_slice *_retn (void);" << nl; - - // generate an additional member function that returns the underlying pointer - *ch << this->local_name () << "_slice *ptr (void) const;\n"; - - *ch << "\n"; - ch->decr_indent (); - - // generate the private section - *ch << "private:\n"; - ch->incr_indent (); - *ch << "friend ACE_CORBA_1 (Any);" << nl; - *ch << this->local_name () << "_slice *ptr_;" << nl; - *ch << "CORBA::Boolean nocopy_;\n"; - - ch->decr_indent (); - *ch << "};\n\n"; - - return 0; -} - -int -be_array::gen_forany_impl (void) -{ - TAO_OutStream *ci; // output stream - TAO_NL nl; // end line - char fname [NAMEBUFSIZE]; // to hold the full and - char lname [NAMEBUFSIZE]; // local _var names - - ACE_OS::memset (fname, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (fname, "%s_forany", this->fullname ()); - - ACE_OS::memset (lname, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (lname, "%s_forany", this->local_name ()->get_string ()); - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - ci = cg->client_inline (); - - // generate the var implementation in the inline file - - ci->indent (); // start with whatever was our current indent level - - *ci << "// *************************************************************" - << nl; - *ci << "// Inline operations for class " << fname << nl; - *ci << "// *************************************************************\n\n"; - - // default constr - *ci << "ACE_INLINE" << nl; - *ci << fname << "::" << lname << - " (void) // default constructor" << nl; - *ci << "\t" << ": ptr_ ((" << this->name () << "_slice *)0)," << nl; - *ci << "\t nocopy_ (0)" << nl; - *ci << "{}\n\n"; - - // constr from a _slice * - ci->indent (); - *ci << "ACE_INLINE" << nl; - *ci << fname << "::" << lname << " (" << name () << "_slice *p, " << - "CORBA::Boolean nocopy)" << nl; - *ci << "\t: ptr_ (p)," << nl; - *ci << "\t nocopy_ (nocopy)" << nl; - *ci << "{}\n\n"; - - // copy constructor (deep copy) - ci->indent (); - *ci << "ACE_INLINE" << nl; - *ci << fname << "::" << lname << " (const " << fname << - " &p) // copy constructor" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "this->ptr_ = " << this->name () << "_dup (p.ptr_);" << nl; - *ci << "this->nocopy_ = p.nocopy_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // destructor - ci->indent (); - *ci << "ACE_INLINE" << nl; - *ci << fname << "::~" << lname << " (void) // destructor" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << this->name () << "_free (this->ptr_);\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // assignment operator - ci->indent (); - *ci << "ACE_INLINE " << fname << " &" << nl; - *ci << fname << "::operator= (" << this->name () << - "_slice *p)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "// is what we own the same that is being assigned to us?" << - nl; - *ci << "if (this->ptr_ != p)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "// delete our stuff and assume ownership of p" << nl; - *ci << this->name () << "_free (this->ptr_);" << nl; - *ci << "this->ptr_ = p;\n"; - ci->decr_indent (); - *ci << "}" << nl; - *ci << "return *this;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // assignment operator from _forany - ci->indent (); - *ci << "ACE_INLINE " << fname << " &" << nl; - *ci << fname << "::operator= (const " << fname << - " &p)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "if (this != &p)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "// not assigning to ourselves" << nl; - *ci << this->name () << "_free (this->ptr_); // free old stuff" << nl; - *ci << "this->ptr_ = " << this->name () << - "_dup (p.ptr_);// deep copy" << nl; - *ci << "this->nocopy_ = p.nocopy_;\n"; - ci->decr_indent (); - *ci << "}" << nl; - *ci << "return *this;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // other extra methods - cast operators () - ci->indent (); - *ci << "ACE_INLINE " << nl; - *ci << fname << "::operator const " << this->name () << - "_slice *&() const // cast" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - ci->indent (); - *ci << "ACE_INLINE " << nl; - *ci << fname << "::operator " << name () << "_slice *&() // cast " << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // two operator []s instead of -> - ci->indent (); - *ci << "ACE_INLINE const" << name () << "_slice &" << nl; - *ci << fname << "::operator[] (CORBA::ULong index) const" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->ptr_[index];\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - ci->indent (); - *ci << "ACE_INLINE " << name () << "_slice &" << nl; - *ci << fname << "::operator[] (CORBA::ULong index)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->ptr_[index];\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // in, inout, out, and _retn - ci->indent (); - *ci << "ACE_INLINE " << this->name () << "_slice *" << nl; - *ci << fname << "::in (void) const" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - ci->indent (); - *ci << "ACE_INLINE " << this->name () << "_slice *" << nl; - *ci << fname << "::inout (void)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - ci->indent (); - *ci << "ACE_INLINE " << this->name () << "_slice *" << nl; - *ci << fname << "::out (void)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - ci->indent (); - *ci << "ACE_INLINE " << this->name () << "_slice *" << nl; - *ci << fname << "::_retn (void)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->val;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // the additional ptr () member function - ci->indent (); - *ci << "ACE_INLINE " << this->name () << "_slice *" << nl; - *ci << fname << "::ptr (void) const" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - return 0; -} - -int -be_array::gen_typecode (void) -{ - TAO_OutStream *cs; // output stream - TAO_NL nl; // end line - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - cs = cg->client_stubs (); - cs->indent (); // start from whatever indentation level we were at - - *cs << "CORBA::tk_array, // typecode kind" << nl; - *cs << this->tc_size () << ", // encapsulation length\n"; - // now emit the encapsulation - return this->gen_encapsulation (); -} - -// generate encapsulation -// An encapsulation for ourselves will be necessary when we are part of some -// other IDL type and a typecode for that other type is being generated. This -// will comprise our typecode kind. IDL types with parameters will additionally -// have the encapsulation length and the entire typecode description - -int -be_array::gen_encapsulation (void) -{ - TAO_OutStream *os; // output stream - TAO_NL nl; // end line - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - be_type *bt; // base type - - os = cg->client_stubs (); - os->indent (); // start from the current indentation level - - // XXXASG - byte order must be based on what m/c we are generating code - - // TODO - *os << "TAO_ENCAP_BYTE_ORDER, // byte order" << nl; - - // emit typecode of element type - bt = be_type::narrow_from_decl (this->base_type ()); - if (!bt || (bt->gen_typecode () == -1)) - { - ACE_ERROR ((LM_ERROR, "be_sequence::gen_typecode - bad base type\n")); - return -1; - } - - // emit the length - os->indent (); - // *os << this->max_size () << ",\n"; - return 0; -} - -// compute typecode size -long -be_array::tc_size (void) -{ - // 4 bytes for enumeration, 4 bytes for storing encap length val, followed by the - // actual encapsulation length - return 4 + 4 + this->tc_encap_len (); -} - -long -be_array::tc_encap_len (void) -{ - if (this->encap_len_ == -1) // not computed yet - { - be_type *bt; // base type - - this->encap_len_ = 4; // holds the byte order flag - // add the encapsulation length of our base type - bt = be_type::narrow_from_decl (this->base_type ()); - if (!bt) - { - ACE_ERROR ((LM_ERROR, - "be_array::tc_encap_len - bad base type\n")); - return 0; - } - this->encap_len_ += bt->tc_size (); - this->encap_len_ += 4; // to hold the array size - - } - return this->encap_len_; -} - -// compute the size type of the node in question -int -be_array::compute_size_type (void) -{ - be_type *type = be_type::narrow_from_decl (this->base_type ()); - if (!type) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_array::compute_size_type - " - "bad base type\n"), -1); - } - - // our size type is the same as our type - this->size_type (type->size_type ()); - return 0; -} - -// Narrowing -IMPL_NARROW_METHODS2 (be_array, AST_Array, be_type) -IMPL_NARROW_FROM_DECL (be_array) diff --git a/TAO/TAO_IDL/be/be_attribute.cpp b/TAO/TAO_IDL/be/be_attribute.cpp deleted file mode 100644 index 5bdbd35ef74..00000000000 --- a/TAO/TAO_IDL/be/be_attribute.cpp +++ /dev/null @@ -1,681 +0,0 @@ -// ============================================================================ -// -// = LIBRARY -// TAO IDL -// -// = FILENAME -// be_attribute.cpp -// -// = DESCRIPTION -// Extension of class AST_Attribute that provides additional means for C++ -// mapping. -// -// = AUTHOR -// Copyright 1994-1995 by Sun Microsystems, Inc. -// and -// Aniruddha Gokhale -// -// ============================================================================ - -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -/* - * BE_Attribute - */ -be_attribute::be_attribute (void) -{ -} - -be_attribute::be_attribute (idl_bool ro, AST_Type *ft, UTL_ScopedName *n, - UTL_StrList *p) - : AST_Attribute (ro, ft, n, p), - AST_Field (AST_Decl::NT_attr, ft, n, p), - AST_Decl (AST_Decl::NT_attr, n, p) -{ -} - -// Handling attributes is very similar to operations. Attributes are mapped to -// two methods - one to set the value and one to get the value. For a readonly -// attribute we only have the method that retrieves the value. For the "set" -// method we pass an in parameter which is of the type of the attribute. So the -// handling here is exactly like the "in" parameters for arguments. The -// handling of the "get" method is exactly like the return values of -// operations. - -int -be_attribute::gen_client_header (void) -{ - TAO_OutStream *ch; // output stream - be_type *bt; // type node - be_state *s; // state based code gen object - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - ch = cg->client_header (); - - ch->indent (); // start with the current indentation level - - bt = be_type::narrow_from_decl (this->field_type ()); - if (!bt) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_attribute::gen_client_header - " - "bad type\n"), - -1); - } - - - // first the "get" method - - // the retrieve method is defined virtual - *ch << "virtual "; - - // first generate the return type - cg->push (TAO_CodeGen::TAO_ATTRIBUTE_RETURN_TYPE_CH); // we are now generating - // an attribute "get" - // definition with the - // return type first - - s = cg->make_state (); // retrieve state based object - - if (!s || (s->gen_code (bt, this) == -1)) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_attribute::gen_client_header - " - "return type generation failure\n"), - -1); - } - cg->pop (); // restore previous state - - // generate the operation name - // additional argument in the form of CORBA::Environment since TAO does not - // yet support C++ style Exceptions. However, we can have an option to the - // "tao" IDL compiler to ask it to generate code for exceptions. This will be - // handled in a later release. - *ch << " " << this->local_name () << " (CORBA::Environment &env);\n"; - - // now the set method. However, this is not defined if we are readonly - if (!this->readonly ()) - { - ch->indent (); - *ch << "virtual void " << this->local_name () << "("; - - // we pass the type as an "in" parameter - cg->push (TAO_CodeGen::TAO_ATTRIBUTE_INPARAM_TYPE_CH); - - s = cg->make_state (); // retrieve state based object - - if (!s || !bt || (s->gen_code (bt, this) == -1)) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_attribute::gen_client_header - " - "in param type generation failure\n"), - -1); - } - cg->pop (); // restore previous state - *ch << ", CORBA::Environment &env);\n"; - } - - return 0; -} - -int -be_attribute::gen_client_stubs (void) -{ - TAO_OutStream *cs; // output stream - TAO_NL nl; // end line - be_type *bt; // type node - be_state *s; // state based code gen object - - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - cs = cg->client_stubs (); - - // retrieve the type - bt = be_type::narrow_from_decl (this->field_type ()); - if (!bt) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_attribute::gen_client_stubs - " - "bad type\n"), - -1); - } - - // first the retrieve method - cs->indent (); // start with current indentation level - - // generate the TAO_Param_Data table for the "get" method - *cs << "static const TAO_Param_Data _get_" << this->flatname () << - "_paramdata [] = " << nl; - *cs << "{\n"; - cs->incr_indent (); - - // entry for the return type - *cs << "{" << bt->tc_name () << ", PARAM_RETURN, "; - // Are we returning a pointer to value? i.e., is the type variable? If it is, - // we must tell the stub what is the size of the top level structure - if (bt->size_type () == be_decl::VARIABLE) - { - switch (bt->node_type ()) - { - case AST_Decl::NT_interface: - case AST_Decl::NT_interface_fwd: - // no need of size here - *cs << "0}"; - break; - case AST_Decl::NT_pre_defined: - { - be_predefined_type *bpd = be_predefined_type::narrow_from_decl - (bt); - if (bpd->pt () == AST_PredefinedType::PT_pseudo) - // no need of size here - *cs << "0}"; - else - *cs << "sizeof (" << bt->name () << ")}"; - } - break; - default: - *cs << "sizeof (" << bt->name () << ")}"; - } - } - else - *cs << "0}"; - cs->decr_indent (); - *cs << "};\n\n"; - - // now generate the calldata table - - cs->indent (); - *cs << "static const TAO_Call_Data _get_" << this->flatname () << "_calldata = " - << nl; - *cs << "{"; - // prepend a "_get_" - *cs << "\"_get_" << this->local_name () << "\", "; - *cs << "1, "; // always a twoway call - *cs << "1, "; // size is 1 - // insert the address of the paramdata table - *cs << "_get_" << this->flatname () << "_paramdata, "; - // XXXASG - Exception list goes here (if it exists) - TODO - *cs << "0, 0};\n\n"; - - // now generate the actual stub - - // first generate the return type - cs->indent (); - cg->push (TAO_CodeGen::TAO_ATTRIBUTE_RETURN_TYPE_CS); // declare a return - // type of the stub - s = cg->make_state (); - if (!s || (s->gen_code (bt, this) == -1)) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_attribute::gen_client_stubs - " - "return type generation failure\n"), - -1); - } - cg->pop (); - - // generate the operation name - *cs << " " << this->name () << "(CORBA::Environment &env)" << nl; - *cs << "{\n"; - cs->incr_indent (); - - // declare a return type - cg->push (TAO_CodeGen::TAO_ATTRIBUTE_RETVAL_DECL_CS); - s = cg->make_state (); - if (!s || (s->gen_code (bt, this) == -1)) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_attribute::gen_client_stubs - " - "retval declaration failure\n"), - -1); - } - cg->pop (); - - // generate code that calls QueryInterface - *cs << "STUB_Object *istub;\n\n"; - cs->indent (); - *cs << "if (this->QueryInterface (IID_STUB_Object, " << - "(void **)&istub) != TAO_NOERROR)" << nl; - *cs << "{\n"; - cs->incr_indent (); - *cs << "env.exception (new CORBA::DATA_CONVERSION (CORBA::COMPLETED_NO));" << - nl; - - // return the appropriate error value on exception - cg->push (TAO_CodeGen::TAO_ATTRIBUTE_RETVAL_EXCEPTION_CS); - s = cg->make_state (); - if (!s || (s->gen_code (bt, this) == -1)) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_attribute::gen_client_stubs - " - "failure returning from exception\n"), - -1); - } - cg->pop (); - - cs->decr_indent (); - *cs << "}" << nl; - *cs << "this->Release (); // QueryInterface has bumped up our refcount" << nl; - - // call do_call with appropriate number of arguments - *cs << "istub->do_call (env, &_get_" << this->flatname () << - "_calldata, &retval);" << nl; - - // return the retval - cg->push (TAO_CodeGen::TAO_ATTRIBUTE_RETVAL_RETURN_CS); - s = cg->make_state (); - if (!s || (s->gen_code (bt, this) == -1)) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_operation::gen_client_stubs\n" - "return val return generation failure\n"), - -1); - return -1; - } - cg->pop (); - - cs->decr_indent (0); - *cs << "\n}\n\n"; - - if (this->readonly ()) - return 0; // we were readonly, nothing else to do. - - // Now generate the stub for the "set" method - cs->indent (); // start with current indentation level - - // generate the TAO_Param_Data table for the "set" method - *cs << "static const TAO_Param_Data _set_" << this->flatname () << - "_paramdata [] = " << nl; - *cs << "{\n"; - cs->incr_indent (); - - // entry for the return type - *cs << "{CORBA::_tc_void, PARAM_RETURN, 0}," << nl; - *cs << "{" << bt->tc_name () << ", PARAM_IN, 0}\n"; - cs->decr_indent (); - *cs << "};\n\n"; - - // now generate the calldata table - - cs->indent (); - *cs << "static const TAO_Call_Data _set_" << this->flatname () << "_calldata = " - << nl; - *cs << "{"; - // prepend a "_set_" - *cs << "\"_set_" << this->local_name () << "\", "; - *cs << "1, "; // always a twoway call - *cs << "2, "; // size is 2 - // insert the address of the paramdata table - *cs << "_get_" << this->flatname () << "_paramdata, "; - // XXXASG - Exception list goes here (if it exists) - TODO - *cs << "0, 0};\n\n"; - - // now generate the actual stub - - cs->indent (); - *cs << "void " << this->name () << "("; - // generate the in parameter - cg->push (TAO_CodeGen::TAO_ATTRIBUTE_INPARAM_TYPE_CS); - s = cg->make_state (); - if (!s || (s->gen_code (bt, this) == -1)) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_operation::gen_client_stubs - " - "failure in argument generation in signature\n"), - -1); - } - cg->pop (); - - // last argument - is always CORBA::Environment - *cs << ", CORBA::Environment &env)" << nl; - *cs << "{\n"; - cs->incr_indent (); - - // generate code that calls QueryInterface - *cs << "STUB_Object *istub;\n\n"; - cs->indent (); - *cs << "if (this->QueryInterface (IID_STUB_Object, " << - "(void **)&istub) != TAO_NOERROR)" << nl; - *cs << "{\n"; - cs->incr_indent (); - *cs << "env.exception (new CORBA::DATA_CONVERSION (CORBA::COMPLETED_NO));" << - nl; - *cs << "return;\n"; - cs->decr_indent (); - *cs << "}" << nl; - *cs << "this->Release (); // QueryInterface has bumped up our refcount" << nl; - - // do any pre do_call stuff with the lone IN parameter - cg->push (TAO_CodeGen::TAO_ATTRIBUTE_PRE_DOCALL_CS); - if (!s || (s->gen_code (bt, this) == -1)) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_atribute::gen_client_stubs - " - "failure generating pre docall stuff\n"), - -1); - } - cg->pop (); - - // call do_call with appropriate number of arguments - *cs << "istub->do_call (env, &_set_" << this->flatname () << - "_calldata, 0"; // no return value - - cg->push (TAO_CodeGen::TAO_ATTRIBUTE_DOCALL_CS); - s = cg->make_state (); - if (!s || (s->gen_code (bt, this) == -1)) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_attribute::gen_client_stubs - " - "in param in docall generation failure\n"), - -1); - return -1; - } - cg->pop (); - *cs << ");" << nl; - - // do any post do_call processing - cg->push (TAO_CodeGen::TAO_ATTRIBUTE_POST_DOCALL_CS); - s = cg->make_state (); - if (!s || !bt || (s->gen_code (bt, this) == -1)) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_attribute::gen_client_stubs\n" - "post docall generation failure\n"), - -1); - return -1; - } - cg->pop (); - - cs->decr_indent (0); - *cs << "\n}\n\n"; - - return 0; -} - -int -be_attribute::gen_server_header (void) -{ - TAO_OutStream *sh; // output stream - be_type *bt; // type node - be_state *s; // state based code generator object - TAO_NL nl; // newline generator - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - sh = cg->server_header (); - - // first retrieve the type - bt = be_type::narrow_from_decl (this->field_type ()); - if (!bt) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_attribute::gen_server_header - " - "bad type\n"), - -1); - } - - // first the "get" method - - sh->indent (); // start with the current indentation level - - // the retrieve method is defined pure virtual - *sh << "virtual "; - cg->push (TAO_CodeGen::TAO_ATTRIBUTE_RETURN_TYPE_SH); // we are now generating - // an operation - // definition with the - // return type first - - s = cg->make_state (); // retrieve state based object - - if (!s || (s->gen_code (bt, this) == -1)) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_attribute::gen_server_header - " - "return type generation failure\n"), - -1); - } - cg->pop (); // restore previous state - - *sh << " " << this->local_name () << " (CORBA::Environment &env) = 0;" << nl; - - // generate the static method corresponding to the method - *sh << "static void _get_" << this->local_name () << - "_skel (CORBA::ServerRequest &req, void *obj, " << - "void *context, CORBA::Environment &env);\n\n"; - - - // now the set method. However, this is not defined if we are readonly - if (this->readonly ()) - return 0; - - sh->indent (); - *sh << "virtual void " << this->local_name () << "("; - - // we pass the type as an "in" parameter - cg->push (TAO_CodeGen::TAO_ATTRIBUTE_INPARAM_TYPE_SH); - - s = cg->make_state (); // retrieve state based object - - if (!s || (s->gen_code (bt, this) == -1)) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_attribute::gen_server_header - " - "in param type generation failure\n"), - -1); - } - cg->pop (); // restore previous state - *sh << ", CORBA::Environment &env) = 0;" << nl; - - // generate the static method corresponding to the method - *sh << "static void _set_" << this->local_name () << - "_skel (CORBA::ServerRequest &req, void *obj, " << - "void *context, CORBA::Environment &env);\n\n"; - - - return 0; -} - -int -be_attribute::gen_server_skeletons (void) -{ - TAO_OutStream *ss; // output stream - TAO_NL nl; // end line - be_type *bt; // type node - be_state *s; // state based code gen object - be_interface *intf; // enclosing interface node - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - ss = cg->server_skeletons (); - - ss->indent (); // start with the current indentation level - - // retrieve our type - bt = be_type::narrow_from_decl (this->field_type ()); - if (!bt) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_attribute::gen_server_skeletons - " - "bad type\n"), - -1); - } - - // retrieve our enclosing interface decl - intf = be_interface::narrow_from_decl (ScopeAsDecl (this->defined_in ())); - if (!intf) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_attribute::gen_server_skeletons - " - "bad enclosing interface\n"), - -1); - } - - - // code generation - first the "get" method - *ss << "void " << intf->full_skel_name () << "::_get_" - << this->local_name () << "_skel (" - << "CORBA::ServerRequest &_tao_server_request, " - << "void *_tao_object_reference, void */*context*/, " - << "CORBA::Environment &_tao_environment)" << nl; - *ss << "{\n"; - ss->incr_indent (); - // define a variable that will eventually point to our implementation object - *ss << intf->full_skel_name () << "_ptr impl = (" << intf->full_skel_name () - << "_ptr) _tao_object_reference;" << nl; - // store the result in this Any - *ss << "CORBA::Any *result;" << nl; - // emit the return type - cg->push (TAO_CodeGen::TAO_ATTRIBUTE_RETVAL_DECL_SS); // emit type for return - // value - // get a state based code gen object - s = cg->make_state (); - if (!s || (s->gen_code (bt, this) == -1)) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_attribute::gen_server_skeletons - " - "codegen for return val decl failed\n"), - -1); - } - cg->pop (); - - ss->indent (); - *ss << "// this method has no incoming parameters. Nothing to parse" << nl; - - // make the upcall - cg->push (TAO_CodeGen::TAO_ATTRIBUTE_RETVAL_ASSIGN_SS); - s = cg->make_state (); - // emit code to assign to retval - if (!s || (s->gen_code (bt, this) == -1)) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_attribute::gen_server_skeletons - " - "codegen for return val assign failed\n"), - -1); - } - *ss << " = impl->" << this->local_name () << "(_tao_environment);" << nl; - cg->pop (); - - // insert our return val into the result - cg->push (TAO_CodeGen::TAO_ATTRIBUTE_RESULT_SS); - s = cg->make_state (); - if (!s || (s->gen_code (bt, this) == -1)) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_attribute::gen_server_skeletons - " - "codegen for returning result failed\n"), - -1); - } - cg->pop (); - // insert the result into the server request - *ss << "_tao_server_request.result (result, _tao_environment);\n"; - ss->decr_indent (); - *ss << "}\n\n"; - - if (this->readonly ()) - return 0; // nothing else to do as we are readonly - - // generate skeleton for the "set" method - - ss->indent (); - *ss << "void " << intf->full_skel_name () << "::_set_" - << this->local_name () << "_skel (" - << "CORBA::ServerRequest &_tao_server_request, " - << "void *_tao_object_reference, void */*context*/, " - << "CORBA::Environment &_tao_environment)" << nl; - *ss << "{\n"; - ss->incr_indent (); - // define an NVList to hold the in argument - *ss << "CORBA::NVList_ptr \t nvlist;" << nl; - // define a variable that will eventually point to our implementation object - *ss << intf->full_skel_name () << "_ptr \t impl = (" << intf->full_skel_name - () << "_ptr)_tao_object_reference;" << nl; - - // declare an NVList and create one - ss->indent (); - *ss << "// create an NV list and populate it with typecodes" << nl; - *ss << "_tao_server_request.orb ()->create_list (1, nvlist); // initialize a list" << nl; - - // if we have any arguments, get each one of them and allocate an Any and - // NamedValue for each. In addition, define a variable of that type - cg->push (TAO_CodeGen::TAO_ATTRIBUTE_INPARAM_TYPE_SS); - s = cg->make_state (); - if (!s || (s->gen_code (bt, this) == -1)) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_attribute::gen_server_skeletons - " - "codegen for returning result failed\n"), - -1); - } - cg->pop (); - - *ss << "// parse the arguments" << nl; - *ss << "_tao_server_request.params (nvlist, _tao_environment);" << nl; - *ss << "if (_tao_environment.exception ()) return;" << nl; - - cg->push (TAO_CodeGen::TAO_ATTRIBUTE_PRE_UPCALL_SS); - s = cg->make_state (); - if (!s || (s->gen_code (bt, this) == -1)) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_attribute::gen_server_skeletons - " - "preupcall code failed\n"), - -1); - } - cg->pop (); - - // make the upcall - *ss << "impl->" << this->local_name () << "("; - cg->push (TAO_CodeGen::TAO_ATTRIBUTE_UPCALL_SS); - s = cg->make_state (); - if (!s || (s->gen_code (bt, this) == -1)) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_attribute::gen_server_skeletons - " - "upcall code failed\n"), - -1); - } - cg->pop (); - *ss << "_tao_environment);" << nl; - - cg->push (TAO_CodeGen::TAO_ATTRIBUTE_POST_UPCALL_SS); - s = cg->make_state (); - if (!s || (s->gen_code (bt, this) == -1)) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_attribute::gen_server_skeletons - " - "post upcall code failed\n"), - -1); - } - cg->pop (); - - *ss << "\n"; - ss->decr_indent (); - *ss << "}\n\n"; - - return 0; -} - -// Generates the client-side inline information -int -be_attribute::gen_client_inline (void) -{ - // nothing to be done - return 0; -} - -// Generates the server-side inline -int -be_attribute::gen_server_inline (void) -{ - // nothing to be done - return 0; -} - -// Narrowing -IMPL_NARROW_METHODS2 (be_attribute, AST_Attribute, be_decl) -IMPL_NARROW_FROM_DECL (be_attribute) diff --git a/TAO/TAO_IDL/be/be_codegen.cpp b/TAO/TAO_IDL/be/be_codegen.cpp deleted file mode 100644 index 9b41fbee13d..00000000000 --- a/TAO/TAO_IDL/be/be_codegen.cpp +++ /dev/null @@ -1,527 +0,0 @@ -/* -*- c++ -*- */ -// ============================================================================ -// -// = LIBRARY -// TAO IDL -// -// = FILENAME -// be_codegen.h -// -// = DESCRIPTION -// -// Code generation -// = AUTHOR -// Aniruddha Gokhale -// -// ============================================================================ - -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -static const int CHUNK = 100; - -/* BE global Data */ -TAO_CodeGen::TAO_CodeGen (void) - : client_header_ (0), - client_stubs_ (0), - client_inline_ (0), - server_header_ (0), - server_skeletons_ (0), - server_inline_ (0), - curr_os_ (0), - state_ (new TAO_CodeGen::CG_STATE [CHUNK]), - top_ (0), - size_ (CHUNK) -{ - // set the current code generation state - this->state_ [this->top_++] = TAO_CodeGen::TAO_INITIAL; -} - -// destructor -TAO_CodeGen::~TAO_CodeGen (void) -{ - delete client_header_; - delete server_header_; - delete client_stubs_; - delete server_skeletons_; - delete client_inline_; - delete server_inline_; - curr_os_ = 0; - delete [] state_; -} - -// factory method -be_state * -TAO_CodeGen::make_state (void) -{ - switch (this->state ()) - { - case TAO_STRUCT_CH: - case TAO_STRUCT_CS: - case TAO_STRUCT_CI: - return TAO_BE_STATE_STRUCT::instance (); - case TAO_UNION_DISCTYPEDEFN_CH: - return TAO_BE_STATE_UNION_DISCTYPEDEFN_CH::instance (); - case TAO_UNION_DISCTYPEDEFN_CI: - return TAO_BE_STATE_UNION_DISCTYPEDEFN_CI::instance (); - case TAO_UNION_PUBLIC_CH: - return TAO_BE_STATE_UNION_PUBLIC_CH::instance (); - case TAO_UNION_PUBLIC_CI: - return TAO_BE_STATE_UNION_PUBLIC_CI::instance (); - case TAO_UNION_PUBLIC_CS: - case TAO_UNION_PUBLIC_ASSIGN_CS: - return TAO_BE_STATE_UNION_PUBLIC_CS::instance (); - case TAO_UNION_PRIVATE_CH: - return TAO_BE_STATE_UNION_PRIVATE_CH::instance (); - case TAO_OPERATION_CH: - case TAO_OPERATION_RETURN_TYPE_CS: - case TAO_OPERATION_RETVAL_DECL_CS: - case TAO_OPERATION_RETVAL_EXCEPTION_CS: - case TAO_OPERATION_RETVAL_RETURN_CS: - case TAO_OPERATION_SH: - case TAO_OPERATION_RETVAL_DECL_SS: - case TAO_OPERATION_RETVAL_ASSIGN_SS: - case TAO_OPERATION_RESULT_SS: - return TAO_BE_STATE_OPERATION::instance (); - case TAO_ARGUMENT_CH: - case TAO_ARGUMENT_CS: - case TAO_ARGUMENT_PRE_DOCALL_CS: - case TAO_ARGUMENT_DOCALL_CS: - case TAO_ARGUMENT_POST_DOCALL_CS: - case TAO_ARGUMENT_SH: - case TAO_ARGUMENT_SS: - case TAO_ARGUMENT_VARDECL_SS: - case TAO_ARGUMENT_PRE_UPCALL_SS: - case TAO_ARGUMENT_UPCALL_SS: - case TAO_ARGUMENT_POST_UPCALL_SS: - return TAO_BE_STATE_ARGUMENT::instance (); - case TAO_TYPEDEF_CH: - case TAO_TYPEDEF_CS: - case TAO_TYPEDEF_CI: - return TAO_BE_STATE_TYPEDEF::instance (); - case TAO_ARRAY_DEFN_CH: - case TAO_ARRAY_OTHER_CH: - case TAO_ARRAY_DEFN_CI: - return TAO_BE_STATE_ARRAY::instance (); - case TAO_SEQUENCE_BASE_CH: - case TAO_SEQUENCE_BASE_CS: - case TAO_SEQUENCE_BASE_CI: - case TAO_SEQUENCE_BODY_CH: - case TAO_SEQUENCE_BODY_CS: - case TAO_SEQUENCE_BODY_CI: - case TAO_SEQELEM_RETTYPE_CH: - case TAO_SEQELEM_RETTYPE_CI: - case TAO_SEQELEM_RETTYPE_CS: - return TAO_BE_STATE_SEQUENCE::instance (); - case TAO_ATTRIBUTE_RETURN_TYPE_CH: - case TAO_ATTRIBUTE_INPARAM_TYPE_CH: - case TAO_ATTRIBUTE_RETURN_TYPE_CS: - case TAO_ATTRIBUTE_RETVAL_DECL_CS: - case TAO_ATTRIBUTE_RETVAL_EXCEPTION_CS: - case TAO_ATTRIBUTE_RETVAL_RETURN_CS: - case TAO_ATTRIBUTE_INPARAM_TYPE_CS: - case TAO_ATTRIBUTE_PRE_DOCALL_CS: - case TAO_ATTRIBUTE_DOCALL_CS: - case TAO_ATTRIBUTE_POST_DOCALL_CS: - case TAO_ATTRIBUTE_RETURN_TYPE_SH: - case TAO_ATTRIBUTE_INPARAM_TYPE_SH: - case TAO_ATTRIBUTE_RETVAL_DECL_SS: - case TAO_ATTRIBUTE_RETVAL_ASSIGN_SS: - case TAO_ATTRIBUTE_RESULT_SS: - case TAO_ATTRIBUTE_INPARAM_TYPE_SS: - case TAO_ATTRIBUTE_PRE_UPCALL_SS: - case TAO_ATTRIBUTE_UPCALL_SS: - case TAO_ATTRIBUTE_POST_UPCALL_SS: - return TAO_BE_STATE_ATTRIBUTE::instance (); - case TAO_EXCEPTION_CH: - case TAO_EXCEPTION_CTOR_CH: - case TAO_EXCEPTION_CS: - case TAO_EXCEPTION_CTOR_CS: - case TAO_EXCEPTION_CTOR_ASSIGN_CS: - case TAO_EXCEPTION_CI: - return TAO_BE_STATE_EXCEPTION::instance (); - default: - return 0; - } -} - -// change the string to all upcase -const char * -TAO_CodeGen::upcase (const char *str) -{ - static char upcase_str [NAMEBUFSIZE]; - - ACE_OS::memset (upcase_str, '\0', NAMEBUFSIZE); - // convert letters in str to upcase - for (unsigned int i=0; i < ACE_OS::strlen (str); i++) - { - if (isalpha (str [i])) - { - upcase_str[i] = toupper (str [i]); - } - else - { - // copy it as it is - upcase_str[i] = str[i]; - } - } - return upcase_str; -} - -// set the client header stream -int -TAO_CodeGen::client_header (const char *fname) -{ - // retrieve the singleton instance to the outstream factory - TAO_OutStream_Factory *factory = TAO_OUTSTREAM_FACTORY::instance (); - - // retrieve a specialized instance - this->client_header_ = factory->make_outstream (); - if (!this->client_header_) - { - return -1; - } - - if (this->client_header_->open (fname, TAO_OutStream::TAO_CLI_HDR) == -1) - return -1; - else - { - // now generate the #if !defined clause - static char macro_name [NAMEBUFSIZE]; - - ACE_OS::memset (macro_name, '\0', NAMEBUFSIZE); - const char *suffix = ACE_OS::strstr (fname, ".h"); - if (suffix == 0) - return -1; // bad file name - else - { - ACE_OS::sprintf (macro_name, "_TAO_IDL_"); - // convert letters in fname to upcase - for (int i=0; i < (suffix - fname); i++) - if (isalpha (fname [i])) - macro_name[i+9] = toupper (fname [i]); - else - macro_name[i+9] = fname[i]; - - ACE_OS::strcat (macro_name, "_H_"); - - this->client_header_->print ("#if !defined (%s)\n", macro_name); - this->client_header_->print ("#define %s\n\n", macro_name); - *this->client_header_ << "#include \"tao/corba.h\"\n"; - - // We must include all the skeleton headers corresponding to - // IDL files included by the current IDL file. - for (size_t j = 0; - j < idl_global->n_include_file_names (); - ++j) - { - String* idl_name = - idl_global->include_file_names()[j]; - - const char* client_hdr = - IDL_GlobalData::be_get_client_hdr (idl_name); - - this->client_header_->print ("#include \"%s\"\n", - client_hdr); - } - *this->client_header_ << "\n"; - return 0; - } - } -} - -// get the client header stream -TAO_OutStream * -TAO_CodeGen::client_header (void) -{ - return this->client_header_; -} - -// set the client stub stream -int -TAO_CodeGen::client_stubs (const char *fname) -{ - // retrieve the singleton instance to the outstream factory - TAO_OutStream_Factory *factory = TAO_OUTSTREAM_FACTORY::instance (); - - // retrieve a specialized instance - this->client_stubs_ = factory->make_outstream (); - if (!this->client_stubs_) - { - return -1; - } - - if (this->client_stubs_->open (fname, TAO_OutStream::TAO_CLI_IMPL) == -1) - { - return -1; - } - // generate the include statement for the client header - *this->client_stubs_ << "#include \"" << - idl_global->be_get_client_hdr_fname () << "\"\n\n"; - - // generate the code that includes the inline file if not included in the - // header file - *this->client_stubs_ << "#if !defined (__ACE_INLINE__)\n"; - *this->client_stubs_ << "#include \"" << - idl_global->be_get_client_inline_fname () << "\"\n"; - *this->client_stubs_ << "#endif // !defined INLINE\n\n"; - return 0; -} - -// get the client stubs stream -TAO_OutStream * -TAO_CodeGen::client_stubs (void) -{ - return this->client_stubs_; -} - -// set the client inline stream -int -TAO_CodeGen::client_inline (const char *fname) -{ - // retrieve the singleton instance to the outstream factory - TAO_OutStream_Factory *factory = TAO_OUTSTREAM_FACTORY::instance (); - - // retrieve a specialized instance - this->client_inline_ = factory->make_outstream (); - if (!this->client_inline_) - { - return -1; - } - - return this->client_inline_->open (fname, TAO_OutStream::TAO_CLI_INL); -} - -// get the client inline stream -TAO_OutStream * -TAO_CodeGen::client_inline (void) -{ - return this->client_inline_; -} - -// set the server header stream -int -TAO_CodeGen::server_header (const char *fname) -{ - // retrieve the singleton instance to the outstream factory - TAO_OutStream_Factory *factory = TAO_OUTSTREAM_FACTORY::instance (); - - // retrieve a specialized instance - this->server_header_ = factory->make_outstream (); - if (!this->server_header_) - { - return -1; - } - - if (this->server_header_->open (fname, TAO_OutStream::TAO_SVR_HDR) == -1) - return -1; - else - { - // now generate the #if !defined clause - static char macro_name [NAMEBUFSIZE]; - - ACE_OS::memset (macro_name, '\0', NAMEBUFSIZE); - const char *suffix = ACE_OS::strstr (fname, ".h"); - if (suffix == 0) - return -1; // bad file name - else - { - ACE_OS::sprintf (macro_name, "_TAO_IDL_"); - // convert letters in fname to upcase - for (int i=0; i < (suffix - fname); i++) - { - if (isalpha (fname [i])) - { - macro_name[i+9] = toupper (fname [i]); - } - } - ACE_OS::strcat (macro_name, "_H_"); - - this->server_header_->print ("#if !defined (%s)\n", macro_name); - this->server_header_->print ("#define %s\n\n", macro_name); - - // We must include all the skeleton headers corresponding to - // IDL files included by the current IDL file. - for (size_t j = 0; - j < idl_global->n_include_file_names (); - ++j) - { - String* idl_name = - idl_global->include_file_names()[j]; - - const char* server_hdr = - IDL_GlobalData::be_get_server_hdr (idl_name); - - this->server_header_->print ("#include \"%s\"\n", - server_hdr); - } - // the server header should include the client header - *this->server_header_ << "#include \"" << - idl_global->be_get_client_hdr_fname () << "\"\n\n"; - - return 0; - } - } -} - -// get the server header stream -TAO_OutStream * -TAO_CodeGen::server_header (void) -{ - return this->server_header_; -} - -// set the server skeletons stream -int -TAO_CodeGen::server_skeletons (const char *fname) -{ - // retrieve the singleton instance to the outstream factory - TAO_OutStream_Factory *factory = TAO_OUTSTREAM_FACTORY::instance (); - - // retrieve a specialized instance - this->server_skeletons_ = factory->make_outstream (); - if (!this->server_skeletons_) - { - return -1; - } - - if (this->server_skeletons_->open (fname, TAO_OutStream::TAO_SVR_IMPL) == -1) - { - return -1; - } - - // generate the include statement for the server header - *this->server_skeletons_ << "#include \"" << - idl_global->be_get_server_hdr_fname () << "\"\n\n"; - - // generate the code that includes the inline file if not included in the - // header file - *this->server_skeletons_ << "#if !defined (__ACE_INLINE__)\n"; - *this->server_skeletons_ << "#include \"" << - idl_global->be_get_server_inline_fname () << "\"\n"; - *this->server_skeletons_ << "#endif // !defined INLINE\n\n"; - return 0; -} - -// get the server skeletons stream -TAO_OutStream * -TAO_CodeGen::server_skeletons (void) -{ - return this->server_skeletons_; -} - -// set the server inline stream -int -TAO_CodeGen::server_inline (const char *fname) -{ - // retrieve the singleton instance to the outstream factory - TAO_OutStream_Factory *factory = TAO_OUTSTREAM_FACTORY::instance (); - - // retrieve a specialized instance - this->server_inline_ = factory->make_outstream (); - if (!this->server_inline_) - { - return -1; - } - - return this->server_inline_->open (fname, TAO_OutStream::TAO_SVR_INL); -} - -// get the server inline stream -TAO_OutStream * -TAO_CodeGen::server_inline (void) -{ - return this->server_inline_; -} - -// put the last #endif in the client and server headers -int -TAO_CodeGen::end_client_header (void) -{ - // insert the code to include the inline file - *this->client_header_ << "\n#if defined (__ACE_INLINE__)\n"; - *this->client_header_ << "#include \"" << - idl_global->be_get_client_inline_fname () << "\"\n"; - *this->client_header_ << "#endif // defined INLINE\n\n"; - - // code to put the last #endif - *this->client_header_ << "\n#endif // if !defined\n"; - return 0; -} - -int -TAO_CodeGen::end_server_header (void) -{ - // insert the code to include the inline file - *this->server_header_ << "\n#if defined (__ACE_INLINE__)\n"; - *this->server_header_ << "#include \"" << - idl_global->be_get_server_inline_fname () << "\"\n"; - *this->server_header_ << "#endif // defined INLINE\n\n"; - - // code to put the last #endif - *this->server_header_ << "\n#endif // if !defined\n"; - return 0; -} - -// We use the following helper functions to pass information. This class is the -// best place to pass such information rather than passing information through -// global variables spread everywhere. This class is a singleton and is -// effectively a global. - -void -TAO_CodeGen::outstream (TAO_OutStream *os) -{ - this->curr_os_ = os; -} - -TAO_OutStream * -TAO_CodeGen::outstream (void) -{ - return this->curr_os_; -} - -void -TAO_CodeGen::push (TAO_CodeGen::CG_STATE s) -{ - if (this->top_ == this->size_) - { - TAO_CodeGen::CG_STATE *temp = this->state_; - this->size_ += CHUNK; - this->state_ = new TAO_CodeGen::CG_STATE [this->size_]; - for (int i=0; i < this->top_; i++) - this->state_ [i] = temp [i]; - delete []temp; - } - this->state_[this->top_++] = s; -} - -void -TAO_CodeGen::pop (void) -{ - this->top_--; -} - -TAO_CodeGen::CG_STATE -TAO_CodeGen::state (void) -{ - return this->state_[this->top_ - 1]; // top points to the next free slot -} - -void -TAO_CodeGen::reset (void) -{ - this->top_ = 1; // the 0th posn is always the INITIAL state -} - -void -TAO_CodeGen::node (be_decl *n) -{ - this->node_ = n; -} - -be_decl * -TAO_CodeGen::node (void) -{ - return this->node_; -} diff --git a/TAO/TAO_IDL/be/be_constant.cpp b/TAO/TAO_IDL/be/be_constant.cpp deleted file mode 100644 index 10dc22066c8..00000000000 --- a/TAO/TAO_IDL/be/be_constant.cpp +++ /dev/null @@ -1,174 +0,0 @@ -// ============================================================================ -// -// = LIBRARY -// TAO IDL -// -// = FILENAME -// be_constant.cpp -// -// = DESCRIPTION -// Extension of class AST_Constant that provides additional means for C++ -// mapping. -// -// = AUTHOR -// Copyright 1994-1995 by Sun Microsystems, Inc. -// and -// Aniruddha Gokhale -// -// ============================================================================ - -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -/* - * BE_Constant - */ -be_constant::be_constant (void) -{ - this->size_type (be_decl::FIXED); -} - -be_constant::be_constant (AST_Expression::ExprType et, - AST_Expression *v, - UTL_ScopedName *n, - UTL_StrList *p) - : AST_Constant (et, v, n, p), - AST_Decl (AST_Decl::NT_const, n, p) -{ - this->size_type (be_decl::FIXED); -} - -// ---------------------------------------- -// CODE GENERATION METHODS -// ---------------------------------------- - -// Generates the client-side header information for the constant -int -be_constant::gen_client_header (void) -{ - TAO_OutStream *ch; // output stream - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - cg->push (TAO_CodeGen::TAO_CONSTANT_CH); - - ch = cg->client_header (); - - // if we are defined in the outermost scope, then the value is assigned - // to us here itself, else it will be in the *.cpp file - - ch->indent (); // start from whatever indentation level we were at - *ch << "static const " << this->exprtype_to_string () << " " << local_name (); - if (!this->is_nested ()) - { - // We were defined at the outermost scope. So we put the value in the - // header itself - *ch << " = " << this->constant_value (); - } - *ch << ";\n\n"; - cg->pop (); - return 0; -} - -// Generates the client-side stubs for the constant -int -be_constant::gen_client_stubs (void) -{ - TAO_OutStream *cs; // output stream - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - cg->push (TAO_CodeGen::TAO_CONSTANT_CS); - - cs = cg->client_stubs (); - - if (this->is_nested ()) - { - // for those constants not defined in the outer most scope, they get - // assigned to their values in the - cs->indent (); // start from whatever indentation level we were at - *cs << "const " << this->exprtype_to_string () << " " << this->name (); - *cs << " = " << this->constant_value (); - *cs << ";\n\n"; - } - cg->pop (); - return 0; -} - -// Generates the server-side header information for the constant -int -be_constant::gen_server_header (void) -{ - // nothing to be done - return 0; -} - -// Generates the server-side skeletons for the constant -int -be_constant::gen_server_skeletons (void) -{ - // nothing to be done - return 0; -} - -// Generates the client-side inline information -int -be_constant::gen_client_inline (void) -{ - // nothing to be done - return 0; -} - -// Generates the server-side inline -int -be_constant::gen_server_inline (void) -{ - // nothing to be done - return 0; -} - -char * -be_constant::exprtype_to_string (void) -{ - switch (this->et ()) - { - case AST_Expression::EV_short: - return "CORBA::Short"; - case AST_Expression::EV_ushort: - return "CORBA::UShort"; - case AST_Expression::EV_long: - return "CORBA::Long"; - case AST_Expression::EV_ulong: - return "CORBA::ULong"; - case AST_Expression::EV_float: - return "CORBA::Float"; - case AST_Expression::EV_double: - return "CORBA::Double"; - case AST_Expression::EV_char: - return "CORBA::Char"; - case AST_Expression::EV_octet: - return "CORBA::Octet"; - case AST_Expression::EV_bool: - return "CORBA::Boolean"; - case AST_Expression::EV_string: - return "char *const"; - case AST_Expression::EV_any: - return "CORBA::Any"; - case AST_Expression::EV_void: - return "void"; - case AST_Expression::EV_none: - return "none"; - case AST_Expression::EV_longlong: - case AST_Expression::EV_ulonglong: - case AST_Expression::EV_longdouble: - case AST_Expression::EV_wchar: - case AST_Expression::EV_wstring: - return NULL; - } - return NULL; -} - -// Narrowing -IMPL_NARROW_METHODS2 (be_constant, AST_Constant, be_decl) -IMPL_NARROW_FROM_DECL (be_constant) diff --git a/TAO/TAO_IDL/be/be_decl.cpp b/TAO/TAO_IDL/be/be_decl.cpp deleted file mode 100644 index f8ff330b522..00000000000 --- a/TAO/TAO_IDL/be/be_decl.cpp +++ /dev/null @@ -1,469 +0,0 @@ -// ============================================================================ -// -// = LIBRARY -// TAO IDL -// -// = FILENAME -// be_decl.cpp -// -// = DESCRIPTION -// Extension of class AST_Decl that provides additional means for C++ -// mapping. -// -// = AUTHOR -// Copyright 1994-1995 by Sun Microsystems, Inc. -// and -// Aniruddha Gokhale -// -// ============================================================================ - -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -// Default Constructor -be_decl::be_decl (void) - : cli_hdr_gen_ (I_FALSE), - cli_stub_gen_ (I_FALSE), - cli_inline_gen_ (I_FALSE), - srv_hdr_gen_ (I_FALSE), - srv_skel_gen_ (I_FALSE), - srv_inline_gen_ (I_FALSE), - fullname_ (0), - flatname_ (0), - repoID_ (0), - size_type_ (be_decl::SIZE_UNKNOWN), - encap_len_ (-1) -{ -} - -// Constructor -be_decl::be_decl (AST_Decl::NodeType type, UTL_ScopedName *n, UTL_StrList - *pragmas) - : AST_Decl (type, n, pragmas), - cli_hdr_gen_ (I_FALSE), - cli_stub_gen_ (I_FALSE), - cli_inline_gen_ (I_FALSE), - srv_hdr_gen_ (I_FALSE), - srv_skel_gen_ (I_FALSE), - srv_inline_gen_ (I_FALSE), - fullname_ (0), - size_type_ (be_decl::SIZE_UNKNOWN), - encap_len_ (-1) -{ -} - -//destructor -be_decl::~be_decl (void) -{ -} - -int -be_decl::gen_encapsulation (void) -{ - // do nothing - return 0; -} - -long -be_decl::tc_encap_len (void) -{ - return -1; -} - -// return our size type -be_decl::SIZE_TYPE -be_decl::size_type (void) -{ - if (this->size_type_ == be_decl::SIZE_UNKNOWN) - (void) this->compute_size_type (); - return this->size_type_; -} - -// set our size type and that of all our ancestors -void -be_decl::size_type (be_decl::SIZE_TYPE st) -{ - // precondition - you cannot set somebody's sizetype to unknown - ACE_ASSERT (st != be_decl::SIZE_UNKNOWN); - - // st can be VARIABLE or FIXED - if (this->size_type_ == be_decl::SIZE_UNKNOWN) // not set yet - this->size_type_ = st; // set it - else if ((this->size_type_ == be_decl::FIXED) && - (st == be_decl::VARIABLE)) - // once we are VARIABLE, we cannot be FIXED. But if we were FIXED and then - // get overwritten to VARIABLE, it is fine. Such a situation occurs only - // when setting the sizes of structures and unions - this->size_type_ = st; - - -#if 0 - // if we are just a typedef, nothing else to do - if (this->node_type () == AST_Decl::NT_typedef) - return; - - // update our parent if it is of a specific type - if (this->is_nested ()) - { - // get the scope we are defined in - be_decl *d = be_decl::narrow_from_decl (ScopeAsDecl (this->defined_in - ())); - switch (d->node_type ()) - { - // only these define valid scopes whose size needs to be set the same - // as ours. - case AST_Decl::NT_struct: - case AST_Decl::NT_union: - d->size_type (st); // call recursively to set the size type of our - // ancestors - default: - return; // we are done - } - } // end else -#endif -} - -// compute stringified fully scoped name -void -be_decl::compute_fullname (void) -{ - if (fullname_) - return; - else - { - long namelen; - UTL_IdListActiveIterator *i; - long first = I_TRUE; - long second = I_FALSE; - - // in the first loop compute the total length - namelen = 0; - i = new UTL_IdListActiveIterator (this->name ()); - while (!(i->is_done ())) - { - if (!first) - namelen += 2; // for "::" - else if (second) - first = second = I_FALSE; - // print the identifier - namelen += ACE_OS::strlen (i->item ()->get_string ()); - if (first) - { - if (ACE_OS::strcmp (i->item ()->get_string (), "") != 0) - // does not start with a "" - first = I_FALSE; - else - second = I_TRUE; - } - i->next (); - } - delete i; - - this->fullname_ = new char [namelen+1]; - this->fullname_[0] = '\0'; - first = I_TRUE; - second = I_FALSE; - i = new UTL_IdListActiveIterator (this->name ()); - while (!(i->is_done ())) - { - if (!first) - ACE_OS::strcat (this->fullname_, "::"); - else if (second) - first = second = I_FALSE; - // print the identifier - ACE_OS::strcat (this->fullname_, i->item ()->get_string ()); - if (first) - { - if (ACE_OS::strcmp (i->item ()->get_string (), "") != 0) - // does not start with a "" - first = I_FALSE; - else - second = I_TRUE; - } - i->next (); - } - delete i; - } - return; -} - -const char* -be_decl::fullname (void) -{ - if (!this->fullname_) - compute_fullname (); - - return this->fullname_; -} - -// compute stringified flattened fully scoped name -void -be_decl::compute_flatname (void) -{ - if (flatname_) - return; - else - { - long namelen; - UTL_IdListActiveIterator *i; - long first = I_TRUE; - long second = I_FALSE; - - // in the first loop compute the total length - namelen = 0; - i = new UTL_IdListActiveIterator (this->name ()); - while (!(i->is_done ())) - { - if (!first) - namelen += 1; // for "_" - else if (second) - first = second = I_FALSE; - // print the identifier - namelen += ACE_OS::strlen (i->item ()->get_string ()); - if (first) - { - if (ACE_OS::strcmp (i->item ()->get_string (), "") != 0) - // does not start with a "" - first = I_FALSE; - else - second = I_TRUE; - } - i->next (); - } - delete i; - - this->flatname_ = new char [namelen+1]; - this->flatname_[0] = '\0'; - first = I_TRUE; - second = I_FALSE; - i = new UTL_IdListActiveIterator (this->name ()); - while (!(i->is_done ())) - { - if (!first) - ACE_OS::strcat (this->flatname_, "_"); - else if (second) - first = second = I_FALSE; - // print the identifier - ACE_OS::strcat (this->flatname_, i->item ()->get_string ()); - if (first) - { - if (ACE_OS::strcmp (i->item ()->get_string (), "") != 0) - // does not start with a "" - first = I_FALSE; - else - second = I_TRUE; - } - i->next (); - } - delete i; - } - return; -} - -const char* -be_decl::flatname (void) -{ - if (!this->flatname_) - compute_flatname (); - - return this->flatname_; -} - -// compute stringified repository ID -void -be_decl::compute_repoID (void) -{ - if (repoID_) - return; - else - { - long namelen; - UTL_IdListActiveIterator *i; - long first = I_TRUE; - long second = I_FALSE; - - // in the first loop compute the total length - namelen = 8; // for the prefix "IDL:" and suffix ":1.0" - i = new UTL_IdListActiveIterator (this->name ()); - while (!(i->is_done ())) - { - if (!first) - namelen += 1; // for "/" - else if (second) - first = second = I_FALSE; - // print the identifier - namelen += ACE_OS::strlen (i->item ()->get_string ()); - if (first) - { - if (ACE_OS::strcmp (i->item ()->get_string (), "") != 0) - // does not start with a "" - first = I_FALSE; - else - second = I_TRUE; - } - i->next (); - } - delete i; - - this->repoID_ = new char [namelen+1]; - this->repoID_[0] = '\0'; - ACE_OS::sprintf (this->repoID_, "%s", "IDL:"); - i = new UTL_IdListActiveIterator (this->name ()); - first = I_TRUE; - second = I_FALSE; - while (!(i->is_done ())) - { - if (!first) - ACE_OS::strcat (this->repoID_, "/"); - else if (second) - first = second = I_FALSE; - // print the identifier - ACE_OS::strcat (this->repoID_, i->item ()->get_string ()); - if (first) - { - if (ACE_OS::strcmp (i->item ()->get_string (), "") != 0) - // does not start with a "" - first = I_FALSE; - else - second = I_TRUE; - } - i->next (); - } - delete i; - ACE_OS::strcat (this->repoID_, ":1.0"); - } - return; -} - -const char * -be_decl::repoID (void) -{ - if (!this->repoID_) - compute_repoID (); - - return this->repoID_; -} - -// converts a string name into an array of 4 byte longs -int -be_decl::tc_name2long (const char *name, long *&larr, long &arrlen) -{ - static char buf [NAMEBUFSIZE]; - long slen; - unsigned int i; - - slen = ACE_OS::strlen (name) + 1; // 1 for NULL terminating - - // compute the number of bytes necessary to hold the name rounded to the next - // multiple of 4 (i.e., size of long) - arrlen = slen/4 + (slen%4 ? 1:0); - - ACE_OS::memset (buf, '\0', arrlen*4); - larr = (long *)buf; - - for (i=0; i < ACE_OS::strlen (name); i++) - { - long shift; // num bytes to shift left - - shift = 3 - (i%4); - // store the computed shifted quantity in the appropriate byte of the - // array to be returned - larr [i/4] |= ((name[i] & 0xff) << (shift*8)); - } - return 0; -} - -idl_bool -be_decl::is_nested (void) -{ - be_decl *d; - - d = be_scope::narrow_from_scope (this->defined_in ())->decl (); - // if we have an outermost scope and if that scope is not that of the Root, - // then we are defined at some nesting level - if (d && d->node_type () != AST_Decl::NT_root) - return I_TRUE; - - return I_FALSE; -} - -// return the length in bytes to hold the repoID inside a typecode. This -// comprises 4 bytes indicating the length of the string followed by the actual -// string represented as longs. -long -be_decl::repoID_encap_len (void) -{ - long slen; - - slen = ACE_OS::strlen (this->repoID ()) + 1; // + 1 for NULL terminating char - // the number of bytes to hold the string must be a multiple of 4 since this - // will be represented as an array of longs - return 4 + 4 * (slen/4 + (slen%4 ? 1:0)); -} - -// return the length in bytes to hold the name inside a typecode. This -// comprises 4 bytes indicating the length of the string followed by the actual -// string represented as longs. -long -be_decl::name_encap_len (void) -{ - long slen; - - slen = ACE_OS::strlen (this->local_name ()->get_string ()) + 1; // + 1 for - // NULL terminating char - // the number of bytes to hold the string must be a multiple of 4 since this - // will be represented as an array of longs - return 4 + 4 * (slen/4 + (slen%4 ? 1:0)); -} - -// compute the size type of the node in question -int -be_decl::compute_size_type (void) -{ - return 0; -} - -// return the scope created by this node (if one exists, else NULL) -be_scope * -be_decl::scope (void) -{ - be_decl *d = this; - - switch (this->node_type()) { - case AST_Decl::NT_interface_fwd: - /* - * Resolve forward declared interface by looking at full_definition() - * field and iterating - */ - d = be_interface::narrow_from_decl ((be_interface_fwd::narrow_from_decl - (this))->full_definition ()); - /* - * Fall through - */ - case AST_Decl::NT_interface: - return be_interface::narrow_from_decl (d); - case AST_Decl::NT_module: - return be_module::narrow_from_decl (d); - case AST_Decl::NT_root: - return be_root::narrow_from_decl (d); - case AST_Decl::NT_except: - return be_exception::narrow_from_decl (d); - case AST_Decl::NT_union: - return be_union::narrow_from_decl (d); - case AST_Decl::NT_struct: - return be_structure::narrow_from_decl (d); - case AST_Decl::NT_enum: - return be_enum::narrow_from_decl (d); - case AST_Decl::NT_op: - return be_operation::narrow_from_decl (d); - case AST_Decl::NT_sequence: - return be_sequence::narrow_from_decl (d); - default: - return (be_scope *)0; - } -} - -// narrowing methods -IMPL_NARROW_METHODS1 (be_decl, AST_Decl) -IMPL_NARROW_FROM_DECL (be_decl) diff --git a/TAO/TAO_IDL/be/be_enum.cpp b/TAO/TAO_IDL/be/be_enum.cpp deleted file mode 100644 index 6493760fc40..00000000000 --- a/TAO/TAO_IDL/be/be_enum.cpp +++ /dev/null @@ -1,320 +0,0 @@ -// ============================================================================ -// -// = LIBRARY -// TAO IDL -// -// = FILENAME -// be_enum.cpp -// -// = DESCRIPTION -// Extension of class AST_Enum that provides additional means for C++ -// mapping. -// -// = AUTHOR -// Copyright 1994-1995 by Sun Microsystems, Inc. -// and -// Aniruddha Gokhale -// -// ============================================================================ - -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -/* - * BE_Enum - */ -be_enum::be_enum (void) -{ - this->size_type (be_decl::FIXED); -} - -be_enum::be_enum (UTL_ScopedName *n, UTL_StrList *p) - : AST_Enum (n, p), - AST_Decl (AST_Decl::NT_enum, n, p), - UTL_Scope (AST_Decl::NT_enum), - member_count_ (-1) -{ - this->size_type (be_decl::FIXED); -} - -// compute total number of members -int -be_enum::compute_member_count (void) -{ - UTL_ScopeActiveIterator *si; // iterator - AST_Decl *d; // temp node - - this->member_count_ = 0; - - // if there are elements in this scope - if (this->nmembers () > 0) - { - // instantiate a scope iterator. - si = new UTL_ScopeActiveIterator (this, UTL_Scope::IK_decls); - - while (!(si->is_done ())) - { - // get the next AST decl node - d = si->item (); - if (!d->imported ()) - { - this->member_count_++; - } - si->next (); - } // end of while - delete si; // free the iterator object - } - return 0; -} - -// return the member count -int -be_enum::member_count (void) -{ - if (this->member_count_ == -1) - this->compute_member_count (); - - return this->member_count_; -} - - -// ---------------------------------------- -// CODE GENERATION METHODS -// ---------------------------------------- - -// Generates the client-side header information for the interface -int -be_enum::gen_client_header (void) -{ - TAO_OutStream *ch; // output stream - TAO_NL nl; // end line - - if (!this->cli_hdr_gen_) - { - UTL_ScopeActiveIterator *i = new UTL_ScopeActiveIterator(this, IK_decls); - // scope iterator - AST_Decl *d; // AST node - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - cg->push (TAO_CodeGen::TAO_ENUM_CH); - - ch = cg->client_header (); - - ch->indent (); // start from whatever indentation level we were at - *ch << "enum " << this->local_name () << nl; - *ch << "{\n"; - ch->incr_indent (); - while (!(i->is_done ())) - { - d = i->item (); - *ch << d->local_name (); - i->next (); - if (!(i->is_done())) - *ch << ", " << nl; - } - delete i; - *ch << "\n"; - ch->decr_indent (); - *ch << "};" << nl; - // As per the ORBOS spec, we need the following typedef - *ch << "typedef " << this->local_name () << " &" << this->local_name () << - "_out;\n"; - cg->pop (); - - // Generate the typecode decl - // All names in the root scope have length 2 (for the root and - // ourself). The children have length greater than 2. Thus, if our name - // length is 2 or less, we are outermost and our typecode decl must be - // extern, else we are defined static inside the enclosing scope. - if (this->name ()->length () > 2) - { - // we have a scoped name - ch->indent (); - *ch << "static CORBA::TypeCode_ptr " << this->tc_name - ()->last_component () << ";\n\n"; - } - else - { - // we are in the ROOT scope - ch->indent (); - *ch << "extern CORBA::TypeCode_ptr " << this->tc_name - ()->last_component () << ";\n\n"; - } - this->cli_hdr_gen_ = I_TRUE; - } - return 0; -} - -// Generates the client-side stubs for the interface -int -be_enum::gen_client_stubs (void) -{ - TAO_OutStream *cs; // output stream - TAO_NL nl; // end line - - if (!this->cli_stub_gen_) - { - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - cg->push (TAO_CodeGen::TAO_ENUM_CS); // set current code gen state - - cs = cg->client_stubs (); - - // generate the typecode information here - cs->indent (); // start from current indentation level - *cs << nl; - *cs << "static const CORBA::Long _oc_" << this->flatname () << "[] =" << - nl; - *cs << "{\n"; - cs->incr_indent (0); - if (this->gen_encapsulation () == -1) - { - ACE_ERROR ((LM_ERROR, "be_enum:Error generating encapsulation\n\n")); - return -1; - } - cs->decr_indent (); - *cs << "};" << nl; - - *cs << "static CORBA::TypeCode _tc__tc_" << this->flatname () << - " (CORBA::tk_enum, sizeof (_oc_" << this->flatname () << - "), (unsigned char *) &_oc_" << this->flatname () << - ", CORBA::B_FALSE);" << nl; - *cs << "CORBA::TypeCode_ptr " << this->tc_name () << " = &_tc__tc_" << - this->flatname () << ";\n\n"; - this->cli_stub_gen_ = I_TRUE; - cg->pop (); - } - return 0; -} - -// Generates the server-side header information for the interface -int -be_enum::gen_server_header (void) -{ - // nothing to be done - return 0; -} - -// Generates the server-side skeletons for the interface -int -be_enum::gen_server_skeletons (void) -{ - // nothing to be done - return 0; -} - -// Generates the client-side inline information -int -be_enum::gen_client_inline (void) -{ - // nothing to be done - return 0; -} - -// Generates the server-side inline -int -be_enum::gen_server_inline (void) -{ - // nothing to be done - return 0; -} - -// generate typecode. -// Typecode for enum comprises the enumerated value followed by the -// encapsulation of the parameters - -int -be_enum::gen_typecode (void) -{ - TAO_OutStream *cs; // output stream - TAO_NL nl; // end line - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - cs = cg->client_stubs (); - cs->indent (); // start from whatever indentation level we were at - - *cs << "CORBA::tk_enum, // typecode kind" << nl; - *cs << this->tc_encap_len () << ", // encapsulation length\n"; - // now emit the encapsulation - return this->gen_encapsulation (); -} - -int -be_enum::gen_encapsulation (void) -{ - TAO_OutStream *cs; // output stream - TAO_NL nl; // end line - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - long i, arrlen; - long *arr; // an array holding string names converted to array of longs - - - cs = cg->client_stubs (); - cs->indent (); // start from whatever indentation level we were at - - *cs << "TAO_ENCAP_BYTE_ORDER, // byte order" << nl; - // generate repoID - *cs << (ACE_OS::strlen (this->repoID ())+1) << ", "; - (void)this->tc_name2long (this->repoID (), arr, arrlen); - for (i=0; i < arrlen; i++) - { - cs->print ("0x%x, ", arr[i]); - } - *cs << " // repository ID = " << this->repoID () << nl; - // generate name - *cs << (ACE_OS::strlen (this->local_name ()->get_string ())+1) << ", "; - (void)this->tc_name2long(this->local_name ()->get_string (), arr, arrlen); - for (i=0; i < arrlen; i++) - { - cs->print ("0x%x, ", arr[i]); - } - *cs << " // name = " << this->local_name () << nl; - // generate the member count - *cs << this->member_count () << ", // member count\n"; - cs->incr_indent (0); - // hand over to the scope to generate the typecode for elements - if (be_scope::gen_encapsulation () == -1) - { - ACE_ERROR ((LM_ERROR, "be_structure: cannot generate code for members\n")); - return -1; - } - cs->decr_indent (0); - return 0; -} - -// compute typecode size -long -be_enum::tc_size (void) -{ - // 4 bytes for enumeration, 4 bytes for storing encap length val, followed by the - // actual encapsulation length - return 4 + 4 + this->tc_encap_len (); -} - -// return encapsulation length -long -be_enum::tc_encap_len (void) -{ - if (this->encap_len_ == -1) // not computed yet - { - this->encap_len_ = 4; // holds the byte order flag - - this->encap_len_ += this->repoID_encap_len (); // repoID storage - - // do the same thing for the local name - this->encap_len_ += this->name_encap_len (); - - this->encap_len_ += 4; // to hold the member count - - // compute encap length for members - this->encap_len_ += be_scope::tc_encap_len (); - } - return this->encap_len_; -} - -// Narrowing -IMPL_NARROW_METHODS3 (be_enum, AST_Enum, be_scope, be_type) - IMPL_NARROW_FROM_DECL (be_enum) - IMPL_NARROW_FROM_SCOPE (be_enum) diff --git a/TAO/TAO_IDL/be/be_enum_val.cpp b/TAO/TAO_IDL/be/be_enum_val.cpp deleted file mode 100644 index 76fa116ae68..00000000000 --- a/TAO/TAO_IDL/be/be_enum_val.cpp +++ /dev/null @@ -1,141 +0,0 @@ -// ============================================================================ -// -// = LIBRARY -// TAO IDL -// -// = FILENAME -// be_enum_val.cpp -// -// = DESCRIPTION -// Extension of class AST_EnumVal that provides additional means for C++ -// mapping. -// -// = AUTHOR -// Copyright 1994-1995 by Sun Microsystems, Inc. -// and -// Aniruddha Gokhale -// -// ============================================================================ - -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -be_enum_val::be_enum_val (void) -{ -} - -be_enum_val::be_enum_val (unsigned long v, UTL_ScopedName *n, UTL_StrList *p) - : AST_Constant (AST_Expression::EV_ulong, - AST_Decl::NT_enum_val, - new AST_Expression(v), - n, - p), - AST_Decl (AST_Decl::NT_enum_val, n, p) -{ -#if 0 - // computes the repoID - compute_repoID (); - - // computes the fully scoped name - compute_fullname (); - - // compute the flattened fully scoped name - compute_flatname (); -#endif -} - -// ---------------------------------------- -// CODE GENERATION METHODS -// ---------------------------------------- - -// NOTE: The IDL front end does a strange thing of putting the enum_vals in the -// Enum decl scope as well as the scope that encloses the ENUM decl. Since we -// took care of generating the client header declarations for all the -// enum_vals, we do not do anything in any of the methods below. However, we -// have to provide them so that whenever be_scope finds an enum_val in a scope -// that is not an ENUM, it just ignores it. - -// Generates the client-side header information for the enum val -int -be_enum_val::gen_client_header (void) -{ - // nothing to be done - return 0; -} - -// Generates the client-side stubs for the enum val -int -be_enum_val::gen_client_stubs (void) -{ - return 0; -} - -// Generates the server-side header information for the enum val -int -be_enum_val::gen_server_header (void) -{ - // nothing to be done - return 0; -} - -// Generates the server-side skeletons for the enum val -int -be_enum_val::gen_server_skeletons (void) -{ - // nothing to be done - return 0; -} - -// Generates the client-side inline information -int -be_enum_val::gen_client_inline (void) -{ - // nothing to be done - return 0; -} - -// Generates the server-side inline -int -be_enum_val::gen_server_inline (void) -{ - // nothing to be done - return 0; -} - -int -be_enum_val::gen_encapsulation (void) -{ - TAO_OutStream *cs; // output stream - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - long i, arrlen; - long *arr; // an array holding string names converted to array of longs - - cs = cg->client_stubs (); - cs->indent (); // start from whatever indentation level we were at - - // generate name - *cs << (ACE_OS::strlen (this->local_name ()->get_string ())+1) << ", "; - (void)this->tc_name2long(this->local_name ()->get_string (), arr, arrlen); - for (i=0; i < arrlen; i++) - { - cs->print ("0x%x, ", arr[i]); - } - *cs << " // name = " << this->local_name () << "\n"; - return 0; -} - -long -be_enum_val::tc_encap_len (void) -{ - if (this->encap_len_ == -1) // not computed yet - { - this->encap_len_ = this->name_encap_len (); // for name - } - - return this->encap_len_; -} - -// Narrowing -IMPL_NARROW_METHODS2 (be_enum_val, AST_EnumVal, be_decl) -IMPL_NARROW_FROM_DECL (be_enum_val) diff --git a/TAO/TAO_IDL/be/be_exception.cpp b/TAO/TAO_IDL/be/be_exception.cpp deleted file mode 100644 index fa0ea4fd946..00000000000 --- a/TAO/TAO_IDL/be/be_exception.cpp +++ /dev/null @@ -1,510 +0,0 @@ -// -// $Id$ -// -// ============================================================================ -// -// = LIBRARY -// TAO IDL -// -// = FILENAME -// be_exception.cpp -// -// = DESCRIPTION -// Extension of class AST_Exception that provides additional means for C++ -// mapping of an interface. -// -// = AUTHOR -// Copyright 1994-1995 by Sun Microsystems, Inc. -// and -// Aniruddha Gokhale -// -// ============================================================================ - - -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -/* - * BE_Exception - */ -be_exception::be_exception (void) -{ - this->size_type (be_decl::VARIABLE); // always the case -} - -be_exception::be_exception (UTL_ScopedName *n, UTL_StrList *p) - : AST_Decl (AST_Decl::NT_except, n, p), - AST_Structure (AST_Decl::NT_except, n, p), - UTL_Scope (AST_Decl::NT_except), - member_count_ (-1) -{ - this->size_type (be_decl::VARIABLE); // always the case -} - -// compute total number of members -int -be_exception::compute_member_count (void) -{ - UTL_ScopeActiveIterator *si; // iterator - - this->member_count_ = 0; - - // if there are elements in this scope - if (this->nmembers () > 0) - { - // instantiate a scope iterator. - si = new UTL_ScopeActiveIterator (this, UTL_Scope::IK_decls); - - while (!(si->is_done ())) - { - // get the next AST decl node - this->member_count_++; - si->next (); - } // end of while - delete si; // free the iterator object - } - return 0; -} - -// return the member count -int -be_exception::member_count (void) -{ - if (this->member_count_ == -1) - this->compute_member_count (); - - return this->member_count_; -} - -// CODE GENERATION - -int -be_exception::gen_client_header (void) -{ - if (!this->cli_hdr_gen_) // not already generated - { - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - TAO_OutStream *ch = cg->client_header (); // output stream - TAO_NL nl; // end line - be_scope *s = be_scope::narrow_from_scope (DeclAsScope (this)); // the - // scope - // defined by us - - if (!s) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_exception::" - "gen_client_header - " - "bad scope\n"), -1); - } - - cg->push (TAO_CodeGen::TAO_EXCEPTION_CH); - ch->indent (); // start from whatever indentation level we were at - ch->gen_ifdef_macro (this->flatname (), "_ptr"); - - ch->indent (); - *ch << "class " << this->local_name () << ";" << nl; - // generate the _ptr declaration - *ch << "typedef " << this->local_name () << " *" - << this->local_name () << "_ptr;" << nl; - ch->gen_endif (); - - ch->gen_ifdef_macro (this->flatname ()); - - ch->indent (); - *ch << "class " << this->local_name () - << " : public CORBA::UserException" << nl; - *ch << "{" << nl - << "public:\n"; - ch->incr_indent (); - // constructors and destructor - *ch << this->local_name () << " (void); // default ctor" << nl; - *ch << this->local_name () << " (const " << this->local_name () << - " &); // copy ctor" << nl; - *ch << "~" << this->local_name () << "(void); // dtor" << nl; - - // generate constructor that takes each member as a parameter. We need a - // new state. Such a constructor exists if we have members - if (this->member_count () > 0) - { - cg->push (TAO_CodeGen::TAO_EXCEPTION_CTOR_CH); - s->comma (1); // tell the scope to generate a comma after every - // member is generated - *ch << this->local_name () << "("; - if (be_scope::gen_client_header () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_exception::" - "gen_client_header - " - "codegen for scope failed\n"), -1); - } - *ch << ");" << nl; - s->comma (0); // revert comma generation state - cg->pop (); // revert to previous state - } - - // assignment operator - *ch << this->local_name () << " &operator= (const " << this->local_name - () << " &);" << nl; - // the static _narrow method - *ch << "static " << this->local_name () << - " *_narrow (CORBA::Exception *);\n"; - - // generate the members - if (be_scope::gen_client_header () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_exception::" - "gen_client_header - " - "codegen for scope failed\n"), -1); - } - - ch->decr_indent (); - *ch << "};" << nl; - - // generate the typecode decl - if (this->is_nested ()) - { - // we have a scoped name - ch->indent (); - *ch << "static CORBA::TypeCode_ptr " << this->tc_name - ()->last_component () << ";\n\n"; - } - else - { - // we are in the ROOT scope - ch->indent (); - *ch << "extern CORBA::TypeCode_ptr " << this->tc_name - ()->last_component () << ";\n\n"; - } - ch->gen_endif (); - - this->cli_hdr_gen_ = I_TRUE; - cg->pop (); - } - - return 0; -} - -int -be_exception::gen_client_inline (void) -{ - if (!this->cli_inline_gen_) - { - TAO_NL nl; // end line - - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - TAO_OutStream *ci = cg->client_inline (); - - ci->indent (); - *ci << "// *************************************************************" - << nl; - *ci << "// Inline operations for exception " << this->name () << nl; - *ci << "// *************************************************************\n\n"; - - // default constructor - ci->indent (); - *ci << "// default constructor" << nl; - *ci << "ACE_INLINE" << nl; - *ci << this->name () << "::" << this->local_name () << " (void)" << nl; - *ci << "\t: CORBA_UserException (ACE_CORBA_3 (TypeCode, _duplicate) (" << - this->tc_name () << "))\n"; - *ci << "{" << nl; - *ci << "}\n\n"; - - // destructor - ci->indent (); - *ci << "// destructor - all members are of self managing types" << nl; - *ci << "ACE_INLINE" << nl; - *ci << this->name () << "::~" << this->local_name () << " (void)" << nl; - *ci << "{" << nl; - *ci << "}\n\n"; - - cg->push (TAO_CodeGen::TAO_EXCEPTION_CI); - // generate inline code required of any anonymous types of members - if (be_scope::gen_client_inline () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_exception::gen_client_inline -" - "codegen for scope failed\n"), -1); - } - - cg->pop (); - this->cli_inline_gen_ = I_TRUE; - } - return 0; -} - -int -be_exception::gen_client_stubs (void) -{ - TAO_OutStream *cs; // output stream - TAO_NL nl; // end line - be_scope *s = be_scope::narrow_from_scope (DeclAsScope (this)); // the scope - // defined by - // us - - if (!s) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_exception::" - "gen_client_stubs - " - "bad scope\n"), -1); - } - - if (!this->cli_stub_gen_) - { - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - cg->push (TAO_CodeGen::TAO_EXCEPTION_CS); // set current code gen state - - cs = cg->client_stubs (); - - // copy constructor - cs->indent (); - *cs << "// copy constructor" << nl; - *cs << this->name () << "::" << this->local_name () << "(const " << - this->name () << " &_tao_excp)" << nl; - *cs << "\t:ACE_CORBA_1 (UserException) (" << - "ACE_CORBA_3 (TypeCode, _duplicate) (_tao_excp.type ()))" << nl; - *cs << "{\n"; - cs->incr_indent (); - // assign each individual member - if (be_scope::gen_client_stubs () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_exception::gen_client_stubs -" - "codegen for scope failed\n"), -1); - } - cs->decr_indent (); - *cs << "}\n\n"; - - // assignment operator - cs->indent (); - *cs << "// assignment operator" << nl; - *cs << this->name () << "&" << nl; - *cs << this->name () << "::operator= (const " << - this->name () << " &_tao_excp)" << nl; - *cs << "{\n"; - cs->incr_indent (); - *cs << "this->type_ = " << - "ACE_CORBA_3 (TypeCode, _duplicate) (_tao_excp.type ());\n"; - // assign each individual member - if (be_scope::gen_client_stubs () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_exception::gen_client_stubs -" - "codegen for scope failed\n"), -1); - } - cs->indent (); - *cs << "return *this;\n"; - cs->decr_indent (); - *cs << "}\n\n"; - - // constructor taking all members. We need a new state here. Also, such a - // constructor exists if we have any members - if (this->member_count () > 0) - { - cg->push (TAO_CodeGen::TAO_EXCEPTION_CTOR_CS); - s->comma (1); // scope should produce comma after every parameter is - // defined - cs->indent (); - *cs << "// special constructor" << nl; - *cs << this->name () << "::" << this->local_name () << "("; - if (be_scope::gen_client_stubs () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_exception::gen_client_stubs -" - "codegen for scope failed\n"), -1); - } - s->comma (0); - cg->pop (); - *cs << ")" << nl; - - *cs << "\t: CORBA_UserException " << - "(ACE_CORBA_3 (TypeCode, _duplicate) (" << this->tc_name () << - "))" << nl; - *cs << "{\n"; - cs->incr_indent (); - // assign each individual member. We need yet another state - cg->push (TAO_CodeGen::TAO_EXCEPTION_CTOR_ASSIGN_CS); - if (be_scope::gen_client_stubs () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_exception::gen_client_stubs -" - "codegen for scope failed\n"), -1); - } - cg->pop (); // revert to previous state - cs->decr_indent (); - *cs << "}\n\n"; - } - - // narrow method - cs->indent (); - *cs << "// narrow" << nl; - *cs << this->name () << "_ptr " << nl; - *cs << this->name () << "::_narrow(CORBA::Exception *exc)" << nl; - *cs << "{\n"; - cs->incr_indent (); - *cs << "if (!ACE_OS::strcmp (\"" << this->repoID () << - "\", exc->id ())) // same type" << nl; - *cs << "\treturn ACE_dynamic_cast (" << this->name () << "_ptr, exc);" << - nl; - *cs << "else" << nl; - *cs << "\treturn 0;\n"; - cs->decr_indent (); - *cs << "}\n\n"; - - // generate the typecode information here - cs->indent (); // start from current indentation level - *cs << "static const CORBA::Long _oc_" << this->flatname () << "[] =" << - nl; - *cs << "{\n"; - cs->incr_indent (0); - // note that we just need the parameters here and hence we generate the - // encapsulation for the parameters - if (this->gen_encapsulation () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_structure::gen_client_stubs -" - "codegen for scope failed\n"), -1); - } - cs->decr_indent (); - *cs << "};" << nl; - - *cs << "static CORBA::TypeCode _tc__tc_" << this->flatname () << - " (CORBA::tk_struct, sizeof (_oc_" << this->flatname () << - "), (unsigned char *) &_oc_" << this->flatname () << - ", CORBA::B_FALSE);" << nl; - *cs << "CORBA::TypeCode_ptr " << this->tc_name () << " = &_tc__tc_" << - this->flatname () << ";\n\n"; - this->cli_stub_gen_ = I_TRUE; - cg->pop (); - } - - return 0; -} - -int -be_exception::gen_server_header (void) -{ - return 0; -} - - -int -be_exception::gen_server_inline (void) -{ - return 0; -} - -int -be_exception::gen_server_skeletons (void) -{ - return 0; -} - -// generate typecode. -// Typecode for exceptions comprises the enumerated value followed by the -// encapsulation of the parameters - -int -be_exception::gen_typecode (void) -{ - TAO_OutStream *cs; // output stream - TAO_NL nl; // end line - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - cs = cg->client_stubs (); - cs->indent (); // start from whatever indentation level we were at - - *cs << "CORBA::tk_except, // typecode kind" << nl; - *cs << this->tc_size () << ", // encapsulation length\n"; - // now emit the encapsulation - return this->gen_encapsulation (); -} - -// generate encapsulation -// An encapsulation for ourselves will be necessary when we are part of some -// other IDL type and a typecode for that other type is being generated. This -// will comprise our typecode kind. IDL types with parameters will additionally -// have the encapsulation length and the entire typecode description -int -be_exception::gen_encapsulation (void) -{ - TAO_OutStream *cs; // output stream - TAO_NL nl; // end line - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - long i, arrlen; - long *arr; // an array holding string names converted to array of longs - - cs = cg->client_stubs (); - cs->indent (); // start from whatever indentation level we were at - - // XXXASG - byte order must be based on what m/c we are generating code - - // TODO - *cs << "0, // byte order" << nl; - // generate repoID - *cs << (ACE_OS::strlen (this->repoID ())+1) << ", "; - (void)this->tc_name2long (this->repoID (), arr, arrlen); - for (i=0; i < arrlen; i++) - { - cs->print ("0x%x, ", arr[i]); - } - *cs << " // repository ID = " << this->repoID () << nl; - // generate name - *cs << (ACE_OS::strlen (this->local_name ()->get_string ())+1) << ", "; - (void)this->tc_name2long(this->local_name ()->get_string (), arr, arrlen); - for (i=0; i < arrlen; i++) - { - cs->print ("0x%x, ", arr[i]); - } - *cs << " // name = " << this->local_name () << nl; - // generate the member count - *cs << this->member_count () << ", // member count\n"; - cs->incr_indent (0); - // hand over to the scope to generate the typecode for elements - if (be_scope::gen_encapsulation () == -1) - { - ACE_ERROR ((LM_ERROR, "be_exception: cannot generate typecode for members\n")); - return -1; - } - cs->decr_indent (0); - return 0; -} - -// compute typecode size -long -be_exception::tc_size (void) -{ - // 4 bytes for enumeration, 4 bytes for storing encap length val, followed by the - // actual encapsulation length - return 4 + 4 + this->tc_encap_len (); -} - -// compute encapsulation length -long -be_exception::tc_encap_len (void) -{ - if (this->encap_len_ == -1) // not computed yet - { - this->encap_len_ = 4; // holds the byte order flag - - this->encap_len_ += this->repoID_encap_len (); // repoID - - // do the same thing for the local name - this->encap_len_ += this->name_encap_len (); - - this->encap_len_ += 4; // to hold the member count - - // compute encap length for members - this->encap_len_ += be_scope::tc_encap_len (); - } - return this->encap_len_; -} - -// Narrowing -IMPL_NARROW_METHODS3 (be_exception, AST_Exception, be_scope, be_type) -IMPL_NARROW_FROM_DECL (be_exception) -IMPL_NARROW_FROM_SCOPE (be_exception) diff --git a/TAO/TAO_IDL/be/be_expression.cpp b/TAO/TAO_IDL/be/be_expression.cpp deleted file mode 100644 index 1b95320823a..00000000000 --- a/TAO/TAO_IDL/be/be_expression.cpp +++ /dev/null @@ -1,77 +0,0 @@ -// ============================================================================ -// -// = LIBRARY -// TAO IDL -// -// = FILENAME -// be_expression.cpp -// -// = DESCRIPTION -// Extension of class AST_Expression that provides additional means for C++ -// mapping. -// -// = AUTHOR -// Copyright 1994-1995 by Sun Microsystems, Inc. -// and -// Aniruddha Gokhale -// -// ============================================================================ - -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -/* - * BE_Expression - */ - -// the constructors -be_expression::be_expression (UTL_ScopedName *n) - : AST_Expression (n) -{ -} - -be_expression::be_expression (AST_Expression *b, AST_Expression::ExprType t) - : AST_Expression (b, t) -{ -} - -be_expression::be_expression (AST_Expression::ExprComb c, - AST_Expression *v1, - AST_Expression *v2) - : AST_Expression (c, v1, v2) -{ -} - -be_expression::be_expression (long l) - : AST_Expression (l) -{ -} - -be_expression::be_expression (long l, AST_Expression::ExprType t) - : AST_Expression (l, t) -{ -} - -be_expression::be_expression (unsigned long l) - : AST_Expression (l) -{ -} - -be_expression::be_expression (String *s) - : AST_Expression (s) -{ -} - -be_expression::be_expression (char c) - : AST_Expression (c) -{ -} - -be_expression::be_expression (double d) - : AST_Expression (d) -{ -} - - - diff --git a/TAO/TAO_IDL/be/be_factory.cpp b/TAO/TAO_IDL/be/be_factory.cpp deleted file mode 100644 index e0ef83d2f78..00000000000 --- a/TAO/TAO_IDL/be/be_factory.cpp +++ /dev/null @@ -1,39 +0,0 @@ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_sunsoft.h" - -// constructor -TAO_OutStream_Factory::TAO_OutStream_Factory (void) - : strm_type_ (TAO_OutStream_Factory::TAO_SUNSOFT) -{ -} - -// destructor -TAO_OutStream_Factory::~TAO_OutStream_Factory (void) -{ -} - -// set the type of specialized o/p stream we want -int -TAO_OutStream_Factory::set_stream_type -(TAO_OutStream_Factory::TAO_OutStream_Type t) -{ - this->strm_type_ = t; - return 0; -} - -// factory method -TAO_OutStream * -TAO_OutStream_Factory::make_outstream (void) -{ - switch (this->strm_type_) - { - case TAO_OutStream_Factory::TAO_SUNSOFT: - return new TAO_SunSoft_OutStream (); - case TAO_OutStream_Factory::TAO_FLICK: - return (TAO_OutStream *)0; // not implemented as yet - default: - return (TAO_OutStream *)0; - } -} diff --git a/TAO/TAO_IDL/be/be_field.cpp b/TAO/TAO_IDL/be/be_field.cpp deleted file mode 100644 index b535f2dbb56..00000000000 --- a/TAO/TAO_IDL/be/be_field.cpp +++ /dev/null @@ -1,204 +0,0 @@ -// ============================================================================ -// -// = LIBRARY -// TAO IDL -// -// = FILENAME -// be_field.cpp -// -// = DESCRIPTION -// Extension of class AST_Field that provides additional means for C++ -// mapping. -// -// = AUTHOR -// Copyright 1994-1995 by Sun Microsystems, Inc. -// and -// Aniruddha Gokhale -// -// ============================================================================ - -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -/* - * BE_Field - */ -be_field::be_field (void) -{ -} -be_field::be_field (AST_Type *ft, UTL_ScopedName *n, UTL_StrList *p) - : AST_Field (ft, n, p), - AST_Decl (AST_Decl::NT_field, n, p) -{ -} - -// ---------------------------------------- -// CODE GENERATION METHODS -// ---------------------------------------- - -// Generates the client-side header information for the field -int -be_field::gen_client_header (void) -{ - be_type *bt; // the field type - be_state *s; // code generation state - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - // retrieve field type - bt = be_type::narrow_from_decl (this->field_type ()); - - // make the state based object. The state has been set by the enclosing - // parent structure - s = cg->make_state (); - if (!s || !bt || (s->gen_code (bt, this) == -1)) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_field::gen_client_header -" - "codegen failed\n"), -1); - } - return 0; -} - -// Generates the client-side stubs for the field -int -be_field::gen_client_stubs (void) -{ - be_type *bt; // the field type - be_state *s; // code generation state - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - // retrieve field type - bt = be_type::narrow_from_decl (this->field_type ()); - - // make the state based object. The state has been set by the enclosing - // parent structure - s = cg->make_state (); - if (!s || !bt || (s->gen_code (bt, this) == -1)) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_field::gen_client_stubs -" - "codegen failed\n"), -1); - } - return 0; -} - -// Generates the client-side inline information -int -be_field::gen_client_inline (void) -{ - be_type *bt; // the field type - be_state *s; // code generation state - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - // retrieve field type - bt = be_type::narrow_from_decl (this->field_type ()); - - // make the state based object. The state has been set by the enclosing - // parent structure - s = cg->make_state (); - if (!s || !bt || (s->gen_code (bt, this) == -1)) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_field::gen_client_inline -" - "codegen failed\n"), -1); - } - return 0; -} - -// Generates the server-side header information for the field -int -be_field::gen_server_header (void) -{ - // nothing to be done - return 0; -} - -// Generates the server-side skeletons for the field -int -be_field::gen_server_skeletons (void) -{ - // nothing to be done - return 0; -} - -// Generates the server-side inline -int -be_field::gen_server_inline (void) -{ - // nothing to be done - return 0; -} - -int -be_field::gen_encapsulation (void) -{ - TAO_OutStream *cs; // output stream - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - be_type *bt; // our type node - long i, arrlen; - long *arr; // an array holding string names converted to array of longs - - cs = cg->client_stubs (); - cs->indent (); // start from whatever indentation level we were at - - // generate name - *cs << (ACE_OS::strlen (this->local_name ()->get_string ())+1) << ", "; - (void)this->tc_name2long(this->local_name ()->get_string (), arr, arrlen); - for (i=0; i < arrlen; i++) - { - cs->print ("0x%x, ", arr[i]); - } - *cs << " // name = " << this->local_name () << "\n"; - - // hand over code generation to our type node - bt = be_type::narrow_from_decl (this->field_type ()); - return bt->gen_typecode (); -} - -long -be_field::tc_encap_len (void) -{ - if (this->encap_len_ == -1) // not computed yet - { - be_type *bt; - - // struct member is represented as the "name" followed by the typecode - - this->encap_len_ = this->name_encap_len (); // for name - - // add to this, the size of our typecode - bt = be_type::narrow_from_decl (this->field_type ()); - this->encap_len_ += bt->tc_size (); // note that we must add typecode - // size of the type - } - return this->encap_len_; -} - -// compute the size type of the node in question -int -be_field::compute_size_type (void) -{ - be_type *type = be_type::narrow_from_decl (this->field_type ()); - if (!type) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_field::compute_size_type - " - "bad field type\n"), -1); - } - - // our size type is the same as our type - this->size_type (type->size_type ()); // as a side effect will also update - // the size type of parent - return 0; -} - -// Narrowing -IMPL_NARROW_METHODS2 (be_field, AST_Field, be_decl) -IMPL_NARROW_FROM_DECL (be_field) diff --git a/TAO/TAO_IDL/be/be_generator.cpp b/TAO/TAO_IDL/be/be_generator.cpp deleted file mode 100644 index b93c92ea88a..00000000000 --- a/TAO/TAO_IDL/be/be_generator.cpp +++ /dev/null @@ -1,399 +0,0 @@ -/* - -COPYRIGHT - -Copyright 1992, 1993, 1994 Sun Microsystems, Inc. Printed in the United -States of America. All Rights Reserved. - -This product is protected by copyright and distributed under the following -license restricting its use. - -The Interface Definition Language Compiler Front End (CFE) is made -available for your use provided that you include this license and copyright -notice on all media and documentation and the software program in which -this product is incorporated in whole or part. You may copy and extend -functionality (but may not remove functionality) of the Interface -Definition Language CFE without charge, but you are not authorized to -license or distribute it to anyone else except as part of a product or -program developed by you or with the express written consent of Sun -Microsystems, Inc. ("Sun"). - -The names of Sun Microsystems, Inc. and any of its subsidiaries or -affiliates may not be used in advertising or publicity pertaining to -distribution of Interface Definition Language CFE as permitted herein. - -This license is effective until terminated by Sun for failure to comply -with this license. Upon termination, you shall destroy or return all code -and documentation for the Interface Definition Language CFE. - -INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED AS IS WITH NO WARRANTIES OF -ANY KIND INCLUDING THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS -FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR ARISING FROM A COURSE OF -DEALING, USAGE OR TRADE PRACTICE. - -INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED WITH NO SUPPORT AND WITHOUT -ANY OBLIGATION ON THE PART OF Sun OR ANY OF ITS SUBSIDIARIES OR AFFILIATES -TO ASSIST IN ITS USE, CORRECTION, MODIFICATION OR ENHANCEMENT. - -SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES SHALL HAVE NO LIABILITY WITH -RESPECT TO THE INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY -INTERFACE DEFINITION LANGUAGE CFE OR ANY PART THEREOF. - -IN NO EVENT WILL SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES BE LIABLE FOR -ANY LOST REVENUE OR PROFITS OR OTHER SPECIAL, INDIRECT AND CONSEQUENTIAL -DAMAGES, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -Use, duplication, or disclosure by the government is subject to -restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in -Technical Data and Computer Software clause at DFARS 252.227-7013 and FAR -52.227-19. - -Sun, Sun Microsystems and the Sun logo are trademarks or registered -trademarks of Sun Microsystems, Inc. - -SunSoft, Inc. -2550 Garcia Avenue -Mountain View, California 94043 - -NOTE: - -SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are -trademarks or registered trademarks of Sun Microsystems, Inc. - - */ - -// be_generator.cc -// -// Implementation of BE generator class -// -// This implements the same protocol as AST_Generator but creates instances -// of the BE-subclassed classes instead of of AST classes - -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -/* - * Constructor - */ - -/* - * Private operations - */ - -/* - * Public operations - */ - -/* - * Inherited operations redefined here - */ - -/* - * Construct a be_root node (a node representing the root of an AST of BE nodes) - */ -AST_Root * -be_generator::create_root(UTL_ScopedName *n, - UTL_StrList *p) -{ - return new be_root(n, p); -} - -/* - * Create a BE_PredefinedType node - */ -AST_PredefinedType * -be_generator::create_predefined_type(AST_PredefinedType::PredefinedType t, - UTL_ScopedName *n, - UTL_StrList *p) -{ - return (AST_PredefinedType *) new be_predefined_type(t, n, p); -} - -/* - * Create a BE_Module node - */ -AST_Module * -be_generator::create_module(UTL_ScopedName *n, UTL_StrList *p) -{ - return (AST_Module *) new be_module(n, p); -} - -/* - * Create a BE_Interface node - */ -AST_Interface * -be_generator::create_interface(UTL_ScopedName *n, - AST_Interface **ih, - long nih, - UTL_StrList *p) -{ - return (AST_Interface *) new be_interface(n, ih, nih, p); -} - -/* - * Create a BE_InterfaceFwd node - */ -AST_InterfaceFwd * -be_generator::create_interface_fwd(UTL_ScopedName *n, UTL_StrList *p) -{ - return (AST_InterfaceFwd *) new be_interface_fwd(n, p); -} - -/* - * Create a BE_Exception node - */ -AST_Exception * -be_generator::create_exception(UTL_ScopedName *n, UTL_StrList *p) -{ - return (AST_Exception *) new be_exception(n, p); -} - -/* - * Create a BE_Structure node - */ -AST_Structure * -be_generator::create_structure(UTL_ScopedName *n, UTL_StrList *p) -{ - return (AST_Structure *) new be_structure(n, p); -} - -/* - * Create a BE_Enum node - */ -AST_Enum * -be_generator::create_enum(UTL_ScopedName *n, UTL_StrList *p) -{ - return (AST_Enum *) new be_enum(n, p); -} - -/* - * Create a BE_Operation node - */ -AST_Operation * -be_generator::create_operation(AST_Type *rt, - AST_Operation::Flags fl, - UTL_ScopedName *n, - UTL_StrList *p) -{ - return (AST_Operation *) new be_operation(rt, fl, n, p); -} - -/* - * Create a BE_Field node - */ -AST_Field * -be_generator::create_field(AST_Type *ft, UTL_ScopedName *n, UTL_StrList *p) -{ - return (AST_Field *) new be_field(ft, n, p); -} - -/* - * Create a BE_Argument node - */ -AST_Argument * -be_generator::create_argument(AST_Argument::Direction d, - AST_Type *ft, - UTL_ScopedName *n, - UTL_StrList *p) -{ - return (AST_Argument *) new be_argument(d, ft, n, p); -} - -/* - * Create a BE_Attribute node - */ -AST_Attribute * -be_generator::create_attribute(idl_bool ro, - AST_Type *ft, - UTL_ScopedName *n, - UTL_StrList *p) -{ - return (AST_Attribute *) new be_attribute(ro, ft, n, p); -} - -/* - * Create a BE_Union node - */ -AST_Union * -be_generator::create_union(AST_ConcreteType *dt, - UTL_ScopedName *n, - UTL_StrList *p) -{ - return (AST_Union *) new be_union(dt, n, p); -} - -/* - * Create a BE_UnionBranch node - */ -AST_UnionBranch * -be_generator::create_union_branch(AST_UnionLabel *lab, - AST_Type *ft, - UTL_ScopedName *n, - UTL_StrList *p) -{ - return (AST_UnionBranch *) new be_union_branch(lab, ft, n, p); -} - -/* - * Create a BE_UnionLabel node - */ -AST_UnionLabel * -be_generator::create_union_label(AST_UnionLabel::UnionLabel ul, - AST_Expression *lv) -{ - return (AST_UnionLabel *) new be_union_label(ul, lv); -} - -/* - * Create a BE_Constant node - */ -AST_Constant * -be_generator::create_constant(AST_Expression::ExprType et, - AST_Expression *ev, - UTL_ScopedName *n, - UTL_StrList *p) -{ - return (AST_Constant *) new be_constant (et, ev, n, p); -} - -/* - * Create a symbolic BE_Expression node - */ -AST_Expression * -be_generator::create_expr(UTL_ScopedName *n) -{ - return (AST_Expression *) new be_expression (n); -} - -/* - * Create a BE_Expression node denoting a coercion - */ -AST_Expression * -be_generator::create_expr(AST_Expression *b, AST_Expression::ExprType t) -{ - return (AST_Expression *) new be_expression (b, t); -} - -/* - * Create a BE_Expression node combining two other AST_Expression nodes - */ -AST_Expression * -be_generator::create_expr(AST_Expression::ExprComb c, - AST_Expression *v1, - AST_Expression *v2) -{ - return (AST_Expression *) new be_expression (c, v1, v2); -} - -/* - * Create a BE_Expression node denoting a long integer - */ -AST_Expression * -be_generator::create_expr(long l) -{ - return (AST_Expression *) new be_expression (l); -} - -/* - * Create a BE_Expression node denoting a long integer being used as a boolean - */ -AST_Expression * -be_generator::create_expr(long l, AST_Expression::ExprType t) -{ - return (AST_Expression *) new be_expression (l, t); -} - -/* - * Create a BE_Expression node denoting an unsigned long integer - */ -AST_Expression * -be_generator::create_expr(unsigned long l) -{ - return (AST_Expression *) new be_expression(l); -} - -/* - * Create a BE_Expression node denoting a char * (encapsulated as a String) - */ -AST_Expression * -be_generator::create_expr (String *s) -{ - return (AST_Expression *) new be_expression (s); -} - -/* - * Create a BE_Expression node denoting a character - */ -AST_Expression * -be_generator::create_expr(char c) -{ - return (AST_Expression *) new be_expression (c); -} - -/* - * Create a BE_Expression node denoting a 64-bit floating point number - */ -AST_Expression * -be_generator::create_expr (double d) -{ - return (AST_Expression *) new be_expression (d); -} - -/* - * Create a BE_EnumVal node - */ -AST_EnumVal * -be_generator::create_enum_val(unsigned long v, - UTL_ScopedName *n, - UTL_StrList *p) -{ - return (AST_EnumVal *) new be_enum_val(v, n, p); -} - -/* - * Create a BE_Array node - */ -AST_Array * -be_generator::create_array(UTL_ScopedName *n, - unsigned long ndims, - UTL_ExprList *dims) -{ - return (AST_Array *) new be_array(n, ndims, dims); -} - -/* - * Create a BE_Sequence node - */ -AST_Sequence * -be_generator::create_sequence(AST_Expression *v, AST_Type *bt) -{ - return (AST_Sequence *) new be_sequence(v, bt); -} - -/* - * Create a BE_String node - */ -AST_String * -be_generator::create_string(AST_Expression *v) -{ - return (AST_String *) new be_string(v); -} - -/* - * Create a BE_string node for a wide string - */ -AST_String * -be_generator::create_wstring(AST_Expression *v) -{ - return (AST_String *) new be_string(v, sizeof(wchar_t)); -} - -/* - * Create a BE_Typedef node - */ -AST_Typedef * -be_generator::create_typedef(AST_Type *bt, UTL_ScopedName *n, UTL_StrList *p) -{ - return (AST_Typedef *) new be_typedef(bt, n, p); -} diff --git a/TAO/TAO_IDL/be/be_helper.cpp b/TAO/TAO_IDL/be/be_helper.cpp deleted file mode 100644 index 7c72dedfb97..00000000000 --- a/TAO/TAO_IDL/be/be_helper.cpp +++ /dev/null @@ -1,242 +0,0 @@ -// ============================================================================ -// -// = LIBRARY -// TAO IDL -// -// = FILENAME -// be_helper.cpp -// -// = DESCRIPTION -// Provides helper classes to print generated code to the output -// -// = AUTHOR -// Copyright 1994-1995 by Sun Microsystems, Inc. -// and -// Aniruddha Gokhale -// -// ============================================================================ - -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -static const char copyright [] = -"// ****** Code generated by the The ACE ORB (TAO) IDL Compiler *******\n\ -// TAO ORB and the TAO IDL Compiler have been developed by Washington \n\ -// University Computer Science's Distributed Object Computing Group.\n\ -//\n\ -// Information on TAO is available at\n\ -// http://www.cs.wustl.edu/~schmidt/TAO.html\n"; - -TAO_NL::TAO_NL (void) -{ -} - -// methods of the TAO_OutStream class - -TAO_OutStream::TAO_OutStream (void) - : fp_ (NULL), - indent_level_ (0) -{ -} - -TAO_OutStream::~TAO_OutStream (void) -{ - // close the underlying I/O handle only if it exists - if (fp_) - { - ACE_OS::fclose (fp_); - fp_ = NULL; - } - indent_level_ = 0; -} - -int -TAO_OutStream::open (const char *fname, TAO_OutStream::STREAM_TYPE st) -{ - if (fname) - { - // file name exists, open an I/O file handle - fp_ = ACE_OS::fopen (fname, "w"); - if (fp_) - { - this->st_ = st; - // put the copyright notice - ACE_OS::fprintf (fp_, "%s\n", copyright); - ACE_OS::fflush (fp_); - return 0; - } - else - return -1; - } - else - { - return -1; - } -} - -// set and get the stream type -void -TAO_OutStream::stream_type (TAO_OutStream::STREAM_TYPE st) -{ - this->st_ = st; -} - -TAO_OutStream::STREAM_TYPE -TAO_OutStream::stream_type (void) -{ - return this->st_; -} - -// indentation -int -TAO_OutStream::incr_indent (unsigned short flag) -{ - indent_level_++; - if (flag) - return this->indent (); - else - return 0; // do not indent output -} - -// indentation -int -TAO_OutStream::decr_indent (unsigned short flag) -{ - indent_level_--; - if (flag) - return this->indent (); - else - return 0; // do not indent output -} - -int -TAO_OutStream::reset (void) -{ - indent_level_ = 0; - return 0; -} - -// indented print -int -TAO_OutStream::indent (void) -{ - int i; - // based on the current indentation level, leave appropriate number of blank - // spaces in the output - if (this->indent_level_ > 0) - { - for (i=0; i < this->indent_level_; i++) - { - ACE_OS::fprintf (this->fp_, " "); - ACE_OS::fflush (fp_); - } - } - return 0; -} - -// macro generation -int -TAO_OutStream::gen_ifdef_macro (const char *flatname, const char *suffix) -{ - static char macro [NAMEBUFSIZE]; - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - ACE_OS::memset (macro, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (macro, "_%s_", cg->upcase (flatname)); - if (suffix) - { - ACE_OS::sprintf (macro, "%s_%s_", macro, cg->upcase (suffix)); - } - - // append a suffix representing the stream type - switch (this->st_) - { - case TAO_OutStream::TAO_CLI_HDR: - ACE_OS::strcat (macro, "CH_"); - break; - case TAO_OutStream::TAO_CLI_INL: - ACE_OS::strcat (macro, "CI_"); - break; - case TAO_OutStream::TAO_CLI_IMPL: - ACE_OS::strcat (macro, "CS_"); - break; - case TAO_OutStream::TAO_SVR_HDR: - ACE_OS::strcat (macro, "SH_"); - break; - case TAO_OutStream::TAO_SVR_INL: - ACE_OS::strcat (macro, "SI_"); - break; - case TAO_OutStream::TAO_SVR_IMPL: - ACE_OS::strcat (macro, "SS_"); - break; - } - *this << "\n#if !defined (" << macro << ")\n"; - *this << "#define " << macro << "\n\n"; - return 0; -} - -int -TAO_OutStream::gen_endif (void) -{ - *this << "\n#endif // end #if !defined\n\n"; - return 0; -} - -// printf style variable argument print -int -TAO_OutStream::print (const char *format, ...) -{ - int result = 0; - va_list ap; - va_start (ap, format); - ACE_OSCALL (::vfprintf (this->fp_, format, ap), int, -1, result); - ACE_OS::fflush (fp_); - va_end (ap); - return result; -} - -TAO_OutStream & -TAO_OutStream::operator<< (const char *str) -{ - ACE_OS::fprintf (this->fp_, "%s", str); - ACE_OS::fflush (fp_); - return *this; -} - -TAO_OutStream & -TAO_OutStream::operator<< (const long num) -{ - ACE_OS::fprintf (this->fp_, "%ld", num); - ACE_OS::fflush (fp_); - return *this; -} - -TAO_OutStream & -TAO_OutStream::operator<< (const TAO_NL nl) -{ - // Macro to avoid "warning: unused parameter" type warning. - ACE_UNUSED_ARG (nl); - - ACE_OS::fprintf (this->fp_ , "\n"); - this->indent (); - return *this; -} - -TAO_OutStream & -TAO_OutStream::operator<< (Identifier *id) -{ - return this->print (id); -} - -TAO_OutStream & -TAO_OutStream::operator<< (UTL_IdList *id) -{ - return this->print (id); -} - -TAO_OutStream & -TAO_OutStream::operator<< (AST_Expression *expr) -{ - return this->print (expr); -} diff --git a/TAO/TAO_IDL/be/be_init.cpp b/TAO/TAO_IDL/be/be_init.cpp deleted file mode 100644 index 47a72c9936d..00000000000 --- a/TAO/TAO_IDL/be/be_init.cpp +++ /dev/null @@ -1,97 +0,0 @@ -/* - -COPYRIGHT - -Copyright 1992, 1993, 1994 Sun Microsystems, Inc. Printed in the United -States of America. All Rights Reserved. - -This product is protected by copyright and distributed under the following -license restricting its use. - -The Interface Definition Language Compiler Front End (CFE) is made -available for your use provided that you include this license and copyright -notice on all media and documentation and the software program in which -this product is incorporated in whole or part. You may copy and extend -functionality (but may not remove functionality) of the Interface -Definition Language CFE without charge, but you are not authorized to -license or distribute it to anyone else except as part of a product or -program developed by you or with the express written consent of Sun -Microsystems, Inc. ("Sun"). - -The names of Sun Microsystems, Inc. and any of its subsidiaries or -affiliates may not be used in advertising or publicity pertaining to -distribution of Interface Definition Language CFE as permitted herein. - -This license is effective until terminated by Sun for failure to comply -with this license. Upon termination, you shall destroy or return all code -and documentation for the Interface Definition Language CFE. - -INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED AS IS WITH NO WARRANTIES OF -ANY KIND INCLUDING THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS -FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR ARISING FROM A COURSE OF -DEALING, USAGE OR TRADE PRACTICE. - -INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED WITH NO SUPPORT AND WITHOUT -ANY OBLIGATION ON THE PART OF Sun OR ANY OF ITS SUBSIDIARIES OR AFFILIATES -TO ASSIST IN ITS USE, CORRECTION, MODIFICATION OR ENHANCEMENT. - -SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES SHALL HAVE NO LIABILITY WITH -RESPECT TO THE INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY -INTERFACE DEFINITION LANGUAGE CFE OR ANY PART THEREOF. - -IN NO EVENT WILL SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES BE LIABLE FOR -ANY LOST REVENUE OR PROFITS OR OTHER SPECIAL, INDIRECT AND CONSEQUENTIAL -DAMAGES, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -Use, duplication, or disclosure by the government is subject to -restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in -Technical Data and Computer Software clause at DFARS 252.227-7013 and FAR -52.227-19. - -Sun, Sun Microsystems and the Sun logo are trademarks or registered -trademarks of Sun Microsystems, Inc. - -SunSoft, Inc. -2550 Garcia Avenue -Mountain View, California 94043 - -NOTE: - -SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are -trademarks or registered trademarks of Sun Microsystems, Inc. - - */ - -// BE_init.cc - Initialization for dummy BE - -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -/* - * Initialize the BE. The protocol requires only that this routine - * return an instance of AST_Generator (or a subclass thereof). - * - * Remember that none of the FE initialization has been done, when you - * add stuff here. - */ -AST_Generator * -BE_init() -{ - AST_Generator *g = new be_generator(); - - if (g == NULL) { - cerr << GTDEVEL("IDL: BE init failed to create generator, exiting\n"); - exit(99); - } - return g; -} - -/* - * Print out a version string for the BE - */ -void -BE_version() -{ - cerr << GTDEVEL("Demonstration BE, version 1.0.0\n"); -} diff --git a/TAO/TAO_IDL/be/be_interface.cpp b/TAO/TAO_IDL/be/be_interface.cpp deleted file mode 100644 index 61e7f8aa155..00000000000 --- a/TAO/TAO_IDL/be/be_interface.cpp +++ /dev/null @@ -1,1715 +0,0 @@ -// ============================================================================ -// -// = LIBRARY -// TAO IDL -// -// = FILENAME -// be_interface.cpp -// -// = DESCRIPTION -// Extension of class AST_Interface that provides additional means for C++ -// mapping of an interface. -// -// = AUTHOR -// Copyright 1994-1995 by Sun Microsystems, Inc. -// and -// Aniruddha Gokhale -// -// ============================================================================ - -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -/* - * BE_Interface - */ - -// default constructor -be_interface::be_interface (void) - : full_skel_name_ (0), - skel_count_ (0) -{ - this->size_type (be_decl::VARIABLE); // always the case -} - -// constructor used to build the AST -be_interface::be_interface (UTL_ScopedName *n, AST_Interface **ih, long nih, - UTL_StrList *p) - : AST_Interface (n, ih, nih, p), - AST_Decl (AST_Decl::NT_interface, n, p), - UTL_Scope (AST_Decl::NT_interface), - full_skel_name_ (0), - skel_count_ (0) -{ - this->size_type (be_decl::VARIABLE); // always the case -} - -// compute stringified fully scoped skel name -void -be_interface::compute_fullskelname (void) -{ - if (full_skel_name_) - return; - else - { - long namelen; - UTL_IdListActiveIterator *i; - long first = I_TRUE; - long second = I_FALSE; - - // in the first loop compute the total length - namelen = 4; - i = new UTL_IdListActiveIterator (this->name ()); - while (!(i->is_done ())) - { - if (!first) - namelen += 2; // for "::" - else if (second) - first = second = I_FALSE; - // print the identifier - namelen += ACE_OS::strlen (i->item ()->get_string ()); // - // additional 4 for the POA_ characters - if (first) - { - if (ACE_OS::strcmp (i->item ()->get_string (), "") != 0) - // does not start with a "" - first = I_FALSE; - else - second = I_TRUE; - } - i->next (); - } - delete i; - - this->full_skel_name_ = new char [namelen+1]; - this->full_skel_name_[0] = '\0'; - first = I_TRUE; - second = I_FALSE; - ACE_OS::strcat (this->full_skel_name_, "POA_"); - i = new UTL_IdListActiveIterator (this->name ()); - while (!(i->is_done ())) - { - if (!first) - ACE_OS::strcat (this->full_skel_name_, "::"); - else if (second) - first = second = I_FALSE; - // print the identifier - ACE_OS::strcat (this->full_skel_name_, i->item ()->get_string ()); - if (first) - { - if (ACE_OS::strcmp (i->item ()->get_string (), "") != 0) - // does not start with a "" - first = I_FALSE; - else - second = I_TRUE; - } - i->next (); - } - delete i; - } - return; -} - -// retrieve the fully scoped skeleton name -const char* -be_interface::full_skel_name (void) -{ - if (!this->full_skel_name_) - compute_fullskelname (); - - return this->full_skel_name_; -} - -// ---------------------------------------- -// CODE GENERATION METHODS -// ---------------------------------------- - -// generate the client header -int be_interface::gen_client_header (void) -{ - TAO_OutStream *ch; // output stream - long i; // loop index - TAO_NL nl; // end line - - - if (!this->cli_hdr_gen_) // not already generated - { - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - cg->push (TAO_CodeGen::TAO_INTERFACE_CH); // set the current code - // generation state - - ch = cg->client_header (); - - // == STEP 1: generate the class name and class names we inherit == - ch->indent (); // start with whatever indentation level we are at - - // generate the ifdefined macro for the _ptr type - ch->gen_ifdef_macro (this->flatname (), "_ptr"); - - // the following two are required to be under the ifdef macro to avoid - // multiple declarations - - // forward declaration - *ch << "class " << this->local_name () << ";" << nl; - // generate the _ptr declaration - *ch << "typedef " << this->local_name () << " *" << this->local_name () - << "_ptr;" << nl; - - ch->gen_endif (); - - // generate the ifdefined macro for the var type - ch->gen_ifdef_macro (this->flatname (), "_var"); - - // generate the _var declaration - if (this->gen_var_defn () == -1) - { - ACE_ERROR ((LM_ERROR, - "be_interface - error generating _var definition\n")); - return -1; - } - ch->gen_endif (); - - // generate the ifdef macro for the _out class - ch->gen_ifdef_macro (this->flatname (), "_out"); - - // generate the _out declaration - ORBOS/97-05-15 pg 16-20 spec - if (this->gen_out_defn () == -1) - { - ACE_ERROR ((LM_ERROR, - "be_interface - error generating _var definition\n")); - return -1; - } - // generate the endif macro - ch->gen_endif (); - - ch->gen_ifdef_macro (this->flatname ()); - - // now generate the class definition - ch->indent (); - *ch << "class " << this->local_name (); - - if (n_inherits () > 0) // this interface inherits from other interfaces - { - *ch << ": "; - for (i = 0; i < n_inherits (); i++) - { - *ch << "public virtual "; - *ch << inherits ()[i]->name (); // dump the scoped name - if (i < n_inherits () - 1) // this is the case of multiple - // inheritance - { - *ch << ", "; - } - } // end of for loop - *ch << nl; - } - else - { - // we do not inherit from anybody, hence we do so from the base - // CORBA::Object class - *ch << ": public virtual ACE_CORBA_1 (Object)" << nl; - } - - // generate the body - - *ch << "{" << nl; - *ch << "public:\n"; - ch->incr_indent (); - // generate the static _duplicate, _narrow, and _nil operations - *ch << "// the static operations" << nl; - *ch << "static " << local_name () << "_ptr " << "_duplicate (" << - local_name () << "_ptr obj);" << nl; - *ch << "static " << local_name () << "_ptr " << "_narrow (" << - "CORBA::Object_ptr obj, CORBA::Environment &env);" << nl; - *ch << "static " << local_name () << "_ptr " << "_nil (" << - "void);" << nl; - - // generate a TAO-specific _bind method similar to what Orbix and VisiBroker - // have - *ch << "static " << this->local_name () << "_ptr _bind (const char *host, " - << "CORBA::UShort port, const char *key, CORBA::Environment &env);\n\n"; - - // generate code for the interface definition by traversing thru the - // elements of its scope. We depend on the front-end to have made sure - // that only legal syntactic elements appear in our scope. - if (be_scope::gen_client_header () == -1) - { - ACE_ERROR ((LM_ERROR, "be_interface::gen_client_header\n")); - ACE_ERROR ((LM_ERROR, "Scope code generation failure\n")); - return -1; - } - - // the _is_a method - ch->indent (); - *ch << "virtual CORBA::Boolean _is_a (const CORBA::Char *type_id, " << - "CORBA::Environment &env);\n"; - - // generate the "protected" constructor so that users cannot instantiate - // us - ch->decr_indent (); - *ch << "protected:\n"; - ch->incr_indent (); - *ch << local_name () << " (void); // default constructor" << nl; - *ch << local_name () << " (STUB_Object *objref);" << nl; - *ch << "virtual ~" << local_name () << " (void);\n"; - ch->decr_indent (); - - // private copy constructor and assignment operator. These are not - // allowed, hence they are private. - *ch << "private:\n"; - ch->incr_indent (); - *ch << local_name () << " (const " << local_name () << "&);" << nl; - *ch << "void operator= (const " << local_name () << "&);\n"; - ch->decr_indent (); - *ch << "};\n\n"; - ch->gen_endif (); - - - // generate the typecode decl. If we are in the outermost scope, our typecode - // decl is extern - if (this->is_nested ()) - { - // we have a scoped name - ch->indent (); - *ch << "static CORBA::TypeCode_ptr " << this->tc_name - ()->last_component () << ";\n\n"; - } - else - { - // we are in the ROOT scope - ch->indent (); - *ch << "extern CORBA::TypeCode_ptr " << this->tc_name - ()->last_component () << ";\n\n"; - } - - cg->pop (); - this->cli_hdr_gen_ = I_TRUE; - } - return 0; -} - -int be_interface::gen_client_stubs (void) -{ - TAO_OutStream *cs; // output stream - long i; // loop index - TAO_NL nl; // end line - - // Macro to avoid "warning: unused parameter" type warning. - ACE_UNUSED_ARG (i); - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - cg->push (TAO_CodeGen::TAO_INTERFACE_CS); // set the current code generation - // state - - cs = cg->client_stubs (); - - cs->indent (); // start with whatever indentation level we are at - - // first generate the code for the static methods - // The _duplicate method - *cs << name () << "_ptr " << name () << "::_duplicate (" << - name () << "_ptr obj)" << nl; - *cs << "{\n"; - cs->incr_indent (); - *cs << "if (!CORBA::is_nil (obj))\n"; - cs->incr_indent (); - *cs << "obj->AddRef ();\n"; - cs->decr_indent (); - *cs << nl; - *cs << "return obj;\n"; - cs->decr_indent (); - *cs << "} // end of _duplicate" << nl << nl; - - // The _narrow method - *cs << name () << "_ptr " << name () << - "::_narrow (CORBA::Object_ptr obj, CORBA::Environment &env)" << nl; - *cs << "{\n"; - cs->incr_indent (); - *cs << "if (CORBA::is_nil (obj)) return " << this->name () << "::_nil ();" << - nl; - *cs << "if (obj->_is_a (\"" << this->repoID () << "\", env))" << nl; - *cs << "{\n"; - cs->incr_indent (); - *cs << "STUB_Object *istub;" << nl; - *cs << name () << "_ptr new_obj; // to be returned " << nl; -#if 0 // XXXASG - I was told that emitting this line of code is the root cause - // of all evil - *cs << "obj->Release ();" << - " // need this since _is_a grabbed an obj reference " << nl; -#endif - *cs << "if (obj->QueryInterface (IID_STUB_Object, (void **)&istub) " << - "!= TAO_NOERROR)\n"; - cs->incr_indent (); - *cs << "return " << this->name () << "::_nil ();\n"; - cs->decr_indent (); - *cs << nl; - *cs << "obj->Release (); " << - "// need this since QueryIntf bumped our refcount" << nl; - *cs << "new_obj = new " << name () << " (istub); " << - "// construct obj ref using the stub object" << nl; - *cs << "return new_obj;\n"; - cs->decr_indent (); - *cs << "} // end of if" << nl; - *cs << "return " << this->name () << "::_nil (); // _narrow failed\n"; - cs->decr_indent (); - *cs << "} // end of _narrow" << nl << nl; - - // _nil method - *cs << this->name () << "_ptr " << this->name () << "::_nil (void)" << - nl; - *cs << "{\n"; - cs->incr_indent (); - *cs << "return (" << name () << "_ptr)NULL;\n"; - cs->decr_indent (); - *cs << "} // end of _nil" << nl << nl; - - // the _bind method - *cs << this->name () << "_ptr " << this->name () << "::_bind (" << - "const char *host, CORBA::UShort port, const char *key, " << - "CORBA::Environment &env)" << nl; - *cs << "{\n"; - cs->incr_indent (); - *cs << "CORBA::Object_ptr objref = CORBA::Object::_nil ();" << nl; - *cs << "IIOP_Object *data = new IIOP_Object (host, port, key);" << nl; - *cs << "if (!data) return " << this->name () << "::_nil ();" << nl; - *cs << "// get the object_ptr using Query Interface" << nl; - *cs << - "if (data->QueryInterface (IID_CORBA_Object, (void **)&objref) != TAO_NOERROR)" - << nl; - *cs << "{" << nl; - *cs << "\tenv.exception (new CORBA::DATA_CONVERSION (CORBA::COMPLETED_NO));" - << nl; - *cs << "\treturn " << this->name () << "::_nil ();" << nl; - *cs << "}" << nl; - *cs << "data->Release (); // QueryInterface had bumped up our count" << nl; - *cs << "if (CORBA::is_nil (objref))" << nl; - *cs << "\treturn " << this->name () << "::_nil ();" << nl; - *cs << "else // narrow it" << nl; - *cs << "\treturn " << this->name () << "::_narrow (objref, env);\n"; - cs->decr_indent (); - *cs << "}\n\n"; - - // generate code for the elements of the interface - if (be_scope::gen_client_stubs () == -1) - { - ACE_ERROR ((LM_ERROR, "be_interface::gen_client_stubs\n")); - ACE_ERROR ((LM_ERROR, "Scope code generation failure\n")); - return -1; - } - - // generate the is_a method - cs->indent (); - *cs << "CORBA::Boolean " << this->name () << "::_is_a (" << - "const CORBA::Char *value, CORBA::Environment &env)" << nl; - *cs << "{\n"; - cs->incr_indent (); - *cs << "if (\n"; - cs->incr_indent (0); - if (this->traverse_inheritance_graph (be_interface::is_a_helper, cs) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_interface::gen_client_stubs - " - "inheritance graph failed\n"), -1); - } - cs->indent (); - *cs << "(!ACE_OS::strcmp ((char *)value, CORBA::_tc_Object->id (env))))\n"; - *cs << "\treturn 1; // success using local knowledge\n"; - cs->decr_indent (); - *cs << "else" << nl; - *cs << "\treturn ACE_CORBA_3 (Object, _is_a) (value, env); // remote call\n"; - cs->decr_indent (); - *cs << "}\n\n"; - - // generate the typecode information here - cs->indent (); // start from current indentation level - *cs << "static const CORBA::Long _oc_" << this->flatname () << "[] =" << - nl; - *cs << "{\n"; - cs->incr_indent (0); - if (this->gen_encapsulation () == -1) - { - ACE_ERROR ((LM_ERROR, "Error generating typecode\n\n")); - return -1; - } - cs->decr_indent (); - *cs << "};" << nl; - - *cs << "static CORBA::TypeCode _tc__tc_" << this->flatname () << - " (CORBA::tk_objref, sizeof (_oc_" << this->flatname () << - "), (unsigned char *) &_oc_" << this->flatname () << - ", CORBA::B_FALSE);" << nl; - *cs << "CORBA::TypeCode_ptr " << this->tc_name () << " = &_tc__tc_" << - this->flatname () << ";\n\n"; - - cg->pop (); - return 0; -} - -// generate server header -int be_interface::gen_server_header (void) -{ - TAO_OutStream *sh; // output stream - long i; // loop index - TAO_NL nl; // end line - static char namebuf [NAMEBUFSIZE]; // holds the class name - AST_Decl *d; // enclosing scope - - ACE_OS::memset (namebuf, '\0', NAMEBUFSIZE); - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - cg->push (TAO_CodeGen::TAO_INTERFACE_SH); // set the current code generation - // state - - sh = cg->server_header (); - - // generate the skeleton class name - - sh->indent (); // start with whatever indentation level we are at - - // we shall have a POA_ prefix only if we are at the topmost level - // generate the forward declaration - d = ScopeAsDecl (this->defined_in ()); - if (d->node_type () == AST_Decl::NT_root) - { - // we are outermost - ACE_OS::sprintf (namebuf, "POA_%s", this->local_name ()->get_string ()); - } - else - { - ACE_OS::sprintf (namebuf, "%s", this->local_name ()->get_string ()); - } - - *sh << "class " << namebuf << ";" << nl; - - // generate the _ptr declaration - *sh << "typedef " << namebuf << " *" << namebuf - << "_ptr;" << nl; - - // now generate the class definition - *sh << "class " << namebuf << " : public virtual " << name (); - if (n_inherits () > 0) // this interface inherits from other interfaces - { - be_interface *intf; - - for (i = 0; i < n_inherits (); i++) - { - *sh << ", public virtual "; - intf = be_interface::narrow_from_decl (inherits ()[i]); - *sh << intf->full_skel_name (); // dump the scoped name - } // end of for loop - } - *sh << nl; - *sh << "{" << nl; - *sh << "protected:\n"; - sh->incr_indent (); - *sh << namebuf << " (const char *obj_name = 0);" << nl; - *sh << "virtual ~" << namebuf << " (void);\n"; - sh->decr_indent (); - *sh << "public:\n"; - sh->incr_indent (0); - // generate code for elements in the scope (e.g., operations) - if (be_scope::gen_server_header () == -1) - { - ACE_ERROR ((LM_ERROR, "be_interface::gen_server_header\n")); - ACE_ERROR ((LM_ERROR, "Scope code generation failure\n")); - return -1; - } - - // add our _is_a method - sh->indent (); - *sh << "static void _is_a_skel (CORBA::ServerRequest &req, " << - "void *obj, void *context, CORBA::Environment &env);\n\n"; - - // generate skeletons for operations of our base classes. These skeletons - // just cast the pointer to the appropriate type before invoking the call - if (this->traverse_inheritance_graph (be_interface::gen_skel_helper, sh) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_interface::gen_server_header - " - "inheritance graph traversal failed\n"), -1); - } - - // add the dispatch method - sh->indent (); - *sh << "virtual void dispatch (CORBA::ServerRequest &req, " << - "void *context, CORBA::Environment &env);" << nl; - sh->decr_indent (); - *sh << "};\n\n"; - - cg->pop (); - return 0; -} - -int be_interface::gen_server_skeletons (void) -{ - TAO_OutStream *ss; // output stream - TAO_NL nl; // end line - AST_Decl *d; // temporary - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - cg->push (TAO_CodeGen::TAO_INTERFACE_SS); // set the current code generation - // state - - ss = cg->server_skeletons (); - - // generate the skeleton class name - - ss->indent (); // start with whatever indentation level we are at - - if (this->gen_operation_table () == -1) - { - ACE_ERROR ((LM_ERROR, - "be_interface::gen_operation_table failure\n")); - return -1; - } - - *ss << "// skeleton constructor" << nl; - // find if we are at the top scope or inside some module - d = ScopeAsDecl (this->defined_in ()); - - // if (d && d->node_type () == AST_Decl::NT_root) - if (!this->is_nested ()) - { - // we are outermost. So the POA_ prefix is prepended to our name - *ss << this->full_skel_name () << "::POA_" << this->local_name () << - " (const char *obj_name)" << nl; - } - else - { - // the POA_ prefix is prepended to our outermost module name - *ss << this->full_skel_name () << "::" << this->local_name () << - " (const char *obj_name)" << nl; - } - - *ss << "{\n"; - ss->incr_indent (); - // code for the skeleton constructor - *ss << "const CORBA::String repoID = \"" << this->repoID () << "\"; // repository ID" << nl; - *ss << "IIOP_Object *data; // Actual object reference" << nl; - *ss << "TAO_ORB_Core *ocp = TAO_ORB_Core_instance (); " << - "// underlying ORB core instance" << nl; - *ss << "CORBA::POA_ptr oa = TAO_ORB_Core_instance ()->root_poa (); " << - "// underlying OA" << nl; - *ss << "const ACE_INET_Addr &addr = ocp->orb_params ()->addr ();" << nl; - *ss << "this->optable_ = &tao_" << this->flatname () << "_optable;" << nl << - nl; - *ss << "// set up an IIOP object" << nl; - *ss << "data = new IIOP_Object (CORBA::string_dup (repoID), addr, obj_name);" - << nl; - *ss << "this->set_parent (data); // store the IIOP obj ref with us" << - nl; - // *ss << "this->sub_ = this; // set the most derived type to be us" << nl; - *ss << "if (oa) oa->bind (data->profile.object_key, this); " << - "// register ourselves\n"; - ss->decr_indent (); - *ss << "}\n\n"; - - // generate code for elements in the scope (e.g., operations) - if (be_scope::gen_server_skeletons () == -1) - { - ACE_ERROR ((LM_ERROR, "be_interface::gen_server_skeletons\n")); - ACE_ERROR ((LM_ERROR, "Scope code generation failure\n")); - return -1; - } - - // generate code for the _is_a skeleton - ss->indent (); - *ss << "void " << this->full_skel_name () << - "::_is_a_skel (CORBA::ServerRequest &req, " << - "void * /* obj */, void * /*context*/, CORBA::Environment &env)" << nl; - *ss << "{\n"; - ss->incr_indent (); - *ss << "CORBA::NVList_ptr nvlist;" << nl; - *ss << "CORBA::NamedValue_ptr nv;" << nl; - *ss << "CORBA::Any temp_value (CORBA::_tc_string);" << nl; - *ss << "CORBA::Any *any;" << nl; - *ss << "CORBA::Boolean *retval;" << nl; - *ss << "CORBA::String value;" << nl; - *ss << nl; - *ss << "req.orb()->create_list (0, nvlist);" << nl; - *ss << "nv = nvlist->add_value (0, temp_value, CORBA::ARG_IN, env);" << nl; - *ss << "req.params (nvlist, env); // parse the args" << nl; - *ss << "if (env.exception () != 0) return;" << nl; - *ss << "value = *(CORBA::String *)nv->value ()->value ();" << nl; - *ss << "if (\n"; - ss->incr_indent (0); - if (this->traverse_inheritance_graph (be_interface::is_a_helper, ss) == -1) - { - } - ss->indent (); - *ss << "(!ACE_OS::strcmp ((char *)value, CORBA::_tc_Object->id (env))))\n"; - *ss << "\tretval = new CORBA::Boolean (CORBA::B_TRUE);\n"; - ss->decr_indent (); - *ss << "else" << nl; - *ss << "\tretval = new CORBA::Boolean (CORBA::B_FALSE);" << nl; - *ss << "any = new CORBA::Any (CORBA::_tc_boolean, retval, CORBA::B_TRUE);" << - nl; - *ss << "req.result (any, env);\n"; - ss->decr_indent (); - *ss << "}\n\n"; - - // now the dispatch method - ss->indent (); - *ss << "void " << this->full_skel_name () << - "::dispatch (CORBA::ServerRequest &req, " << - "void *context, CORBA::Environment &env)" << nl; - *ss << "{\n"; - ss->incr_indent (); - *ss << "TAO_Skeleton skel; // pointer to skeleton for operation" << nl; - *ss << "CORBA::String opname = req.op_name (); // retrieve operation name" << - nl; - *ss << "// find the skeleton corresponding to this opname" << nl; - *ss << "if (this->find (opname, skel) == -1)" << nl; - *ss << "{\n"; - ss->incr_indent (); - *ss << "env.exception (new CORBA_BAD_OPERATION (CORBA::COMPLETED_NO));" << - nl; - *ss << "ACE_ERROR ((LM_ERROR, \"Bad operation <%s>\\n\", opname));\n"; - ss->decr_indent (); - *ss << "}\n"; - *ss << "else" << nl; - *ss << "\tskel (req, this, context, env);\n"; - ss->decr_indent (); - *ss << "}\n"; - cg->pop (); - return 0; -} - -// Generates the client-side inline information -int -be_interface::gen_client_inline (void) -{ - TAO_OutStream *ci; // output stream - TAO_NL nl; // end line - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - ci = cg->client_inline (); - ci->indent (); // start from the current indentation level - - // generate the constructors and destructor - *ci << "ACE_INLINE" << nl; - *ci << this->name () << "::" << this->local_name () << - " (void) // default constructor" << nl; - *ci << "{}" << nl << nl; - - *ci << "ACE_INLINE" << nl; - *ci << this->name () << "::" << this->local_name () << - " (STUB_Object *objref) // constructor" << nl; - *ci << "\t: ACE_CORBA_1 (Object) (objref)" << nl; - *ci << "{}" << nl << nl; - - *ci << "ACE_INLINE" << nl; - *ci << this->name () << "::~" << this->local_name () << - " (void) // destructor" << nl; - *ci << "{}\n\n"; - - // generate the ifdefined macro for the _var type - ci->gen_ifdef_macro (this->flatname (), "_var"); - - if (this->gen_var_impl () == -1) - { - ACE_ERROR ((LM_ERROR, "be_interface: _var impl code gen failed\n")); - return -1; - } - ci->gen_endif (); - - // generate the ifdefined macro for the _out type - ci->gen_ifdef_macro (this->flatname (), "_out"); - - if (this->gen_out_impl () == -1) - { - ACE_ERROR ((LM_ERROR, "be_interface: _out impl code gen failed\n")); - return -1; - } - ci->gen_endif (); - - if (be_scope::gen_client_inline () == -1) - { - ACE_ERROR ((LM_ERROR, "be_interface: code gen failed for scope\n")); - return -1; - } - return 0; -} - -// Generates the server-side inline -int -be_interface::gen_server_inline (void) -{ - // nothing to be done - TAO_OutStream *si; // output stream - long i; // loop index - TAO_NL nl; // end line - - // Macro to avoid "warning: unused parameter" type warning. - ACE_UNUSED_ARG (i); - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - si = cg->server_inline (); - - // generate the skeleton class name - - si->indent (); // start with whatever indentation level we are at - - *si << "// skeleton destructor" << nl; - - *si << "ACE_INLINE" << nl; - if (!this->is_nested ()) - { - // we are outermost. So the POA_ prefix is prepended to our name - *si << this->full_skel_name () << "::~POA_" << this->local_name () << - " (void)" << nl; - } - else - { - // the POA_ prefix is prepended to our outermost module name - *si << this->full_skel_name () << "::~" << this->local_name () << - " (void)" << nl; - } - - *si << "{" << nl; - *si << "}\n"; - - // generate skeletons for operations of our base classes. These skeletons - // just cast the pointer to the appropriate type before invoking the call - if (this->traverse_inheritance_graph (be_interface::gen_skel_helper, si) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_interface::gen_server_inline - " - "inheritance graph traversal failed\n"), -1); - } - - return 0; -} - -// generate the var definition -int -be_interface::gen_var_defn (void) -{ - TAO_OutStream *ch; // output stream - TAO_NL nl; // end line - char namebuf [NAMEBUFSIZE]; // names - - ACE_OS::memset (namebuf, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (namebuf, "%s_var", this->local_name ()->get_string ()); - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - ch = cg->client_header (); - - // generate the var definition (always in the client header). - // Depending upon the data type, there are some differences which we account - // for over here. - - ch->indent (); // start with whatever was our current indent level - *ch << "class " << namebuf << nl; - *ch << "{" << nl; - *ch << "public:\n"; - ch->incr_indent (); - - // default constr - *ch << namebuf << " (void); // default constructor" << nl; - *ch << namebuf << " (" << local_name () << "_ptr);" << nl; - - // copy constructor - *ch << namebuf << " (const " << namebuf << - " &); // copy constructor" << nl; - - // destructor - *ch << "~" << namebuf << " (void); // destructor" << nl; - *ch << nl; - - // assignment operator from a pointer - *ch << namebuf << " &operator= (" << local_name () << "_ptr);" << nl; - - // assignment from _var - *ch << namebuf << " &operator= (const " << namebuf << - " &);" << nl; - - // arrow operator - *ch << local_name () << "_ptr operator-> (void) const;" << nl; - - *ch << nl; - - // other extra types (cast operators, [] operator, and others) - *ch << "operator const " << local_name () << "_ptr &() const;" << nl; - *ch << "operator " << local_name () << "_ptr &();" << nl; - - *ch << "// in, inout, out, _retn " << nl; - // the return types of in, out, inout, and _retn are based on the parameter - // passing rules and the base type - *ch << local_name () << "_ptr in (void) const;" << nl; - *ch << local_name () << "_ptr &inout (void);" << nl; - *ch << local_name () << "_ptr &out (void);" << nl; - *ch << local_name () << "_ptr _retn (void);" << nl; - - // generate an additional member function that returns the underlying pointer - *ch << local_name () << "_ptr ptr (void) const;\n"; - - *ch << "\n"; - ch->decr_indent (); - - // private - *ch << "private:\n"; - ch->incr_indent (); - *ch << local_name () << "_ptr ptr_;\n"; - - ch->decr_indent (); - *ch << "};\n\n"; - - return 0; -} - -// implementation of the _var class. All of these get generated in the inline -// file -int -be_interface::gen_var_impl (void) -{ - TAO_OutStream *ci; // output stream - TAO_NL nl; // end line - char fname [NAMEBUFSIZE]; // to hold the full and - char lname [NAMEBUFSIZE]; // local _var names - - ACE_OS::memset (fname, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (fname, "%s_var", this->fullname ()); - - ACE_OS::memset (lname, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (lname, "%s_var", local_name ()->get_string ()); - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - ci = cg->client_inline (); - - // generate the var implementation in the inline file - // Depending upon the data type, there are some differences which we account - // for over here. - - ci->indent (); // start with whatever was our current indent level - - *ci << "// *************************************************************" - << nl; - *ci << "// Inline operations for class " << fname << nl; - *ci << "// *************************************************************\n\n"; - - // default constr - *ci << "ACE_INLINE" << nl; - *ci << fname << "::" << lname << - " (void) // default constructor" << nl; - *ci << "\t" << ": ptr_ (" << this->name () << "::_nil ())" << nl; - *ci << "{}\n\n"; - - // constr from a _ptr - ci->indent (); - *ci << "ACE_INLINE" << nl; - *ci << fname << "::" << lname << " (" << name () << "_ptr p)" << nl; - *ci << "\t: ptr_ (p)" << nl; - *ci << "{}\n\n"; - - // the additional ptr () member function. This member function must be - // defined before the remaining member functions including the copy - // constructor because this inline function is used elsewhere. Hence to make - // inlining of this function possible, we must define it before its use. - ci->indent (); - *ci << "ACE_INLINE " << name () << "_ptr " << nl; - *ci << fname << "::ptr (void) const" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // copy constructor - ci->indent (); - *ci << "ACE_INLINE" << nl; - *ci << fname << "::" << lname << " (const " << fname << - " &p) // copy constructor" << nl; - *ci << "\t: ptr_ (" << name () << "::_duplicate (p.ptr ()))" << nl; - *ci << "{}\n\n"; - - // destructor - ci->indent (); - *ci << "ACE_INLINE" << nl; - *ci << fname << "::~" << lname << " (void) // destructor" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "CORBA::release (this->ptr_);\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // assignment operator - ci->indent (); - *ci << "ACE_INLINE " << fname << " &" << nl; - *ci << fname << "::operator= (" << name () << - "_ptr p)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "CORBA::release (this->ptr_);" << nl; - *ci << "this->ptr_ = p;" << nl; - *ci << "return *this;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // assignment operator from _var - ci->indent (); - *ci << "ACE_INLINE " << fname << " &" << nl; - *ci << fname << "::operator= (const " << fname << - " &p)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "if (this != &p)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "CORBA::release (this->ptr_);" << nl; - *ci << "this->ptr_ = " << name () << "::_duplicate (p.ptr ());\n"; - ci->decr_indent (); - *ci << "}" << nl; - *ci << "return *this;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // other extra methods - cast operator () - ci->indent (); - *ci << "ACE_INLINE " << nl; - *ci << fname << "::operator const " << name () << - "_ptr &() const // cast" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - ci->indent (); - *ci << "ACE_INLINE " << nl; - *ci << fname << "::operator " << name () << "_ptr &() // cast " << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // operator-> - ci->indent (); - *ci << "ACE_INLINE " << name () << "_ptr " << nl; - *ci << fname << "::operator-> (void) const" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // in, inout, out, and _retn - ci->indent (); - *ci << "ACE_INLINE " << name () << "_ptr" << nl; - *ci << fname << "::in (void) const" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - ci->indent (); - *ci << "ACE_INLINE " << name () << "_ptr &" << nl; - *ci << fname << "::inout (void)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - ci->indent (); - *ci << "ACE_INLINE " << name () << "_ptr &" << nl; - *ci << fname << "::out (void)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "CORBA::release (this->ptr_);" << nl; - *ci << "this->ptr_ = " << this->name () << "::_nil ();" << nl; - *ci << "return this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - ci->indent (); - *ci << "ACE_INLINE " << name () << "_ptr " << nl; - *ci << fname << "::_retn (void)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "// yield ownership of managed obj reference" << nl; - *ci << this->name () << "_ptr val = this->ptr_;" << nl; - *ci << "this->ptr_ = " << this->name () << "::_nil ();" << nl; - *ci << "return val;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - return 0; -} - -// generate the _out definition -int -be_interface::gen_out_defn (void) -{ - TAO_OutStream *ch; // output stream - TAO_NL nl; // end line - char namebuf [NAMEBUFSIZE]; // to hold the _out name - - ACE_OS::memset (namebuf, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (namebuf, "%s_out", local_name ()->get_string ()); - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - ch = cg->client_header (); - - // generate the out definition (always in the client header) - ch->indent (); // start with whatever was our current indent level - - *ch << "class " << namebuf << nl; - *ch << "{" << nl; - *ch << "public:\n"; - ch->incr_indent (); - - // No default constructor - - // constructor from a pointer - *ch << namebuf << " (" << local_name () << "_ptr &);" << nl; - // constructor from a _var & - *ch << namebuf << " (" << local_name () << "_var &);" << nl; - // constructor from a _out & - *ch << namebuf << " (" << namebuf << " &);" << nl; - // assignment operator from a _out & - *ch << namebuf << " &operator= (" << namebuf << " &);" << nl; - // assignment operator from a pointer &, cast operator, ptr fn, operator - // -> and any other extra operators - // only interface allows assignment from var & - *ch << namebuf << " &operator= (const " << local_name () << "_var &);" << nl; - *ch << namebuf << " &operator= (" << local_name () << "_ptr);" << nl; - // cast - *ch << "operator " << local_name () << "_ptr &();" << nl; - // ptr fn - *ch << local_name () << "_ptr &ptr (void);" << nl; - // operator -> - *ch << local_name () << "_ptr operator-> (void);" << nl; - - *ch << "\n"; - ch->decr_indent (); - *ch << "private:\n"; - ch->incr_indent (); - *ch << local_name () << "_ptr &ptr_;\n"; - - ch->decr_indent (); - *ch << "};\n\n"; - return 0; -} - -int -be_interface::gen_out_impl (void) -{ - TAO_OutStream *ci; // output stream - TAO_NL nl; // end line - char fname [NAMEBUFSIZE]; // to hold the full and - char lname [NAMEBUFSIZE]; // local _out names - - ACE_OS::memset (fname, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (fname, "%s_out", this->fullname ()); - - ACE_OS::memset (lname, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (lname, "%s_out", local_name ()->get_string ()); - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - ci = cg->client_inline (); - - // generate the var implementation in the inline file - // Depending upon the data type, there are some differences which we account - // for over here. - - ci->indent (); // start with whatever was our current indent level - - *ci << "// *************************************************************" - << nl; - *ci << "// Inline operations for class " << fname << nl; - *ci << "// *************************************************************\n\n"; - - // constr from a _ptr - ci->indent (); - *ci << "ACE_INLINE" << nl; - *ci << fname << "::" << lname << " (" << name () << "_ptr &p)" << nl; - *ci << "\t: ptr_ (p)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "this->ptr_ = " << this->name () << "::_nil ();\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // constructor from _var & - ci->indent (); - *ci << "ACE_INLINE" << nl; - *ci << fname << "::" << lname << " (" << this->name () << - "_var &p) // constructor from _var" << nl; - *ci << "\t: ptr_ (p.out ())" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "CORBA::release (this->ptr_);" << nl; - *ci << "this->ptr_ = " << this->name () << "::_nil ();\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // copy constructor - ci->indent (); - *ci << "ACE_INLINE" << nl; - *ci << fname << "::" << lname << " (" << fname << - " &p) // copy constructor" << nl; - *ci << "\t: ptr_ (p.ptr_)" << nl; - *ci << "{}\n\n"; - - // assignment operator from _out & - ci->indent (); - *ci << "ACE_INLINE " << fname << " &" << nl; - *ci << fname << "::operator= (" << fname << - " &p)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "this->ptr_ = p.ptr_;" << nl; - *ci << "return *this;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // assignment operator from _var - ci->indent (); - *ci << "ACE_INLINE " << fname << " &" << nl; - *ci << fname << "::operator= (const " << this->name () << - "_var &p)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "this->ptr_ = " << this->name () << "::_duplicate (p.ptr ());" << nl; - *ci << "return *this;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // assignment operator from _ptr - ci->indent (); - *ci << "ACE_INLINE " << fname << " &" << nl; - *ci << fname << "::operator= (" << this->name () << - "_ptr p)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "this->ptr_ = p;" << nl; - *ci << "return *this;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // other extra methods - cast operator () - ci->indent (); - *ci << "ACE_INLINE " << nl; - *ci << fname << "::operator " << this->name () << - "_ptr &() // cast" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // ptr function - ci->indent (); - *ci << "ACE_INLINE " << this->name () << "_ptr &" << nl; - *ci << fname << "::ptr (void) // ptr" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // operator-> - ci->indent (); - *ci << "ACE_INLINE " << this->name () << "_ptr " << nl; - *ci << fname << "::operator-> (void)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - return 0; -} - -// generate typecode. -// Typecode for interface comprises the enumerated value followed by the -// encapsulation of the parameters - -int -be_interface::gen_typecode (void) -{ - TAO_OutStream *cs; // output stream - TAO_NL nl; // end line - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - cs = cg->client_stubs (); - cs->indent (); // start from whatever indentation level we were at - - *cs << "CORBA::tk_objref, // typecode kind" << nl; - *cs << this->tc_size () << ", // encapsulation length\n"; - // now emit the encapsulation - return this->gen_encapsulation (); -} - -// generate encapsulation -// An encapsulation for ourselves will be necessary when we are part of some -// other IDL type and a typecode for that other type is being generated. This -// will comprise our typecode kind. IDL types with parameters will additionally -// have the encapsulation length and the entire typecode description -int -be_interface::gen_encapsulation (void) -{ - TAO_OutStream *cs; // output stream - TAO_NL nl; // end line - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - long i, arrlen; - long *arr; // an array holding string names converted to array of longs - - cs = cg->client_stubs (); - cs->indent (); // start from whatever indentation level we were at - - // XXXASG - byte order must be based on what m/c we are generating code - - // TODO - *cs << "TAO_ENCAP_BYTE_ORDER, // byte order" << nl; - // generate repoID - *cs << (ACE_OS::strlen (this->repoID ())+1) << ", "; - (void)this->tc_name2long (this->repoID (), arr, arrlen); - for (i=0; i < arrlen; i++) - { - cs->print ("0x%x, ", arr[i]); - } - *cs << " // repository ID = " << this->repoID () << nl; - // generate name - *cs << (ACE_OS::strlen (this->local_name ()->get_string ())+1) << ", "; - (void)this->tc_name2long(this->local_name ()->get_string (), arr, arrlen); - for (i=0; i < arrlen; i++) - { - cs->print ("0x%x, ", arr[i]); - } - *cs << " // name = " << this->local_name () << ",\n"; - - return 0; -} - -// compute size of typecode -long -be_interface::tc_size (void) -{ - return 4 + 4 + this->tc_encap_len (); -} - -// compute the encapsulation length -long -be_interface::tc_encap_len (void) -{ - if (this->encap_len_ == -1) // not computed yet - { - long slen; - - // Macro to avoid "warning: unused parameter" type warning. - ACE_UNUSED_ARG (slen); - - this->encap_len_ = 4; // holds the byte order flag - - this->encap_len_ += this->repoID_encap_len (); // for repoID - - // do the same thing for the local name - this->encap_len_ += this->name_encap_len (); - - } - return this->encap_len_; -} - -// helper -int -be_interface::gen_operation_table (void) -{ - TAO_OutStream *ss; // output stream - TAO_NL nl; // end line - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - ss = cg->server_skeletons (); - - ss->indent (); // start from current indentation level - *ss << "static const TAO_operation_db_entry " << this->flatname () << - "_operations [] = {\n"; - ss->incr_indent (0); - - if (this->traverse_inheritance_graph (be_interface::gen_optable_helper, ss) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_interface::gen_operation_table - " - "inheritance graph traversal failed\n"), -1); - } - - // generate the skeleton for the is_a method - ss->indent (); - *ss << "{\"_is_a\", &" << this->full_skel_name () << "::_is_a_skel}\n"; - this->skel_count_++; - - ss->decr_indent (); - *ss << "};" << nl << nl; - - // XXXASG - this code should be based on using different strategies for - // demux - for next release - *ss << "TAO_Dynamic_Hash_OpTable tao_" << this->flatname () << "_optable " << - "(" << this->flatname () << "_operations, " << this->skel_count_ << ", " << - 2*this->skel_count_ << ");" - << nl; - return 0; -} - -// we separate the generation of operation table entries from the -// "gen_operation_table" method. This enables us to invoke generation of -// entries for interfaces from which we inherit without any additional -// code. The parameter "derived" is the one for which the entire operation -// table is being built. -int -be_interface::gen_optable_entries (be_interface *derived) -{ - UTL_ScopeActiveIterator *si; - AST_Decl *d; - TAO_OutStream *ss; // output stream - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - ss = cg->server_skeletons (); - - if (this->nmembers () > 0) - { - // if there are elements in this scope i.e., any operations and - // attributes defined by "this" which happens to be the same as "derived" - // or one of its ancestors. - - si = new UTL_ScopeActiveIterator (this, UTL_Scope::IK_decls); - // instantiate a scope iterator. - - while (!(si->is_done ())) - { - // get the next AST decl node - d = si->item (); - if (d->node_type () == AST_Decl::NT_op) - { - ss->indent (); // start from current indentation level - // we are an operation node - *ss << "{\"" << d->local_name () << "\", &" << derived->full_skel_name - () << "::" << d->local_name () << "_skel},\n"; - derived->skel_count_++; - } - else if (d->node_type () == AST_Decl::NT_attr) - { - AST_Attribute *attr; - - ss->indent (); // start from current indentation level - // generate only the "get" entry if we are readonly - *ss << "{\"_get_" << d->local_name () << "\", &" << - derived->full_skel_name () << "::_get_" << d->local_name () << - "_skel},\n"; - derived->skel_count_++; - - attr = AST_Attribute::narrow_from_decl (d); - if (!attr) - return -1; - - if (!attr->readonly ()) - { - // the set method - ss->indent (); // start from current indentation level - *ss << "{\"_set_" << d->local_name () << "\", &" << - derived->full_skel_name () << "::_set_" << d->local_name - () << "_skel},\n"; - derived->skel_count_++; - } - } - si->next (); - } // end of while - delete si; // free the iterator object - } - return 0; -} - -// template method that traverses the inheritance graph in a breadth-first -// style. The actual work on each element in the inheritance graph is carried -// out by the function passed as argument -int be_interface::traverse_inheritance_graph (be_interface::tao_code_emitter gen, - TAO_OutStream *os) -{ - long i; // loop index - ACE_Unbounded_Queue <be_interface*> queue; // Queue data structure needed for - // breadth-first traversal of - // inheritance tree - // insert ourselves in the Queue - if (queue.enqueue_tail (this) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, "(%N:%l) be_interface::gen_operation_table - " - "error generating entries\n"), -1); - } - - // do until queue is empty - while (!queue.is_empty ()) - { - be_interface *bi; // element inside the queue - - // use breadth-first strategy i.e., first generate entries for ourselves, - // followed by nodes that we immediately inherit from, and so on. In the - // process make sure that we do not generate code for the same node more - // than once. Such a case may arise due to multiple inheritance forming a - // diamond like inheritance graph. - - // dequeue the element at the head of the queue - if (queue.dequeue_head (bi)) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_interface::traverse_graph - " - "dequeue_head failed\n"), -1); - } - - // use the helper method to generate code for ourself using the - // properties of the element dequeued. For the first iteration, the - // element dequeued and "this" will be the same i.e., ourselves - if (gen (this, bi, os) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_interface::traverse_graph - " - "helper code gen failed\n"), -1); - } - - // now check if the dequeued element has any ancestors. If yes, insert - // them inside the queue making sure that there are no duplicates - for (i=0; i < bi->n_inherits (); i++) - { - be_interface *parent; // parent of the dequeued element - - // initialize an iterator to search the queue for duplicates - ACE_Unbounded_Queue_Iterator<be_interface*> q_iter (queue); - - // retrieve the next parent from which the dequeued element inherits - parent = be_interface::narrow_from_decl (bi->inherits ()[i]); - if (!parent) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_interface::gen_server_skeletons - " - "bad inherited interface\n"), -1); - } - - // now insert this node at the tail of the queue, but make sure that - // it doesn't already exist in the queue - int found = 0; - while (!q_iter.done ()) - { - be_interface **temp; // queue element - - (void) q_iter.next (temp); - if (!ACE_OS::strcmp (parent->fullname (), (*temp)->fullname ())) - { - // we exist in this queue and cannot be inserted - found = 1; - } - if (found) - break; - (void) q_iter.advance (); - } // end of while - if (!found) - { - // insert the parent in the queue - if (queue.enqueue_tail (parent) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_interface::gen_server_skeletons - " - "enqueue op failed\n"), -1); - } - } - } // end of for loop - } // end of while queue not empty - return 0; -} - -// helpers passed to the template method - -int -be_interface::gen_optable_helper (be_interface *derived, - be_interface *ancestor, - TAO_OutStream * /*os*/) -{ - // generate entries for the derived class using the properties of its - // ancestors - if (ancestor->gen_optable_entries (derived) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_interface::gen_operation_table - " - "error generating entries for inherited" - "interfaces\n"), -1); - } - return 0; -} - -int -be_interface::is_a_helper (be_interface * /*derived*/, be_interface *bi, TAO_OutStream *os) -{ - // emit the comparison code - os->indent (); - *os << "(!ACE_OS::strcmp ((char *)value, \"" << bi->repoID () << - "\")) ||\n"; - - return 0; -} - -int -be_interface::gen_skel_helper (be_interface *derived, - be_interface *ancestor, - TAO_OutStream *os) -{ - UTL_ScopeActiveIterator *si; - AST_Decl *d; - TAO_NL nl; // end line - - // if derived and ancestor are same, skip it - if (derived == ancestor) - return 0; - - // else generate code that does the cast to the appropriate type - - if (ancestor->nmembers () > 0) - { - // if there are elements in ancestor scope i.e., any operations and - // attributes defined by "ancestor", become methods on the derived class - // which call the corresponding method of the base class by doing the - // proper casting - - si = new UTL_ScopeActiveIterator (ancestor, UTL_Scope::IK_decls); - // instantiate a scope iterator. - - while (!(si->is_done ())) - { - // get the next AST decl node - d = si->item (); - if (d->node_type () == AST_Decl::NT_op) - { - os->indent (); // start from current indentation level - if (os->stream_type () == TAO_OutStream::TAO_SVR_HDR) - { - // generate the static method corresponding to this method - *os << "static void " << d->local_name () << - "_skel (CORBA::ServerRequest &req, void *obj," - << " void *context, CORBA::Environment &env);\n\n"; - } - else - { // generate code in the inline file - // generate the static method corresponding to this method - *os << "ACE_INLINE void " << derived->full_skel_name () << - "::" << d->local_name () << - "_skel (CORBA::ServerRequest &req, " << - "void *obj, void *context, CORBA::Environment &env)" << nl; - *os << "{\n"; - os->incr_indent (); - *os << ancestor->full_skel_name () << "_ptr impl = (" << - derived->full_skel_name () << "_ptr) obj;" << nl; - *os << ancestor->full_skel_name () << "::" << d->local_name - () << "_skel (req, (" << ancestor->full_skel_name () << - "_ptr) impl, context, env);\n"; - os->decr_indent (); - *os << "}\n"; - } - } - else if (d->node_type () == AST_Decl::NT_attr) - { - AST_Attribute *attr; - - attr = AST_Attribute::narrow_from_decl (d); - if (!attr) - return -1; - - os->indent (); // start from current indentation level - if (os->stream_type () == TAO_OutStream::TAO_SVR_HDR) - { - // generate the static method corresponding to this method - *os << "static void _get_" << d->local_name () << - "_skel (CORBA::ServerRequest &req, void *obj," - << " void *context, CORBA::Environment &env);\n\n"; - } - else - { // generate code in the inline file - // generate the static method corresponding to this method - *os << "ACE_INLINE void " << derived->full_skel_name () << - "::_get_" << d->local_name () << - "_skel (CORBA::ServerRequest &req, " << - "void *obj, void *context, CORBA::Environment &env)" << nl; - *os << "{\n"; - os->incr_indent (); - *os << ancestor->full_skel_name () << "_ptr impl = (" << - derived->full_skel_name () << "_ptr) obj;" << nl; - *os << ancestor->full_skel_name () << "::_get_" << d->local_name - () << "_skel (req, (" << ancestor->full_skel_name () << - "_ptr) impl, context, env);\n"; - os->decr_indent (); - *os << "}\n"; - } - - if (!attr->readonly ()) - { - // the set method - os->indent (); // start from current indentation level - if (os->stream_type () == TAO_OutStream::TAO_SVR_HDR) - { - // generate the static method corresponding to this method - *os << "static void _set_" << d->local_name () << - "_skel (CORBA::ServerRequest &req, void *obj," - << " void *context, CORBA::Environment &env);\n\n"; - } - else - { // generate code in the inline file - // generate the static method corresponding to this method - *os << "ACE_INLINE void " << derived->full_skel_name () - << "::_set_" << d->local_name () << - "_skel (CORBA::ServerRequest &req, " << - "void *obj, void *context, CORBA::Environment &env)" << - nl; - *os << "{\n"; - os->incr_indent (); - *os << ancestor->full_skel_name () << "_ptr impl = (" << - derived->full_skel_name () << "_ptr) obj;" << nl; - *os << ancestor->full_skel_name () << "::_get_" << - d->local_name () << "_skel (req, (" << - ancestor->full_skel_name () << - "_ptr) impl, context, env);\n"; - os->decr_indent (); - *os << "}\n"; - } - - } - } - si->next (); - } // end of while - delete si; // free the iterator object - } - return 0; -} - -// Narrowing -IMPL_NARROW_METHODS3 (be_interface, AST_Interface, be_scope, be_type) -IMPL_NARROW_FROM_DECL (be_interface) -IMPL_NARROW_FROM_SCOPE (be_interface) - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class ACE_Node <be_interface*>; -template class ACE_Unbounded_Queue <be_interface*>; -template class ACE_Unbounded_Queue_Iterator <be_interface*>; -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -#pragma instantiate ACE_Node<be_interface*> -#pragma instantiate ACE_Unbounded_Queue<be_interface*> -#pragma instantiate ACE_Unbounded_Queue_Iterator<be_interface*> -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/TAO/TAO_IDL/be/be_interface_fwd.cpp b/TAO/TAO_IDL/be/be_interface_fwd.cpp deleted file mode 100644 index 68910b7b6de..00000000000 --- a/TAO/TAO_IDL/be/be_interface_fwd.cpp +++ /dev/null @@ -1,628 +0,0 @@ -/* -*- c++ -*- */ -// ============================================================================ -// -// = LIBRARY -// TAO IDL -// -// = FILENAME -// be_interface.h -// -// = DESCRIPTION -// Extension of class AST_Interface_Fwd that provides additional means for C++ -// mapping of an interface. -// -// = AUTHOR -// Copyright 1994-1995 by Sun Microsystems, Inc. -// and -// Aniruddha Gokhale -// -// ============================================================================ - -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -/* - * BE_InterfaceFwd - */ - -be_interface_fwd::be_interface_fwd (void) -{ - this->size_type (be_decl::VARIABLE); // always the case -} - -be_interface_fwd::be_interface_fwd (UTL_ScopedName *n, UTL_StrList *p) - : AST_InterfaceFwd (n, p), - AST_Decl (AST_Decl::NT_interface_fwd, n, p) -{ - this->size_type (be_decl::VARIABLE); // always the case -} - -// ---------------------------------------- -// CODE GENERATION METHODS -// ---------------------------------------- - -// generate the client header -int be_interface_fwd::gen_client_header (void) -{ - TAO_OutStream *ch; // output stream - TAO_NL nl; // end line - - if (!this->cli_hdr_gen_) // not already generated - { - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - // get the client header - ch = cg->client_header (); - - ch->indent (); // start from the current - - // all we do in this is generate a forward declaration of the class - *ch << "class " << this->local_name () << ";" << nl; - - // generate the ifdefined macro for the _ptr type - ch->gen_ifdef_macro (this->flatname (), "_ptr"); - - // generate the _ptr declaration - *ch << "typedef " << this->local_name () << " *" << this->local_name () << - "_ptr; \n"; - - ch->gen_endif (); - - // enclose under an ifdef macro - ch->gen_ifdef_macro (this->flatname (), "_var"); - - // generate the _var declaration - if (this->gen_var_defn () == -1) - { - ACE_ERROR ((LM_ERROR, - "be_interface_fwd - error generating _var definition\n")); - return -1; - } - // gen an endif - ch->gen_endif (); - - // enclose under an ifdef macro - ch->gen_ifdef_macro (this->flatname (), "_out"); - - // generate the _out declaration - ORBOS/97-05-15 pg 16-20 spec - if (this->gen_out_defn () == -1) - { - ACE_ERROR ((LM_ERROR, - "be_interface_fwd - error generating _var definition\n")); - return -1; - } - - // generate the endif macro - ch->gen_endif (); - - this->cli_hdr_gen_ = I_TRUE; - } - return 0; -} - -int -be_interface_fwd::gen_client_stubs (void) -{ - return 0; -} - -int -be_interface_fwd::gen_client_inline (void) -{ - TAO_OutStream *ci; // output stream - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - ci = cg->client_inline (); - - // generate the ifdefined macro for the _var type - ci->gen_ifdef_macro (this->flatname (), "_var"); - - if (this->gen_var_impl () == -1) - { - ACE_ERROR ((LM_ERROR, "be_interface_fwd: _var impl code gen failed\n")); - return -1; - } - - ci->gen_endif (); - - // generate the ifdefined macro for the _out type - ci->gen_ifdef_macro (this->flatname (), "_out"); - - if (this->gen_out_impl () == -1) - { - ACE_ERROR ((LM_ERROR, "be_interface_fwd: _out impl code gen failed\n")); - return -1; - } - ci->gen_endif (); - - return 0; -} - -int -be_interface_fwd::gen_server_header (void) -{ - return 0; -} - -int -be_interface_fwd::gen_server_skeletons (void) -{ - return 0; -} - -int -be_interface_fwd::gen_server_inline (void) -{ - return 0; -} - -// generate the var definition -int -be_interface_fwd::gen_var_defn (void) -{ - TAO_OutStream *ch; // output stream - TAO_NL nl; // end line - char namebuf [NAMEBUFSIZE]; // names - - ACE_OS::memset (namebuf, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (namebuf, "%s_var", this->local_name ()->get_string ()); - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - ch = cg->client_header (); - - // generate the var definition (always in the client header). - // Depending upon the data type, there are some differences which we account - // for over here. - - ch->indent (); // start with whatever was our current indent level - *ch << "class " << namebuf << nl; - *ch << "{" << nl; - *ch << "public:\n"; - ch->incr_indent (); - - // default constr - *ch << namebuf << " (void); // default constructor" << nl; - *ch << namebuf << " (" << local_name () << "_ptr);" << nl; - - // copy constructor - *ch << namebuf << " (const " << namebuf << - " &); // copy constructor" << nl; - - // destructor - *ch << "~" << namebuf << " (void); // destructor" << nl; - *ch << nl; - - // assignment operator from a pointer - *ch << namebuf << " &operator= (" << local_name () << "_ptr);" << nl; - - // assignment from _var - *ch << namebuf << " &operator= (const " << namebuf << - " &);" << nl; - - // arrow operator - *ch << local_name () << "_ptr operator-> (void) const;" << nl; - - *ch << nl; - - // other extra types (cast operators, [] operator, and others) - *ch << "operator const " << local_name () << "_ptr &() const;" << nl; - *ch << "operator " << local_name () << "_ptr &();" << nl; - - *ch << "// in, inout, out, _retn " << nl; - // the return types of in, out, inout, and _retn are based on the parameter - // passing rules and the base type - *ch << local_name () << "_ptr in (void) const;" << nl; - *ch << local_name () << "_ptr &inout (void);" << nl; - *ch << local_name () << "_ptr &out (void);" << nl; - *ch << local_name () << "_ptr _retn (void);" << nl; - - // generate an additional member function that returns the underlying pointer - *ch << local_name () << "_ptr ptr (void) const;\n"; - - *ch << "\n"; - ch->decr_indent (); - - // private - *ch << "private:\n"; - ch->incr_indent (); - *ch << local_name () << "_ptr ptr_;\n"; - - ch->decr_indent (); - *ch << "};\n\n"; - - return 0; -} - -// implementation of the _var class. All of these get generated in the inline -// file -int -be_interface_fwd::gen_var_impl (void) -{ - TAO_OutStream *ci; // output stream - TAO_NL nl; // end line - char fname [NAMEBUFSIZE]; // to hold the full and - char lname [NAMEBUFSIZE]; // local _var names - - ACE_OS::memset (fname, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (fname, "%s_var", this->fullname ()); - - ACE_OS::memset (lname, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (lname, "%s_var", local_name ()->get_string ()); - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - ci = cg->client_inline (); - - // generate the var implementation in the inline file - // Depending upon the data type, there are some differences which we account - // for over here. - - ci->indent (); // start with whatever was our current indent level - - *ci << "// *************************************************************" - << nl; - *ci << "// Inline operations for class " << fname << nl; - *ci << "// *************************************************************\n\n"; - - // default constr - *ci << "ACE_INLINE" << nl; - *ci << fname << "::" << lname << - " (void) // default constructor" << nl; - *ci << "\t" << ": ptr_ (" << this->name () << "::_nil ())" << nl; - *ci << "{}\n\n"; - - // constr from a _ptr - ci->indent (); - *ci << "ACE_INLINE" << nl; - *ci << fname << "::" << lname << " (" << name () << "_ptr p)" << nl; - *ci << "\t: ptr_ (p)" << nl; - *ci << "{}\n\n"; - - // the additional ptr () member function. This member function must be - // defined before the remaining member functions including the copy - // constructor because this inline function is used elsewhere. Hence to make - // inlining of this function possible, we must define it before its use. - ci->indent (); - *ci << "ACE_INLINE " << name () << "_ptr " << nl; - *ci << fname << "::ptr (void) const" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // copy constructor - ci->indent (); - *ci << "ACE_INLINE" << nl; - *ci << fname << "::" << lname << " (const " << fname << - " &p) // copy constructor" << nl; - *ci << "\t: ptr_ (" << name () << "::_duplicate (p.ptr ()))" << nl; - *ci << "{}\n\n"; - - // destructor - ci->indent (); - *ci << "ACE_INLINE" << nl; - *ci << fname << "::~" << lname << " (void) // destructor" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "CORBA::release (this->ptr_);\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // assignment operator - ci->indent (); - *ci << "ACE_INLINE " << fname << " &" << nl; - *ci << fname << "::operator= (" << name () << - "_ptr p)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "CORBA::release (this->ptr_);" << nl; - *ci << "this->ptr_ = p;" << nl; - *ci << "return *this;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // assignment operator from _var - ci->indent (); - *ci << "ACE_INLINE " << fname << " &" << nl; - *ci << fname << "::operator= (const " << fname << - " &p)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "if (this != &p)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "CORBA::release (this->ptr_);" << nl; - *ci << "this->ptr_ = " << name () << "::_duplicate (p.ptr ());\n"; - ci->decr_indent (); - *ci << "}" << nl; - *ci << "return *this;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // other extra methods - cast operator () - ci->indent (); - *ci << "ACE_INLINE " << nl; - *ci << fname << "::operator const " << name () << - "_ptr &() const // cast" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - ci->indent (); - *ci << "ACE_INLINE " << nl; - *ci << fname << "::operator " << name () << "_ptr &() // cast " << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // operator-> - ci->indent (); - *ci << "ACE_INLINE " << name () << "_ptr " << nl; - *ci << fname << "::operator-> (void) const" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // in, inout, out, and _retn - ci->indent (); - *ci << "ACE_INLINE " << name () << "_ptr" << nl; - *ci << fname << "::in (void) const" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - ci->indent (); - *ci << "ACE_INLINE " << name () << "_ptr &" << nl; - *ci << fname << "::inout (void)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - ci->indent (); - *ci << "ACE_INLINE " << name () << "_ptr &" << nl; - *ci << fname << "::out (void)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "CORBA::release (this->ptr_);" << nl; - *ci << "this->ptr_ = " << this->name () << "::_nil ();" << nl; - *ci << "return this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - ci->indent (); - *ci << "ACE_INLINE " << name () << "_ptr " << nl; - *ci << fname << "::_retn (void)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "// yield ownership of managed obj reference" << nl; - *ci << this->name () << "_ptr val = this->ptr_;" << nl; - *ci << "this->ptr_ = " << this->name () << "::_nil ();" << nl; - *ci << "return val;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - return 0; -} - -// generate the _out definition -int -be_interface_fwd::gen_out_defn (void) -{ - TAO_OutStream *ch; // output stream - TAO_NL nl; // end line - char namebuf [NAMEBUFSIZE]; // to hold the _out name - - ACE_OS::memset (namebuf, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (namebuf, "%s_out", local_name ()->get_string ()); - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - ch = cg->client_header (); - - // generate the out definition (always in the client header) - ch->indent (); // start with whatever was our current indent level - - *ch << "class " << namebuf << nl; - *ch << "{" << nl; - *ch << "public:\n"; - ch->incr_indent (); - - // No default constructor - - // constructor from a pointer - *ch << namebuf << " (" << local_name () << "_ptr &);" << nl; - // constructor from a _var & - *ch << namebuf << " (" << local_name () << "_var &);" << nl; - // constructor from a _out & - *ch << namebuf << " (" << namebuf << " &);" << nl; - // assignment operator from a _out & - *ch << namebuf << " &operator= (" << namebuf << " &);" << nl; - // assignment operator from a pointer &, cast operator, ptr fn, operator - // -> and any other extra operators - // only interface allows assignment from var & - *ch << namebuf << " &operator= (const " << local_name () << "_var &);" << nl; - *ch << namebuf << " &operator= (" << local_name () << "_ptr);" << nl; - // cast - *ch << "operator " << local_name () << "_ptr &();" << nl; - // ptr fn - *ch << local_name () << "_ptr &ptr (void);" << nl; - // operator -> - *ch << local_name () << "_ptr operator-> (void);" << nl; - - *ch << "\n"; - ch->decr_indent (); - *ch << "private:\n"; - ch->incr_indent (); - *ch << local_name () << "_ptr &ptr_;\n"; - - ch->decr_indent (); - *ch << "};\n\n"; - - return 0; -} - -int -be_interface_fwd::gen_out_impl (void) -{ - TAO_OutStream *ci; // output stream - TAO_NL nl; // end line - char fname [NAMEBUFSIZE]; // to hold the full and - char lname [NAMEBUFSIZE]; // local _out names - - ACE_OS::memset (fname, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (fname, "%s_out", this->fullname ()); - - ACE_OS::memset (lname, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (lname, "%s_out", local_name ()->get_string ()); - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - ci = cg->client_inline (); - - // generate the var implementation in the inline file - // Depending upon the data type, there are some differences which we account - // for over here. - - ci->indent (); // start with whatever was our current indent level - - *ci << "// *************************************************************" - << nl; - *ci << "// Inline operations for class " << fname << nl; - *ci << "// *************************************************************\n\n"; - - // constr from a _ptr - ci->indent (); - *ci << "ACE_INLINE" << nl; - *ci << fname << "::" << lname << " (" << name () << "_ptr &p)" << nl; - *ci << "\t: ptr_ (p)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "this->ptr_ = " << this->name () << "::_nil ();\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // constructor from _var & - ci->indent (); - *ci << "ACE_INLINE" << nl; - *ci << fname << "::" << lname << " (" << this->name () << - "_var &p) // constructor from _var" << nl; - *ci << "\t: ptr_ (p.out ())" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "CORBA::release (this->ptr_);" << nl; - *ci << "this->ptr_ = " << this->name () << "::_nil ();\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // copy constructor - ci->indent (); - *ci << "ACE_INLINE" << nl; - *ci << fname << "::" << lname << " (" << fname << - " &p) // copy constructor" << nl; - *ci << "\t: ptr_ (p.ptr_)" << nl; - *ci << "{}\n\n"; - - // assignment operator from _out & - ci->indent (); - *ci << "ACE_INLINE " << fname << " &" << nl; - *ci << fname << "::operator= (" << fname << - " &p)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "this->ptr_ = p.ptr_;" << nl; - *ci << "return *this;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // assignment operator from _var - ci->indent (); - *ci << "ACE_INLINE " << fname << " &" << nl; - *ci << fname << "::operator= (const " << this->name () << - "_var &p)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "this->ptr_ = " << this->name () << "::_duplicate (p.ptr ());" << nl; - *ci << "return *this;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // assignment operator from _ptr - ci->indent (); - *ci << "ACE_INLINE " << fname << " &" << nl; - *ci << fname << "::operator= (" << this->name () << - "_ptr p)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "this->ptr_ = p;" << nl; - *ci << "return *this;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // other extra methods - cast operator () - ci->indent (); - *ci << "ACE_INLINE " << nl; - *ci << fname << "::operator " << this->name () << - "_ptr &() // cast" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // ptr function - ci->indent (); - *ci << "ACE_INLINE " << this->name () << "_ptr &" << nl; - *ci << fname << "::ptr (void) // ptr" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // operator-> - ci->indent (); - *ci << "ACE_INLINE " << this->name () << "_ptr " << nl; - *ci << fname << "::operator-> (void)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - return 0; -} -int -be_interface_fwd::gen_typecode (void) -{ - return 0; -} - -long -be_interface_fwd::tc_size (void) -{ - return 0; -} - -// Narrowing -IMPL_NARROW_METHODS2 (be_interface_fwd, AST_InterfaceFwd, be_type) -IMPL_NARROW_FROM_DECL (be_interface_fwd) diff --git a/TAO/TAO_IDL/be/be_module.cpp b/TAO/TAO_IDL/be/be_module.cpp deleted file mode 100644 index d66a7ace2bb..00000000000 --- a/TAO/TAO_IDL/be/be_module.cpp +++ /dev/null @@ -1,211 +0,0 @@ -// ============================================================================ -// -// = LIBRARY -// TAO IDL -// -// = FILENAME -// be_module.cpp -// -// = DESCRIPTION -// Extension of class AST_Module that provides additional means for C++ -// mapping of a module -// -// = AUTHOR -// Copyright 1994-1995 by Sun Microsystems, Inc. -// and -// Aniruddha Gokhale -// -// ============================================================================ - -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -/* - * BE_Module - */ -be_module::be_module (void) -{ -} - -be_module::be_module (UTL_ScopedName *n, UTL_StrList *p) - : AST_Decl (AST_Decl::NT_module, n, p), - UTL_Scope (AST_Decl::NT_module) -{ -} - -// ---------------------------------------- -// CODE GENERATION METHODS -// ---------------------------------------- - -// generate the client header -int be_module::gen_client_header (void) -{ - TAO_OutStream *ch; // output stream - TAO_NL nl; // end line - - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - cg->push (TAO_CodeGen::TAO_MODULE_CH); // set the current code generation state - ch = cg->client_header (); // get the stream - - // XXXASG - Modules really map to namespace. We need to see if our target - // compiler supports namespaces or not. For this release we opt to generate a - // class definition for a module - - ch->indent (); // start with whatever indentation level we are at - - // now generate the class definition - *ch << "class " << local_name (); - - // generate the body - *ch << "{" << nl; - *ch << "public:\n"; - ch->incr_indent (0); - - // generate code for the module definition by traversing thru the - // elements of its scope. We depend on the front-end to have made sure - // that only legal syntactic elements appear in our scope. - if (be_scope::gen_client_header () == -1) - { - ACE_ERROR ((LM_ERROR, "be_module::gen_client_header\n")); - ACE_ERROR ((LM_ERROR, "Scope code generation failure\n")); - return -1; - } - - ch->decr_indent (); - *ch << "};\n\n"; - cg->pop (); - return 0; -} - -int be_module::gen_client_stubs (void) -{ - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - cg->push (TAO_CodeGen::TAO_MODULE_CS); // set the current code generation state - - // gen code for elements in the scope - if (be_scope::gen_client_stubs () == -1) - { - ACE_ERROR ((LM_ERROR, "be_module::gen_client_stubs\n")); - ACE_ERROR ((LM_ERROR, "Scope code generation failure\n")); - return -1; - } - - cg->pop (); - return 0; -} - -int be_module::gen_server_header (void) -{ - TAO_OutStream *sh; // output stream - TAO_NL nl; // end line - AST_Decl *d; - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - cg->push (TAO_CodeGen::TAO_MODULE_SH); // set the current code generation state - - sh = cg->server_header (); - - // generate the skeleton class name - - sh->indent (); // start with whatever indentation level we are at - - // now generate the class definition. The prefix POA_ is prepended to our - // name only if we are the outermost module - d = ScopeAsDecl (this->defined_in ()); - if (d->node_type () == AST_Decl::NT_root) - // we are outermost module - *sh << "class POA_" << local_name () << nl; - else - // we are inside another module - *sh << "class " << local_name () << nl; - - *sh << "{" << nl; - *sh << "public:\n"; - sh->incr_indent (0); - - if (be_scope::gen_server_header () == -1) - { - ACE_ERROR ((LM_ERROR, "be_module::gen_server_header\n")); - ACE_ERROR ((LM_ERROR, "Scope code generation failure\n")); - return -1; - } - - sh->decr_indent (); - *sh << "};\n\n"; - cg->pop (); - return 0; -} - -int be_module::gen_server_skeletons (void) -{ - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - cg->push (TAO_CodeGen::TAO_MODULE_SS); // set the current code generation state - - if (be_scope::gen_server_skeletons () == -1) - { - ACE_ERROR ((LM_ERROR, "be_module::gen_server_skeletons\n")); - ACE_ERROR ((LM_ERROR, "Scope code generation failure\n")); - return -1; - } - cg->pop (); - return 0; -} - -// Generates the client-side inline information -int -be_module::gen_client_inline (void) -{ - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - cg->push (TAO_CodeGen::TAO_MODULE_CI); // set the current code generation state - - // gen code for elements in the scope - if (be_scope::gen_client_inline () == -1) - { - ACE_ERROR ((LM_ERROR, "be_module::gen_client_inline\n")); - ACE_ERROR ((LM_ERROR, "Scope code generation failure\n")); - return -1; - } - - cg->pop (); - return 0; -} - -// Generates the server-side inline -int -be_module::gen_server_inline (void) -{ - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - cg->push (TAO_CodeGen::TAO_MODULE_SI); // set the current code generation state - - // gen code for elements in the scope - if (be_scope::gen_server_inline () == -1) - { - ACE_ERROR ((LM_ERROR, "be_module::gen_server_inline\n")); - ACE_ERROR ((LM_ERROR, "Scope code generation failure\n")); - return -1; - } - - cg->pop (); - return 0; -} - -// compute the size type of the node in question -int -be_module::compute_size_type (void) -{ - // our size does not matter - return 0; -} - -// Narrowing -IMPL_NARROW_METHODS3 (be_module, AST_Module, be_scope, be_decl) -IMPL_NARROW_FROM_DECL (be_module) -IMPL_NARROW_FROM_SCOPE (be_module) diff --git a/TAO/TAO_IDL/be/be_operation.cpp b/TAO/TAO_IDL/be/be_operation.cpp deleted file mode 100644 index d326c64c285..00000000000 --- a/TAO/TAO_IDL/be/be_operation.cpp +++ /dev/null @@ -1,834 +0,0 @@ -// ============================================================================ -// -// = LIBRARY -// TAO IDL -// -// = FILENAME -// be_operation.cpp -// -// = DESCRIPTION -// Extension of class AST_Operation that provides additional means for C++ -// mapping. -// -// = AUTHOR -// Copyright 1994-1995 by Sun Microsystems, Inc. -// and -// Aniruddha Gokhale -// -// ============================================================================ - -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -/* - * BE_Operation - */ -be_operation::be_operation (void) - : argument_count_ (-1) -{ -} - -be_operation::be_operation (AST_Type *rt, AST_Operation::Flags fl, - UTL_ScopedName *n, UTL_StrList *p) - : AST_Operation (rt, fl, n, p), - AST_Decl (AST_Decl::NT_op, n, p), - UTL_Scope (AST_Decl::NT_op), - argument_count_ (-1) -{ -} - -// compute total number of members -int -be_operation::compute_argument_count (void) -{ - UTL_ScopeActiveIterator *si; // iterator - AST_Decl *d; // temp node - - this->argument_count_ = 0; - - // if there are elements in this scope - if (this->nmembers () > 0) - { - // instantiate a scope iterator. - si = new UTL_ScopeActiveIterator (this, UTL_Scope::IK_decls); - - while (!(si->is_done ())) - { - // get the next AST decl node - d = si->item (); - if (!d->imported () && d->node_type () == AST_Decl::NT_argument) - this->argument_count_++; - si->next (); - } // end of while - delete si; // free the iterator object - } - return 0; -} - -// return the member count -int -be_operation::argument_count (void) -{ - if (this->argument_count_ == -1) - this->compute_argument_count (); - - return this->argument_count_; -} - -// ---------------------------------------- -// CODE GENERATION METHODS -// ---------------------------------------- - -int -be_operation::gen_client_header (void) -{ - TAO_OutStream *ch; // output stream - be_type *bt; // type node - be_state *s; // state based code gen object - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - ch = cg->client_header (); - - ch->indent (); // start with the current indentation level - - // every operation is declared virtual in the client code - *ch << "virtual "; - - // first generate the return type - bt = be_type::narrow_from_decl (this->return_type ()); - cg->push (TAO_CodeGen::TAO_OPERATION_CH); // we are now generating an - // operation definition with the - // return type first - - s = cg->make_state (); // retrieve state based object - - if (!s || !bt || (s->gen_code (bt, this) == -1)) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_operation::gen_client_header - " - "return type generation failure\n"), - -1); - } - cg->pop (); // restore previous state - - // generate the operation name - *ch << " " << this->local_name () << " ("; - - // generate the arguments with the appropriate mapping - cg->push (TAO_CodeGen::TAO_ARGUMENT_CH); // generating code for arguments in - // the signature - if (be_scope::gen_client_header () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_operation::gen_client_header - " - "failed in argument generation in signature\n"), - -1); - } - cg->pop (); - - // XXXASG - // additional argument in the form of CORBA::Environment since TAO does not - // yet support C++ style Exceptions. However, we can have an option to the - // "tao" IDL compiler to ask it to generate code for exceptions. This will be - // handled in a later release. - *ch << "CORBA::Environment &env);\n"; - - return 0; -} - -int -be_operation::gen_client_stubs (void) -{ - TAO_OutStream *cs; // output stream - TAO_NL nl; // end line - be_type *bt; // type node - UTL_ScopeActiveIterator *si; // scope iterator - AST_Decl *d; // temp node - be_argument *bd; // argument node - be_predefined_type *bpd=0; // predefined type used for return VOID type - be_state *s; // state based code gen object - long paramtblsize = 0; // size of the paradata table - - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - cs = cg->client_stubs (); - - // for each operation, generate the paramdata and calldata tables followed by - // the actual stub - - cs->indent (); // start with current indentation level - - // retrieve the return type - bt = be_type::narrow_from_decl (this->return_type ()); - - // bt holds the return type. Declare a variable that will hold the return - // type. However, we must be careful if the return type is a void - if (bt->node_type () == AST_Decl::NT_pre_defined) - { - bpd = be_predefined_type::narrow_from_decl (bt); - } - - // generate the TAO_Param_Data table - *cs << "static const TAO_Param_Data " << this->flatname () << - "_paramdata [] = " << nl; - *cs << "{\n"; - cs->incr_indent (); - - // entry for the return type - *cs << "{" << bt->tc_name () << ", PARAM_RETURN, "; - // Are we returning a pointer to value? i.e., is the type variable? If it is, - // we must tell the stub what is the size of the top level structure - if (bt->size_type () == be_decl::VARIABLE) - { - switch (bt->node_type ()) - { - case AST_Decl::NT_interface: - case AST_Decl::NT_interface_fwd: - case AST_Decl::NT_string: - // no need of size here - *cs << "0}"; - break; - case AST_Decl::NT_pre_defined: - { - be_predefined_type *bpd = be_predefined_type::narrow_from_decl - (bt); - if (bpd->pt () == AST_PredefinedType::PT_pseudo) - // no need of size here - *cs << "0}"; - else - *cs << "sizeof (" << bt->name () << ")}"; - } - break; - default: - *cs << "sizeof (" << bt->name () << ")}"; - } - } - else - *cs << "0}"; - paramtblsize++; - // if we have any arguments, get each one of them - if (this->nmembers () > 0) - { - // if there are elements in this scope - - si = new UTL_ScopeActiveIterator (this, UTL_Scope::IK_decls); - // instantiate a scope iterator. - - while (!(si->is_done ())) - { - // get the next AST decl node - d = si->item (); - // only if this is an argument node - if (d->node_type () == AST_Decl::NT_argument) - { - bd = be_argument::narrow_from_decl (d); - bt = be_type::narrow_from_decl (bd->field_type ()); - *cs << "," << nl; // put a comma and newline before the - // previous entry - *cs << "{" << bt->tc_name (); - // based on the direction, output the appropriate constant. - switch (bd->direction ()) - { - case AST_Argument::dir_IN: - *cs << ", PARAM_IN, 0}"; - break; - case AST_Argument::dir_INOUT: - *cs << ", PARAM_INOUT, 0}"; - break; - case AST_Argument::dir_OUT: - { - *cs << ", PARAM_OUT, 0}"; -#if 0 - // Are we returning a pointer to value? i.e., is the type variable? If it is, - // we must tell the stub what is the size of the top level structure - if (bt->size_type () == be_decl::VARIABLE) - { - switch (bt->node_type ()) - { - case AST_Decl::NT_interface: - case AST_Decl::NT_interface_fwd: - // no need of size here - *cs << "0}"; - break; - case AST_Decl::NT_pre_defined: - { - be_predefined_type *bpd = - be_predefined_type::narrow_from_decl (bt); - if (bpd->pt () == AST_PredefinedType::PT_pseudo) - // no need of size here - *cs << "0}"; - else - *cs << "sizeof (" << bt->name () << ")}"; - } - break; - default: - *cs << "sizeof (" << bt->name () << ")}"; - } - } - else - *cs << "0}"; -#endif - } - break; - } // end switch - paramtblsize++; - } // end if argument node - si->next (); - } // end of while - delete si; // free the iterator object - } // end of arg list - *cs << "\n"; - cs->decr_indent (); - *cs << "};\n\n"; - - // now generate the calldata table - - cs->indent (); - *cs << "static const TAO_Call_Data " << this->flatname () << "_calldata = " - << nl; - *cs << "{"; - *cs << "\"" << this->local_name () << "\", "; - - // are we oneway or two operation? - if (this->flags () == AST_Operation::OP_oneway) - { - *cs << "0, "; // for false - } - else - { - *cs << "1, "; // for true - } - // insert the size of the paramdata table - *cs << paramtblsize << ", "; - - // insert the address of the paramdata table - *cs << this->flatname () << "_paramdata, "; - - // XXXASG - Exception list goes here (if it exists) - TODO - *cs << "0, 0};\n\n"; - - // now generate the actual stub - - // retrieve the return type again because we have used bt to also retrieve - // the argument types - bt = be_type::narrow_from_decl (this->return_type ()); - - // bt holds the return type. Declare a variable that will hold the return - // type. However, we must be careful if the return type is a void - if (bt->node_type () == AST_Decl::NT_pre_defined) - { - bpd = be_predefined_type::narrow_from_decl (bt); - } - - // first generate the return type - cs->indent (); - cg->push (TAO_CodeGen::TAO_OPERATION_RETURN_TYPE_CS); // declare a return - // type of the stub - s = cg->make_state (); - if (!s || !bt || (s->gen_code (bt, this) == -1)) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_operation::gen_client_stubs - " - "return type generation failure\n"), - -1); - } - cg->pop (); - - // generate the operation name - *cs << " " << this->name () << " ("; - - // generate the arguments with the appropriate mapping - cg->push (TAO_CodeGen::TAO_ARGUMENT_CS); // generating code for arguments in - // the signature - if (be_scope::gen_client_stubs () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_operation::gen_client_stubs - " - "failure in argument generation in signature\n"), - -1); - } - cg->pop (); - - // last argument - is always CORBA::Environment - *cs << "CORBA::Environment &env)" << nl; - *cs << "{\n"; - cs->incr_indent (); - - // declare a return type - cg->push (TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_CS); - s = cg->make_state (); - if (!s || !bt || (s->gen_code (bt, this) == -1)) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_operation::gen_client_stubs - " - "retval declaration failure\n"), - -1); - } - cg->pop (); - - // generate code that calls QueryInterface - *cs << "STUB_Object *istub;\n\n"; - cs->indent (); - *cs << "if (this->QueryInterface (IID_STUB_Object, " << - "(void **)&istub) != TAO_NOERROR)" << nl; - *cs << "{\n"; - cs->incr_indent (); - *cs << "env.exception (new CORBA::DATA_CONVERSION (CORBA::COMPLETED_NO));" << - nl; - - // return the appropriate error value on exception - cg->push (TAO_CodeGen::TAO_OPERATION_RETVAL_EXCEPTION_CS); - s = cg->make_state (); - if (!s || !bt || (s->gen_code (bt, this) == -1)) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_operation::gen_client_stubs - " - "failure returning from exception\n"), - -1); - } - cg->pop (); - - cs->decr_indent (); - *cs << "}" << nl; - *cs << "this->Release (); // QueryInterface has bumped up our refcount" << nl; - - // do any pre do_call stuff with arguments - cg->push (TAO_CodeGen::TAO_ARGUMENT_PRE_DOCALL_CS); - if (be_scope::gen_client_stubs () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_operation::gen_client_stubs - " - "failure generating pre docall stuff\n"), - -1); - } - cg->pop (); - - // call do_call with appropriate number of arguments - *cs << "istub->do_call (env, &" << this->flatname () << "_calldata"; - - // if our return type is not void, then pass the address of retval - if (!bpd || (bpd->pt () != AST_PredefinedType::PT_void)) - { - *cs << ", &retval"; - } - else - { - // pass a 0 - *cs << ", 0"; - } - - cg->push (TAO_CodeGen::TAO_ARGUMENT_DOCALL_CS); - if (be_scope::gen_client_stubs () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_operation::gen_client_stubs - " - "failed to emit code for arguments in docall\n"), - -1); - } - cg->pop (); - *cs << ");" << nl; - - // do any post do_call stuff with arguments - cg->push (TAO_CodeGen::TAO_ARGUMENT_POST_DOCALL_CS); - if (be_scope::gen_client_stubs () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_operation::gen_client_stubs - " - "failed to emit code for post docall processing\n"), - -1); - } - cg->pop (); - - // return the retval - cg->push (TAO_CodeGen::TAO_OPERATION_RETVAL_RETURN_CS); - s = cg->make_state (); - if (!s || !bt || (s->gen_code (bt, this) == -1)) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_operation::gen_client_stubs\n" - "return val return generation failure\n"), - -1); - } - cg->pop (); - - cs->decr_indent (0); - *cs << "\n}\n\n"; - return 0; -} - -int -be_operation::gen_server_header (void) -{ - TAO_OutStream *sh; // output stream - be_type *bt; // type node - be_state *s; // state based code generator object - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - cg->push (TAO_CodeGen::TAO_OPERATION_SH); // we are now generating an - // operation definition - - sh = cg->server_header (); - sh->indent (); // start with the current indentation level - - // every operation is declared virtual - *sh << "virtual "; - - // first generate the return type - bt = be_type::narrow_from_decl (this->return_type ()); - s = cg->make_state (); // retrieve code gen object for this state - if (!s || !bt || (s->gen_code (bt, this) == -1)) - { - ACE_ERROR ((LM_ERROR, "be_operation::gen_server_header\n")); - ACE_ERROR ((LM_ERROR, "return type generation failure\n")); - return -1; - } - // generate the operation name - *sh << " " << this->local_name () << " ("; - - // generate the arguments with the appropriate mapping - cg->push (TAO_CodeGen::TAO_ARGUMENT_SH); // generating code for arguments in - // the signature - if (be_scope::gen_server_header () == -1) - { - ACE_ERROR ((LM_ERROR, "be_operation::gen_server_header\n")); - ACE_ERROR ((LM_ERROR, "Argument generation failure\n")); - return -1; - } - cg->pop (); - - // XXXASG - // additional argument in the form of CORBA::Environment since TAO does not - // yet support Exceptions. However, we can have an option to the "tao" IDL - // compiler to ask it to generate code for exceptions. This will be handled - // in a later release. - *sh << " CORBA::Environment &env) = 0; // pure virtual\n"; - - sh->indent (); - - // generate the static method corresponding to this method - *sh << "static void " << this->local_name () << - "_skel (CORBA::ServerRequest &req, void *obj," - << " void *context, CORBA::Environment &env);\n\n"; - cg->pop (); // restore previous state - return 0; -} - -// Generate code for the operation skeleton that makes the upcall. -// Special Note: We deviate a bit from our policy of handing over code -// generation for elements in our scope to the be_scope class. For this method, -// it is best to simulate that behavior here as it involves a lot of -// complexity. -int -be_operation::gen_server_skeletons (void) -{ - TAO_OutStream *ss; // output stream - TAO_NL nl; // end line - be_type *bt; // type node - be_type *rt; // type node for the return type - UTL_ScopeActiveIterator *si; // scope iterator - AST_Decl *d; // temp node - be_argument *bd = 0; // argument node - be_state *s; // state based code gen object - be_predefined_type *bpd=0; // predefined return type - be_interface *intf; // enclosing interface node - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - ss = cg->server_skeletons (); - - ss->indent (); // start with the current indentation level - - // retrieve our enclosing interface decl - intf = be_interface::narrow_from_decl (ScopeAsDecl (this->defined_in ())); - - *ss << "void " << intf->full_skel_name () << "::" - << this->local_name () << "_skel (" - << "CORBA::ServerRequest &_tao_server_request, " - //@@XXASG << "CORBA::Object_ptr _tao_object_reference, " - << "void *_tao_object_reference, " - << "void *context, " - << "CORBA::Environment &_tao_environment)" << nl; - *ss << "{\n"; - ss->incr_indent (); - *ss << "ACE_UNUSED_ARG (context);" << nl; - // define an NVList to hold arguments - *ss << "CORBA::NVList_ptr \t nvlist;" << nl; - // define a variable that will eventually point to our implementation object - *ss << intf->full_skel_name () << "_ptr \t impl = (" << intf->full_skel_name - () << "_ptr) _tao_object_reference;" << nl; - - // verify if we need to define a variable intended to hold the operation - // return type. We do not need one if the return type is void - - rt = be_type::narrow_from_decl (this->return_type ()); - if (!rt) - { - ACE_ERROR ((LM_ERROR, - "be_operation::gen_server_skeletons - bad return type\n")); - return -1; - } - if (rt->node_type () == AST_Decl::NT_pre_defined) - { - bpd = be_predefined_type::narrow_from_decl (rt); - } - if (!bpd || (bpd->pt () != AST_PredefinedType::PT_void)) - { - // not a void type - *ss << "CORBA::Any *result;" << nl; - - // emit the return type - cg->push (TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_SS); // emit type for - // return value - // get a state based code gen object - s = cg->make_state (); - - if (s->gen_code (rt, this) == -1) - { - ACE_ERROR ((LM_ERROR, - "be_operation::gen_server_skeletons - codegen failed for return type\n")); - return -1; - } - cg->pop (); - } - -#if 0 - // if we have any arguments, get each one of them and allocate an Any and - // NamedValue for each. In addition, define a variable of that type - cg->push (TAO_CodeGen::TAO_ARGUMENT_VARDECL_SS); - if (be_scope::gen_server_skeletons () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "be_operation::gen_server_skeletons - argument gen code failed\n"), - -1); - } - *ss << "\n"; - cg->pop (); - -#endif - - // declare an NVList and create one - ss->indent (); - *ss << "// create an NV list and populate it with typecodes" << nl; - *ss << "_tao_server_request.orb ()->create_list (" << this->argument_count () - << ", nvlist); // initialize a list" << nl; - - // add each argument according to the in, out, inout semantics - if (this->nmembers () > 0) - { - *ss << "// add each argument according to the in, out, inout semantics" - << nl; - // if we have any arguments, insert its typecode and a pointer to storage - // for the variable - cg->push (TAO_CodeGen::TAO_ARGUMENT_VARDECL_SS); - s = cg->make_state (); - if (!s) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_operation::" - "gen_server_skeletons - " - "Bad state\n"), - -1); - } - - // if there are elements in this scope - si = new UTL_ScopeActiveIterator (this, UTL_Scope::IK_decls); - // instantiate a scope iterator. - - while (!(si->is_done ())) - { - // get the next AST decl node - d = si->item (); - if (!d->imported ()) - { - // only if this is an argument node - if (d->node_type () == AST_Decl::NT_argument) - { - bd = be_argument::narrow_from_decl (d); - if (!bd) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_operation::" - "gen_server_skeletons - " - "Bad argument\n"), - -1); - } - bt = be_type::narrow_from_decl (bd->field_type ()); - if (!bt) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_operation::" - "gen_server_skeletons - " - "Bad type\n"), - -1); - } - // emit code that adds this argument to the NVList -#if 0 - *ss << "nv_" << bd->local_name () << - " = nvlist->add_value (\"" << bd->local_name () << "\", " - << "any_" << bd->local_name () << ", "; - switch (bd->direction ()) - { - case AST_Argument::dir_IN: - *ss << "CORBA::ARG_IN, _tao_environment);" << nl; - break; - case AST_Argument::dir_INOUT: - *ss << "CORBA::ARG_INOUT, _tao_environment);" << nl; - break; - case AST_Argument::dir_OUT: - *ss << "CORBA::ARG_OUT, _tao_environment);" << nl; - break; - } -#endif - if (s->gen_code (bt, bd) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_operation::" - "gen_server_skeletons - " - "state based code gen failed\n"), - -1); - } - } // end if argument node - } // end if ! imported - si->next (); - } // end of while - delete si; // free the iterator object - cg->pop (); - } // end of arg list - - // parse the arguments - *ss << "// parse the arguments" << nl; - *ss << "_tao_server_request.params (nvlist, _tao_environment);" << nl; - *ss << "if (_tao_environment.exception ()) return;" << nl; - - cg->push (TAO_CodeGen::TAO_ARGUMENT_PRE_UPCALL_SS); - if (be_scope::gen_server_skeletons () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "be_operation::gen_server_skeletons - argument gen code failed\n"), - -1); - } - cg->pop (); - - // make the upcall - // *ss << "impl = (" << intf->full_skel_name () << "_ptr) _tao_object_reference->get_subclass ();" - // << nl; - if (!bpd || (bpd->pt () != AST_PredefinedType::PT_void)) - { - cg->push (TAO_CodeGen::TAO_OPERATION_RETVAL_ASSIGN_SS); - s = cg->make_state (); - // emit code to assign to retval - if (!s || (s->gen_code (rt, this) == -1)) - { - return -1; - } - *ss << " = impl->" << this->local_name () << "("; - cg->pop (); - } - else - { - // void return type - *ss << "impl->" << this->local_name () << "("; - } - - cg->push (TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS); - if (be_scope::gen_server_skeletons () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "be_operation::gen_server_skeletons - argument in upcall\n"), - -1); - } - cg->pop (); - *ss << "_tao_environment);" << nl; - - cg->push (TAO_CodeGen::TAO_ARGUMENT_POST_UPCALL_SS); - if (be_scope::gen_server_skeletons () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "be_operation::gen_server_skeletons - argument gen code failed\n"), - -1); - } - cg->pop (); - - // if there is any return type, send it via the ServerRequest - if (!bpd || (bpd->pt () != AST_PredefinedType::PT_void)) - { - cg->push (TAO_CodeGen::TAO_OPERATION_RESULT_SS); - s = cg->make_state (); - if (!s || (s->gen_code (rt, this) == -1)) - return -1; - cg->pop (); - *ss << "_tao_server_request.result (result, _tao_environment);" << nl; - } - *ss << "\n"; - ss->decr_indent (); - *ss << "}\n\n"; - - return 0; -} - -// Generates the client-side inline information -int -be_operation::gen_client_inline (void) -{ - // nothing to be done - return 0; -} - -// Generates the server-side inline -int -be_operation::gen_server_inline (void) -{ - // nothing to be done - return 0; -} - -// compute the size type of the node in question -int -be_operation::compute_size_type (void) -{ - UTL_ScopeActiveIterator *si; - AST_Decl *d; - be_decl *bd; - - if (this->nmembers () > 0) - { - // if there are elements in this scope - - si = new UTL_ScopeActiveIterator (this, UTL_Scope::IK_decls); - // instantiate a scope iterator. - - while (!(si->is_done ())) - { - // get the next AST decl node - d = si->item (); - bd = be_decl::narrow_from_decl (d); - if (bd != 0) - { - // our sizetype depends on the sizetype of our members. Although - // previous value of sizetype may get overwritten, we are - // guaranteed by the "size_type" call that once the value reached - // be_decl::VARIABLE, nothing else can overwrite it. - this->size_type (bd->size_type ()); - } - else - { - ACE_DEBUG ((LM_DEBUG, - "WARNING (%N:%l) be_operation::compute_size_type - " - "narrow_from_decl returned 0\n")); - } - si->next (); - } // end of while - delete si; // free the iterator object - } - return 0; -} - -// Narrowing -IMPL_NARROW_METHODS3 (be_operation, AST_Operation, be_scope, be_decl) -IMPL_NARROW_FROM_DECL (be_operation) -IMPL_NARROW_FROM_SCOPE (be_operation) diff --git a/TAO/TAO_IDL/be/be_predefined_type.cpp b/TAO/TAO_IDL/be/be_predefined_type.cpp deleted file mode 100644 index 8029132e871..00000000000 --- a/TAO/TAO_IDL/be/be_predefined_type.cpp +++ /dev/null @@ -1,437 +0,0 @@ -// ============================================================================ -// -// = LIBRARY -// TAO IDL -// -// = FILENAME -// be_predefined_type.cpp -// -// = DESCRIPTION -// Extension of class AST_PredefinedType that provides additional means for C++ -// mapping. -// -// = AUTHOR -// Copyright 1994-1995 by Sun Microsystems, Inc. -// and -// Aniruddha Gokhale -// -// ============================================================================ - -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -/* - * BE_PredefinedType - */ -be_predefined_type::be_predefined_type (void) -{ -} - -be_predefined_type::be_predefined_type (AST_PredefinedType::PredefinedType t, - UTL_ScopedName *n, UTL_StrList *p) - : AST_PredefinedType (t, n, p), - AST_Decl (AST_Decl::NT_pre_defined, n, p) -{ - // generate a new Scoped Name for us such that we belong to the CORBA - // namespace - if (this->pt () != AST_PredefinedType::PT_void) - { - - UTL_ScopedName *new_name = new UTL_ScopedName (new Identifier ("CORBA", 1, 0, - I_FALSE), - NULL); - switch (this->pt ()) - { - case AST_PredefinedType::PT_long: - { - new_name->nconc (new UTL_ScopedName (new Identifier ("Long", 1, 0, - I_FALSE), NULL)); - } - break; - case AST_PredefinedType::PT_ulong: - { - new_name->nconc (new UTL_ScopedName (new Identifier ("ULong", 1, 0, - I_FALSE), NULL)); - } - break; - case AST_PredefinedType::PT_short: - { - new_name->nconc (new UTL_ScopedName (new Identifier ("Short", 1, 0, - I_FALSE), NULL)); - } - break; - case AST_PredefinedType::PT_ushort: - { - new_name->nconc (new UTL_ScopedName (new Identifier ("UShort", 1, 0, - I_FALSE), NULL)); - } - break; - case AST_PredefinedType::PT_float: - { - new_name->nconc (new UTL_ScopedName (new Identifier ("Float", 1, 0, - I_FALSE), NULL)); - } - break; - case AST_PredefinedType::PT_double: - { - new_name->nconc (new UTL_ScopedName (new Identifier ("Double", 1, 0, - I_FALSE), NULL)); - } - break; - case AST_PredefinedType::PT_char: - { - new_name->nconc (new UTL_ScopedName (new Identifier ("Char", 1, 0, - I_FALSE), NULL)); - } - break; - case AST_PredefinedType::PT_octet: - { - new_name->nconc (new UTL_ScopedName (new Identifier ("Octet", 1, 0, - I_FALSE), NULL)); - } - break; - case AST_PredefinedType::PT_wchar: - { - new_name->nconc (new UTL_ScopedName (new Identifier ("WChar", 1, 0, - I_FALSE), NULL)); - } - break; - case AST_PredefinedType::PT_boolean: - { - new_name->nconc (new UTL_ScopedName (new Identifier ("Boolean", 1, 0, - I_FALSE), NULL)); - } - break; - case AST_PredefinedType::PT_any: - { - new_name->nconc (new UTL_ScopedName (new Identifier ("Any", 1, 0, - I_FALSE), NULL)); - } - break; - case AST_PredefinedType::PT_pseudo: - { - new_name->nconc (new UTL_ScopedName (new Identifier - (n->last_component - ()->get_string (), 1, 0, - I_FALSE), NULL)); - } - break; - default: - { - new_name->nconc (new UTL_ScopedName (this->local_name (), NULL)); - } - } - this->set_name (new_name); - } - - // computes the repoID - compute_repoID (); - - // computes the fully scoped name - compute_fullname (); - - // computes the fully scoped typecode name - compute_tc_name (); - - // compute the flattened fully scoped name - compute_flatname (); -} - -// overriden method -void -be_predefined_type::compute_tc_name (void) -{ - // start with the head as the CORBA namespace - this->tc_name_ = new UTL_ScopedName (new Identifier ("CORBA", 1, 0, I_FALSE), - NULL); - - switch (this->pt ()) - { - case AST_PredefinedType::PT_void: - { - this->tc_name_->nconc (new UTL_ScopedName (new Identifier ("_tc_void", 1, 0, - I_FALSE), NULL)); - } - break; - case AST_PredefinedType::PT_long: - { - this->tc_name_->nconc (new UTL_ScopedName (new Identifier ("_tc_long", 1, 0, - I_FALSE), NULL)); - } - break; - case AST_PredefinedType::PT_longlong: - { - this->tc_name_->nconc (new UTL_ScopedName (new Identifier ("_tc_longlong", 1, 0, - I_FALSE), NULL)); - } - break; - case AST_PredefinedType::PT_ulong: - { - this->tc_name_->nconc (new UTL_ScopedName (new Identifier ("_tc_ulong", 1, 0, - I_FALSE), NULL)); - } - break; - case AST_PredefinedType::PT_ulonglong: - { - this->tc_name_->nconc (new UTL_ScopedName (new Identifier ("_tc_ulonglong", 1, 0, - I_FALSE), NULL)); - } - break; - case AST_PredefinedType::PT_short: - { - this->tc_name_->nconc (new UTL_ScopedName (new Identifier ("_tc_short", 1, 0, - I_FALSE), NULL)); - } - break; - case AST_PredefinedType::PT_ushort: - { - this->tc_name_->nconc (new UTL_ScopedName (new Identifier ("_tc_ushort", 1, 0, - I_FALSE), NULL)); - } - break; - case AST_PredefinedType::PT_float: - { - this->tc_name_->nconc (new UTL_ScopedName (new Identifier ("_tc_float", 1, 0, - I_FALSE), NULL)); - } - break; - case AST_PredefinedType::PT_double: - { - this->tc_name_->nconc (new UTL_ScopedName (new Identifier ("_tc_double", 1, 0, - I_FALSE), NULL)); - } - break; - case AST_PredefinedType::PT_longdouble: - { - this->tc_name_->nconc (new UTL_ScopedName (new Identifier ("_tc_longdouble", 1, 0, - I_FALSE), NULL)); - } - break; - case AST_PredefinedType::PT_char: - { - this->tc_name_->nconc (new UTL_ScopedName (new Identifier ("_tc_char", 1, 0, - I_FALSE), NULL)); - } - break; - case AST_PredefinedType::PT_wchar: - { - this->tc_name_->nconc (new UTL_ScopedName (new Identifier ("_tc_wchar", 1, 0, - I_FALSE), NULL)); - } - break; - case AST_PredefinedType::PT_octet: - { - this->tc_name_->nconc (new UTL_ScopedName (new Identifier ("_tc_octet", 1, 0, - I_FALSE), NULL)); - } - break; - case AST_PredefinedType::PT_boolean: - { - this->tc_name_->nconc (new UTL_ScopedName (new Identifier ("_tc_boolean", 1, 0, - I_FALSE), NULL)); - } - break; - case AST_PredefinedType::PT_any: - { - this->tc_name_->nconc (new UTL_ScopedName (new Identifier ("_tc_any", 1, 0, - I_FALSE), NULL)); - } - break; - case AST_PredefinedType::PT_pseudo: - // @@@ XXXASG - // TODO: This is a kind of hack, there are other things that are - // pseudo objects, not only objref (aka CORBA::Object). - { - this->tc_name_->nconc (new UTL_ScopedName (new Identifier ("_tc_Object", 1, 0, - I_FALSE), NULL)); - } - break; - default: - ACE_ERROR ((LM_WARNING, "Unknown or invalid predefined type")); - break; - } -} - -// ---------------------------------------- -// CODE GENERATION METHODS -// ---------------------------------------- - -// Generates the client-side header information for the predefined type -int -be_predefined_type::gen_client_header (void) -{ - TAO_OutStream *ch; // output stream - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - ch = cg->client_header (); - - ch->indent (); - *ch << this->name (); - return 0; -} - -// Generates the client-side stubs for the predefined type -int -be_predefined_type::gen_client_stubs (void) -{ - TAO_OutStream *cs; // output stream - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - cs = cg->client_stubs (); - - return 0; -} - -// Generates the server-side header information for the predefined type -int -be_predefined_type::gen_server_header (void) -{ - TAO_OutStream *sh; // output stream - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - sh = cg->server_header (); - - return 0; -} - -// Generates the server-side skeletons for the predefined type -int -be_predefined_type::gen_server_skeletons (void) -{ - TAO_OutStream *ss; // output stream - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - ss = cg->server_skeletons (); - - return 0; -} - -// Generates the client-side inline information -int -be_predefined_type::gen_client_inline (void) -{ - // nothing to be done - return 0; -} - -// Generates the server-side inline -int -be_predefined_type::gen_server_inline (void) -{ - // nothing to be done - return 0; -} - -int -be_predefined_type::gen_typecode (void) -{ - TAO_OutStream *cs; // output stream - TAO_NL nl; // end line - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - // Macro to avoid "warning: unused parameter" type warning. - ACE_UNUSED_ARG (nl); - - cs = cg->client_stubs (); - cs->indent (); // start from the current indentation level - - switch (this->pt ()) - { - case AST_PredefinedType::PT_void: - *cs << "CORBA::tk_void,\n\n"; - break; - case AST_PredefinedType::PT_short: - *cs << "CORBA::tk_short,\n\n"; - break; - case AST_PredefinedType::PT_ushort: - *cs << "CORBA::tk_ushort,\n\n"; - break; - case AST_PredefinedType::PT_long: - *cs << "CORBA::tk_long,\n\n"; - break; - case AST_PredefinedType::PT_ulong: - *cs << "CORBA::tk_ulong,\n\n"; - break; - case AST_PredefinedType::PT_longlong: - *cs << "CORBA::tk_longlong,\n\n"; - break; - case AST_PredefinedType::PT_ulonglong: - *cs << "CORBA::tk_ulonglong,\n\n"; - break; - case AST_PredefinedType::PT_float: - *cs << "CORBA::tk_float,\n\n"; - break; - case AST_PredefinedType::PT_double: - *cs << "CORBA::tk_double,\n\n"; - break; - case AST_PredefinedType::PT_longdouble: - *cs << "CORBA::tk_longdouble,\n\n"; - break; - case AST_PredefinedType::PT_boolean: - *cs << "CORBA::tk_boolean,\n\n"; - break; - case AST_PredefinedType::PT_char: - *cs << "CORBA::tk_char,\n\n"; - break; - case AST_PredefinedType::PT_octet: - *cs << "CORBA::tk_octet,\n\n"; - break; - case AST_PredefinedType::PT_any: - *cs << "CORBA::tk_any,\n\n"; - break; - case AST_PredefinedType::PT_wchar: - *cs << "CORBA::tk_wchar,\n\n"; - break; - } - return 0; -} - -long -be_predefined_type::tc_size (void) -{ - return 4; // for the enum value -} - -long -be_predefined_type::tc_encap_len (void) -{ - // XXXASG - TODO what if it was of type Object? or one of the pseudo-objects - return 0; // no encapsulation -} - -int -be_predefined_type::gen_encapsulation (void) -{ - // XXXASG - TODO what if it was of type Object? or one of the pseudo-objects - return 0; // nothing to be done -} - -// compute the size type of the node in question -int -be_predefined_type::compute_size_type (void) -{ - switch (this->pt ()) - { - case AST_PredefinedType::PT_any: - case AST_PredefinedType::PT_pseudo: - // we are variable length type - this->size_type (be_decl::VARIABLE); - break; - default: - this->size_type (be_decl::FIXED); - } - return 0; -} - -// Narrowing -IMPL_NARROW_METHODS2 (be_predefined_type, AST_PredefinedType, be_type) -IMPL_NARROW_FROM_DECL (be_predefined_type) diff --git a/TAO/TAO_IDL/be/be_produce.cpp b/TAO/TAO_IDL/be/be_produce.cpp deleted file mode 100644 index 15691d84164..00000000000 --- a/TAO/TAO_IDL/be/be_produce.cpp +++ /dev/null @@ -1,129 +0,0 @@ -/* - -COPYRIGHT - -Copyright 1992, 1993, 1994 Sun Microsystems, Inc. Printed in the United -States of America. All Rights Reserved. - -This product is protected by copyright and distributed under the following -license restricting its use. - -The Interface Definition Language Compiler Front End (CFE) is made -available for your use provided that you include this license and copyright -notice on all media and documentation and the software program in which -this product is incorporated in whole or part. You may copy and extend -functionality (but may not remove functionality) of the Interface -Definition Language CFE without charge, but you are not authorized to -license or distribute it to anyone else except as part of a product or -program developed by you or with the express written consent of Sun -Microsystems, Inc. ("Sun"). - -The names of Sun Microsystems, Inc. and any of its subsidiaries or -affiliates may not be used in advertising or publicity pertaining to -distribution of Interface Definition Language CFE as permitted herein. - -This license is effective until terminated by Sun for failure to comply -with this license. Upon termination, you shall destroy or return all code -and documentation for the Interface Definition Language CFE. - -INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED AS IS WITH NO WARRANTIES OF -ANY KIND INCLUDING THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS -FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR ARISING FROM A COURSE OF -DEALING, USAGE OR TRADE PRACTICE. - -INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED WITH NO SUPPORT AND WITHOUT -ANY OBLIGATION ON THE PART OF Sun OR ANY OF ITS SUBSIDIARIES OR AFFILIATES -TO ASSIST IN ITS USE, CORRECTION, MODIFICATION OR ENHANCEMENT. - -SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES SHALL HAVE NO LIABILITY WITH -RESPECT TO THE INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY -INTERFACE DEFINITION LANGUAGE CFE OR ANY PART THEREOF. - -IN NO EVENT WILL SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES BE LIABLE FOR -ANY LOST REVENUE OR PROFITS OR OTHER SPECIAL, INDIRECT AND CONSEQUENTIAL -DAMAGES, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -Use, duplication, or disclosure by the government is subject to -restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in -Technical Data and Computer Software clause at DFARS 252.227-7013 and FAR -52.227-19. - -Sun, Sun Microsystems and the Sun logo are trademarks or registered -trademarks of Sun Microsystems, Inc. - -SunSoft, Inc. -2550 Garcia Avenue -Mountain View, California 94043 - -NOTE: - -SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are -trademarks or registered trademarks of Sun Microsystems, Inc. - - */ - -// BE_produce.cc - Produce the work of the BE - does nothing in the -// dummy BE - -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -/* - * Do the work of this BE. This is the dummy BE so we dont do anything in - * particular here - */ -void -BE_produce() -{ - -#if 0 - // let us print all the global values - cout << "filename is " << endl; - idl_global->filename()->dump(cout); - cout << endl; - cout << "main filename is " << endl; - idl_global->main_filename()->dump(cout); - cout << endl; - cout << "real filename is " << endl; - idl_global->real_filename()->dump(cout); - cout << endl; - cout << "stripped filename is " << endl; - idl_global->stripped_filename()->dump(cout); - cout << endl; - cout << "IDL source filename is " << endl; - idl_global->idl_src_file()->dump(cout); - cout << endl; - cout << "prog_name is " << idl_global->prog_name() << endl; -#endif - be_root *root; // root of the AST made up of BE nodes - AST_Decl *d = idl_global->root (); - root = be_root::narrow_from_decl (d); - if (root == NULL) - { - cerr << "No root" << endl; - BE_abort(); - } - -#if 0 - // this was just for debugging - root->dump (cerr); -#endif - - // start the code generation process - if (root->gen_idl2cplusplus_mapping() == -1) - { - cerr << "Mapping process failed" << endl; - BE_abort(); - } -} - -/* - * Abort this run of the BE - */ -void -BE_abort() -{ - cerr << "Fatal Error" << endl; - exit (1); -} diff --git a/TAO/TAO_IDL/be/be_root.cpp b/TAO/TAO_IDL/be/be_root.cpp deleted file mode 100644 index 4fbe89ebf3a..00000000000 --- a/TAO/TAO_IDL/be/be_root.cpp +++ /dev/null @@ -1,308 +0,0 @@ -// ============================================================================ -// -// = LIBRARY -// TAO IDL -// -// = FILENAME -// be_root.cpp -// -// = DESCRIPTION -// Extension of class AST_Root that provides additional means for C++ -// mapping. -// -// = AUTHOR -// Copyright 1994-1995 by Sun Microsystems, Inc. -// and -// Aniruddha Gokhale -// -// ============================================================================ - -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -// Default Constructor -be_root::be_root (void) -{ -} - -// Constructor used to build the root of the abstract syntax tree (AST) -be_root::be_root (UTL_ScopedName *n, UTL_StrList *p) - : AST_Root (n, p), - AST_Decl (AST_Decl::NT_root, n, p), - UTL_Scope (AST_Decl::NT_root) - -{ -} - -// ===================================================== -// CODE GENERATION METHODS -// ===================================================== - -// Starting point for the code generation. Called inside BE_produce () -int be_root::gen_idl2cplusplus_mapping (void) -{ - // this is the main starting point from which the files are generated. We - // delegate the task of code generation to a special Code Generation - // object. This allows a number of different front ends to access the services - // of a single code generator - - // C++ mapping involves producing 6 files. These include the client and - // server side headers, the client and server side inlines, as well as client - // stubs and server skeletons. - if (this->gen_client_header () == -1) - { - ACE_ERROR ((LM_ERROR, "be_root: Error generating client header file: %s\n", - idl_global->be_get_client_hdr_fname ())); - return -1; - } - if (this->gen_client_inline () == -1) - { - ACE_ERROR ((LM_ERROR, "be_root: Error generating client inline file: %s\n", - idl_global->be_get_client_inline_fname ())); - return -1; - } - if (this->gen_client_stubs () == -1) - { - ACE_ERROR ((LM_ERROR, "be_root: Error generating client stubs file: %s\n", - idl_global->be_get_client_stub_fname ())); - return -1; - } - if (this->gen_server_header () == -1) - { - ACE_ERROR ((LM_ERROR, "be_root: Error generating server header file: %s\n", - idl_global->be_get_server_hdr_fname ())); - return -1; - } - if (this->gen_server_inline () == -1) - { - ACE_ERROR ((LM_ERROR, "be_root: Error generating server inline file: %s\n", - idl_global->be_get_server_inline_fname ())); - return -1; - } - if (this->gen_server_skeletons () == -1) - { - ACE_ERROR ((LM_ERROR, "be_root: Error generating server skeleton file: %s\n", - idl_global->be_get_server_skeleton_fname ())); - return -1; - } - - return 0; -} - -// generate client header -int be_root::gen_client_header (void) -{ - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - cg->push (TAO_CodeGen::TAO_ROOT_CH); // set the code generation state - - // open the client-side header file - if (cg->client_header (idl_global->be_get_client_hdr_fname ()) == -1) - { - ACE_ERROR ((LM_ERROR, "be_root: Error opening client header\n")); - return -1; - } - // delegate the task of code generation to the scope - if (be_scope::gen_client_header () == -1) - { - ACE_ERROR ((LM_ERROR, "be_root: code generation for scope failed\n")); - return -1; - } - cg->pop (); - - // at this point, we must be in the initial state - ACE_ASSERT (cg->state () == TAO_CodeGen::TAO_INITIAL); - - (void) cg->end_client_header (); // generate the last #endif - return 0; -} - -// Generates the client-side stubs for the root -int be_root::gen_client_stubs (void) -{ - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - cg->push (TAO_CodeGen::TAO_ROOT_CS); // set the code generation state - - // open the client-side stub file - if (cg->client_stubs (idl_global->be_get_client_stub_fname ()) == -1) - { - ACE_ERROR ((LM_ERROR, "be_root: Error opening client stubs file\n")); - return -1; - } - // delegate the task of code generation to the scope - if (be_scope::gen_client_stubs () == -1) - { - ACE_ERROR ((LM_ERROR, "be_root: code generation for scope failed\n")); - return -1; - } - cg->pop (); - - // at this point, we must be in the initial state - // ACE_ASSERT (cg->state () == TAO_CodeGen::TAO_INITIAL); - - return 0; -} - -// Generates the client-side inlines for the root -int be_root::gen_client_inline (void) -{ - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - cg->push (TAO_CodeGen::TAO_ROOT_CI); // set the code generation state - - // open the client-side inline file - if (cg->client_inline (idl_global->be_get_client_inline_fname ()) == -1) - { - ACE_ERROR ((LM_ERROR, "be_root: Error opening client inline file\n")); - return -1; - } - // delegate the task of code generation to the scope - if (be_scope::gen_client_inline () == -1) - { - ACE_ERROR ((LM_ERROR, "be_root: code generation for scope failed\n")); - return -1; - } - cg->pop (); - - // at this point, we must be in the initial state - // ACE_ASSERT (cg->state () == TAO_CodeGen::TAO_INITIAL); - - return 0; -} - -// Generates the server-side header information for the root -int be_root::gen_server_header (void) -{ - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - cg->push (TAO_CodeGen::TAO_ROOT_SH); // set the code generation state - - // open the server-side header file - if (cg->server_header (idl_global->be_get_server_hdr_fname ()) == -1) - { - ACE_ERROR ((LM_ERROR, "be_root: Error opening server header\n")); - return -1; - } - // delegate the task of code generation to the scope - if (be_scope::gen_server_header () == -1) - { - ACE_ERROR ((LM_ERROR, - "be_root: server code generation for scope failed\n")); - return -1; - } - - cg->pop (); - - // at this point, we must be in the initial state - // ACE_ASSERT (cg->state () == TAO_CodeGen::TAO_INITIAL); - - (void) cg->end_server_header (); // generate the last #endif statement - return 0; -} - -// Generates the server-side skeletons for the root -int be_root::gen_server_skeletons (void) -{ - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - cg->push (TAO_CodeGen::TAO_ROOT_SS); // set the code generation state - - // open the server-side skeleton file - if (cg->server_skeletons (idl_global->be_get_server_skeleton_fname ()) == -1) - { - ACE_ERROR ((LM_ERROR, "be_root: Error opening server skeletons file\n")); - return -1; - } - // delegate the task of code generation to the scope - if (be_scope::gen_server_skeletons () == -1) - { - ACE_ERROR ((LM_ERROR, "be_root: code generation for scope failed\n")); - return -1; - } - cg->pop (); - - // at this point, we must be in the initial state - // ACE_ASSERT (cg->state () == TAO_CodeGen::TAO_INITIAL); - - return 0; -} - -// Generates the server-side inlines for the root -int be_root::gen_server_inline (void) -{ - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - cg->push (TAO_CodeGen::TAO_ROOT_SI); // set the code generation state - - // open the server-side inline file - if (cg->server_inline (idl_global->be_get_server_inline_fname ()) == -1) - { - ACE_ERROR ((LM_ERROR, "be_root: Error opening server inline file\n")); - return -1; - } - // delegate the task of code generation to the scope - if (be_scope::gen_server_inline () == -1) - { - ACE_ERROR ((LM_ERROR, "be_root: code generation for scope failed\n")); - return -1; - } - cg->pop (); - - // at this point, we must be in the initial state - // ACE_ASSERT (cg->state () == TAO_CodeGen::TAO_INITIAL); - - return 0; -} - -// We had to provide these since the AST_Root::fe_* method was setting the -// names of these three to "local type" - -/* - * Add this AST_Sequence to the locally defined types in this scope - */ -AST_Sequence * -be_root::fe_add_sequence (AST_Sequence *t) -{ - if (t == NULL) - return NULL; - - add_to_local_types(t); - return t; -} - -/* - * Add this AST_String to the locally defined types in this scope - */ -AST_String * -be_root::fe_add_string (AST_String *t) -{ - if (t == NULL) - return NULL; - - add_to_local_types (t); - - return t; -} - -/* - * Add this AST_Array to the locally defined types in this scope - */ -AST_Array * -be_root::fe_add_array (AST_Array *t) -{ - if (t == NULL) - return NULL; - - add_to_local_types (t); - - return t; -} - -/* - * Narrowing methods - */ -IMPL_NARROW_METHODS3 (be_root, AST_Root, be_scope, be_decl) -IMPL_NARROW_FROM_DECL (be_root) -IMPL_NARROW_FROM_SCOPE (be_root) diff --git a/TAO/TAO_IDL/be/be_scope.cpp b/TAO/TAO_IDL/be/be_scope.cpp deleted file mode 100644 index e25ddf47fc5..00000000000 --- a/TAO/TAO_IDL/be/be_scope.cpp +++ /dev/null @@ -1,484 +0,0 @@ -// -// $Id$ -// -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -// Default Constructor -be_scope::be_scope (void) - : comma_ (0) -{ -} - -// Constructor -be_scope::be_scope (AST_Decl::NodeType type) - : UTL_Scope (type), - comma_ (0) -{ -} - -be_scope::~be_scope (void) -{ -} - -// Code generation methods -void -be_scope::comma (unsigned short comma) -{ - this->comma_ = comma; -} - -int -be_scope::gen_client_header (void) -{ - UTL_ScopeActiveIterator *si; - AST_Decl *d; - be_decl *bd; - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - TAO_OutStream *os = cg->client_header (); // output stream - - if (this->nmembers () > 0) - { - // if there are elements in this scope - - si = new UTL_ScopeActiveIterator (this, UTL_Scope::IK_decls); - // instantiate a scope iterator. - - while (!(si->is_done ())) - { - // get the next AST decl node - d = si->item (); - if (!d->imported ()) - { - // we are not imported. - - // NOTE: Our assumption here is that whatever scope we are in, the - // node type that shows up here *MUST* be valid according to the - // IDL grammar. We do not check for this since the front end must - // have taken care of weeding out such errors - - // The FE does some strange things in which items get added to - // the enclosing scope as well as the scope that encloses the - // enclosing scope. We do not want to generate code for items - // that do not belong to the appropriate scope - - bd = be_decl::narrow_from_decl (d); - // @@ Despite the comment above the following code will - // crash without the if() around it. - if (bd != 0) - { - if (bd->gen_client_header () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_scope::gen_client_header failed\n"), - -1); - } - } - else - { - ACE_DEBUG ((LM_DEBUG, - "WARNING (%N:%l) be_scope::gen_client_header - " - "narrow_from_decl returned 0\n")); - } - } // no imported - si->next (); - if (!si->is_done () && this->comma_) - { - *os << ", "; // generate a comma - } - } // end of while - delete si; // free the iterator object - } - return 0; -} - -int -be_scope::gen_client_stubs (void) -{ - UTL_ScopeActiveIterator *si; - AST_Decl *d; - be_decl *bd; - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - TAO_OutStream *os = cg->client_stubs (); // output stream - - if (this->nmembers () > 0) - { - // if there are elements in this scope - - si = new UTL_ScopeActiveIterator (this, UTL_Scope::IK_decls); - // instantiate a scope iterator. - - while (!(si->is_done ())) - { - // get the next AST decl node - d = si->item (); - if (!d->imported ()) - { - // we are not imported. - // NOTE: Our assumptin here is that whatever scope we are in, the - // node type that shows up here *MUST* be valid according to the - // IDL grammar. We do not check for this since the front end must - // have taken care of weeding out such errors - - bd = be_decl::narrow_from_decl (d); - // @@ Despite the comment above the following code will - // crash without the if() around it. - if (bd != 0) - { - if (bd->gen_client_stubs () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_scope::gen_client_stubs failed\n"), - -1); - } - } - else - { - ACE_DEBUG ((LM_DEBUG, - "WARNING (%N:%l) be_scope::gen_client_stubs - " - "narrow_from_decl returned 0\n")); - } - } // not imported - si->next (); - if (!si->is_done () && this->comma_) - { - *os << ", "; // generate a comma - } - } // end of while - delete si; // free the iterator object - } - return 0; -} - -int -be_scope::gen_client_inline (void) -{ - UTL_ScopeActiveIterator *si; - AST_Decl *d; - be_decl *bd; - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - TAO_OutStream *os = cg->client_inline (); // output stream - - if (this->nmembers () > 0) - { - // if there are elements in this scope - - si = new UTL_ScopeActiveIterator (this, UTL_Scope::IK_decls); - // instantiate a scope iterator. - - while (!(si->is_done ())) - { - // get the next AST decl node - d = si->item (); - if (!d->imported ()) - { - // we are not imported. - // NOTE: Our assumptin here is that whatever scope we are in, the - // node type that shows up here *MUST* be valid according to the - // IDL grammar. We do not check for this since the front end must - // have taken care of weeding out such errors - - bd = be_decl::narrow_from_decl (d); - if (bd != 0) - { - if (bd->gen_client_inline () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_scope::gen_client_inline failed\n"), - -1); - } - } - else - { - ACE_DEBUG ((LM_DEBUG, - "WARNING (%N:%l) be_scope::gen_client_inline - " - "narrow_from_decl returned 0\n")); - } - } // not imported - si->next (); - if (!si->is_done () && this->comma_) - { - *os << ", "; // generate a comma - } - } // end of while - delete si; // free the iterator object - } - return 0; -} - -int -be_scope::gen_server_header (void) -{ - UTL_ScopeActiveIterator *si; - AST_Decl *d; - be_decl *bd; - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - TAO_OutStream *os = cg->server_header (); // output stream - - if (this->nmembers () > 0) - { - // if there are elements in this scope - - si = new UTL_ScopeActiveIterator (this, UTL_Scope::IK_decls); - // instantiate a scope iterator. - - while (!(si->is_done ())) - { - // get the next AST decl node - d = si->item (); - if (!d->imported ()) - { - // we are not imported. - // we are not imported. - - // NOTE: Our assumptin here is that whatever scope we are in, the - // node type that shows up here *MUST* be valid according to the - // IDL grammar. We do not check for this since the front end must - // have taken care of weeding out such errors - - bd = be_decl::narrow_from_decl (d); - if (bd != 0) - { - if (bd->gen_server_header () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_scope::gen_server_header failed\n"), - -1); - } - } - else - { - ACE_DEBUG ((LM_DEBUG, - "WARNING (%N:%l) be_scope::gen_server_header - " - "narrow_from_decl returned 0\n")); - } - } // not imported - si->next (); - if (!si->is_done () && this->comma_) - { - *os << ", "; // generate a comma - } - } // end of while - delete si; // free the iterator object - } - return 0; -} - -int -be_scope::gen_server_skeletons (void) -{ - UTL_ScopeActiveIterator *si; - AST_Decl *d; - be_decl *bd; - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - TAO_OutStream *os = cg->server_skeletons (); // output stream - - if (this->nmembers () > 0) - { - // if there are elements in this scope - - si = new UTL_ScopeActiveIterator (this, UTL_Scope::IK_decls); - // instantiate a scope iterator. - - while (!(si->is_done ())) - { - // get the next AST decl node - d = si->item (); - if (!d->imported ()) - { - // we are not imported. - - // NOTE: Our assumptin here is that whatever scope we are in, the - // node type that shows up here *MUST* be valid according to the - // IDL grammar. We do not check for this since the front end must - // have taken care of weeding out such errors - - bd = be_decl::narrow_from_decl (d); - if (bd != 0) - { - if (bd->gen_server_skeletons () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_scope::gen_server_skeletons failed\n"), - -1); - } - } - else - { - ACE_DEBUG ((LM_DEBUG, - "WARNING (%N:%l): be_scope::gen-server_skeletons - " - "narrow_from_decl returned 0\n")); - } - } // not imported - si->next (); - if (!si->is_done () && this->comma_) - { - *os << ", "; // generate a comma - } - } // end of while - delete si; // free the iterator object - } - return 0; -} - -int -be_scope::gen_server_inline (void) -{ - UTL_ScopeActiveIterator *si; - AST_Decl *d; - be_decl *bd; - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - TAO_OutStream *os = cg->server_inline (); // output stream - - if (this->nmembers () > 0) - { - // if there are elements in this scope - - si = new UTL_ScopeActiveIterator (this, UTL_Scope::IK_decls); - // instantiate a scope iterator. - - while (!(si->is_done ())) - { - // get the next AST decl node - d = si->item (); - - if (!d->imported ()) - { - // we are not imported. - // NOTE: Our assumptin here is that whatever scope we are in, the - // node type that shows up here *MUST* be valid according to the - // IDL grammar. We do not check for this since the front end must - // have taken care of weeding out such errors - - bd = be_decl::narrow_from_decl (d); - if (bd != 0) - { - if (bd->gen_server_inline () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_scope::gen_server_inline failed\n"), - -1); - } - } - else - { - ACE_DEBUG ((LM_DEBUG, - "WARNING (%N:%l): be_scope::gen_server_inline - " - "narrow_from_decl returned 0\n")); - } - } - si->next (); - if (!si->is_done () && this->comma_) - { - *os << ", "; // generate a comma - } - } // end of while - delete si; // free the iterator object - } - return 0; -} - -int -be_scope::gen_encapsulation (void) -{ - UTL_ScopeActiveIterator *si; - AST_Decl *d; - be_decl *bd; - - // if there are elements in this scope - if (this->nmembers () > 0) - { - // instantiate a scope iterator. - si = new UTL_ScopeActiveIterator (this, UTL_Scope::IK_decls); - - while (!(si->is_done ())) - { - // get the next AST decl node - d = si->item (); - bd = be_decl::narrow_from_decl (d); - if (bd->gen_encapsulation () == -1) - { - // failure - return -1; - } - si->next (); - } // end of while - delete si; // free the iterator object - } - return 0; -} - -long -be_scope::tc_encap_len (void) -{ - UTL_ScopeActiveIterator *si; - AST_Decl *d; - be_decl *bd; - long encap_len = 0; - - if (this->nmembers () > 0) - { - // if there are elements in this scope - - si = new UTL_ScopeActiveIterator (this, UTL_Scope::IK_decls); - // instantiate a scope iterator. - - while (!(si->is_done ())) - { - // get the next AST decl node - d = si->item (); - - // NOTE: Our assumptin here is that whatever scope we are in, the - // node type that shows up here *MUST* be valid according to the - // IDL grammar. We do not check for this since the front end must - // have taken care of weeding out such errors - - bd = be_decl::narrow_from_decl (d); - if (bd != 0) - { - encap_len += bd->tc_encap_len (); - } - else - { - ACE_DEBUG ((LM_DEBUG, - "WARNING (%N:%l): be_scope::tc_encap_len - " - "narrow_from_decl returned 0\n")); - } - si->next (); - } // end of while - delete si; // free the iterator object - } - return encap_len; -} - -// return the scope created by this node (if one exists, else NULL) -be_decl * -be_scope::decl (void) -{ - switch (this->scope_node_type()) - { - case AST_Decl::NT_interface: - return be_interface::narrow_from_scope (this); - case AST_Decl::NT_module: - return be_module::narrow_from_scope (this); - case AST_Decl::NT_root: - return be_root::narrow_from_scope (this); - case AST_Decl::NT_except: - return be_exception::narrow_from_scope (this); - case AST_Decl::NT_union: - return be_union::narrow_from_scope (this); - case AST_Decl::NT_struct: - return be_structure::narrow_from_scope (this); - case AST_Decl::NT_enum: - return be_enum::narrow_from_scope (this); - case AST_Decl::NT_op: - return be_operation::narrow_from_scope (this); - default: - return (be_decl *)0; - } -} - -// narrowing methods -IMPL_NARROW_METHODS1 (be_scope, UTL_Scope) -IMPL_NARROW_FROM_SCOPE (be_scope) diff --git a/TAO/TAO_IDL/be/be_sequence.cpp b/TAO/TAO_IDL/be/be_sequence.cpp deleted file mode 100644 index 69a9c66d84e..00000000000 --- a/TAO/TAO_IDL/be/be_sequence.cpp +++ /dev/null @@ -1,2537 +0,0 @@ -// ============================================================================ -// -// = LIBRARY -// TAO IDL -// -// = FILENAME -// be_sequence.cpp -// -// = DESCRIPTION -// Extension of class AST_Sequence that provides additional means for C++ -// mapping. -// -// = AUTHOR -// Copyright 1994-1995 by Sun Microsystems, Inc. -// and -// Aniruddha Gokhale -// -// ============================================================================ - -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -/* - * BE_Sequence - */ -be_sequence::be_sequence (void) - : mt_ (be_sequence::MNG_UNKNOWN) -{ - this->size_type (be_decl::VARIABLE); // always the case -} - -be_sequence::be_sequence (AST_Expression *v, AST_Type *t) - : AST_Sequence (v, t), - AST_Decl (AST_Decl::NT_sequence, - NULL, - NULL), - mt_ (be_sequence::MNG_UNKNOWN) -{ - // check if we are bounded or unbounded. An expression value of 0 means - // unbounded - if (v->ev ()->u.ulval == 0) - { - this->unbounded_ = I_TRUE; - } - else - { - this->unbounded_ = I_FALSE; - } - - this->size_type (be_decl::VARIABLE); // a sequence data type is always - // VARIABLE -} - -// helper to create_name -char * -be_sequence::gen_name (void) -{ - char namebuf [NAMEBUFSIZE]; - be_type *bt; // base type; - - ACE_OS::memset (namebuf, '\0', NAMEBUFSIZE); // reset the buffer - // retrieve the base type - bt = be_type::narrow_from_decl (this->base_type ()); - if (!bt) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_sequence::" - "gen_name - " - "bad base type\n"), - 0); - } - if (bt->node_type () == AST_Decl::NT_sequence) - { - // our base type is an anonymous sequence - be_sequence *seq; - seq = be_sequence::narrow_from_decl (bt); - if (!seq) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_sequence::" - "gen_name - " - "error converting base type to sequence\n"), - 0); - } - seq->set_defined_in (this); // set ourselves as its parent - this->fe_add_sequence (seq); // add the child to our scope - ACE_OS::sprintf (namebuf, "_tao_seq_%s", seq->gen_name ()); - } - else - { - ACE_OS::sprintf (namebuf, "_tao_seq_%s", bt->local_name ()->get_string ()); - } - // append the size (if any) - if (!this->unbounded_) - { - ACE_OS::sprintf (namebuf, "%s_%d", namebuf, this->max_size ()->ev - ()->u.ulval); - } - return ACE_OS::strdup (namebuf); -} - -// create a name for ourselves -int -be_sequence::create_name (void) -{ - static char namebuf [NAMEBUFSIZE]; - UTL_ScopedName *n = NULL; - be_decl *scope; // scope in which we are defined - - ACE_OS::memset (namebuf, '\0', NAMEBUFSIZE); // reset the buffer - ACE_OS::strcpy (namebuf, this->gen_name ()); // generate a local name - - // now see if we have a fully scoped name and if so, generate one - scope = be_scope::narrow_from_scope (this->defined_in ())->decl (); - if (scope) - { - // make a copy of the enclosing scope's name - n = (UTL_ScopedName *)scope->name ()->copy () ; - - // add our local name as the last component - n->nconc (new UTL_ScopedName (new Identifier (ACE_OS::strdup - (namebuf), 1, - 0, I_FALSE), - NULL)); - // set the fully scoped name - this->set_name (n); - } - else - { - // We better be not here because we must be inside some scope, - // atleast the ROOT scope. - return -1; - } - return 0; -} - -// Does this sequence have a managed type sequence element? -be_sequence::MANAGED_TYPE -be_sequence::managed_type (void) -{ - if (this->mt_ == be_sequence::MNG_UNKNOWN) // not calculated yet - { - be_type *bt, *prim_type; // base types - - bt = be_type::narrow_from_decl (this->base_type ()); - - if (bt->node_type () == AST_Decl::NT_typedef) - { - // get the primitive base type of this typedef node - be_typedef *t = be_typedef::narrow_from_decl (bt); - prim_type = t->primitive_base_type (); - } - else - prim_type = bt; - - // determine if we need a managed type and which one - switch (prim_type->node_type ()) - { - case AST_Decl::NT_interface: - case AST_Decl::NT_interface_fwd: - this->mt_ = be_sequence::MNG_OBJREF; - break; - case AST_Decl::NT_string: - this->mt_ = be_sequence::MNG_STRING; - break; - case AST_Decl::NT_pre_defined: - { - be_predefined_type *bpd = be_predefined_type::narrow_from_decl - (prim_type); - if (bpd->pt () == AST_PredefinedType::PT_pseudo) - { - this->mt_ = be_sequence::MNG_OBJREF; - } - else - { - this->mt_ = be_sequence::MNG_NONE; - } - } - break; - default: - this->mt_ = be_sequence::MNG_NONE; - } // end of switch - } - return this->mt_; -} - -int -be_sequence::gen_client_header (void) -{ - TAO_OutStream *ch; // output stream - TAO_NL nl; // end line - be_type *bt; // type node - be_state *s; // state based code gen object - - if (!this->cli_hdr_gen_) - { - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - // first create a name for ourselves. We defer name creation for - // ourselves to this point since named sequences should get the name - // of the typedef node, else some other technique of name generation - // should be used. - if (this->create_name () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "be_sequence::gen_client_header - name creation failed\n"), - -1); - } - - ch = cg->client_header (); - - // generate the ifdefined macro for the sequence type - ch->gen_ifdef_macro (this->flatname ()); - - ch->indent (); // start with the current indentation level - - *ch << "// *************************************************************" - << nl; - *ch << "// class " << this->local_name () << nl; - *ch << "// *************************************************************" - << nl << nl; - - *ch << "class " << this->local_name () << nl; - *ch << "{" << nl; - *ch << "public:\n"; - ch->incr_indent (0); - - // retrieve the base type since we may need to do some code - // generation for the base type. - bt = be_type::narrow_from_decl (this->base_type ()); - if (!bt) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_sequence.cpp - " - "Bad base type\n"), - -1); - } - - cg->push (TAO_CodeGen::TAO_SEQUENCE_BASE_CH); // set current code gen - // state - s = cg->make_state (); - if (!s || (s->gen_code (bt, this) == -1)) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_sequence.cpp - " - "base type codegen failed\n"), - -1); - } - cg->pop (); - - // now generate the sequence body - cg->push (TAO_CodeGen::TAO_SEQUENCE_BODY_CH); - s = cg->make_state (); - if (!s) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_sequence::" - "gen_client_header - " - "bad state\n"), - -1); - } - - // generate constructors - ch->indent (); - *ch << this->local_name () << " (void); // default constructor" << nl; - // check whether we are bounded or not. Depending on that the mapping is - // slightly different as shown below - if (this->unbounded_) - { - *ch << local_name () << " (CORBA::ULong max);" << nl; - *ch << local_name () << " (CORBA::ULong max, CORBA::ULong length, " << nl; - } - else - { - // bounded seq does not take the "max" argument - *ch << local_name () << " (CORBA::ULong length, " << nl; - } - - *ch << "\t"; - // generate the type info for the element type - if (s->gen_code (bt, this) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_sequence::" - "gen_client_header - " - "state based codegen failed\n"), - -1); - } - - *ch << " *value, CORBA::Boolean release=CORBA::B_FALSE);" << nl; - *ch << local_name () << "(const " << local_name () << - " &); // copy constructor" << nl; - *ch << "~" << this->local_name () << " (void);" << nl; - *ch << this->local_name () << " &operator= (const " << - this->local_name () << " &);" << nl; - *ch << "CORBA::ULong maximum (void) const;" << nl; - *ch << "void length (CORBA::ULong);" << nl; - *ch << "CORBA::ULong length (void) const;" << nl; - - // we need a new state here because the [] operator for strings and obj - // references returns a managed type as opposed to the normal type - cg->push (TAO_CodeGen::TAO_SEQELEM_RETTYPE_CH); - s = cg->make_state (); - if (!s || s->gen_code (bt, this) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_sequence::" - "gen_client_header - " - "state based codegen failed\n"), - -1); - } - *ch << "operator[] (CORBA::ULong index);" << nl; - *ch << "const "; - if (s->gen_code (bt, this) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_sequence::" - "gen_client_header - " - "state based codegen failed\n"), - -1); - } - *ch << "operator[] (CORBA::ULong index) const;" << nl; - cg->pop (); // back to the previous state - - s = cg->make_state (); - // generate the static allocbuf and freebuf methods - *ch << "static "; - if (!s || s->gen_code (bt, this) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_sequence::" - "gen_client_header - " - "state based codegen failed\n"), - -1); - } - *ch << " *allocbuf (CORBA::ULong nelems);" << nl; - *ch << "static void freebuf ("; - if (s->gen_code (bt, this) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_sequence::" - "gen_client_header - " - "state based codegen failed\n"), - -1); - } - *ch << " *);\n" ; - - // the spec says that for managed sequence types, the freebuf method - // should individually free up the elements before deleting the - // buffer. However, freebuf does not have a parameter that indicates the - // total number of elements that are in the buffer. Hence we provide a - // helper method to freebuf - switch (this->managed_type ()) - { - case be_sequence::MNG_OBJREF: - case be_sequence::MNG_STRING: - ch->indent (); - *ch << "static void freebuf (" << nl; - if (s->gen_code (bt, this) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_sequence::" - "gen_client_header - " - "state based codegen failed\n"), - -1); - } - *ch << " *, CORBA::ULong);\n" ; - break; - default: - break; - } - ch->decr_indent (); - *ch << "private:\n"; - ch->incr_indent (); - *ch << "CORBA::ULong maximum_;" << nl; - *ch << "CORBA::ULong length_;" << nl; - if (s->gen_code (bt, this) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_sequence::" - "gen_client_header - " - "state based codegen failed\n"), - -1); - } - - *ch << " *buffer_;" << nl; - *ch << "CORBA::Boolean release_;\n"; - ch->decr_indent (); - *ch << "};\n"; - ch->indent (); - *ch << "typedef " << this->local_name () << "* " - << this->local_name () << "_ptr;\n"; - - // Generate the typecode decl - if (this->is_nested ()) - { - // we have a scoped name - ch->indent (); - *ch << "static CORBA::TypeCode_ptr " << this->tc_name - ()->last_component () << ";\n\n"; - } - else - { - // we are in the ROOT scope - ch->indent (); - *ch << "extern CORBA::TypeCode_ptr " << this->tc_name - ()->last_component () << ";\n\n"; - } - - ch->gen_endif (); // endif macro - - // generate the ifdefined macro for the var type - ch->gen_ifdef_macro (this->flatname (), "_var"); - - // generate the var and out types - if (this->gen_var_defn () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_sequence::" - "gen_client_header - " - "codegen for _var failed\n"), - -1); - } - - ch->gen_endif (); - - // generate the ifdefined macro for the var type - ch->gen_ifdef_macro (this->flatname (), "_out"); - - if (this->gen_out_defn () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_sequence::" - "gen_client_header - " - "codegen for _out failed\n"), - -1); - } - ch->gen_endif (); - - cg->pop (); - - this->cli_hdr_gen_ = I_TRUE; - } // if (cli_hdr_gen_) - return 0; -} - -int -be_sequence::gen_client_stubs (void) -{ - TAO_OutStream *cs; // output stream - TAO_NL nl; // end line - be_type *bt; // base type - be_state *s; //state object - - if (!this->cli_stub_gen_) - { - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - cs = cg->client_stubs (); // retrieve the client stubs stream - - // retrieve base type - bt = be_type::narrow_from_decl (this->base_type ()); - if (!bt) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_sequence::" - "gen_client_stubs - " - "bad type\n"), - -1); - } - - cg->push (TAO_CodeGen::TAO_SEQUENCE_BASE_CS); - s = cg->make_state (); - - // generate stubs for our base type if it itself is a sequence or we - // need to generate code for our managed types - if (!s || (s->gen_code (bt, this) == -1)) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_sequence::" - "gen_client_stubs - " - "state based codegen failed\n"), - -1); - } - - cg->pop (); - - // generate the ifdefined macro for the sequence type - cs->gen_ifdef_macro (this->flatname ()); - - // generate the methods of the sequence C++ mapping - cg->push (TAO_CodeGen::TAO_SEQUENCE_BODY_CS); - s = cg->make_state (); - if (!s) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_sequence::" - "gen_client_stubs - " - "bad state\n"), - -1); - } - - - *cs << "// *************************************************************" - << nl; - *cs << "// class " << this->name () << nl; - *cs << "// *************************************************************\n\n"; - - // copy constructor - cs->indent (); - *cs << "// copy constructor" << nl; - *cs << this->name () << "::" << this->local_name () << - " (const " << this->name () << " &seq)" << nl; - *cs << "\t: maximum_ (seq.maximum_)," << nl; - *cs << "\t length_ (seq.length_)," << nl; - *cs << "\t buffer_ (" << this->name () << "::allocbuf (seq.maximum_))," - << nl; - *cs << "\t release_ (1) // we always own it" << nl; - *cs << "{\n"; - cs->incr_indent (); - // copy each element - switch (this->managed_type ()) - { - case be_sequence::MNG_OBJREF: - { - *cs << "for (CORBA::ULong i=0; i < seq.length_; i++)" << nl; - *cs << "{" << nl; - *cs << "\tthis->buffer_[i] = " << bt->name () << "::_duplicate (" - << "seq.buffer_[i]);" << nl; - *cs << "}\n"; - } - break; - case be_sequence::MNG_STRING: - { - *cs << "for (CORBA::ULong i=0; i < seq.length_; i++)" << nl; - *cs << "{" << nl; - *cs << "\tthis->buffer_[i] = CORBA::string_dup (" << - "seq.buffer_[i]);" << nl; - *cs << "}\n"; - } - break; - default: // all other types are self managed, just assign them. - *cs << "for (CORBA::ULong i=0; i < seq.length_; i++)" << nl; - *cs << "\tthis->buffer_[i] = seq.buffer_[i];\n"; - } - cs->decr_indent (); - *cs << "}\n\n"; - - // constructor only for unbounded seq. This takes in "max length" - if (this->unbounded_) - { - cs->indent (); - *cs << "// constructor for unbounded seq" << nl; - *cs << this->name () << "::" << this->local_name () << - "(CORBA::ULong max )" << nl; - *cs << "\t: maximum_ (max)," << nl; - *cs << "\t length_ (0)," << nl; - *cs << "\t buffer_ (" << this->name () << "::allocbuf (max))," << nl; - *cs << "\t release_ (1) // owns" << nl; - *cs << "{\n"; - *cs << "}\n\n"; - } - - // constructor that takes in the data buffer - cs->indent (); - *cs << "// constructor from data buffer" << nl; - *cs << this->name () << "::" << this->local_name (); - // depending on whether we are bounded or not, the constructor has - // different sets of parameters - if (this->unbounded_) - { - *cs << " (CORBA::ULong max, CORBA::ULong length, " << nl; - } - else - { - // bounded seq does not take the "max" argument - *cs << " (CORBA::ULong length, " << nl; - } - *cs << "\t"; - if (s->gen_code (bt, this) == -1) - return -1; - *cs << " *value, CORBA::Boolean release)" << nl; - // for unbounded we have the additional max parameter - if (this->unbounded_) - { - *cs << "\t: maximum_ (max)," << nl; - } - else - { - *cs << "\t: maximum_ (" << this->max_size () << ")," << nl; - } - *cs << "\t length_ (length)," << nl; - *cs << "\t buffer_ (value)," << nl; - *cs << "\t release_ (release) // ownership depends on release" << nl; - *cs << "{\n"; - *cs << "}\n\n"; - - // destructor - cs->indent (); - *cs << "// destructor" << nl; - *cs << this->name () << "::~" << this->local_name () << " (void)" << nl; - *cs << "{\n"; - cs->incr_indent (); - *cs << "if (this->release_) // we own the buffer" << nl; - *cs << "{\n"; - cs->incr_indent (); - - // only for obj references and strings, we need to free each individual - // element - // call the appropriate freebuf on the buffer - if (this->managed_type () != be_sequence::MNG_NONE) - { - *cs << this->name () << "::freebuf (this->buffer_, " << - "this->maximum_);\n"; - } - else - *cs << this->name () << "::freebuf (this->buffer_);\n"; - - cs->decr_indent (); - *cs << "}\n"; - cs->decr_indent (); - *cs << "}\n\n"; - - // assignment operator - cs->indent (); - *cs << "// assignment operator" << nl; - *cs << this->name () << "& " << nl; - *cs << this->name () << "::operator=" << - " (const " << this->name () << " &seq)" << nl; - *cs << "{\n"; - cs->incr_indent (); - // check for equality - *cs << "if (this == &seq) return *this;" << nl; - // otherwise, if release flag, free the buffer - *cs << "if (this->release_)" << nl; - *cs << "{\n"; - cs->incr_indent (); - // only for obj references and strings, we need to free each individual - // element - // call the appropriate freebuf on the buffer - if (this->managed_type () != be_sequence::MNG_NONE) - { - *cs << this->name () << "::freebuf (this->buffer_, " << - "this->maximum_);\n"; - } - else - *cs << this->name () << "::freebuf (this->buffer_);\n"; - - cs->decr_indent (); - *cs << "}" << nl; - - *cs << "this->length_ = seq.length_;" << nl; - *cs << "this->maximum_ = seq.maximum_;" << nl; - *cs << "this->buffer_ = " << this->name () << "::allocbuf (seq.maximum_)," - << nl; - *cs << "this->release_ = 1; // we always own it" << nl; - // copy each element - switch (this->managed_type ()) - { - case be_sequence::MNG_OBJREF: - { - *cs << "for (CORBA::ULong i=0; i < seq.length_; i++)" << nl; - *cs << "{" << nl; - *cs << "\tthis->buffer_[i] = " << bt->name () << "::_duplicate (" - << "seq.buffer_[i]);" << nl; - *cs << "}" << nl; - } - break; - case be_sequence::MNG_STRING: - { - *cs << "for (CORBA::ULong i=0; i < seq.length_; i++)" << nl; - *cs << "{" << nl; - *cs << "\tthis->buffer_[i] = CORBA::string_dup (" << - "seq.buffer_[i]);" << nl; - *cs << "}" << nl; - } - break; - default: // all other types are self managed, just assign them. - *cs << "for (CORBA::ULong i=0; i < seq.length_; i++)" << nl; - *cs << "\tthis->buffer_[i] = seq.buffer_[i];" << nl; - } - *cs << "return *this;\n"; - cs->decr_indent (); - *cs << "}\n\n"; - - // the length method - cs->indent (); - *cs << "void" << nl; - *cs << this->name () << "::length (CORBA::ULong length)" << nl; - *cs << "{\n"; - cs->incr_indent (); - if (!this->unbounded_) // bounded sequence - we cannot increase length - // more than its max => no reallocation necessary - { - // The sequence has a maximum length, check that the new - // length is valid before changing anything. - *cs << "if (length > this->maximum_)" << nl; - *cs << "{\n"; - cs->incr_indent (); - *cs << "// @@ throw something?" << nl; - *cs << "return;\n"; - cs->decr_indent (); - *cs << "}" << nl; - *cs << "this->length_ = length;\n"; - } - else // unbounded buffer - may need reallocation - { - // Reallocate the buffer. - *cs << "if (length > this->maximum_) // need realloc" << nl; - *cs << "{\n"; - cs->incr_indent (); - if (s->gen_code (bt, this) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_sequence::" - "gen_client_stubs - " - "bad state\n"), - -1); - } - - *cs << " *tmp = " << this->name () - << "::allocbuf (length);" << nl; - *cs << "if (!tmp)" << nl; - *cs << "\treturn;" << nl; - - // copy each element. Allocate a new manager and initialize it. - switch (this->managed_type ()) - { - case be_sequence::MNG_OBJREF: - { - *cs << "CORBA::ULong i;" << nl; - *cs << "// copy old buffer" << nl; - *cs << "for (i=0; i < this->length_; i++)" << nl; - *cs << "{" << nl; - *cs << "\ttmp[i] = " << bt->name () << "::_duplicate (" - << "this->buffer_[i]);" << nl; - *cs << "}" << nl; - } - break; - case be_sequence::MNG_STRING: - { - *cs << "CORBA::ULong i;" << nl; - *cs << "// copy old buffer" << nl; - *cs << "for (i=0; i < this->length_; i++)" << nl; - *cs << "{" << nl; - *cs << "\ttmp[i] = CORBA::string_dup (" << - "this->buffer_[i]);" << nl; - *cs << "}" << nl; - } - break; - default: // all other types are self managed, just assign them. - { - *cs << "CORBA::ULong i;" << nl; - *cs << "// copy old buffer" << nl; - *cs << "for (i=0; i < this->length_; i++)" << nl; - *cs << "{" << nl; - *cs << "\ttmp[i] = this->buffer_[i];" << nl; - *cs << "}" << nl; - } - } - // if release is set, we must free the previous buffer - *cs << "if (this->release_) // free old one if we own it" << nl; - *cs << "{\n"; - cs->incr_indent (); - // only for obj references and strings, we need to free each individual - // element. Others are self managed. - // call the appropriate freebuf on the buffer - if (this->managed_type () != be_sequence::MNG_NONE) - { - *cs << this->name () << "::freebuf (this->buffer_, " << - "this->maximum_);\n"; - } - else - *cs << this->name () << "::freebuf (this->buffer_);\n"; - - cs->decr_indent (); - *cs << "}" << nl; - - *cs << "//assign the newly reallocated buffer" << nl; - *cs << "this->buffer_ = tmp;" << nl; - *cs << "this->release_ = 1; //after reallocation, we own it" << nl; - *cs << "this->maximum_ = length;\n"; - cs->decr_indent (); - *cs << "}" << nl;; - *cs << "this->length_ = length;\n"; - } - cs->decr_indent (); - *cs << "}\n\n"; - - // the allocbuf method - cs->indent (); - if (s->gen_code (bt, this) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_sequence::" - "gen_client_stubs - " - "state based codegen failed\n"), - -1); - } - - *cs << " *" << nl; - *cs << this->name () << "::allocbuf (CORBA::ULong nelems)" << nl; - *cs << "{\n"; - cs->incr_indent (); - if (s->gen_code (bt, this) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_sequence::" - "gen_client_stubs - " - "state based codegen failed\n"), - -1); - } - - *cs << " *buf = new "; - if (s->gen_code (bt, this) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_sequence::" - "gen_client_stubs - " - "state based codegen failed\n"), - -1); - } - *cs << "[nelems]; // allocate from heap" << nl; - // the managed types must be initilaized - switch (this->managed_type ()) - { - case be_sequence::MNG_OBJREF: - { - *cs << "for (CORBA::ULong i=0; i < nelems; i++)" << nl; - *cs << "\tbuf[i] = " << bt->name () << "::_nil ();" << nl; - } - break; - case be_sequence::MNG_STRING: - { - *cs << "for (CORBA::ULong i=0; i < nelems; i++)" << nl; - *cs << "\tbuf[i] = (char *)0;" << nl; - } - break; - } - *cs << "return buf;\n"; - - cs->decr_indent (); - *cs << "}\n\n"; - - // extra freebuf method for managed types - if (this->managed_type () != MNG_NONE) - { - cs->indent (); - *cs << "void" << nl; - *cs << this->name () << "::freebuf ("; - if (s->gen_code (bt, this) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_sequence::" - "gen_client_inline - " - "state based codegen failed\n"), - -1); - } - - *cs << " *seq, CORBA::ULong nelems)" << nl; - *cs << "{\n"; - cs->incr_indent (); - *cs << "if (!seq) return; // null sequence" << nl; - // the managed types must be individually freed. The others will have - // their destructors called. - switch (this->managed_type ()) - { - case be_sequence::MNG_OBJREF: - { - *cs << "for (CORBA::ULong i=0; i < nelems; i++)" << nl; - *cs << "\tCORBA::release (seq[i]);" << nl; - } - break; - case be_sequence::MNG_STRING: - { - *cs << "for (CORBA::ULong i=0; i < nelems; i++)" << nl; - *cs << "\tCORBA::string_free (seq[i]);" << nl; - } - break; - } - *cs << this->name () << "::freebuf (seq);\n"; - cs->decr_indent (); - *cs << "}\n\n"; - } - - // generate the typecode information here - cs->indent (); // start from current indentation level - *cs << "static const CORBA::Long _oc_" << this->flatname () << "[] =" << - nl; - *cs << "{\n"; - cs->incr_indent (0); - if (this->gen_encapsulation () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_sequence::" - "gen_client_stubs - " - "codegen for encapsulation failed\n"), - -1); - } - - cs->decr_indent (); - *cs << "};" << nl; - - *cs << "static CORBA::TypeCode _tc__tc_" << this->flatname () << - " (CORBA::tk_sequence, sizeof (_oc_" << this->flatname () << - "), (unsigned char *) &_oc_" << this->flatname () << - ", CORBA::B_FALSE);" << nl; - *cs << "CORBA::TypeCode_ptr " << this->tc_name () << " = &_tc__tc_" << - this->flatname () << ";\n\n"; - - cg->pop (); - this->cli_stub_gen_ = I_TRUE; - - cs->gen_endif (); - } - return 0; -} - -// Generates the client-side inline information -int -be_sequence::gen_client_inline (void) -{ - TAO_OutStream *ci; // output stream - TAO_NL nl; // end line - be_state *s; // code gen state - be_type *bt; // base type - - if (!this->cli_inline_gen_) - { - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - ci = cg->client_inline (); - - // retrieve base type - bt = be_type::narrow_from_decl (this->base_type ()); - if (!bt) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_sequence::" - "gen_client_inline - " - "bad type\n"), - -1); - } - - cg->push (TAO_CodeGen::TAO_SEQUENCE_BASE_CI); - s = cg->make_state (); - - // generate inline methods for our base type if it itself is a sequence - if (!s || (s->gen_code (bt, this) == -1)) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_sequence::" - "gen_client_inline - " - "state based codegen failed\n"), - -1); - } - cg->pop (); - - // generate the methods of the sequence C++ mapping - cg->push (TAO_CodeGen::TAO_SEQUENCE_BODY_CI); - s = cg->make_state (); - if (!s) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_sequence::" - "gen_client_inline - " - "bad state\n"), - -1); - } - - // generate the ifdefined macro for type - ci->gen_ifdef_macro (this->flatname ()); - - *ci << "// *************************************************************" - << nl; - *ci << "// class " << this->name () << nl; - *ci << "// *************************************************************\n\n"; - - // freebuf method - ci->indent (); - *ci << "ACE_INLINE void" << nl; - *ci << this->name () << "::freebuf ("; - if (s->gen_code (bt, this) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_sequence::" - "gen_client_inline - " - "state based codegen failed\n"), - -1); - } - - *ci << " *seq)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "delete []seq;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // default constructor - ci->indent (); - *ci << "//default constructor" << nl; - *ci << "ACE_INLINE " << nl; - *ci << this->name () << "::" << this->local_name () << " (void)" << nl; - // for bounded and unbounded, initialize the data members differently - if (this->unbounded_) - { - *ci << "\t: maximum_ (0)," << nl; - *ci << "\t length_ (0)," << nl; - *ci << "\t buffer_ (0)," << nl; - *ci << "\t release_ (0) // does not own" << nl; - } - else - { - *ci << "\t: maximum_ (" << this->max_size () << ")," << nl; - *ci << "\t length_ (0)," << nl; - *ci << "\t buffer_ (" << this->name () << "::allocbuf (" << - this->max_size () << "))," << nl; - *ci << "\t release_ (1) // owns" << nl; - } - *ci << "{}\n\n"; - - // the maximum method - ci->indent (); - *ci << "ACE_INLINE CORBA::ULong" << nl; - *ci << this->name () << "::maximum (void) const" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->maximum_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // the length method - ci->indent (); - *ci << "ACE_INLINE CORBA::ULong" << nl; - *ci << this->name () << "::length (void) const" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->length_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - cg->pop (); - - // subscript operators (1) read-only, (2) read/write - cg->push (TAO_CodeGen::TAO_SEQELEM_RETTYPE_CI); - s = cg->make_state (); - if (!s) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_sequence::" - "gen_client_inline - " - "bad state\n"), - -1); - } - - ci->indent (); - *ci << "ACE_INLINE "; - if (s->gen_code (bt, this) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_sequence::" - "gen_client_inline - " - "state based codegen failed\n"), - -1); - } - - *ci << nl; - *ci << this->name () << "::operator[] (CORBA::ULong index) // read/write" - << nl; - *ci << "{\n"; - ci->incr_indent (); - switch (this->managed_type ()) - { - case be_sequence::MNG_OBJREF: - *ci << "return " << this->name () << "::TAO_ObjRefMngType (" << - "&this->buffer_[index], this->release_);\n"; - break; - case be_sequence::MNG_STRING: - *ci << "return " << this->name () << "::TAO_StrMngType (" << - "&this->buffer_[index], this->release_);\n"; - break; - default: - *ci << "return this->buffer_[index];\n"; - } - ci->decr_indent (); - *ci << "}\n\n"; - - ci->indent (); - *ci << "ACE_INLINE const "; - if (s->gen_code (bt, this) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_sequence::" - "gen_client_inline - " - "state based codegen failed\n"), - -1); - } - - *ci << nl; - *ci << this->name () << "::operator[] (CORBA::ULong index) const // read" - << nl; - *ci << "{\n"; - ci->incr_indent (); - switch (this->managed_type ()) - { - case be_sequence::MNG_OBJREF: - *ci << "return " << this->name () << "::TAO_ObjRefMngType (" << - "&this->buffer_[index], this->release_);\n"; - break; - case be_sequence::MNG_STRING: - *ci << "return " << this->name () << "::TAO_StrMngType (" << - "&this->buffer_[index], this->release_);\n"; - break; - default: - *ci << "return this->buffer_[index];\n"; - } - ci->decr_indent (); - *ci << "}\n\n"; - cg->pop (); - ci->gen_endif (); // endif macro - - // generate the ifdefined macro for the var type - ci->gen_ifdef_macro (this->flatname (), "_var"); - - // generate the implementations for the _var and _impl classes - if (this->gen_var_impl () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_sequence::" - "gen_client_inline - " - "var implementation failed\n"), - -1); - } - ci->gen_endif (); - - // generate the ifdefined macro for the var type - ci->gen_ifdef_macro (this->flatname (), "_out"); - - if (this->gen_out_impl () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_sequence::" - "gen_client_inline - " - "out impl failed\n"), - -1); - } - ci->gen_endif (); // endif macro - - this->cli_inline_gen_ = I_TRUE; - } - return 0; -} - -int -be_sequence::gen_server_header (void) -{ - // nothing to be done - return 0; -} - -int -be_sequence::gen_server_skeletons (void) -{ - // nothing to be done - return 0; -} - -// Generates the server-side inline -int -be_sequence::gen_server_inline (void) -{ - // nothing to be done - return 0; -} - -// generate the _var definition for ourself -int -be_sequence::gen_var_defn (void) -{ - TAO_OutStream *ch; // output stream - TAO_NL nl; // end line - char namebuf [NAMEBUFSIZE]; // names - be_state *s; // code gen state - be_type *bt; // base type - be_decl *scope; // our enclosing scope - - - ACE_OS::memset (namebuf, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (namebuf, "%s_var", this->local_name ()->get_string ()); - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - ch = cg->client_header (); - - *ch << "// *************************************************************" - << nl; - *ch << "// class " << this->name () << "_var" << nl; - *ch << "// *************************************************************\n\n"; - - cg->push (TAO_CodeGen::TAO_SEQUENCE_BODY_CH); - s = cg->make_state (); - - if (!s) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_sequence::" - "gen_var_defn - " - "state based codegen failed\n"), - -1); - } - - // retrieve base type - bt = be_type::narrow_from_decl (this->base_type ()); - - if (this->defined_in ()) - scope = be_scope::narrow_from_scope (this->defined_in ())->decl (); - else - scope = 0; - - // generate the var definition (always in the client header). - // Depending upon the data type, there are some differences which we account - // for over here. - - ch->indent (); // start with whatever was our current indent level - *ch << "class " << namebuf << nl; - *ch << "{" << nl; - *ch << "public:\n"; - ch->incr_indent (); - // default constr - *ch << namebuf << " (void); // default constructor" << nl; - // constr - *ch << namebuf << " (" << this->local_name () << " *);" << nl; - // copy constructor - *ch << namebuf << " (const " << namebuf << - " &); // copy constructor" << nl; - // destructor - *ch << "~" << namebuf << " (void); // destructor" << nl; - *ch << nl; - // assignment operator from a pointer - *ch << namebuf << " &operator= (" << this->local_name () << " *);" << nl; - // assignment from _var - *ch << namebuf << " &operator= (const " << namebuf << - " &);" << nl; - - // arrow operator - *ch << this->local_name () << " *operator-> (void);" << nl; - *ch << "const " << this->local_name () << " *operator-> (void) const;" << nl; - *ch << nl; - - // other extra types (cast operators, [] operator, and others) - - // cast operator - *ch << "operator const " << this->local_name () << " &() const;" << nl; - *ch << "operator " << this->local_name () << " &();" << nl; - *ch << "operator " << this->local_name () << " &() const;" << nl; - - // overloaded [] operator. The const version is not required for sequences - - switch (this->managed_type ()) - { - case be_sequence::MNG_STRING: - if (scope) - { - *ch << "ACE_NESTED_CLASS (" << scope->name () << "," << - this->local_name () << "::TAO_StrMngType) "; - } - else - { - *ch << this->local_name () << "::TAO_StrMngType "; - } - break; - case be_sequence::MNG_OBJREF: - if (scope) - { - *ch << "ACE_NESTED_CLASS (" << scope->name () << "," << - this->local_name () << "::TAO_ObjRefMngType) "; - } - else - { - *ch << this->local_name () << "::TAO_ObjRefMngType "; - } - break; - default: - // gen code for base return type - if (s->gen_code (bt, this) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_sequence::" - "gen_var_defn - " - "state based codegen failed\n"), - -1); - } - *ch << " &"; - } - - *ch << "operator[] (CORBA::ULong index);" << nl; - - *ch << "// in, inout, out, _retn " << nl; - // the return types of in, out, inout, and _retn are based on the parameter - // passing rules and the base type - *ch << "const " << this->local_name () << " &in (void) const;" << nl; - *ch << this->local_name () << " &inout (void);" << nl; - *ch << this->local_name () << " *&out (void);" << nl; - *ch << this->local_name () << " *_retn (void);" << nl; - - // generate an additional member function that returns the underlying pointer - *ch << this->local_name () << " *ptr (void) const;\n"; - - *ch << "\n"; - ch->decr_indent (); - - // generate the private section - *ch << "private:\n"; - ch->incr_indent (); - *ch << this->local_name () << " *ptr_;\n"; - - ch->decr_indent (); - *ch << "};\n\n"; - cg->pop (); - - return 0; -} - -// implementation of the _var class. All of these get generated in the inline -// file -int -be_sequence::gen_var_impl (void) -{ - TAO_OutStream *ci; // output stream - TAO_NL nl; // end line - char fname [NAMEBUFSIZE]; // to hold the full and - char lname [NAMEBUFSIZE]; // local _var names - be_state *s; // code gen state - be_type *bt; // base type - - - ACE_OS::memset (fname, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (fname, "%s_var", this->fullname ()); - - ACE_OS::memset (lname, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (lname, "%s_var", this->local_name ()->get_string ()); - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - ci = cg->client_inline (); - - cg->push (TAO_CodeGen::TAO_SEQUENCE_BODY_CI); - s = cg->make_state (); - - if (!s) - { - ACE_ERROR_RETURN ((LM_ERROR, - "be_sequence::gen_var_impl - invalid state obj\n"), -1); - } - - // retrieve base type - bt = be_type::narrow_from_decl (this->base_type ()); - - // generate the var implementation in the inline file - ci->indent (); // start with whatever was our current indent level - - *ci << "// *************************************************************" - << nl; - *ci << "// Inline operations for class " << fname << nl; - *ci << "// *************************************************************\n\n"; - - // default constr - *ci << "ACE_INLINE" << nl; - *ci << fname << "::" << lname << - " (void) // default constructor" << nl; - *ci << "\t" << ": ptr_ (0)" << nl; - *ci << "{}\n\n"; - - // constr from a _ptr - ci->indent (); - *ci << "ACE_INLINE" << nl; - *ci << fname << "::" << lname << " (" << name () << "_ptr p)" << nl; - *ci << "\t: ptr_ (p)" << nl; - *ci << "{}\n\n"; - - // copy constructor - ci->indent (); - *ci << "ACE_INLINE" << nl; - *ci << fname << "::" << lname << " (const " << fname << - " &p) // copy constructor" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "if (p.ptr_)" << nl; - *ci << "\tthis->ptr_ = new " << this->name () << "(*p.ptr_);" << nl; - *ci << "else" << nl; - *ci << "\tthis->ptr_ = 0;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // destructor - ci->indent (); - *ci << "ACE_INLINE" << nl; - *ci << fname << "::~" << lname << " (void) // destructor" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "delete this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // assignment operator from a pointer - ci->indent (); - *ci << "ACE_INLINE " << fname << " &" << nl; - *ci << fname << "::operator= (" << name () << - " *p)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "delete this->ptr_;" << nl; - *ci << "this->ptr_ = p;" << nl; - *ci << "return *this;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // assignment operator from _var - ci->indent (); - *ci << "ACE_INLINE " << fname << " &" << nl; - *ci << fname << "::operator= (const " << fname << - " &p) // deep copy" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "if (this != &p)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "delete this->ptr_;" << nl; - *ci << "this->ptr_ = new " << this->name () << " (*p.ptr_);\n"; - ci->decr_indent (); - *ci << "}" << nl; - *ci << "return *this;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // two arrow operators - ci->indent (); - *ci << "ACE_INLINE const " << this->name () << " *" << nl; - *ci << fname << "::operator-> (void) const" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - ci->indent (); - *ci << "ACE_INLINE " << this->name () << " *" << nl; - *ci << fname << "::operator-> (void)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // other extra methods - 3 cast operator () - ci->indent (); - *ci << "ACE_INLINE " << nl; - *ci << fname << "::operator const " << name () << - " &() const // cast" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return *this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - ci->indent (); - *ci << "ACE_INLINE " << nl; - *ci << fname << "::operator " << name () << " &() // cast " << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return *this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - ci->indent (); - *ci << "ACE_INLINE " << nl; - *ci << fname << "::operator " << name () << " &() const// cast " << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return *this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // operator [] - ci->indent (); - *ci << "ACE_INLINE "; - switch (this->managed_type ()) - { - case be_sequence::MNG_STRING: - *ci << this->name () << "::TAO_StrMngType "; - break; - case be_sequence::MNG_OBJREF: - *ci << this->name () << "::TAO_ObjRefMngType "; - break; - default: - // gen code for base return type - if (s->gen_code (bt, this) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_sequence::" - "gen_var_impl - " - "state based codegen failed\n"), - -1); - } - *ci << " &"; - } - - *ci << nl; - *ci << fname << "::operator[] (CORBA::ULong index)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->ptr_->operator[] (index);\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // in, inout, out, and _retn - ci->indent (); - *ci << "ACE_INLINE const " << name () << " &" << nl; - *ci << fname << "::in (void) const" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return *this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - ci->indent (); - *ci << "ACE_INLINE " << name () << " &" << nl; - *ci << fname << "::inout (void)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return *this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - ci->indent (); - *ci << "// mapping for variable size " << nl; - *ci << "ACE_INLINE " << name () << " *&" << nl; - *ci << fname << "::out (void)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "delete this->ptr_;" << nl; - *ci << "this->ptr_ = 0;" << nl; - *ci << "return this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - ci->indent (); - *ci << "ACE_INLINE " << name () << " *" << nl; - *ci << fname << "::_retn (void)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << this->name () << " *tmp = this->ptr_;" << nl; - *ci << "this->ptr_ = 0;" << nl; - *ci << "return tmp;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // the additional ptr () member function - ci->indent (); - *ci << "ACE_INLINE " << name () << " *" << nl; - *ci << fname << "::ptr (void) const" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - cg->pop (); - - return 0; -} - -// generate the _out definition -int -be_sequence::gen_out_defn (void) -{ - TAO_OutStream *ch; // output stream - TAO_NL nl; // end line - char namebuf [NAMEBUFSIZE]; // to hold the _out name - be_state *s; // code gen state - be_type *bt; // base type - be_decl *scope; // our enclosing scope - - ACE_OS::memset (namebuf, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (namebuf, "%s_out", this->local_name ()->get_string ()); - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - ch = cg->client_header (); - cg->push (TAO_CodeGen::TAO_SEQUENCE_BODY_CH); - s = cg->make_state (); - - if (!s) - { - ACE_ERROR_RETURN ((LM_ERROR, - "be_sequence::gen_out_defn - invalid state obj\n"), -1); - } - - // retrieve base type - bt = be_type::narrow_from_decl (this->base_type ()); - - if (this->defined_in ()) - scope = be_scope::narrow_from_scope (this->defined_in ())->decl (); - else - scope = 0; - - // generate the out definition (always in the client header) - ch->indent (); // start with whatever was our current indent level - - *ch << "class " << namebuf << nl; - *ch << "{" << nl; - *ch << "public:\n"; - ch->incr_indent (); - - // No default constructor - - // constructor from a pointer - *ch << namebuf << " (" << this->local_name () << " *&);" << nl; - // constructor from a _var & - *ch << namebuf << " (" << this->local_name () << "_var &);" << nl; - // constructor from a _out & - *ch << namebuf << " (" << namebuf << " &);" << nl; - // assignment operator from a _out & - *ch << namebuf << " &operator= (" << namebuf << " &);" << nl; - // assignment operator from a pointer &, cast operator, ptr fn, operator - // -> and any other extra operators - // assignment - *ch << namebuf << " &operator= (" << this->local_name () << " *);" << nl; - // operator () - *ch << "operator " << this->local_name () << " *&();" << nl; - // ptr fn - *ch << this->local_name () << " *&ptr (void);" << nl; - // operator -> - *ch << this->local_name () << " *operator-> (void);" << nl; - - // overloaded [] operator only for sequence. The const version is not - // required - - switch (this->managed_type ()) - { - case be_sequence::MNG_STRING: - if (scope) - { - *ch << "ACE_NESTED_CLASS (" << scope->name () << "," << - this->local_name () << "::TAO_StrMngType) "; - } - else - { - *ch << this->local_name () << "::TAO_StrMngType "; - } - break; - case be_sequence::MNG_OBJREF: - if (scope) - { - *ch << "ACE_NESTED_CLASS (" << scope->name () << "," << - this->local_name () << "::TAO_ObjRefMngType) "; - } - else - { - *ch << this->local_name () << "::TAO_ObjRefMngType "; - } - break; - default: - // gen code for base return type - if (s->gen_code (bt, this) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_sequence::" - "gen_out_defn - " - "state based codegen failed\n"), - -1); - } - *ch << " &"; - } - - *ch << "operator[] (CORBA::ULong index);" << nl; - *ch << "\n"; - ch->decr_indent (); - *ch << "private:\n"; - ch->incr_indent (); - - *ch << this->local_name () << " *&ptr_;" << nl; - *ch << "// assignment from T_var not allowed" << nl; - *ch << "void operator= (const " << this->local_name () << "_var &);\n"; - - ch->decr_indent (); - *ch << "};\n\n"; - - cg->pop (); - return 0; -} - -int -be_sequence::gen_out_impl (void) -{ - TAO_OutStream *ci; // output stream - TAO_NL nl; // end line - char fname [NAMEBUFSIZE]; // to hold the full and - char lname [NAMEBUFSIZE]; // local _out names - be_state *s; // code gen state - be_type *bt; // base type - - - ACE_OS::memset (fname, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (fname, "%s_out", this->fullname ()); - - ACE_OS::memset (lname, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (lname, "%s_out", this->local_name ()->get_string ()); - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - ci = cg->client_inline (); - - cg->push (TAO_CodeGen::TAO_SEQUENCE_BODY_CI); - s = cg->make_state (); - - if (!s) - { - ACE_ERROR_RETURN ((LM_ERROR, - "be_sequence::gen_out_impl - invalid state obj\n"), -1); - } - - // retrieve base type - bt = be_type::narrow_from_decl (this->base_type ()); - - // generate the out implementation in the inline file - - ci->indent (); // start with whatever was our current indent level - - *ci << "// *************************************************************" - << nl; - *ci << "// Inline operations for class " << fname << nl; - *ci << "// *************************************************************\n\n"; - - // constr from a pointer - ci->indent (); - *ci << "ACE_INLINE" << nl; - *ci << fname << "::" << lname << " (" << name () << " *&p)" << nl; - *ci << "\t: ptr_ (p)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "this->ptr_ = 0;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // constructor from _var & - ci->indent (); - *ci << "ACE_INLINE" << nl; - *ci << fname << "::" << lname << " (" << this->name () << - "_var &p) // constructor from _var" << nl; - *ci << "\t: ptr_ (p.out ())" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "delete this->ptr_;" << nl; - *ci << "this->ptr_ = 0;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // copy constructor - ci->indent (); - *ci << "ACE_INLINE" << nl; - *ci << fname << "::" << lname << " (" << fname << - " &p) // copy constructor" << nl; - *ci << "\t: ptr_ (p.ptr_)" << nl; - *ci << "{}\n\n"; - - // assignment operator from _out & - ci->indent (); - *ci << "ACE_INLINE " << fname << " &" << nl; - *ci << fname << "::operator= (" << fname << - " &p)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "this->ptr_ = p.ptr_;" << nl; - *ci << "return *this;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // assignment from _var is not allowed by a private declaration - - // assignment operator from pointer - ci->indent (); - *ci << "ACE_INLINE " << fname << " &" << nl; - *ci << fname << "::operator= (" << this->name () << - " *p)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "this->ptr_ = p;" << nl; - *ci << "return *this;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // other extra methods - cast operator () - ci->indent (); - *ci << "ACE_INLINE " << nl; - *ci << fname << "::operator " << this->name () << - " *&() // cast" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // ptr function - ci->indent (); - *ci << "ACE_INLINE " << this->name () << " *&" << nl; - *ci << fname << "::ptr (void) // ptr" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // operator -> - ci->indent (); - *ci << "ACE_INLINE " << this->name () << " *" << nl; - *ci << fname << "::operator-> (void)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // sequence has an additional method - ci->indent (); - *ci << "ACE_INLINE "; - switch (this->managed_type ()) - { - case be_sequence::MNG_STRING: - *ci << this->name () << "::TAO_StrMngType "; - break; - case be_sequence::MNG_OBJREF: - *ci << this->name () << "::TAO_ObjRefMngType "; - break; - default: - // gen code for base return type - if (s->gen_code (bt, this) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_sequence::" - "gen_out_impl - " - "state based codegen failed\n"), - -1); - } - *ci << " &"; - } - - *ci << nl; - *ci << fname << "::operator[] (CORBA::ULong index)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->ptr_->operator[] (index);\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - cg->pop (); - return 0; -} - -// generate the managed type -int -be_sequence::gen_managed_type_ch (void) -{ - TAO_OutStream *ch; // output stream - TAO_NL nl; // end line - char namebuf [NAMEBUFSIZE]; // names - char typebuf [NAMEBUFSIZE]; // generated type - be_type *bt; // base type - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - ch = cg->client_header (); - - // retrieve base type - bt = be_type::narrow_from_decl (this->base_type ()); - if (!bt) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_sequence::" - "gen_gen_managed_type_ch - " - "state based codegen failed\n"), - -1); - } - - // set the name of the generated class - // the name depends on whether we are interface type or a string type - ACE_OS::memset (namebuf, '\0', NAMEBUFSIZE); - ACE_OS::memset (typebuf, '\0', NAMEBUFSIZE); - switch (this->managed_type ()) - { - case be_sequence::MNG_OBJREF: - { - ACE_OS::sprintf (namebuf, "%s", "TAO_ObjRefMngType"); - ACE_OS::sprintf (typebuf, "%s", bt->nested_type_name (this, "_ptr")); - } - break; - case be_sequence::MNG_STRING: - { - ACE_OS::sprintf (namebuf, "%s", "TAO_StrMngType"); - ACE_OS::sprintf (typebuf, "%s", "char *"); - } - break; - default: - // cannot be here - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_sequence::" - "gen_gen_managed_type_ch - " - "bad managed type\n"), - -1); - } - } - - ch->indent (); // start with whatever was our current indent level - *ch << "class " << namebuf << nl; - *ch << "{" << nl; - *ch << "public:\n"; - ch->incr_indent (); - // generate the friend instruction - *ch << "friend " << this->local_name () << ";" << nl; - // default constr is protected as this managed type is not available - // outside. Only this sequence can play with it. - //*ch << namebuf << " (void); // default constructor" << nl; - // copy constructor - *ch << namebuf << "(const " << namebuf << " &); // copy ctor " << nl; - // the constructor that will be used - if (this->managed_type () == be_sequence::MNG_STRING) - { - *ch << namebuf << "(char **buffer, CORBA::Boolean release);" << nl; - } - else - { - *ch << namebuf << "(" << bt->nested_type_name (this, "_ptr*") << - ", CORBA::Boolean release);" << nl; - } - // destructor - *ch << "~" << namebuf << " (void); // destructor" << nl; - *ch << nl; - // assignment operator from another managed type - *ch << namebuf << " &operator= (const " << namebuf << "&);" << nl; - // assignment operator from a pointer - *ch << namebuf << " &operator= (" << typebuf << ");" << nl; - - // others - if (this->managed_type () == be_sequence::MNG_STRING) - { - // assignment operator from a pointer to const - *ch << namebuf << " &operator= (const " << typebuf << ");" << nl; - // cast op - *ch << "operator const char*() const;" << nl; - *ch << "operator char *();" << nl; - // overloaded [] operator - only for strings - *ch << "char &operator[] (CORBA::ULong index);" << nl; - *ch << "const char &operator[] (CORBA::ULong index) const;" << nl; - *ch << "// in, inout, out, _retn " << nl; - // the return types of in, out, inout, and _retn are based on the parameter - // passing rules and the base type - *ch << "const char *in (void) const;" << nl; - *ch << "char *&inout (void);" << nl; - *ch << "char *&out (void);" << nl; - *ch << "char *_retn (void);" << nl; - } - else - { - *ch << "operator const " << bt->nested_type_name (this, "_ptr") << - " &() const;" << nl; - *ch << "operator " << bt->nested_type_name (this, "_ptr") << - " &();" << nl; - *ch << "// in, inout, out, _retn " << nl; - // the return types of in, out, inout, and _retn are based on the parameter - // passing rules and the base type - *ch << "const " << bt->nested_type_name (this, "_ptr") << - " in (void) const;" << nl; - *ch << bt->nested_type_name (this, "_ptr") << " &inout (void);" << nl; - *ch << bt->nested_type_name (this, "_ptr") << " &out (void);" << nl; - *ch << bt->nested_type_name (this, "_ptr") << " _retn (void);" << nl; - } - - *ch << "\n"; - ch->decr_indent (); - - // generate the private section - *ch << "private:\n"; - ch->incr_indent (); - // *ch << namebuf << "(const " << namebuf << " &); // copy ctor " << nl; - *ch << typebuf << " *ptr_;" << nl; - *ch << "CORBA::Boolean release_;\n"; - ch->decr_indent (); - *ch << "};\n\n"; - - return 0; -} - -// implementation of the managed type class. All of these get generated in the -// inline file -int -be_sequence::gen_managed_type_ci (void) -{ - TAO_OutStream *ci; // output stream - TAO_NL nl; // end line - be_type *bt; // base type - char fnamebuf [NAMEBUFSIZE]; // full name - char lnamebuf [NAMEBUFSIZE]; // local name - char typebuf [NAMEBUFSIZE]; // type name - char macro [NAMEBUFSIZE]; // for ifdef macro - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - // get the inline stream - ci = cg->client_inline (); - - // retrieve base type - bt = be_type::narrow_from_decl (this->base_type ()); - if (!bt) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_sequence.cpp::" - "gen_managed_types_ci - " - "Bad base type\n"), - -1); - } - - // set the names (this is for easier code generation) - ACE_OS::memset (fnamebuf, '\0', NAMEBUFSIZE); - ACE_OS::memset (lnamebuf, '\0', NAMEBUFSIZE); - ACE_OS::memset (typebuf, '\0', NAMEBUFSIZE); - ACE_OS::memset (macro, '\0', NAMEBUFSIZE); - switch (this->managed_type ()) - { - case be_sequence::MNG_OBJREF: - { - ACE_OS::sprintf (fnamebuf, "%s::%s", this->fullname (), "TAO_ObjRefMngType"); - ACE_OS::sprintf (lnamebuf, "%s", "TAO_ObjRefMngType"); - ACE_OS::sprintf (typebuf, "%s_ptr", bt->fullname ()); - ACE_OS::sprintf (macro, "%s_%s", this->flatname (), "TAO_ObjRefMngType"); - } - break; - case be_sequence::MNG_STRING: - { - ACE_OS::sprintf (fnamebuf, "%s::%s", this->fullname (), "TAO_StrMngType"); - ACE_OS::sprintf (lnamebuf, "%s", "TAO_StrMngType"); - ACE_OS::sprintf (typebuf, "%s", "char *"); - ACE_OS::sprintf (macro, "%s_%s", this->flatname (), "TAO_StrMngType"); - } - break; - default: - // cannot be here - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_sequence::" - "gen_managed_types_ci - " - "Bad managed type\n"), - -1); - } - } - - // generate the ifdefined macro for the managed - ci->gen_ifdef_macro (macro); - - // generate the managed type implementation in the inline file - ci->indent (); // start with whatever was our current indent level - - *ci << "// *************************************************************" - << nl; - *ci << "// Inline operations for class " << fnamebuf << nl; - *ci << "// *************************************************************\n\n"; - - // destructor - ci->indent (); - *ci << "ACE_INLINE " << nl; - *ci << fnamebuf << "::~" << lnamebuf << " (void) // destructor" << nl; - *ci << "{}\n\n"; - - // copy constructor not allowed - - // operators - if (this->managed_type () == be_sequence::MNG_STRING) - { - // constructor that will be used - ci->indent (); - *ci << "ACE_INLINE " << nl; - *ci << fnamebuf << "::" << lnamebuf << - "(char **buffer, CORBA::Boolean release)" << nl; - *ci << "\t: ptr_ (buffer)," << nl; - *ci << "\t release_ (release)" << nl; - *ci << "{}\n\n"; - - // other extra methods - cast operator () - ci->indent (); - *ci << "ACE_INLINE " << nl; - *ci << fnamebuf << "::operator const " << typebuf << - " () const // cast" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return *this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - ci->indent (); - *ci << "ACE_INLINE " << nl; - *ci << fnamebuf << "::operator " << typebuf << " () // cast " << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return *this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // operator [] - ci->indent (); - *ci << "ACE_INLINE char&" << nl; - *ci << fnamebuf << "::operator[] (CORBA::ULong index)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return *this->ptr_[index];\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // operator [] - ci->indent (); - *ci << "ACE_INLINE const char&" << nl; - *ci << fnamebuf << "::operator[] (CORBA::ULong index) const" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return *this->ptr_[index];\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - } - else if (this->managed_type () == be_sequence::MNG_OBJREF) - { - // constructor that will be used - ci->indent (); - *ci << "ACE_INLINE " << nl; - *ci << fnamebuf << "::" << lnamebuf << "(" << bt->name () << - "_ptr* buffer, CORBA::Boolean release)" << nl; - *ci << "\t: ptr_ (buffer)," << nl; - *ci << "\t release_ (release)" << nl; - *ci << "{}\n\n"; - - // other extra methods - cast operator () - ci->indent (); - *ci << "ACE_INLINE " << nl; - *ci << fnamebuf << "::operator const " << typebuf << - " &() const // cast" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return *this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - ci->indent (); - *ci << "ACE_INLINE " << nl; - *ci << fnamebuf << "::operator " << typebuf << " &() // cast " << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return *this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - } - else - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_sequence::" - "gen_managed_types_ci - " - "Bad managed type\n"), - -1); - } - - // in, inout - ci->indent (); - *ci << "ACE_INLINE const " << typebuf << nl; - *ci << fnamebuf << "::in (void) const" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return *this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - ci->indent (); - *ci << "ACE_INLINE " << typebuf << "&" << nl; - *ci << fnamebuf << "::inout (void)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return *this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - ci->gen_endif (); - return 0; -} - -// implementation of the managed types -int -be_sequence::gen_managed_type_cs (void) -{ - TAO_OutStream *cs; // output stream - TAO_NL nl; // end line - be_type *bt; // base type - char fnamebuf [NAMEBUFSIZE]; // full name - char lnamebuf [NAMEBUFSIZE]; // local name - char typebuf [NAMEBUFSIZE]; // type name - char macro [NAMEBUFSIZE]; // for ifdef macro - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - // get the stubs stream - cs = cg->client_stubs (); - - // retrieve base type - bt = be_type::narrow_from_decl (this->base_type ()); - if (!bt) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_sequence.cpp::" - "gen_managed_types_cs - " - "Bad base type\n"), - -1); - } - - // set the names (this is for easier code generation) - ACE_OS::memset (fnamebuf, '\0', NAMEBUFSIZE); - ACE_OS::memset (lnamebuf, '\0', NAMEBUFSIZE); - ACE_OS::memset (typebuf, '\0', NAMEBUFSIZE); - ACE_OS::memset (macro, '\0', NAMEBUFSIZE); - switch (this->managed_type ()) - { - case be_sequence::MNG_OBJREF: - { - ACE_OS::sprintf (fnamebuf, "%s::%s", this->fullname (), "TAO_ObjRefMngType"); - ACE_OS::sprintf (lnamebuf, "%s", "TAO_ObjRefMngType"); - ACE_OS::sprintf (typebuf, "%s_ptr", bt->fullname ()); - ACE_OS::sprintf (macro, "%s_%s", this->flatname (), "TAO_ObjRefMngType"); - } - break; - case be_sequence::MNG_STRING: - { - ACE_OS::sprintf (fnamebuf, "%s::%s", this->fullname (), "TAO_StrMngType"); - ACE_OS::sprintf (lnamebuf, "%s", "TAO_StrMngType"); - ACE_OS::sprintf (typebuf, "%s", "char *"); - ACE_OS::sprintf (macro, "%s_%s", this->flatname (), "TAO_StrMngType"); - } - break; - default: - // cannot be here - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_sequence.cpp::" - "gen_managed_types_cs - " - "Bad managed type\n"), - -1); - } - } - - // generate the ifdefined macro for the sequence type - cs->gen_ifdef_macro (macro); - - switch (this->managed_type ()) - { - case be_sequence::MNG_OBJREF: - { - // copy ctro - cs->indent (); - *cs << fnamebuf << "::" << lnamebuf << "(const " << fnamebuf << - " &_tao_mng_type)" << nl; - *cs << "{\n"; - cs->incr_indent (); - *cs << "*this->ptr_ = " << bt->name () << - "::_duplicate (*_tao_mng_type.ptr_);" << nl; - *cs << "this->release_ = _tao_mng_type.release_;\n"; - cs->decr_indent (); - *cs << "}\n\n"; - - // assignment operator - cs->indent (); - *cs << fnamebuf << "&" << nl; - *cs << fnamebuf << "::operator= (const " << fnamebuf << - " &_tao_mng_type)" << nl; - *cs << "{\n"; - cs->incr_indent (); - *cs << "if (this == &_tao_mng_type) return *this;" << nl; - *cs << "if (this->release_) // need to free old one" << nl; - *cs << " CORBA::release (*this->ptr_);" << nl; - *cs << "*this->ptr_ = " << bt->name () << - "::_duplicate (*_tao_mng_type.ptr_);" << nl; - *cs << "return *this;\n"; - cs->decr_indent (); - *cs << "}\n\n"; - - // assignment operator from a pointer - cs->indent (); - *cs << fnamebuf << " &" << nl; - *cs << fnamebuf << "::operator= (" << typebuf << " p)" << nl; - *cs << "{\n"; - cs->incr_indent (); - *cs << "if (this->release_) // need to free old one" << nl; - *cs << " CORBA::release (*this->ptr_);" << nl; - *cs << "*this->ptr_ = p; // no copy" << nl; - *cs << "return *this;\n"; - cs->decr_indent (); - *cs << "}\n\n"; - - // out method and _retn - cs->indent (); - *cs << "// mapping for variable size " << nl; - *cs << bt->name () << "_ptr &" << nl; - *cs << fnamebuf << "::out (void)" << nl; - *cs << "{\n"; - cs->incr_indent (); - *cs << "if (this->release_)" << nl; - *cs << " CORBA::release (*this->ptr_);" << nl; - *cs << "*this->ptr_ = " << bt->name () << "::_nil ();" << nl; - *cs << "return *this->ptr_;\n"; - cs->decr_indent (); - *cs << "}\n\n"; - - cs->indent (); - *cs << bt->name () << "_ptr" << nl; - *cs << fnamebuf << "::_retn (void)" << nl; - *cs << "{\n"; - cs->incr_indent (); - *cs << bt->name () << "_ptr tmp = *this->ptr_;" << nl; - *cs << "*this->ptr_ = " << bt->name () << "::_nil ();" << nl; - *cs << "return tmp;\n"; - cs->decr_indent (); - *cs << "}\n\n"; - } - break; - case be_sequence::MNG_STRING: - { - // copy constructor - cs->indent (); - *cs << fnamebuf << "::" << lnamebuf << "(const " << fnamebuf << - " &_tao_mng_type)" << nl; - *cs << "{\n"; - cs->incr_indent (); - *cs << "*this->ptr_ = CORBA::string_dup (*_tao_mng_type.ptr_);" << nl; - *cs << "this->release_ = _tao_mng_type.release_;\n"; - cs->decr_indent (); - *cs << "}\n\n"; - - // assignment operator (does not change the release flag) - cs->indent (); - *cs << fnamebuf << "&" << nl; - *cs << fnamebuf << "::operator= (const " << fnamebuf << - " &_tao_mng_type)" << nl; - *cs << "{\n"; - cs->incr_indent (); - *cs << "if (this == &_tao_mng_type) return *this;" << nl; - *cs << "if (this->release_) // need to free old one" << nl; - *cs << " CORBA::string_free (*this->ptr_);" << nl; - *cs << "*this->ptr_ = CORBA::string_dup (*_tao_mng_type.ptr_);" << nl; - *cs << "return *this;\n"; - cs->decr_indent (); - *cs << "}\n\n"; - - // assignment operator from a pointer - cs->indent (); - *cs << fnamebuf << " &" << nl; - *cs << fnamebuf << "::operator= (" << typebuf << " p)" << nl; - *cs << "{\n"; - cs->incr_indent (); - *cs << "if (this->release_) // need to free old one" << nl; - *cs << " CORBA::string_free (*this->ptr_);" << nl; - *cs << "*this->ptr_ = p; // no copy" << nl; - *cs << "return *this;\n"; - cs->decr_indent (); - *cs << "}\n\n"; - - // assignment operator from a pointer to const - cs->indent (); - *cs << fnamebuf << " &" << nl; - *cs << fnamebuf << "::operator= (const " << typebuf << " p)" << nl; - *cs << "{\n"; - cs->incr_indent (); - *cs << "if (this->release_) // need to free old one" << nl; - *cs << "{" << nl; - *cs << " CORBA::string_free (*this->ptr_);" << nl; - *cs << " *this->ptr_ = CORBA::string_dup (p);// make copy" << nl; - *cs << "}" << nl; - *cs << "else // make no copy as we don't own it" << nl; - *cs << " *this->ptr_ = (char *)p; // no copy" << nl; - *cs << "return *this;\n"; - cs->decr_indent (); - *cs << "}\n\n"; - - // out method and _retn - cs->indent (); - *cs << "// mapping for variable size " << nl; - *cs << "char *&" << nl; - *cs << fnamebuf << "::out (void)" << nl; - *cs << "{\n"; - cs->incr_indent (); - *cs << "if (this->release_)" << nl; - *cs << " CORBA::string_free (*this->ptr_);" << nl; - *cs << "*this->ptr_ = 0;" << nl; - *cs << "return *this->ptr_;\n"; - cs->decr_indent (); - *cs << "}\n\n"; - - cs->indent (); - *cs << "char *" << nl; - *cs << fnamebuf << "::_retn (void)" << nl; - *cs << "{\n"; - cs->incr_indent (); - *cs << "char *tmp = *this->ptr_;" << nl; - *cs << "*this->ptr_ = 0;" << nl; - *cs << "return tmp;\n"; - cs->decr_indent (); - *cs << "}\n\n"; - } - break; - } - - cs->gen_endif (); - return 0; -} - -// generate typecode. -// Typecode for sequences comprises the enumerated value followed by the -// encapsulation of the parameters - -int -be_sequence::gen_typecode (void) -{ - TAO_OutStream *cs; // output stream - TAO_NL nl; // end line - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - cs = cg->client_stubs (); - cs->indent (); // start from whatever indentation level we were at - - *cs << "CORBA::tk_sequence, // typecode kind" << nl; - *cs << this->tc_encap_len () << ", // encapsulation length\n"; - // now emit the encapsulation - return this->gen_encapsulation (); -} - -// generate encapsulation -// An encapsulation for ourselves will be necessary when we are part of some -// other IDL type and a typecode for that other type is being generated. This -// will comprise our typecode kind. IDL types with parameters will additionally -// have the encapsulation length and the entire typecode description - -int -be_sequence::gen_encapsulation (void) -{ - TAO_OutStream *os; // output stream - TAO_NL nl; // end line - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - be_type *bt; // base type - - os = cg->client_stubs (); - os->incr_indent (); - - *os << "TAO_ENCAP_BYTE_ORDER, // byte order\n"; - - // emit typecode of element type - bt = be_type::narrow_from_decl (this->base_type ()); - if (!bt || (bt->gen_typecode () == -1)) - { - ACE_ERROR ((LM_ERROR, "be_sequence::gen_typecode - bad base type\n")); - return -1; - } - - // emit the length - os->decr_indent (); - *os << this->max_size () << ",\n"; - return 0; -} - -// compute typecode size -long -be_sequence::tc_size (void) -{ - // 4 bytes for enumeration, 4 bytes for storing encap length val, followed by the - // actual encapsulation length - return 4 + 4 + this->tc_encap_len (); -} - -long -be_sequence::tc_encap_len (void) -{ - if (this->encap_len_ == -1) // not computed yet - { - be_type *bt; // base type - - this->encap_len_ = 4; // holds the byte order flag - // add the encapsulation length of our base type - bt = be_type::narrow_from_decl (this->base_type ()); - if (!bt) - { - ACE_ERROR ((LM_ERROR, - "be_sequence::tc_encap_len - bad base type\n")); - return 0; - } - this->encap_len_ += bt->tc_size (); - this->encap_len_ += 4; // to hold the max size - - } - return this->encap_len_; -} - -/* - * Add this be_sequence to the locally defined types in this scope - */ -be_sequence * -be_sequence::fe_add_sequence (be_sequence *t) -{ - if (t == NULL) - return NULL; - - this->add_to_local_types(t); - return t; -} - -// overridden method -be_decl * -be_sequence::decl (void) -{ - return this; -} - -// Narrowing -IMPL_NARROW_METHODS3 (be_sequence, AST_Sequence, be_scope, be_type) -IMPL_NARROW_FROM_DECL (be_sequence) diff --git a/TAO/TAO_IDL/be/be_state.cpp b/TAO/TAO_IDL/be/be_state.cpp deleted file mode 100644 index 59312eaeaa5..00000000000 --- a/TAO/TAO_IDL/be/be_state.cpp +++ /dev/null @@ -1,65 +0,0 @@ -// ============================================================================ -// -// = LIBRARY -// TAO IDL -// -// = FILENAME -// be_state.cpp -// -// = DESCRIPTION -// state based code generation. -// -// = AUTHOR -// Aniruddha Gokhale -// -// ============================================================================ - -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -// constructor -be_state::be_state (void) -{ -} - -// destructor -be_state::~be_state (void) -{ -} - -#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class ACE_Singleton<be_state_struct, ACE_SYNCH_RECURSIVE_MUTEX>; -template class ACE_Singleton<be_state_union_disctypedefn_ch, ACE_SYNCH_RECURSIVE_MUTEX>; -template class ACE_Singleton<be_state_union_disctypedefn_ci, ACE_SYNCH_RECURSIVE_MUTEX>; -template class ACE_Singleton<be_state_union_public_ch, ACE_SYNCH_RECURSIVE_MUTEX>; -template class ACE_Singleton<be_state_union_public_ci, ACE_SYNCH_RECURSIVE_MUTEX>; -template class ACE_Singleton<be_state_union_public_cs, ACE_SYNCH_RECURSIVE_MUTEX>; -template class ACE_Singleton<be_state_union_private_ch, ACE_SYNCH_RECURSIVE_MUTEX>; -template class ACE_Singleton<be_state_operation, ACE_SYNCH_RECURSIVE_MUTEX>; -template class ACE_Singleton<be_state_argument, ACE_SYNCH_RECURSIVE_MUTEX>; -template class ACE_Singleton<be_state_typedef, ACE_SYNCH_RECURSIVE_MUTEX>; -template class ACE_Singleton<be_state_array, ACE_SYNCH_RECURSIVE_MUTEX>; -template class ACE_Singleton<be_state_sequence, ACE_SYNCH_RECURSIVE_MUTEX>; -template class ACE_Singleton<be_state_attribute, ACE_SYNCH_RECURSIVE_MUTEX>; -template class ACE_Singleton<be_state_exception, ACE_SYNCH_RECURSIVE_MUTEX>; -template class ACE_Singleton<TAO_CodeGen, ACE_SYNCH_RECURSIVE_MUTEX>; -template class ACE_Singleton<TAO_OutStream_Factory, ACE_SYNCH_RECURSIVE_MUTEX>; -#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -#pragma instantiate ACE_Singleton<be_state_struct, ACE_SYNCH_RECURSIVE_MUTEX> -#pragma instantiate ACE_Singleton<be_state_union_disctypedefn_ch, ACE_SYNCH_RECURSIVE_MUTEX> -#pragma instantiate ACE_Singleton<be_state_union_disctypedefn_ci, ACE_SYNCH_RECURSIVE_MUTEX> -#pragma instantiate ACE_Singleton<be_state_union_public_ch, ACE_SYNCH_RECURSIVE_MUTEX> -#pragma instantiate ACE_Singleton<be_state_union_public_ci, ACE_SYNCH_RECURSIVE_MUTEX> -#pragma instantiate ACE_Singleton<be_state_union_public_cs, ACE_SYNCH_RECURSIVE_MUTEX> -#pragma instantiate ACE_Singleton<be_state_union_private_ch, ACE_SYNCH_RECURSIVE_MUTEX> -#pragma instantiate ACE_Singleton<be_state_operation, ACE_SYNCH_RECURSIVE_MUTEX> -#pragma instantiate ACE_Singleton<be_state_argument, ACE_SYNCH_RECURSIVE_MUTEX> -#pragma instantiate ACE_Singleton<be_state_typedef, ACE_SYNCH_RECURSIVE_MUTEX> -#pragma instantiate ACE_Singleton<be_state_array, ACE_SYNCH_RECURSIVE_MUTEX> -#pragma instantiate ACE_Singleton<be_state_sequence, ACE_SYNCH_RECURSIVE_MUTEX> -#pragma instantiate ACE_Singleton<be_state_attribute, ACE_SYNCH_RECURSIVE_MUTEX> -#pragma instantiate ACE_Singleton<be_state_exception, ACE_SYNCH_RECURSIVE_MUTEX> -#pragma instantiate ACE_Singleton<TAO_CodeGen, ACE_SYNCH_RECURSIVE_MUTEX> -#pragma instantiate ACE_Singleton<TAO_OutStream_Factory, ACE_SYNCH_RECURSIVE_MUTEX> -#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/TAO/TAO_IDL/be/be_state_argument.cpp b/TAO/TAO_IDL/be/be_state_argument.cpp deleted file mode 100644 index ed428d30a66..00000000000 --- a/TAO/TAO_IDL/be/be_state_argument.cpp +++ /dev/null @@ -1,2230 +0,0 @@ -// ============================================================================ -// -// = LIBRARY -// TAO IDL -// -// = FILENAME -// be_state_argument.cpp -// -// = DESCRIPTION -// state based code generation for arguments. -// -// = AUTHOR -// Aniruddha Gokhale -// -// ============================================================================ - -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -// return type for argument -be_state_argument::be_state_argument (void) -{ -} - -// generate code for the mapping of the argument. -// The different cases below have the following meaning: -// TAO_ARGUMENT_CH -// TAO_ARGUMENT_CS -// TAO_ARGUMENT_SH -- all three generate the arguments in the signature of the -// method . The CH case uses the ACE_NESTED_CLASS macro to -// keep the MSVC++ compiler happy -// The rest of the enumerated constants are self-explanatory -// -// There are 3 levels of nested switch statements -// Level (1): The "type" of each argument, e.g., predefined, structure, ... -// Level (2): The direction - in, inout, out -// Level (3): The current state we are in - -int -be_state_argument::gen_code (be_type *bt, be_decl *d, be_type *type) -{ - TAO_OutStream *os = 0; // output stream - TAO_NL nl; // end line - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - be_argument *arg; // argument node - be_interface *bif; // interface inside which the operation that uses this - // argument was defined - - switch (cg->state ()) - { - case TAO_CodeGen::TAO_ARGUMENT_CH: - os = cg->client_header (); - break; - case TAO_CodeGen::TAO_ARGUMENT_CS: - case TAO_CodeGen::TAO_ARGUMENT_PRE_DOCALL_CS: - case TAO_CodeGen::TAO_ARGUMENT_DOCALL_CS: - case TAO_CodeGen::TAO_ARGUMENT_POST_DOCALL_CS: - os = cg->client_stubs (); - break; - case TAO_CodeGen::TAO_ARGUMENT_SH: - os = cg->server_header (); - break; - case TAO_CodeGen::TAO_ARGUMENT_SS: - case TAO_CodeGen::TAO_ARGUMENT_VARDECL_SS: - case TAO_CodeGen::TAO_ARGUMENT_PRE_UPCALL_SS: - case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: - case TAO_CodeGen::TAO_ARGUMENT_POST_UPCALL_SS: - os = cg->server_skeletons (); - break; - } - - // retrieve the argument node - arg = be_argument::narrow_from_decl (d); - if (!arg) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_argument.cpp - " - "Bad argument\n"), - -1); - } - - // get the scope of the arg which is the operation. Its scope is the - // interface node. We need this interface node for generating the - // ACE_NESTED_CLASS macro - bif = be_interface::narrow_from_scope (ScopeAsDecl (arg->defined_in - ())->defined_in ()); - if (!bif) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_argument.cpp - " - "Bad interface\n"), - -1); - } - - if (!type) // not a recursive call - type = bt; - else // recursively called thru a typedef. "type" will have the most primitive - // base class of the typedef - ACE_ASSERT (bt->node_type () == AST_Decl::NT_typedef); - - // find the direction of the argument. Depending on the direction and the - // type, generate the mapping - switch (type->node_type ()) // LEVEL (1) switch on node type of the "type" - { - case AST_Decl::NT_interface: // type is an obj reference - case AST_Decl::NT_interface_fwd: // type is an obj reference - { - switch (arg->direction ()) - { - case AST_Argument::dir_IN: - // what state are we in - switch (cg->state ()) - { - case TAO_CodeGen::TAO_ARGUMENT_PRE_DOCALL_CS: - { - // assign to a CORBA::Object_ptr - *os << "CORBA::Object_ptr _tao_base_" << arg->local_name () - << " = " << arg->local_name () << "; // cast it" << nl; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_DOCALL_CS: - { - // pass the cast value - *os << ", &_tao_base_" << arg->local_name (); - } - break; - case TAO_CodeGen::TAO_ARGUMENT_POST_DOCALL_CS: - { - // nothing for in parameters - } - break; - case TAO_CodeGen::TAO_ARGUMENT_VARDECL_SS: - { - // declare a variable - *os << bt->name () << "_ptr "; - *os << arg->local_name () << ";" << nl; - // we also declare a corresponding CORBA::Object_ptr to be - // passed to the decoder - *os << "CORBA::Object_ptr _tao_base_" << arg->local_name () - << ";" << nl; -#if 0 - // now define a NamedValue_ptr - *os << "CORBA::NamedValue_ptr nv_" << arg->local_name () << - ";" << nl; - // declare an Any - *os << "CORBA::Any \t any_" << arg->local_name () << " (" << - bt->tc_name () << ", &_tao_base_" << arg->local_name () << - "); // ORB does not own" << nl; -#endif - // insert into the Any - *os << "(void) nvlist->add_item (\"" << arg->local_name () << - "\", CORBA::ARG_IN, _tao_environment)->value ()->" << - "replace (" << bt->tc_name () - << ", &_tao_base_" << arg->local_name () << ", 0, " << - "_tao_environment); // ORB does not own" << nl; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_PRE_UPCALL_SS: - { - // convert from the CORBA::Object_ptr to the interface type - // using a _narrow - *os << arg->local_name () << " = " << bt->name () << - "::_narrow (_tao_base_" << arg->local_name () << ", " << - "_tao_environment);" << nl; - *os << "if (_tao_environment.exception ()) return;" << nl; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: - { - *os << arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_POST_UPCALL_SS: - { - // we must release the in parameter - *os << "CORBA::release (" << arg->local_name () << ");" << nl; - *os << "CORBA::release (_tao_base_" << arg->local_name () << - ");" << nl; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_CH: - { - // to keep the MSVC++ compiler happy - *os << bt->nested_type_name (bif, "_ptr") << " " << - arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_CS: - case TAO_CodeGen::TAO_ARGUMENT_SH: - { - *os << bt->name () << "_ptr " << arg->local_name () << ", "; - } - break; - default: - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_argument - unknown state\n"), -1); - } - } // switch state - break; - case AST_Argument::dir_INOUT: // inout - switch (cg->state ()) - { - case TAO_CodeGen::TAO_ARGUMENT_PRE_DOCALL_CS: - { - // assign to a CORBA::Object_ptr - *os << "CORBA::Object_ptr _tao_base_" << arg->local_name () - << " = " << arg->local_name () << ";" << nl; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_DOCALL_CS: - { - *os << ", &_tao_base_" << arg->local_name (); - } - break; - case TAO_CodeGen::TAO_ARGUMENT_POST_DOCALL_CS: - { - // reassign to the inout parameter doing a _narrow - *os << arg->local_name () << " = " << bt->name () << - "::_narrow (_tao_base_" << arg->local_name () << ", env);" - << nl; - *os << "CORBA::release (_tao_base_" << arg->local_name () << - ");" << nl; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_VARDECL_SS: - { - // declare a variable - *os << bt->name () << "_ptr "; - *os << arg->local_name () << ";" << nl; - // we also declare a corresponding CORBA::Object_ptr to be - // passed to the decoder - *os << "CORBA::Object_ptr *_tao_base_" << arg->local_name () - << " = new CORBA::Object_ptr;" << nl; -#if 0 - // now define a NamedValue_ptr - *os << "CORBA::NamedValue_ptr nv_" << arg->local_name () << - ";" << nl; - // declare an Any - *os << "CORBA::Any \t any_" << arg->local_name () << " (" << - bt->tc_name () << ", _tao_base_" << arg->local_name () << - ", 1); // ORB owns" << nl; -#endif - // insert into the Any - *os << "(void) nvlist->add_item (\"" << arg->local_name () << - "\", CORBA::ARG_INOUT, _tao_environment)->value ()->" << - "replace (" << bt->tc_name () - << ", _tao_base_" << arg->local_name () << ", 1, " << - "_tao_environment); // ORB owns" << nl; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_PRE_UPCALL_SS: - { - // convert from the CORBA::Object_ptr to the interface type - // using a _narrow - *os << arg->local_name () << " = " << bt->name () << - "::_narrow (*_tao_base_" << arg->local_name () << ", " << - "_tao_environment);" << nl; - *os << "if (_tao_environment.exception ()) return;" << nl; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_POST_UPCALL_SS: - { - // assign modified interface obj ref to object_ptr - *os << "CORBA::release (*_tao_base_" << arg->local_name () << - "); // first release old obj" << nl; - *os << "*_tao_base_" << arg->local_name () << " = " << - arg->local_name () << ";" << nl; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: - { - *os << arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_CH: - { - // to keep the MSVC++ compiler happy - *os << bt->nested_type_name (bif, "_ptr") << " &" << - arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_CS: - case TAO_CodeGen::TAO_ARGUMENT_SH: - { - *os << bt->name () << "_ptr &" << arg->local_name () << ", "; - } - break; - default: - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_argument - unknown state\n"), -1); - } - } // end switch state - break; - case AST_Argument::dir_OUT: - switch (cg->state ()) - { - case TAO_CodeGen::TAO_ARGUMENT_PRE_DOCALL_CS: - { - // assign to a CORBA::Object_ptr - *os << "CORBA::Object_ptr _tao_base_" << arg->local_name () - << ";" << nl; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_DOCALL_CS: - { - *os << ", &_tao_base_" << arg->local_name (); - } - break; - case TAO_CodeGen::TAO_ARGUMENT_POST_DOCALL_CS: - { - // reassign to the inout parameter doing a _narrow - *os << arg->local_name () << " = " << bt->name () << - "::_narrow (_tao_base_" << arg->local_name () << ", env);" - << nl; - *os << "// free the Object_ptr" << nl; - *os << "CORBA::release (_tao_base_" << arg->local_name () << - ");" << nl; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_VARDECL_SS: - { - // declare a variable - *os << bt->name () << "_ptr " << arg->local_name () << ";" << - nl; - *os << bt->name () << "_out " << arg->local_name () << - "_out (" << arg->local_name () << ");" << nl; - // we also declare a corresponding CORBA::Object_ptr to be - // passed to the decoder - *os << "CORBA::Object_ptr *_tao_base_" << arg->local_name () - << " = new CORBA::Object_ptr;" << nl; -#if 0 - // now define a NamedValue_ptr - *os << "CORBA::NamedValue_ptr nv_" << arg->local_name () << - ";" << nl; - // declare an Any - *os << "CORBA::Any \t any_" << arg->local_name () << " (" << - bt->tc_name () << ", _tao_base_" << arg->local_name () << - ", 1); // ORB owns" << nl; -#endif - // now define a NamedValue_ptr - *os << "CORBA::NamedValue_ptr nv_" << arg->local_name () << - " = nvlist->add_item (\"" << arg->local_name () << - "\", CORBA::ARG_OUT, _tao_environment);" << nl; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_PRE_UPCALL_SS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ARGUMENT_POST_UPCALL_SS: - { - // out parameter is cast to Object_ptr - *os << "*_tao_base_" << arg->local_name () << " = " << - arg->local_name () << "_out.ptr ();" << nl; - *os << "nv_" << arg->local_name () << "->value ()->" << - "replace (" << bt->tc_name () - << ", _tao_base_" << arg->local_name () << ", 1, " << - "_tao_environment); // ORB owns" << nl; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: - { - *os << arg->local_name () << "_out, "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_CH: - { - // to keep the MSVC++ compiler happy - *os << bt->nested_type_name (bif, "_out") << " " << - arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_CS: - case TAO_CodeGen::TAO_ARGUMENT_SH: - { - *os << bt->name () << "_out " << arg->local_name () << ", "; - } - break; - default: - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_argument - unknown state\n"), -1); - } - } // end switch state - break; - } // end switch direction - } // end of case interface/interface_fwd - break; - case AST_Decl::NT_pre_defined: // type is predefined type - { - be_predefined_type *bpd = be_predefined_type::narrow_from_decl (type); - - // check if the type is an any - if (bpd->pt () == AST_PredefinedType::PT_any) - { - switch (arg->direction ()) - { - case AST_Argument::dir_IN: - switch (cg->state ()) - { - case TAO_CodeGen::TAO_ARGUMENT_VARDECL_SS: - { - *os << bt->name () << " "; - // declare a variable - *os << arg->local_name () << ";" << nl; -#if 0 - // now define a NamedValue_ptr - *os << "CORBA::NamedValue_ptr nv_" << arg->local_name () << - ";" << nl; - // declare an Any - *os << "CORBA::Any \t any_" << arg->local_name () << " (" << - bt->tc_name () << ", &" << arg->local_name () << - "); // ORB does not own" << nl; -#endif - // insert into the Any - *os << "(void) nvlist->add_item (\"" << arg->local_name () << - "\", CORBA::ARG_IN, _tao_environment)->value ()->" << - "replace (" << bt->tc_name () - << ", &" << arg->local_name () << ", 0, " << - "_tao_environment); // ORB does not own" << nl; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_PRE_DOCALL_CS: - { - // XXXASG - TODO - } - break; - case TAO_CodeGen::TAO_ARGUMENT_DOCALL_CS: - { - // XXXASG - TODO - } - break; - case TAO_CodeGen::TAO_ARGUMENT_POST_DOCALL_CS: - { - // XXXASG - TODO - } - break; - case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: - { - *os << arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_PRE_UPCALL_SS: - { - // XXXASG - TODO - } - break; - case TAO_CodeGen::TAO_ARGUMENT_POST_UPCALL_SS: - { - // nothing since the Any will call its destructor - } - break; - case TAO_CodeGen::TAO_ARGUMENT_CH: - { - // keep MSVC++ happy - *os << "const " << bt->nested_type_name (bif) << " &" << - arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_CS: - case TAO_CodeGen::TAO_ARGUMENT_SH: - { - *os << "const " << bt->name () << " &" << arg->local_name - () << ", "; - } - break; - default: - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_argument - unknown state\n"), -1); - } - } // end switch state - break; - case AST_Argument::dir_INOUT: - switch (cg->state ()) - { - case TAO_CodeGen::TAO_ARGUMENT_VARDECL_SS: - { - // declare a variable - *os << bt->name () << " *"; - *os << arg->local_name () << " = new " << bt->name () << - ";" << nl; -#if 0 - // now define a NamedValue_ptr - *os << "CORBA::NamedValue_ptr nv_" << arg->local_name () << - ";" << nl; - // declare an Any - *os << "CORBA::Any \t any_" << arg->local_name () << " (" << - bt->tc_name () << ", &" << arg->local_name () << - ", 1); // ORB owns" << nl; -#endif - // insert into the Any - *os << "(void) nvlist->add_item (\"" << arg->local_name () << - "\", CORBA::ARG_INOUT, _tao_environment)->value ()->" << - "replace (" << bt->tc_name () - << ", " << arg->local_name () << ", 1, " << - "_tao_environment); // ORB owns" << nl; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_PRE_DOCALL_CS: - { - // XXXASG - TODO very similar to ObjRef - } - break; - case TAO_CodeGen::TAO_ARGUMENT_DOCALL_CS: - { - // XXXASG - TODO very similar to ObjRef - } - break; - case TAO_CodeGen::TAO_ARGUMENT_POST_DOCALL_CS: - { - // XXXASG - TODO very similar to ObjRef - } - break; - case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: - { - *os << "*" << arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_PRE_UPCALL_SS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ARGUMENT_POST_UPCALL_SS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ARGUMENT_CH: - { - *os << "const " << bt->nested_type_name (bif) << " &" << - arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_CS: - case TAO_CodeGen::TAO_ARGUMENT_SH: - { - *os << bt->name () << " &" << arg->local_name () << ", "; - } - break; - default: - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_argument - unknown state\n"), -1); - } - } // end switch state - break; - case AST_Argument::dir_OUT: - switch (cg->state ()) - { - case TAO_CodeGen::TAO_ARGUMENT_VARDECL_SS: - { - // declare a variable - *os << bt->name () << " *" << arg->local_name () << - " = 0;" << nl; - *os << bt->name () << "_out " << arg->local_name () << - "_out (" << arg->local_name () << ");" << nl; -#if 0 - // now define a NamedValue_ptr - *os << "CORBA::NamedValue_ptr nv_" << arg->local_name () << - ";" << nl; - // declare an Any - *os << "CORBA::Any \t any_" << arg->local_name () << " (" << - bt->tc_name () << ", " << arg->local_name () << - ", 1); // ORB owns" << nl; -#endif - // now define a NamedValue_ptr - *os << "CORBA::NamedValue_ptr nv_" << arg->local_name () - << " = nvlist->add_item (\"" << arg->local_name - () << "\", CORBA::ARG_OUT, _tao_environment);" << nl; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_PRE_DOCALL_CS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ARGUMENT_DOCALL_CS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ARGUMENT_POST_DOCALL_CS: - { - // TODO - } - break; - case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: - { - *os << arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_PRE_UPCALL_SS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ARGUMENT_POST_UPCALL_SS: - { -#if 0 // causing ambiguity on NT compiler - *os << arg->local_name () << " = " << arg->local_name () - << "_out;" << nl; -#endif - *os << "nv_" << arg->local_name () << "->" << - "value ()->replace (" << bt->tc_name () - << ", " << arg->local_name () << ", 1, " << - "_tao_environment); // ORB owns" << nl; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_CH: - { - *os << bt->nested_type_name (bif, "_out") << " " << - arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_CS: - case TAO_CodeGen::TAO_ARGUMENT_SH: - { - *os << bt->name () << "_out " << arg->local_name () << - ", "; - } - break; - default: - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_argument - unknown state\n"), -1); - } - } // end switch state - break; - } // end switch direction - } // end of if - else if (bpd->pt () == AST_PredefinedType::PT_pseudo) // e.g., CORBA::Object - { - switch (arg->direction ()) - { - case AST_Argument::dir_IN: - switch (cg->state ()) - { - case TAO_CodeGen::TAO_ARGUMENT_VARDECL_SS: - { - // declare a variable - *os << bt->name () << "_ptr " << arg->local_name () << ";" << nl; -#if 0 - // now define a NamedValue_ptr - *os << "CORBA::NamedValue_ptr nv_" << arg->local_name () << - ";" << nl; - // declare an Any - *os << "CORBA::Any \t any_" << arg->local_name () << " (" << - bt->tc_name () << ", &" << arg->local_name () << - "); // ORB does not own" << nl; -#endif - // insert into the Any - *os << "(void) nvlist->add_item (\"" << arg->local_name - () << "\", CORBA::ARG_IN, _tao_environment)->" << - "value ()->replace (" << bt->tc_name () - << ", &" << arg->local_name () << ", 0, " << - "_tao_environment); // ORB does not own" << nl; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_PRE_DOCALL_CS: - { - // no casting necessary as we already are object_ptr - } - break; - case TAO_CodeGen::TAO_ARGUMENT_DOCALL_CS: - { - *os << ", &" << arg->local_name (); - } - break; - case TAO_CodeGen::TAO_ARGUMENT_POST_DOCALL_CS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: - { - *os << arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_PRE_UPCALL_SS: - { - // nothing to be done as we are Object_ptr - } - break; - case TAO_CodeGen::TAO_ARGUMENT_POST_UPCALL_SS: - { - //release the in parameter - *os << "CORBA::release (" << arg->local_name () << ");" - << nl; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_CH: - { - *os << bt->nested_type_name (bif, "_ptr") << " " << - arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_CS: - case TAO_CodeGen::TAO_ARGUMENT_SH: - { - *os << bt->name () << "_ptr " << arg->local_name () << - ", "; - } - break; - default: - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_argument - unknown state\n"), -1); - } - } // end of switch state - break; - case AST_Argument::dir_INOUT: - switch (cg->state ()) - { - case TAO_CodeGen::TAO_ARGUMENT_VARDECL_SS: - { - // declare a variable - *os << bt->name () << "_ptr *" << arg->local_name () << - " = new " << bt->name () << "_ptr;" << nl; -#if 0 - // now define a NamedValue_ptr - *os << "CORBA::NamedValue_ptr nv_" << arg->local_name () << - ";" << nl; - // declare an Any - *os << "CORBA::Any \t any_" << arg->local_name () << " (" << - bt->tc_name () << ", " << arg->local_name () << - ", 1); // ORB owns" << nl; -#endif - // insert into the Any - *os << "(void) nvlist->add_item (\"" << arg->local_name - () << "\", CORBA::ARG_INOUT, _tao_environment)->" << - "value ()->replace (" << bt->tc_name () - << ", " << arg->local_name () << ", 1, " << - "_tao_environment); // ORB owns" << nl; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_PRE_DOCALL_CS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ARGUMENT_DOCALL_CS: - { - *os << ", &" << arg->local_name (); - } - break; - case TAO_CodeGen::TAO_ARGUMENT_POST_DOCALL_CS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: - { - *os << "*" << arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_PRE_UPCALL_SS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ARGUMENT_POST_UPCALL_SS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ARGUMENT_CH: - { - *os << bt->nested_type_name (bif, "_ptr") << " &" << - arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_CS: - case TAO_CodeGen::TAO_ARGUMENT_SH: - { - *os << bt->name () << "_ptr &" << arg->local_name () << - ", "; - } - break; - default: - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_argument - unknown state\n"), -1); - } - } // end switch state - break; - case AST_Argument::dir_OUT: - switch (cg->state ()) - { - case TAO_CodeGen::TAO_ARGUMENT_VARDECL_SS: - { - // declare a variable - *os << bt->name () << "_ptr *" << arg->local_name () << - " = new " << bt->name () << "_ptr;" << nl; - *os << bt->name () << "_out "; - *os << arg->local_name () << "_out (*" << arg->local_name - () << ");" << nl; -#if 0 - // now define a NamedValue_ptr - *os << "CORBA::NamedValue_ptr nv_" << arg->local_name () << - ";" << nl; - // declare an Any - *os << "CORBA::Any \t any_" << arg->local_name () << " (" << - bt->tc_name () << ", &" << arg->local_name () << - ", 0); // ORB doesn't own" << nl; -#endif - // now define a NamedValue_ptr - *os << "CORBA::NamedValue_ptr nv_" << arg->local_name () - << " = nvlist->add_item (\"" << arg->local_name - () << "\", CORBA::ARG_OUT, _tao_environment);" << nl; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_PRE_DOCALL_CS: - { - // declare a variable - *os << bt->name () << "_ptr _tao_base_" << - arg->local_name () << ";" << nl; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_DOCALL_CS: - { - *os << ", &_tao_base_" << arg->local_name (); - } - break; - case TAO_CodeGen::TAO_ARGUMENT_POST_DOCALL_CS: - { - // this was causing an ambiguity on NT compiler - // assign to the _out parameter - *os << arg->local_name () << " = _tao_base_" << - arg->local_name () << ";" << nl; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: - { - *os << arg->local_name () << "_out, "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_PRE_UPCALL_SS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ARGUMENT_POST_UPCALL_SS: - { -#if 0 // causing ambiguity on NT compiler - *os << "*" << arg->local_name () << " = " << - arg->local_name () << "_out;" << nl; -#endif - *os << "nv_" << arg->local_name () << "->" << - "value ()->replace (" << bt->tc_name () - << ", " << arg->local_name () << ", 1, " << - "_tao_environment); // ORB owns" << nl; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_CH: - { - *os << bt->nested_type_name (bif, "_out") << " " << - arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_CS: - case TAO_CodeGen::TAO_ARGUMENT_SH: - { - *os << bt->name () << "_out " << arg->local_name () << - ", "; - } - break; - default: - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_argument - unknown state\n"), -1); - } - } // end switch state - break; - } // end switch direction - } // end else if - else // simple predefined types - { - switch (arg->direction ()) - { - case AST_Argument::dir_IN: - switch (cg->state ()) - { - case TAO_CodeGen::TAO_ARGUMENT_VARDECL_SS: - { - // declare a variable - *os << bt->name () << " " << arg->local_name () << ";" << - nl; -#if 0 - // now define a NamedValue_ptr - *os << "CORBA::NamedValue_ptr nv_" << arg->local_name () << - ";" << nl; - // declare an Any - *os << "CORBA::Any \t any_" << arg->local_name () << " (" << - bt->tc_name () << ", &" << arg->local_name () << - "); // ORB does not own" << nl; -#endif - // insert into the Any - *os << "(void) nvlist->add_item (\"" << arg->local_name - () << "\", CORBA::ARG_IN, _tao_environment)->value ()" - << "->replace (" << bt->tc_name () - << ", &" << arg->local_name () << ", 0, " << - "_tao_environment); // ORB does not own" << nl; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_PRE_DOCALL_CS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ARGUMENT_DOCALL_CS: - { - *os << ", &" << arg->local_name (); - } - break; - case TAO_CodeGen::TAO_ARGUMENT_POST_DOCALL_CS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: - { - *os << arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_PRE_UPCALL_SS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ARGUMENT_POST_UPCALL_SS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ARGUMENT_CH: - { - *os << bt->nested_type_name (bif) << " " << - arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_CS: - case TAO_CodeGen::TAO_ARGUMENT_SH: - { - *os << bt->name () << " " << arg->local_name () << ", "; - } - break; - default: - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_argument - unknown state\n"), -1); - } - } // end switch state - break; - case AST_Argument::dir_INOUT: - switch (cg->state ()) - { - case TAO_CodeGen::TAO_ARGUMENT_VARDECL_SS: - { - // declare a variable - *os << bt->name () << " *" << arg->local_name () << - " = new " << bt->name () << ";" << nl; -#if 0 - // now define a NamedValue_ptr - *os << "CORBA::NamedValue_ptr nv_" << arg->local_name () << - ";" << nl; - // declare an Any - *os << "CORBA::Any \t any_" << arg->local_name () << " (" << - bt->tc_name () << ", " << arg->local_name () << - "); // ORB owns " << nl; -#endif - // insert into the Any - *os << "(void) nvlist->add_item (\"" << arg->local_name - () << "\", CORBA::ARG_INOUT, _tao_environment)->" << - "value ()->replace (" << bt->tc_name () - << ", " << arg->local_name () << ", 1, " << - "_tao_environment); // ORB owns" << nl; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_PRE_DOCALL_CS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ARGUMENT_DOCALL_CS: - { - *os << ", &" << arg->local_name (); - } - break; - case TAO_CodeGen::TAO_ARGUMENT_POST_DOCALL_CS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: - { - *os << "*" << arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_PRE_UPCALL_SS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ARGUMENT_POST_UPCALL_SS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ARGUMENT_CH: - { - *os << bt->nested_type_name (bif) << " &" << - arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_CS: - case TAO_CodeGen::TAO_ARGUMENT_SH: - { - *os << bt->name () << " &" << arg->local_name () << ", "; - } - break; - default: - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_argument - unknown state\n"), -1); - } - } // end switch state - break; - case AST_Argument::dir_OUT: - switch (cg->state ()) - { - case TAO_CodeGen::TAO_ARGUMENT_VARDECL_SS: - { - // declare a variable - *os << bt->name () << " *" << arg->local_name () << - " = new " << bt->name () << ";" << nl; -#if 0 - // now define a NamedValue_ptr - *os << "CORBA::NamedValue_ptr nv_" << arg->local_name () << - ";" << nl; - // declare an Any - *os << "CORBA::Any \t any_" << arg->local_name () << " (" << - bt->tc_name () << ", " << arg->local_name () << - ", 1); // ORB owns" << nl; -#endif - // insert into the Any - *os << "(void) nvlist->add_item (\"" << arg->local_name - () << "\", CORBA::ARG_OUT, _tao_environment)->" << - "value ()->replace (" << bt->tc_name () - << ", " << arg->local_name () << ", 1, " << - "_tao_environment); // ORB owns" << nl; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_PRE_DOCALL_CS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ARGUMENT_DOCALL_CS: - { - *os << ", &" << arg->local_name (); - } - break; - case TAO_CodeGen::TAO_ARGUMENT_POST_DOCALL_CS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: - { - *os << "*" << arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_PRE_UPCALL_SS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ARGUMENT_POST_UPCALL_SS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ARGUMENT_CH: - { - *os << bt->nested_type_name (bif, "_out") << " " << - arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_CS: - case TAO_CodeGen::TAO_ARGUMENT_SH: - { - *os << bt->name () << "_out " << arg->local_name () << - ", "; - } - break; - default: - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_argument - unknown state\n"), -1); - } - } // end of switch - break; - } // end switch direction - } // end of else - } // end of case predefined - break; - case AST_Decl::NT_string: // type is a string - { - switch (arg->direction ()) - { - case AST_Argument::dir_IN: - switch (cg->state ()) - { - case TAO_CodeGen::TAO_ARGUMENT_VARDECL_SS: - { - // XXXASG- check for memory leak here - TODO - // declare a variable - if (bt->node_type () == AST_Decl::NT_typedef) - *os << bt->name (); - else - *os << "char *"; - *os << " " << arg->local_name () << ";" << nl; -#if 0 - // now define a NamedValue_ptr - *os << "CORBA::NamedValue_ptr nv_" << arg->local_name () << - ";" << nl; - // declare an Any - *os << "CORBA::Any \t any_" << arg->local_name () << " (" << - bt->tc_name () << ", &" << arg->local_name () << - "); // ORB does not own" << nl; -#endif - // insert into the Any - *os << "(void) nvlist->add_item (\"" << arg->local_name () << - "\", CORBA::ARG_IN, _tao_environment)->value ()->replace (" - << bt->tc_name () << ", &" << arg->local_name () << - ", 0, _tao_environment); // ORB does not own" << nl; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_PRE_DOCALL_CS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ARGUMENT_DOCALL_CS: - { - *os << ", &" << arg->local_name (); - } - break; - case TAO_CodeGen::TAO_ARGUMENT_POST_DOCALL_CS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ARGUMENT_PRE_UPCALL_SS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: - { - *os << arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_POST_UPCALL_SS: - { - // we need to free the "in" string that got decoded - *os << "CORBA::string_free (" << arg->local_name () << ");" - << nl; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_CH: - { - *os << "const "; - if (bt->node_type () == AST_Decl::NT_typedef) - *os << bt->nested_type_name (bif); - else - *os << "char *"; - *os << " " << arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_SH: - case TAO_CodeGen::TAO_ARGUMENT_CS: - { - *os << "const "; - if (bt->node_type () == AST_Decl::NT_typedef) - *os << bt->name (); - else - *os << "char *"; - *os << " " << arg->local_name () << ", "; - } - break; - default: - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_argument - unknown state\n"), -1); - } - } // end switch state - break; - case AST_Argument::dir_INOUT: - switch (cg->state ()) - { - case TAO_CodeGen::TAO_ARGUMENT_VARDECL_SS: - { - // declare a variable - if (bt->node_type () == AST_Decl::NT_typedef) - { - *os << bt->name () << " *" << arg->local_name () << - " = new " << bt->name () << ";" << nl; - } - else - { - *os << "char **" << arg->local_name () << - " = new char *;" << nl; - } -#if 0 - // now define a NamedValue_ptr - *os << "CORBA::NamedValue_ptr nv_" << arg->local_name () << - ";" << nl; - // declare an Any - *os << "CORBA::Any \t any_" << arg->local_name () << " (" << - bt->tc_name () << ", &" << arg->local_name () << - "); // ORB does not own" << nl; -#endif - // insert into the Any - *os << "(void) nvlist->add_item (\"" << arg->local_name () << - "\", CORBA::ARG_INOUT, _tao_environment)->value ()->" << - "replace (" << bt->tc_name () - << ", " << arg->local_name () << ", 1, " << - "_tao_environment); // ORB owns" << nl; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_PRE_DOCALL_CS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ARGUMENT_DOCALL_CS: - { - *os << ", &" << arg->local_name (); - } - break; - case TAO_CodeGen::TAO_ARGUMENT_POST_DOCALL_CS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ARGUMENT_PRE_UPCALL_SS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ARGUMENT_POST_UPCALL_SS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: - { - *os << "*" << arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_CH: - { - if (bt->node_type () == AST_Decl::NT_typedef) - *os << bt->nested_type_name (bif, " &"); - else - *os << "char *&"; - *os << " " << arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_SH: - case TAO_CodeGen::TAO_ARGUMENT_CS: - { - if (bt->node_type () == AST_Decl::NT_typedef) - *os << bt->name (); - else - *os << "char *&"; - *os << " " << arg->local_name () << ", "; - } - break; - default: - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_argument - unknown state\n"), -1); - } - } // end switch state - break; - case AST_Argument::dir_OUT: - switch (cg->state ()) - { - case TAO_CodeGen::TAO_ARGUMENT_VARDECL_SS: - { - // declare a variable - if (bt->node_type () == AST_Decl::NT_typedef) - { - *os << bt->name () << " *" << arg->local_name () << - " = new " << bt->name () << ";" << nl; - } - else - { - *os << "char **" << arg->local_name () << - " = new char *;" << nl; - } - // now declare a _out variable to be passed as a parameter - if (bt->node_type () == AST_Decl::NT_typedef) - *os << bt->name () << "_out"; - else - *os << "CORBA::String_out"; - *os << " " << arg->local_name () << "_out (*" << - arg->local_name () << ");" << nl; -#if 0 - // now define a NamedValue_ptr - *os << "CORBA::NamedValue_ptr nv_" << arg->local_name () << - ";" << nl; - // declare an Any - *os << "CORBA::Any \t any_" << arg->local_name () << " (" << - bt->tc_name () << ", _tao_base_" << arg->local_name () << - ", 1); // ORB owns" << nl; -#endif - // insert into the Any - *os << "(void) nvlist->add_item (\"" << arg->local_name () << - "\", CORBA::ARG_OUT, _tao_environment)->value ()->" << - "replace (" << bt->tc_name () - << ", " << arg->local_name () << ", 1, " << - "_tao_environment); // ORB owns" << nl; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_PRE_DOCALL_CS: - { - // declare a string variable - if (bt->node_type () == AST_Decl::NT_typedef) - *os << bt->name (); - else - *os << "char *"; - *os << " _tao_base_" << arg->local_name () << ";" << nl; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_DOCALL_CS: - { - *os << ", &_tao_base_" << arg->local_name (); - } - break; - case TAO_CodeGen::TAO_ARGUMENT_POST_DOCALL_CS: - { - // assign the _tao_base_<string> variable to the out - // parameter - *os << arg->local_name () << " = _tao_base_" << - arg->local_name () << ";" << nl; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: - { - *os << arg->local_name () << "_out, "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_PRE_UPCALL_SS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ARGUMENT_POST_UPCALL_SS: - { -#if 0 // causing ambiguity on NT compiler - // out parameter is cast back to the real parameter - *os << "*" << arg->local_name () << " = " << - arg->local_name () << "_out;" << nl; -#endif - } - break; - case TAO_CodeGen::TAO_ARGUMENT_CH: - { - if (bt->node_type () == AST_Decl::NT_typedef) - *os << bt->nested_type_name (bif, "_out"); - else - *os << "CORBA::String_out"; - *os << " " << arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_CS: - case TAO_CodeGen::TAO_ARGUMENT_SH: - { - if (bt->node_type () == AST_Decl::NT_typedef) - *os << bt->name () << "_out"; - else - *os << "CORBA::String_out"; - *os << " " << arg->local_name () << ", "; - } - break; - default: - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_argument - unknown state\n"), -1); - } - } // end switch state - break; - } // end switch direction - } // end case string - break; - case AST_Decl::NT_array: // type is an array - switch (arg->direction ()) - { - case AST_Argument::dir_IN: - { - switch (cg->state ()) - { - case TAO_CodeGen::TAO_ARGUMENT_VARDECL_SS: - { - // declare a variable - *os << bt->name () << " " << arg->local_name () - << ";" << nl; -#if 0 - // now define a NamedValue_ptr - *os << "CORBA::NamedValue_ptr nv_" << arg->local_name () << - ";" << nl; - // declare an Any - *os << "CORBA::Any \t any_" << arg->local_name () << " (" << - bt->tc_name () << ", " << arg->local_name () << - "); // ORB does not own" << nl; -#endif - // insert into the Any - *os << "(void) nvlist->add_item (\"" << arg->local_name () << - "\", CORBA::ARG_INOUT, _tao_environment)->value ()->" << - "replace (" << bt->tc_name () - << ", &" << arg->local_name () << ", 0, " << - "_tao_environment); // ORB does not own" << nl; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_PRE_DOCALL_CS: - { - // XXXASG TODO - } - break; - case TAO_CodeGen::TAO_ARGUMENT_DOCALL_CS: - { - // XXXASG TODO - } - break; - case TAO_CodeGen::TAO_ARGUMENT_POST_DOCALL_CS: - { - // XXXASG TODO - } - break; - case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: - { - *os << arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_PRE_UPCALL_SS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ARGUMENT_POST_UPCALL_SS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ARGUMENT_CH: - { - // to keep the MSVC++ compiler happy - *os << "const " << bt->nested_type_name (bif) << " " << - arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_CS: - case TAO_CodeGen::TAO_ARGUMENT_SH: - { - *os << "const " << bt->name () << " " << arg->local_name () - << ", "; - } - break; - default: - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_argument - unknown state\n"), -1); - } - } // end switch state - } // end case - break; - case AST_Argument::dir_INOUT: - { - switch (cg->state ()) - { - case TAO_CodeGen::TAO_ARGUMENT_VARDECL_SS: - { - // declare a variable - *os << bt->name (); - if (bt->size_type () == be_decl::VARIABLE) - { - *os << "_slice *"; - } - *os << " " << arg->local_name () << ";" << nl; - // now define a NamedValue_ptr - *os << "CORBA::NamedValue_ptr nv_" << arg->local_name () << - ";" << nl; - // declare an Any - *os << "CORBA::Any \t any_" << arg->local_name () << " (" << - bt->tc_name () << ", " << arg->local_name () << - "); // ORB does not own" << nl; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_PRE_DOCALL_CS: - { - // TODO XXXASG - } - break; - case TAO_CodeGen::TAO_ARGUMENT_DOCALL_CS: - { - // TODO XXXASG - } - break; - case TAO_CodeGen::TAO_ARGUMENT_POST_DOCALL_CS: - { - // TODO XXXASG - } - break; - case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: - { - *os << arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_PRE_UPCALL_SS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ARGUMENT_POST_UPCALL_SS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ARGUMENT_CH: - { - // to keep the MSVC++ compiler happy - if (bt->size_type () == be_decl::VARIABLE) - { - *os << bt->nested_type_name (bif, "_slice") << " *" << - arg->local_name () << ", "; - } - else - { - *os << bt->nested_type_name (bif) << " " << - arg->local_name () << ", "; - } - } - break; - case TAO_CodeGen::TAO_ARGUMENT_CS: - case TAO_CodeGen::TAO_ARGUMENT_SH: - { - *os << bt->name (); - if (bt->size_type () == be_decl::VARIABLE) - { - *os << "_slice *"; - } - *os << arg->local_name () << ", "; - } - break; - default: - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_argument - unknown state\n"), -1); - } - } // end switch state - } // end case - break; - case AST_Argument::dir_OUT: - { - switch (cg->state ()) - { - case TAO_CodeGen::TAO_ARGUMENT_VARDECL_SS: - { - // declare a variable - *os << bt->name () << "_slice *" << arg->local_name () << ";" << - nl; - // now define a NamedValue_ptr - *os << "CORBA::NamedValue_ptr nv_" << arg->local_name () << - ";" << nl; - // declare an Any - *os << "CORBA::Any \t any_" << arg->local_name () << " (" << - bt->tc_name () << ", " << arg->local_name () << - ", 1); // ORB owns" << nl; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_PRE_DOCALL_CS: - { - // TODO XXXASG - } - break; - case TAO_CodeGen::TAO_ARGUMENT_DOCALL_CS: - { - // TODO XXXASG - } - break; - case TAO_CodeGen::TAO_ARGUMENT_POST_DOCALL_CS: - { - // TODO XXXASG - } - break; - case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: - { - *os << arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_PRE_UPCALL_SS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ARGUMENT_POST_UPCALL_SS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ARGUMENT_CH: - { - // to keep the MSVC++ compiler happy - *os << bt->nested_type_name (bif, "_out") << " " << - arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_CS: - case TAO_CodeGen::TAO_ARGUMENT_SH: - { - *os << bt->name () << "_out " << arg->local_name () << ", "; - } - break; - default: - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_argument - unknown state\n"), -1); - } - } // end switch state - } - break; - } // end of switch direction - break; - case AST_Decl::NT_sequence: // type is a sequence - case AST_Decl::NT_struct: // type is a struct - case AST_Decl::NT_union: // type is a union - switch (arg->direction ()) - { - case AST_Argument::dir_IN: - { - switch (cg->state ()) - { - case TAO_CodeGen::TAO_ARGUMENT_VARDECL_SS: - { - // declare a variable - *os << bt->name () << " " << arg->local_name () << - ";" << nl; -#if 0 - // now define a NamedValue_ptr - *os << "CORBA::NamedValue_ptr nv_" << arg->local_name () << - ";" << nl; - // declare an Any - *os << "CORBA::Any \t any_" << arg->local_name () << " (" << - bt->tc_name () << ", &" << arg->local_name () << - "); // ORB does not own" << nl; -#endif - // insert into the Any - *os << "(void) nvlist->add_item (\"" << arg->local_name () << - "\", CORBA::ARG_IN, _tao_environment)->value ()->" << - "replace (" << bt->tc_name () - << ", &" << arg->local_name () << ", 0, " << - "_tao_environment); // ORB does not own" << nl; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_PRE_DOCALL_CS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ARGUMENT_DOCALL_CS: - { - *os << ", &" << arg->local_name (); - } - break; - case TAO_CodeGen::TAO_ARGUMENT_POST_DOCALL_CS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: - { - *os << arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_PRE_UPCALL_SS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ARGUMENT_POST_UPCALL_SS: - { - // nothing - the destructor will ensure proper memory release - } - break; - case TAO_CodeGen::TAO_ARGUMENT_CH: - { - // to keep the MSVC++ compiler happy - *os << "const " << bt->nested_type_name (bif) << " &" << - arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_CS: - case TAO_CodeGen::TAO_ARGUMENT_SH: - { - *os << "const " << bt->name () << " &" << arg->local_name () - << ", "; - } - break; - default: - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_argument - unknown state\n"), -1); - } - } // end switch state - } - break; - case AST_Argument::dir_INOUT: - { - switch (cg->state ()) - { - case TAO_CodeGen::TAO_ARGUMENT_VARDECL_SS: - { - // declare a variable - *os << bt->name () << " *" << arg->local_name () << - " = new " << bt->name () << ";" << nl; -#if 0 - // now define a NamedValue_ptr - *os << "CORBA::NamedValue_ptr nv_" << arg->local_name () << - ";" << nl; - // declare an Any - *os << "CORBA::Any \t any_" << arg->local_name () << " (" << - bt->tc_name () << ", &" << arg->local_name () << - "); // ORB does not own" << nl; -#endif - // insert into the Any - *os << "(void) nvlist->add_item (\"" << arg->local_name () << - "\", CORBA::ARG_INOUT, _tao_environment)->value ()->" << - "replace (" << bt->tc_name () - << ", " << arg->local_name () << ", 1, " << - "_tao_environment); // ORB owns" << nl; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_PRE_DOCALL_CS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ARGUMENT_DOCALL_CS: - { - *os << ", &" << arg->local_name (); - } - break; - case TAO_CodeGen::TAO_ARGUMENT_POST_DOCALL_CS: - { -#if 0 - // if we are sequence, call init manager - if (type->node_type () == AST_Decl::NT_sequence) - { - be_sequence *seq = be_sequence::narrow_from_decl (type); - // init_mgr method for managed types - switch (seq->managed_type ()) - { - case be_sequence::MNG_OBJREF: - case be_sequence::MNG_STRING: - *os << arg->local_name () << ".init_mgr ();" << nl; - break; - default: - break; - } - } -#endif - } - break; - case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: - { - *os << "*" << arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_PRE_UPCALL_SS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ARGUMENT_POST_UPCALL_SS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ARGUMENT_CH: - { - // to keep the MSVC++ compiler happy - *os << bt->nested_type_name (bif) << " &" << arg->local_name - () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_CS: - case TAO_CodeGen::TAO_ARGUMENT_SH: - { - *os << bt->name () << " &" << arg->local_name () << ", "; - } - break; - default: - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_argument - unknown state\n"), -1); - } - } // end switch state - } // end case - break; - case AST_Argument::dir_OUT: - { - switch (cg->state ()) - { - case TAO_CodeGen::TAO_ARGUMENT_VARDECL_SS: - { - // for a variable sized type, the caller allocates a pointer - if (bt->size_type () == be_decl::VARIABLE) - { - // declare a variable - *os << bt->name () << " *" << arg->local_name () << - " = 0;" << nl; - *os << bt->name () << "_out " << arg->local_name () << - "_out (" << arg->local_name () << ");" << nl; -#if 0 - // now define a NamedValue_ptr - *os << "CORBA::NamedValue_ptr nv_" << arg->local_name () << - ";" << nl; - // declare an Any - *os << "CORBA::Any \t any_" << arg->local_name () << " (" << - bt->tc_name () << ", " << arg->local_name () << - ", 0); // ORB does not own" << nl; -#endif - // now define a NamedValue_ptr - *os << "CORBA::NamedValue_ptr nv_" << arg->local_name () - << " = nvlist->add_item (\"" << arg->local_name - () << "\", CORBA::ARG_OUT, _tao_environment);" << nl; - } - else - { - // declare a variable - *os << bt->name () << " *" << arg->local_name () << - " = new " << bt->name () << ";" << nl; -#if 0 - // now define a NamedValue_ptr - *os << "CORBA::NamedValue_ptr nv_" << arg->local_name () << - ";" << nl; - // declare an Any - *os << "CORBA::Any \t any_" << arg->local_name () << " (" << - bt->tc_name () << ", &" << arg->local_name () << - ", 0); // ORB does not own" << nl; -#endif - // insert into the Any - *os << "(void) nvlist->add_item (\"" << arg->local_name () << - "\", CORBA::ARG_OUT, _tao_environment)->value ()->" << - "replace (" << bt->tc_name () - << ", " << arg->local_name () << ", 1, " << - "_tao_environment); // ORB owns" << nl; - } // end else - } - break; - case TAO_CodeGen::TAO_ARGUMENT_PRE_DOCALL_CS: - { - // declare a variable. We need this only if we are variable - // sized. If we are fixed sized, we already know our size and - // hence we have already been allocated - if (bt->size_type () == be_decl::VARIABLE) - { - *os << bt->name () << " *_tao_base_" << arg->local_name - () << " = new " << bt->name () << ";" << nl; - } - } - break; - case TAO_CodeGen::TAO_ARGUMENT_DOCALL_CS: - { - if (bt->size_type () == be_decl::VARIABLE) - { - *os << ", _tao_base_" << arg->local_name (); - } - else - { - // simply pass our address - *os << ", &" << arg->local_name (); - } - } - break; - case TAO_CodeGen::TAO_ARGUMENT_POST_DOCALL_CS: - { -#if 0 - // if we are sequence, call init manager - if (type->node_type () == AST_Decl::NT_sequence) - { - be_sequence *seq = be_sequence::narrow_from_decl (type); - // init_mgr method for managed types - switch (seq->managed_type ()) - { - case be_sequence::MNG_OBJREF: - case be_sequence::MNG_STRING: - *os << "_tao_base_" << arg->local_name () << - "->init_mgr ();" << nl; - break; - default: - break; - } - } -#endif - if (bt->size_type () == be_decl::VARIABLE) - { - *os << arg->local_name () << " = _tao_base_" << - arg->local_name () << ";" << nl; - } - } - break; - case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: - { - if (bt->size_type () == be_decl::VARIABLE) - *os << arg->local_name () << "_out, "; - else - *os << "*" << arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_PRE_UPCALL_SS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ARGUMENT_POST_UPCALL_SS: - { - if (bt->size_type () == be_decl::VARIABLE) - { -#if 0 // causing ambiguity on NT compiler - *os << arg->local_name () << " = " << arg->local_name () - << "_out;" << nl; -#endif - *os << "nv_" << arg->local_name () << "->" << - "value ()->replace (" << bt->tc_name () - << ", " << arg->local_name () << ", 1, " << - "_tao_environment); // ORB owns" << nl; - } - } - break; - case TAO_CodeGen::TAO_ARGUMENT_CH: - { - // to keep the MSVC++ compiler happy - *os << bt->nested_type_name (bif, "_out") << " " << - arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_CS: - case TAO_CodeGen::TAO_ARGUMENT_SH: - { - *os << bt->name () << "_out " << arg->local_name () << ", "; - break; - } - break; - default: - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_argument - unknown state\n"), -1); - } - } // end switch state - } // end case - break; - } // end switch direction - break; - case AST_Decl::NT_enum: // type is an enum - switch (arg->direction ()) - { - case AST_Argument::dir_IN: - { - switch (cg->state ()) - { - case TAO_CodeGen::TAO_ARGUMENT_VARDECL_SS: - { - // declare a variable - *os << bt->name () << " " << arg->local_name () << ";" << - nl; -#if 0 - // now define a NamedValue_ptr - *os << "CORBA::NamedValue_ptr nv_" << arg->local_name () << - ";" << nl; - // declare an Any - *os << "CORBA::Any \t any_" << arg->local_name () << " (" << - bt->tc_name () << ", &" << arg->local_name () << - "); // ORB does not own" << nl; -#endif - // insert into the Any - *os << "(void) nvlist->add_item (\"" << arg->local_name - () << "\", CORBA::ARG_IN, _tao_environment)->value ()" - << "->replace (" << bt->tc_name () - << ", &" << arg->local_name () << ", 0, " << - "_tao_environment); // ORB does not own" << nl; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_PRE_DOCALL_CS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ARGUMENT_DOCALL_CS: - { - *os << ", &" << arg->local_name (); - } - break; - case TAO_CodeGen::TAO_ARGUMENT_POST_DOCALL_CS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: - { - *os << arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_PRE_UPCALL_SS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ARGUMENT_POST_UPCALL_SS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ARGUMENT_CH: - { - // to keep the MSVC++ compiler happy - *os << bt->nested_type_name (bif) << " " << arg->local_name - () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_CS: - case TAO_CodeGen::TAO_ARGUMENT_SH: - { - *os << bt->name () << " " << arg->local_name () << ", "; - } - break; - default: - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_argument - unknown state\n"), -1); - } - } // end of switch state - } // end case - break; - case AST_Argument::dir_INOUT: - { - switch (cg->state ()) - { - case TAO_CodeGen::TAO_ARGUMENT_VARDECL_SS: - { - // declare a variable - *os << bt->name () << " *" << arg->local_name () << - " = new " << bt->name () << ";" << nl; -#if 0 - // now define a NamedValue_ptr - *os << "CORBA::NamedValue_ptr nv_" << arg->local_name () << - ";" << nl; - // declare an Any - *os << "CORBA::Any \t any_" << arg->local_name () << " (" << - bt->tc_name () << ", &" << arg->local_name () << - "); // ORB does not own" << nl; -#endif - // insert into the Any - *os << "(void) nvlist->add_item (\"" << arg->local_name - () << "\", CORBA::ARG_INOUT, _tao_environment)->" << - "value ()->replace (" << bt->tc_name () - << ", " << arg->local_name () << ", 1, " << - "_tao_environment); // ORB owns" << nl; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_PRE_DOCALL_CS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ARGUMENT_DOCALL_CS: - { - *os << ", &" << arg->local_name (); - } - break; - case TAO_CodeGen::TAO_ARGUMENT_POST_DOCALL_CS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: - { - *os << "*" << arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_PRE_UPCALL_SS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ARGUMENT_POST_UPCALL_SS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ARGUMENT_CH: - { - // to keep the MSVC++ compiler happy - *os << bt->nested_type_name (bif) << " &" << arg->local_name - () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_CS: - case TAO_CodeGen::TAO_ARGUMENT_SH: - { - *os << bt->name () << " &" << arg->local_name () << ", "; - } - break; - default: - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_argument - unknown state\n"), -1); - } - } // end switch state - } // end case - break; - case AST_Argument::dir_OUT: - { - switch (cg->state ()) - { - case TAO_CodeGen::TAO_ARGUMENT_VARDECL_SS: - { - // declare a variable - *os << bt->name () << " *" << arg->local_name () << - " = new " << bt->name () << ";" << nl; -#if 0 - // now define a NamedValue_ptr - *os << "CORBA::NamedValue_ptr nv_" << arg->local_name () << - ";" << nl; - // declare an Any - *os << "CORBA::Any \t any_" << arg->local_name () << " (" << - bt->tc_name () << ", &" << arg->local_name () << - "); // ORB does not own" << nl; -#endif - // insert into the Any - *os << "(void) nvlist->add_item (\"" << arg->local_name - () << "\", CORBA::ARG_OUT, _tao_environment)->" << - "value ()->replace (" << bt->tc_name () - << ", " << arg->local_name () << ", 1, " << - "_tao_environment); // ORB owns" << nl; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_PRE_DOCALL_CS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ARGUMENT_DOCALL_CS: - { - *os << ", &" << arg->local_name (); - } - break; - case TAO_CodeGen::TAO_ARGUMENT_POST_DOCALL_CS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: - { - *os << "*" << arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_PRE_UPCALL_SS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ARGUMENT_POST_UPCALL_SS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ARGUMENT_CH: - { - // to keep the MSVC++ compiler happy - *os << bt->nested_type_name (bif, "_out") << " " << - arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_CS: - case TAO_CodeGen::TAO_ARGUMENT_SH: - { - *os << bt->name () << "_out " << arg->local_name () << ", "; - } - break; - default: - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_argument - unknown state\n"), -1); - } - } // end switch state - } // end case - break; - } // end switch direction - break; - case AST_Decl::NT_except: // type is an exception - { - // XXXASG TODO: is this allowed ??? - } - break; - case AST_Decl::NT_typedef: // type is a typedef - { - be_type *temp; - be_typedef *t = be_typedef::narrow_from_decl (bt); - - if (!t) - return -1; - - temp = t->primitive_base_type (); - // make a recursive call - return this->gen_code (t, d, temp); - } // end of case - break; - } //end switch node type - return 0; -} diff --git a/TAO/TAO_IDL/be/be_state_array.cpp b/TAO/TAO_IDL/be/be_state_array.cpp deleted file mode 100644 index 618c891bc7b..00000000000 --- a/TAO/TAO_IDL/be/be_state_array.cpp +++ /dev/null @@ -1,118 +0,0 @@ -// ============================================================================ -// -// = LIBRARY -// TAO IDL -// -// = FILENAME -// be_state_array.cpp -// -// = DESCRIPTION -// state based code generation for arrays. -// -// = AUTHOR -// Aniruddha Gokhale -// -// ============================================================================ - -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -// return type for array -be_state_array::be_state_array (void) -{ -} - -// generate code for array type -int -be_state_array::gen_code (be_type *bt, be_decl *d, be_type *type) -{ - TAO_OutStream *os = 0; // output stream - TAO_NL nl; // end line - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - // Macro to avoid "warning: unused parameter" type warning. - ACE_UNUSED_ARG (nl); - - // get the appropriate stream - switch (cg->state ()) - { - case TAO_CodeGen::TAO_ARRAY_DEFN_CH: - case TAO_CodeGen::TAO_ARRAY_OTHER_CH: - os = cg->client_header (); - break; - case TAO_CodeGen::TAO_ARRAY_DEFN_CI: - os = cg->client_inline (); - break; - } - - if (!type) // not a recursive call - type = bt; - else // recursively called thru a typedef. "type" will have the most primitive - // base class of the typedef - ACE_ASSERT (bt->node_type () == AST_Decl::NT_typedef); - - // generate code based on type. For every case, first downcast to the - // appropriate type. If the downcast fails, return error, else proceed. In - // some cases, the type itself may need code generation, e.g., anonymous - // struct types. - switch (type->node_type ()) - { - case AST_Decl::NT_interface: // type is an obj reference - { - *os << bt->name () << "_var "; - } - break; - case AST_Decl::NT_pre_defined: // type is predefined type - { - *os << bt->name (); - } - break; - case AST_Decl::NT_string: // type is a string - { - *os << "CORBA::String_var "; - } - break; - case AST_Decl::NT_array: - // type is an array. This is possible only if we - // are here thru the typedef node - { - *os << bt->name () << "_slice *"; - } - break; - // these are all anonymous types - case AST_Decl::NT_enum: // type is an enum - case AST_Decl::NT_sequence: // type is a sequence - case AST_Decl::NT_struct: // type is a struct - case AST_Decl::NT_union: // type is a union - { - // based on what state we are in, we may have to generate the definition - // of the type first - if (cg->state () == TAO_CodeGen::TAO_ARRAY_DEFN_CH) - if (bt->gen_client_header () == -1) // generate the defn - return -1; - - *os << bt->name (); - } - break; - case AST_Decl::NT_except: // type is an exception - { - // XXXASG TODO: is this allowed ??? - } - break; - case AST_Decl::NT_typedef: // type is a typedef - { - be_type *temp; - be_typedef *t = be_typedef::narrow_from_decl (bt); - - if (!t) - return -1; - - temp = t->primitive_base_type (); - // make a recursive call - return this->gen_code (t, d, temp); - } // end of switch - //break; unreachable statement! - } - return 0; -} diff --git a/TAO/TAO_IDL/be/be_state_attribute.cpp b/TAO/TAO_IDL/be/be_state_attribute.cpp deleted file mode 100644 index 315503929cf..00000000000 --- a/TAO/TAO_IDL/be/be_state_attribute.cpp +++ /dev/null @@ -1,1163 +0,0 @@ - -// ============================================================================ -// -// = LIBRARY -// TAO IDL -// -// = FILENAME -// be_state_attribute.cpp -// -// = DESCRIPTION -// state based code generation for attributes. -// -// = AUTHOR -// Aniruddha Gokhale -// -// ============================================================================ - -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -// constructor -be_state_attribute::be_state_attribute (void) -{ -} - -int -be_state_attribute::gen_code (be_type *bt, be_decl *d, be_type *type) -{ - TAO_OutStream *os = 0; // output stream - TAO_NL nl; // end line - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - be_attribute *attr; // attribute node - be_interface *bif; // enclosing scope which is an interface - - switch (cg->state ()) - { - case TAO_CodeGen::TAO_ATTRIBUTE_RETURN_TYPE_CH: - case TAO_CodeGen::TAO_ATTRIBUTE_INPARAM_TYPE_CH: - os = cg->client_header (); - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RETURN_TYPE_CS: - case TAO_CodeGen::TAO_ATTRIBUTE_RETVAL_DECL_CS: - case TAO_CodeGen::TAO_ATTRIBUTE_RETVAL_EXCEPTION_CS: - case TAO_CodeGen::TAO_ATTRIBUTE_RETVAL_RETURN_CS: - case TAO_CodeGen::TAO_ATTRIBUTE_INPARAM_TYPE_CS: - case TAO_CodeGen::TAO_ATTRIBUTE_PRE_DOCALL_CS: - case TAO_CodeGen::TAO_ATTRIBUTE_DOCALL_CS: - case TAO_CodeGen::TAO_ATTRIBUTE_POST_DOCALL_CS: - os = cg->client_stubs (); - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RETURN_TYPE_SH: - case TAO_CodeGen::TAO_ATTRIBUTE_INPARAM_TYPE_SH: - os = cg->server_header (); - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RETVAL_DECL_SS: - case TAO_CodeGen::TAO_ATTRIBUTE_RETVAL_ASSIGN_SS: - case TAO_CodeGen::TAO_ATTRIBUTE_RESULT_SS: - case TAO_CodeGen::TAO_ATTRIBUTE_INPARAM_TYPE_SS: - case TAO_CodeGen::TAO_ATTRIBUTE_PRE_UPCALL_SS: - case TAO_CodeGen::TAO_ATTRIBUTE_UPCALL_SS: - case TAO_CodeGen::TAO_ATTRIBUTE_POST_UPCALL_SS: - os = cg->server_skeletons (); - break; - } - - // retrieve the ATTRIBUTE node - attr = be_attribute::narrow_from_decl (d); - if (!attr) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_attribute.cpp - " - "Bad attribute node\n"), - -1); - } - - // get the enclosing interface scope to be used in the NESTED_CLASS macro - bif = be_interface::narrow_from_decl (ScopeAsDecl (attr->defined_in ())); - if (!bif) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_attribute.cpp - " - "Bad interface\n"), - -1); - } - - if (!type) // not a recursive call - type = bt; - else // recursively called thru a typedef. "type" will have the most primitive - // base class of the typedef - ACE_ASSERT (bt->node_type () == AST_Decl::NT_typedef); - - // Two level switching - // (1) switch on node type - // (2) switch on current code generation state - - switch (type->node_type ()) // LEVEL (1) switch based on node type - { - case AST_Decl::NT_interface: // type is an obj reference - case AST_Decl::NT_interface_fwd: // type is an obj reference - { - // what state are we in - switch (cg->state ()) - { - case TAO_CodeGen::TAO_ATTRIBUTE_RETURN_TYPE_CH: - { - // to keep MSVC++ happy - *os << bt->nested_type_name (bif, "_ptr") << " "; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_INPARAM_TYPE_CH: - { - // to keep the MSVC++ compiler happy - *os << bt->nested_type_name (bif, "_ptr") << " " << - attr->local_name (); - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RETURN_TYPE_CS: - case TAO_CodeGen::TAO_ATTRIBUTE_RETURN_TYPE_SH: - { - *os << bt->name () << "_ptr "; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_INPARAM_TYPE_CS: - case TAO_CodeGen::TAO_ATTRIBUTE_INPARAM_TYPE_SH: - { - *os << bt->name () << "_ptr " << attr->local_name (); - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RETVAL_DECL_CS: - { - *os << "CORBA::Object_ptr retval = CORBA::Object::_nil ();" << nl; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RETVAL_EXCEPTION_CS: - { - *os << "return " << bt->name () << "::_nil ();\n"; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RETVAL_RETURN_CS: - { - *os << "return " << bt->name () << "::_narrow (retval, env);" << nl; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RETVAL_DECL_SS: - { - *os << "CORBA::Object_ptr *retval =" - " new CORBA::Object_ptr;" << nl; - *os << "*retval = CORBA::Object::_nil ();" << nl; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RETVAL_ASSIGN_SS: - { - *os << "*retval"; // assign to retval - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RESULT_SS: - { - *os << "result = new CORBA::Any (" << bt->tc_name () << - ", retval, 1); // ORB owns" << nl; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_PRE_DOCALL_CS: - { - // assign to a CORBA::Object_ptr - *os << "CORBA::Object_ptr _tao_base_" << attr->local_name () - << " = " << attr->local_name () << "; // cast it" << nl; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_DOCALL_CS: - { - // pass the cast value - *os << ", &_tao_base_" << attr->local_name (); - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_POST_DOCALL_CS: - { - // nothing for in parameters - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_INPARAM_TYPE_SS: - { - // declare a variable - *os << bt->name () << "_ptr "; - *os << attr->local_name () << ";" << nl; - // we also declare a corresponding CORBA::Object_ptr to be - // passed to the decoder - *os << "CORBA::Object_ptr _tao_base_" << attr->local_name () - << ";" << nl; -#if 0 - // now define a NamedValue_ptr - *os << "CORBA::NamedValue_ptr nv_" << attr->local_name () << - ";" << nl; - // declare an Any - *os << "CORBA::Any \t any_" << attr->local_name () << " (" << - bt->tc_name () << ", &_tao_base_" << attr->local_name () << - "); // ORB does not own" << nl; -#endif - // insert into the Any - *os << "(void) nvlist->add_item (\"" << attr->local_name () << - "\", CORBA::ARG_IN, _tao_environment)->value ()->" << - "replace (" << bt->tc_name () - << ", &_tao_base_" << attr->local_name () << ", 0, " << - "_tao_environment); // ORB does not own" << nl; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_PRE_UPCALL_SS: - { - // convert from the CORBA::Object_ptr to the interface type - // using a _narrow - *os << attr->local_name () << " = " << bt->name () << - "::_narrow (_tao_base_" << attr->local_name () << ", " << - "_tao_environment);" << nl; - *os << "if (_tao_environment.exception ()) return;" << nl; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_POST_UPCALL_SS: - { - // we must release the in parameter - *os << "CORBA::release (" << attr->local_name () << ");" << nl; - *os << "CORBA::release (_tao_base_" << attr->local_name () << - ");" << nl; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_UPCALL_SS: - { - *os << attr->local_name () << ", "; - } - break; - default: - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_attribute - unknown state\n"), -1); - } - } // switch state - } // end of case interface/interface_fwd - break; - case AST_Decl::NT_pre_defined: // type is predefined type - { - be_predefined_type *bpd = be_predefined_type::narrow_from_decl (type); - - // check if the type is an any - if (bpd->pt () == AST_PredefinedType::PT_any) - { - switch (cg->state ()) - { - case TAO_CodeGen::TAO_ATTRIBUTE_RETVAL_DECL_CS: - { - // if it is an any, return a pointer to it - *os << bt->name () << " *retval;" << nl; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RETVAL_EXCEPTION_CS: - { - // if it is an any, return a pointer to it - *os << "return 0;\n"; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RETVAL_RETURN_CS: - { - *os << "return retval;" << nl; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RETVAL_DECL_SS: - { - // if it is an any, return a pointer to it - *os << bt->name () << " *retval;" << nl; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RETVAL_ASSIGN_SS: - { - // if it is an any, return a pointer to it - *os << "retval"; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RESULT_SS: - { - // if it is an any, return a pointer to it - *os << "result = new CORBA::Any (" << bt->tc_name () << - ", retval, 1); // ORB owns" << nl; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_INPARAM_TYPE_SS: - { - *os << bt->name () << " "; - // declare a variable - *os << attr->local_name () << ";" << nl; -#if 0 - // now define a NamedValue_ptr - *os << "CORBA::NamedValue_ptr nv_" << attr->local_name () << - ";" << nl; - // declare an Any - *os << "CORBA::Any \t any_" << attr->local_name () << " (" << - bt->tc_name () << ", &" << attr->local_name () << - "); // ORB does not own" << nl; -#endif - // insert into the Any - *os << "(void) nvlist->add_item (\"" << attr->local_name () << - "\", CORBA::ARG_IN, _tao_environment)->value ()->" << - "replace (" << bt->tc_name () - << ", &" << attr->local_name () << ", 0, " << - "_tao_environment); // ORB does not own" << nl; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_PRE_DOCALL_CS: - { - // XXXASG - TODO - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_DOCALL_CS: - { - // XXXASG - TODO - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_POST_DOCALL_CS: - { - // XXXASG - TODO - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_UPCALL_SS: - { - *os << attr->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_PRE_UPCALL_SS: - { - // XXXASG - TODO - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_POST_UPCALL_SS: - { - // XXXASG - TODO - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RETURN_TYPE_CH: - { - // keep MSVC++ happy - *os << bt->nested_type_name (bif); - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RETURN_TYPE_CS: - case TAO_CodeGen::TAO_ATTRIBUTE_RETURN_TYPE_SH: - { - *os << bt->name () << "* "; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_INPARAM_TYPE_CH: - { - // keep MSVC++ happy - *os << "const " << bt->nested_type_name (bif) << " &" << - attr->local_name (); - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_INPARAM_TYPE_CS: - case TAO_CodeGen::TAO_ATTRIBUTE_INPARAM_TYPE_SH: - { - *os << "const " << bt->name () << " &" << attr->local_name - (); - } - break; - default: - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_attribute - unknown state\n"), -1); - } - } // end switch state - } // end of if - else if (bpd->pt () == AST_PredefinedType::PT_pseudo) // e.g., CORBA::Object - { - switch (cg->state ()) - { - case TAO_CodeGen::TAO_ATTRIBUTE_RETVAL_DECL_CS: - { - // pseudo object, return a pointer - *os << bt->name () << "_ptr retval;" << nl; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RETVAL_EXCEPTION_CS: - { - // pseudo object, return a pointer - *os << "return 0;\n"; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RETVAL_RETURN_CS: - { - *os << "return retval;" << nl; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RETVAL_DECL_SS: - { - // pseudo object, return a pointer - *os << bt->name () << "_ptr *retval = new " << bt->name () << - "_ptr;" << nl; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RETVAL_ASSIGN_SS: - { - // pseudo object, return a pointer - *os << "*retval"; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RESULT_SS: - { - // pseudo object, return a pointer - *os << "result = new CORBA::Any (" << bt->tc_name () << - ", retval, 1); // ORB owns" << nl; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_INPARAM_TYPE_SS: - { - // declare a variable - *os << bt->name () << "_ptr " << attr->local_name () << ";" << nl; -#if 0 - // now define a NamedValue_ptr - *os << "CORBA::NamedValue_ptr nv_" << attr->local_name () << - ";" << nl; - // declare an Any - *os << "CORBA::Any \t any_" << attr->local_name () << " (" << - bt->tc_name () << ", &" << attr->local_name () << - "); // ORB does not own" << nl; -#endif - // insert into the Any - *os << "(void) nvlist->add_item (\"" << attr->local_name - () << "\", CORBA::ARG_IN, _tao_environment)->" << - "value ()->replace (" << bt->tc_name () - << ", &" << attr->local_name () << ", 0, " << - "_tao_environment); // ORB does not own" << nl; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_PRE_DOCALL_CS: - { - // no casting necessary as we already are object_ptr - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_DOCALL_CS: - { - *os << ", &" << attr->local_name (); - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_POST_DOCALL_CS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_UPCALL_SS: - { - *os << attr->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_PRE_UPCALL_SS: - { - // nothing to be done as we are Object_ptr - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_POST_UPCALL_SS: - { - //release the in parameter - *os << "CORBA::release (" << attr->local_name () << ");" - << nl; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RETURN_TYPE_CH: - { - // keep MSVC++ happy - *os << bt->nested_type_name (bif); - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RETURN_TYPE_CS: - case TAO_CodeGen::TAO_ATTRIBUTE_RETURN_TYPE_SH: - { - *os << bt->name (); - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_INPARAM_TYPE_CH: - { - // keep MSVC++ happy - *os << "const " << bt->nested_type_name (bif) << " &" << - attr->local_name (); - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_INPARAM_TYPE_CS: - case TAO_CodeGen::TAO_ATTRIBUTE_INPARAM_TYPE_SH: - { - *os << "const " << bt->name () << " &" << attr->local_name - (); - } - break; - default: - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_attribute - unknown state\n"), -1); - } - } // end of switch state - } // end else if - else // simple predefined types - { - switch (cg->state ()) - { - case TAO_CodeGen::TAO_ATTRIBUTE_RETVAL_DECL_CS: - { - *os << bt->name () << " retval;" << nl; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RETVAL_EXCEPTION_CS: - { - *os << "return retval;\n"; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RETVAL_RETURN_CS: - { - *os << "return retval;" << nl; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RETVAL_DECL_SS: - { - *os << bt->name () << " *retval = new " << bt->name () << ";" - << nl; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RETVAL_ASSIGN_SS: - { - *os << " *retval"; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RESULT_SS: - { - *os << "result = new CORBA::Any (" << bt->tc_name () << - ", retval, 1); // ORB owns" << nl; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_INPARAM_TYPE_SS: - { - // declare a variable - *os << bt->name () << " " << attr->local_name () << ";" << - nl; -#if 0 - // now define a NamedValue_ptr - *os << "CORBA::NamedValue_ptr nv_" << attr->local_name () << - ";" << nl; - // declare an Any - *os << "CORBA::Any \t any_" << attr->local_name () << " (" << - bt->tc_name () << ", &" << attr->local_name () << - "); // ORB does not own" << nl; -#endif - // insert into the Any - *os << "(void) nvlist->add_item (\"" << attr->local_name - () << "\", CORBA::ARG_IN, _tao_environment)->value ()" - << "->replace (" << bt->tc_name () - << ", &" << attr->local_name () << ", 0, " << - "_tao_environment); // ORB does not own" << nl; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_PRE_DOCALL_CS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_DOCALL_CS: - { - *os << ", &" << attr->local_name (); - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_POST_DOCALL_CS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_UPCALL_SS: - { - *os << attr->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_PRE_UPCALL_SS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_POST_UPCALL_SS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RETURN_TYPE_CH: - { - // keep MSVC++ happy - *os << bt->nested_type_name (bif); - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RETURN_TYPE_CS: - case TAO_CodeGen::TAO_ATTRIBUTE_RETURN_TYPE_SH: - { - *os << bt->name (); - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_INPARAM_TYPE_CH: - { - // keep MSVC++ happy - *os << "const " << bt->nested_type_name (bif) << " &" << - attr->local_name (); - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_INPARAM_TYPE_CS: - case TAO_CodeGen::TAO_ATTRIBUTE_INPARAM_TYPE_SH: - { - *os << "const " << bt->name () << " &" << attr->local_name - (); - } - break; - default: - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_attribute - unknown state\n"), -1); - } - } // end switch state - } // end of else - } // end of case predefined - break; - case AST_Decl::NT_string: // type is a string - { - switch (cg->state ()) - { - case TAO_CodeGen::TAO_ATTRIBUTE_RETVAL_DECL_CS: - { - if (bt->node_type () == AST_Decl::NT_typedef) - { - *os << bt->name () << " retval = 0;" << nl; - } - else - { - *os << "char *retval = 0;" << nl; - } - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RETVAL_EXCEPTION_CS: - { - *os << "return 0;\n"; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RETVAL_RETURN_CS: - { - *os << "return retval;" << nl; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RETVAL_DECL_SS: - { - if (bt->node_type () == AST_Decl::NT_typedef) - { - *os << bt->name () << " *retval = new " << bt->name () << "*;" << nl; - } - else - { - *os << "char **retval = new char*;" << nl; - } - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RETVAL_ASSIGN_SS: - { - *os << "*retval"; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RESULT_SS: - { - *os << "result = new CORBA::Any (" << bt->tc_name () << - ", retval, 1); // ORB owns" << nl; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_PRE_DOCALL_CS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_DOCALL_CS: - { - *os << ", &" << attr->local_name (); - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_POST_DOCALL_CS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_PRE_UPCALL_SS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_POST_UPCALL_SS: - { - // we need to free the "in" string that got decoded - *os << "CORBA::string_free (" << attr->local_name () << ");" - << nl; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_UPCALL_SS: - { - *os << attr->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RETURN_TYPE_CH: - { - if (bt->node_type () == AST_Decl::NT_typedef) - { - // to keep MSVC++ happy - *os << bt->nested_type_name (bif); - } - else - { - *os << "char *"; - } - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RETURN_TYPE_CS: - case TAO_CodeGen::TAO_ATTRIBUTE_RETURN_TYPE_SH: - { - if (bt->node_type () == AST_Decl::NT_typedef) - { - *os << bt->name (); - } - else - { - *os << "char *"; - } - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_INPARAM_TYPE_SS: - { - // declare a variable - if (bt->node_type () == AST_Decl::NT_typedef) - *os << bt->name (); - else - *os << "char *"; - *os << " " << attr->local_name () << ";" << nl; -#if 0 - // now define a NamedValue_ptr - *os << "CORBA::NamedValue_ptr nv_" << attr->local_name () << - ";" << nl; - // declare an Any - *os << "CORBA::Any \t any_" << attr->local_name () << " (" << - bt->tc_name () << ", &" << attr->local_name () << - "); // ORB does not own" << nl; -#endif - // insert into the Any - *os << "(void) nvlist->add_item (\"" << attr->local_name () << - "\", CORBA::ARG_IN, _tao_environment)->value ()->replace (" - << bt->tc_name () << ", &" << attr->local_name () << - ", 0, _tao_environment); // ORB does not own" << nl; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_INPARAM_TYPE_SH: - case TAO_CodeGen::TAO_ATTRIBUTE_INPARAM_TYPE_CS: - case TAO_CodeGen::TAO_ATTRIBUTE_INPARAM_TYPE_CH: - { - *os << "const char *" << attr->local_name (); - } - break; - default: - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_attribute - unknown state\n"), -1); - } - } // end switch state - } // end case string - break; - case AST_Decl::NT_array: // type is an array - { - switch (cg->state ()) - { - case TAO_CodeGen::TAO_ATTRIBUTE_RETVAL_DECL_CS: - { - *os << bt->name () << "_slice *retval;" << nl; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RETVAL_EXCEPTION_CS: - { - *os << "return 0;\n"; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RETVAL_RETURN_CS: - { - *os << "return retval;" << nl; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RETVAL_DECL_SS: - { - *os << bt->name () << "_slice *retval;" << nl; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RETVAL_ASSIGN_SS: - { - *os << "retval"; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RESULT_SS: - { - *os << "result = new CORBA::Any (" << bt->tc_name () << - ", retval, 1); // ORB owns" << nl; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_INPARAM_TYPE_SS: - { - // declare a variable - *os << bt->name () << " " << attr->local_name () - << ";" << nl; - // now define a NamedValue_ptr - *os << "CORBA::NamedValue_ptr nv_" << attr->local_name () << - ";" << nl; - // declare an Any - *os << "CORBA::Any \t any_" << attr->local_name () << " (" << - bt->tc_name () << ", " << attr->local_name () << - "); // ORB does not own" << nl; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_PRE_DOCALL_CS: - { - // XXXASG TODO - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_DOCALL_CS: - { - // XXXASG TODO - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_POST_DOCALL_CS: - { - // XXXASG TODO - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_UPCALL_SS: - { - *os << attr->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_PRE_UPCALL_SS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_POST_UPCALL_SS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RETURN_TYPE_CH: - { - // to keep MSVC++ happy - *os << bt->nested_type_name (bif, "_slice") << " *"; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RETURN_TYPE_CS: - case TAO_CodeGen::TAO_ATTRIBUTE_RETURN_TYPE_SH: - { - *os << bt->name () << "_slice *"; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_INPARAM_TYPE_CH: - { - // to keep the MSVC++ compiler happy - *os << "const " << bt->nested_type_name (bif) << " " << - attr->local_name (); - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_INPARAM_TYPE_CS: - case TAO_CodeGen::TAO_ATTRIBUTE_INPARAM_TYPE_SH: - { - *os << "const " << bt->name () << " " << attr->local_name (); - } - break; - default: - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_attribute - unknown state\n"), -1); - } - } // end switch state - } // end of case array - break; - case AST_Decl::NT_sequence: // type is a sequence - case AST_Decl::NT_struct: // type is a struct - case AST_Decl::NT_union: // type is a union - { - switch (cg->state ()) - { - case TAO_CodeGen::TAO_ATTRIBUTE_INPARAM_TYPE_SS: - { - // declare a variable - *os << bt->name () << " " << attr->local_name () << - ";" << nl; -#if 0 - // now define a NamedValue_ptr - *os << "CORBA::NamedValue_ptr nv_" << attr->local_name () << - ";" << nl; - // declare an Any - *os << "CORBA::Any \t any_" << attr->local_name () << " (" << - bt->tc_name () << ", &" << attr->local_name () << - "); // ORB does not own" << nl; -#endif - // insert into the Any - *os << "(void) nvlist->add_item (\"" << attr->local_name () << - "\", CORBA::ARG_IN, _tao_environment)->value ()->" << - "replace (" << bt->tc_name () - << ", &" << attr->local_name () << ", 0, " << - "_tao_environment); // ORB does not own" << nl; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_PRE_DOCALL_CS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_DOCALL_CS: - { - *os << ", &" << attr->local_name (); - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_POST_DOCALL_CS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_UPCALL_SS: - { - *os << attr->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_PRE_UPCALL_SS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_POST_UPCALL_SS: - { - // nothing - } - break; - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RETVAL_DECL_CS: - { - *os << bt->name () << " *retval = 0;" << nl; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RETVAL_EXCEPTION_CS: - { - *os << "return 0;\n"; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RETVAL_RETURN_CS: - { -#if 0 - if (type->node_type () == AST_Decl::NT_sequence) - { - be_sequence *seq = be_sequence::narrow_from_decl (type); - // init_mgr method for managed types - switch (seq->managed_type ()) - { - case be_sequence::MNG_OBJREF: - case be_sequence::MNG_STRING: - *os << "retval->init_mgr ();" << nl; - break; - default: - break; - } - } -#endif - *os << "return retval;" << nl; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RETVAL_DECL_SS: - { - *os << bt->name () << " *retval;" << nl; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RETVAL_ASSIGN_SS: - { - *os << "retval"; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RESULT_SS: - { - *os << "result = new CORBA::Any (" << bt->tc_name () << - ", retval, 1); // ORB owns" << nl; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RETURN_TYPE_CH: - { - if (bt->size_type () == be_decl::VARIABLE) - // to keep MSVC++ happy - *os << bt->nested_type_name (bif) << " *"; - else - *os << bt->nested_type_name (bif); - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RETURN_TYPE_CS: - case TAO_CodeGen::TAO_ATTRIBUTE_RETURN_TYPE_SH: - { - if (bt->size_type () == be_decl::VARIABLE) - *os << bt->name () << " *"; - else - *os << bt->name (); - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_INPARAM_TYPE_CH: - { - // to keep the MSVC++ compiler happy - *os << "const " << bt->nested_type_name (bif) << " &" << - attr->local_name (); - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_INPARAM_TYPE_CS: - case TAO_CodeGen::TAO_ATTRIBUTE_INPARAM_TYPE_SH: - { - *os << "const " << bt->name () << " &" << attr->local_name (); - } - break; - default: - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_attribute - unknown state\n"), -1); - } - } // end switch state - } // end case - break; - case AST_Decl::NT_enum: // type is an enum - { - switch (cg->state ()) - { - case TAO_CodeGen::TAO_ATTRIBUTE_RETVAL_DECL_CS: - { - *os << bt->name () << " retval;" << nl; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RETVAL_EXCEPTION_CS: - { - *os << "return retval;\n"; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RETVAL_RETURN_CS: - { - *os << "return retval;" << nl; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RETVAL_DECL_SS: - { - *os << bt->name () << " *retval = new " << bt->name () << ";" << - nl; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RETVAL_ASSIGN_SS: - { - *os << "*retval"; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RESULT_SS: - { - *os << "result = new CORBA::Any (" << bt->tc_name () << - ", retval, 1); // ORB owns" << nl; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_INPARAM_TYPE_SS: - { - // declare a variable - *os << bt->name () << " " << attr->local_name () << ";" << - nl; -#if 0 - // now define a NamedValue_ptr - *os << "CORBA::NamedValue_ptr nv_" << attr->local_name () << - ";" << nl; - // declare an Any - *os << "CORBA::Any \t any_" << attr->local_name () << " (" << - bt->tc_name () << ", &" << attr->local_name () << - "); // ORB does not own" << nl; -#endif - // insert into the Any - *os << "(void) nvlist->add_item (\"" << attr->local_name - () << "\", CORBA::ARG_IN, _tao_environment)->value ()" - << "->replace (" << bt->tc_name () - << ", &" << attr->local_name () << ", 0, " << - "_tao_environment); // ORB does not own" << nl; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_PRE_DOCALL_CS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_DOCALL_CS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_POST_DOCALL_CS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_UPCALL_SS: - { - *os << attr->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_PRE_UPCALL_SS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_POST_UPCALL_SS: - { - // nothing - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_INPARAM_TYPE_CH: - { - // to keep the MSVC++ compiler happy - *os << bt->nested_type_name (bif) << " " << attr->local_name - (); - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_INPARAM_TYPE_CS: - - case TAO_CodeGen::TAO_ATTRIBUTE_INPARAM_TYPE_SH: - { - *os << bt->name () << " " << attr->local_name (); - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RETURN_TYPE_CH: - { - // to keep MSVC++ happy - *os << bt->nested_type_name (bif); - } - break; - case TAO_CodeGen::TAO_ATTRIBUTE_RETURN_TYPE_CS: - case TAO_CodeGen::TAO_ATTRIBUTE_RETURN_TYPE_SH: - { - *os << bt->name (); - } - break; - default: - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_attribute - unknown state\n"), -1); - } - } // end switch state - } // end case - break; - case AST_Decl::NT_except: // type is an exception - { - // XXXASG TODO: is this allowed ??? - } - break; - case AST_Decl::NT_typedef: // type is a typedef - { - be_type *temp; - be_typedef *t = be_typedef::narrow_from_decl (bt); - - if (!t) - return -1; - - temp = t->primitive_base_type (); - // make a recursive call - return this->gen_code (t, d, temp); - } // end of case - break; - } //end switch node type - return 0; -} diff --git a/TAO/TAO_IDL/be/be_state_exception.cpp b/TAO/TAO_IDL/be/be_state_exception.cpp deleted file mode 100644 index b260dadb437..00000000000 --- a/TAO/TAO_IDL/be/be_state_exception.cpp +++ /dev/null @@ -1,405 +0,0 @@ -// ============================================================================ -// -// = LIBRARY -// TAO IDL -// -// = FILENAME -// be_state_exception.cpp -// -// = DESCRIPTION -// state based code generation for exceptions. -// -// = AUTHOR -// Aniruddha Gokhale -// -// ============================================================================ - -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -be_state_exception::be_state_exception (void) -{ -} - -// generate code for exception member -int -be_state_exception ::gen_code (be_type *bt, be_decl *d, be_type *type) -{ - TAO_OutStream *os; // output stream - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - be_field *f; // field node - be_exception *bexcp; // enclosing exception node - - switch (cg->state ()) - { - case TAO_CodeGen::TAO_EXCEPTION_CH: // used for defining members - case TAO_CodeGen::TAO_EXCEPTION_CTOR_CH: // used for defining the - // parameters to the special - // constructor - os = cg->client_header (); - break; - case TAO_CodeGen::TAO_EXCEPTION_CI: // for generating inline functions for - // specific anonymous types - os = cg->client_inline (); - break; - case TAO_CodeGen::TAO_EXCEPTION_CS: // for copy ctor and assignment op - case TAO_CodeGen::TAO_EXCEPTION_CTOR_CS: // for the parameters of the - // special constructor - case TAO_CodeGen::TAO_EXCEPTION_CTOR_ASSIGN_CS: // for assigning to members - // inside the special ctor - os = cg->client_stubs (); - break; - } - - f = be_field::narrow_from_decl (d); // downcast to field node - if (!f) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_exception.cpp - " - "Bad field\n"), - -1); - } - - // retrieve the exception node - bexcp = be_exception::narrow_from_scope (f->defined_in ()); - if (!bexcp) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_exception.cpp - " - "Bad exception\n"), - -1); - } - - // pass the field node just incase it is needed to generate definition for - // sequence - cg->node (f); - - if (!type) // not a recursive call - type = bt; - else // recursively called thru a typedef. "type" will have the most primitive - // base class of the typedef - ACE_ASSERT (bt->node_type () == AST_Decl::NT_typedef); - - // generate code based on type. - switch (type->node_type ()) - { - case AST_Decl::NT_interface: // type is an obj reference - { - switch (cg->state ()) - { - case TAO_CodeGen::TAO_EXCEPTION_CH: - { - os->indent (); // start from current indentation - *os << bt->nested_type_name (bexcp, "_var") << " " << f->local_name - () << ";\n"; - } - break; - case TAO_CodeGen::TAO_EXCEPTION_CS: - { - // assign - os->indent (); // start with current indentation - *os << "this->" << f->local_name () << " = _tao_excp." << - f->local_name () << ";\n"; - } - break; - case TAO_CodeGen::TAO_EXCEPTION_CTOR_CH: - { - *os << "const " << bt->nested_type_name (bexcp, "_ptr") << "&"; - } - break; - case TAO_CodeGen::TAO_EXCEPTION_CTOR_CS: - { - *os << "const " << bt->name () << "_ptr &_tao_" << f->local_name - (); - } - break; - case TAO_CodeGen::TAO_EXCEPTION_CTOR_ASSIGN_CS: - { - // assign - os->indent (); // start with current indentation - *os << "this->" << f->local_name () << " = _tao_" << - f->local_name () << ";\n"; - } - break; - case TAO_CodeGen::TAO_EXCEPTION_CI: - break; - default: - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_exception - unknown state\n"), -1); - } - } // end switch state - } // end case interface - break; - case AST_Decl::NT_pre_defined: // type is predefined type - { - be_predefined_type *bpd = be_predefined_type::narrow_from_decl (type); - if (!bpd) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_exception - " - "bad predefined type\n"), -1); - } - switch (cg->state ()) - { - case TAO_CodeGen::TAO_EXCEPTION_CH: - { - switch (bpd->pt ()) - { - case AST_PredefinedType::PT_pseudo: - { - os->indent (); // start from current indentation - *os << bt->nested_type_name (bexcp, "_var") << " " << - f->local_name () << ";\n"; - } - break; - default: - { - os->indent (); // start from current indentation - *os << bt->nested_type_name (bexcp) << " " << f->local_name - () << ";\n"; - } - } // end of switch state - } - break; - case TAO_CodeGen::TAO_EXCEPTION_CS: - { - // assign - os->indent (); // start with current indentation - *os << "this->" << f->local_name () << " = _tao_excp." << - f->local_name () << ";\n"; - } - break; - case TAO_CodeGen::TAO_EXCEPTION_CTOR_CH: - { - switch (bpd->pt ()) - { - case AST_PredefinedType::PT_pseudo: - { - *os << "const " << bt->nested_type_name (bexcp, "_ptr") << - "&"; - } - break; - default: - { - *os << "const " << bt->nested_type_name (bexcp); - } - } - } - break; - case TAO_CodeGen::TAO_EXCEPTION_CTOR_CS: - { - switch (bpd->pt ()) - { - case AST_PredefinedType::PT_pseudo: - { - *os << "const " << bt->name () << "_ptr &_tao_" << - f->local_name (); - } - break; - default: - { - *os << "const " << bt->name () << " _tao_" << - f->local_name (); - } - } - } - break; - case TAO_CodeGen::TAO_EXCEPTION_CTOR_ASSIGN_CS: - { - // assign - os->indent (); // start with current indentation - *os << "this->" << f->local_name () << " = _tao_" << - f->local_name () << ";\n"; - } - break; - case TAO_CodeGen::TAO_EXCEPTION_CI: - break; - default: - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_exception - unknown state\n"), -1); - } - } // end switch state - } - break; - case AST_Decl::NT_string: // type is a string - { - switch (cg->state ()) - { - case TAO_CodeGen::TAO_EXCEPTION_CH: - { - os->indent (); // start from current indentation - if (bt->node_type () == AST_Decl::NT_typedef) - { - *os << bt->nested_type_name (bexcp, "_var") << " " << - f->local_name () << ";\n"; - } - else - { - *os << "CORBA::String_var " << f->local_name () << ";\n"; - } - } - break; - case TAO_CodeGen::TAO_EXCEPTION_CS: - { - // assign - os->indent (); // start with current indentation - *os << "this->" << f->local_name () << " = _tao_excp." << - f->local_name () << ";\n"; - } - break; - case TAO_CodeGen::TAO_EXCEPTION_CTOR_CH: - { - if (bt->node_type () == AST_Decl::NT_typedef) - { - *os << "const " << bt->nested_type_name (bexcp); - } - else - { - *os << "const char*"; - } - } - break; - case TAO_CodeGen::TAO_EXCEPTION_CTOR_CS: - { - if (bt->node_type () == AST_Decl::NT_typedef) - { - *os << "const " << bt->name () << " _tao_" << f->local_name - (); - } - else - { - *os << "const char* _tao_" << f->local_name (); - } - } - break; - case TAO_CodeGen::TAO_EXCEPTION_CTOR_ASSIGN_CS: - { - // assign - os->indent (); // start with current indentation - *os << "this->" << f->local_name () << " = _tao_" << - f->local_name () << ";\n"; - } - break; - case TAO_CodeGen::TAO_EXCEPTION_CI: - break; - default: - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_exception - unknown state\n"), -1); - } - } // end switch state - } - break; - // these are all anonymous types - case AST_Decl::NT_array: // type is an array - case AST_Decl::NT_sequence: // type is a sequence - case AST_Decl::NT_enum: // type is an enum - case AST_Decl::NT_union: // type is a union - { - switch (cg->state ()) - { - case TAO_CodeGen::TAO_EXCEPTION_CH: - { - // We first need to generate code for this aggregate type. Check - // if we are not called recursively thru a typedef - if (bt->node_type () != AST_Decl::NT_typedef - && !bt->imported ()) - if (bt->gen_client_header () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_exception - " - "error generating code for type\n"), - -1); - } - os->indent (); - *os << bt->nested_type_name (bexcp) << " " << f->local_name () << - ";\n"; - } - break; - case TAO_CodeGen::TAO_EXCEPTION_CI: - { - // We first need to generate code for this aggregate type. Check - // if we are not called recursively thru a typedef - if (bt->node_type () != AST_Decl::NT_typedef - && !bt->imported ()) - if (bt->gen_client_inline () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_exception - " - "error generating code for type\n"), - -1); - } - } - break; - case TAO_CodeGen::TAO_EXCEPTION_CS: - { - // We first need to generate code for this aggregate type. Check - // if we are not called recursively thru a typedef - if (bt->node_type () != AST_Decl::NT_typedef - && !bt->imported ()) - if (bt->gen_client_stubs () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_exception - " - "error generating code for type\n"), - -1); - } - // assign - os->indent (); // start with current indentation - *os << "this->" << f->local_name () << " = _tao_excp." << - f->local_name () << ";\n"; - } - break; - case TAO_CodeGen::TAO_EXCEPTION_CTOR_CH: - { - *os << "const " << bt->nested_type_name (bexcp) << "&"; - } - break; - case TAO_CodeGen::TAO_EXCEPTION_CTOR_CS: - { - *os << "const " << bt->name () << "&_tao_" << f->local_name (); - } - break; - case TAO_CodeGen::TAO_EXCEPTION_CTOR_ASSIGN_CS: - { - // assign - os->indent (); // start with current indentation - *os << "this->" << f->local_name () << " = _tao_" << - f->local_name () << ";\n"; - } - break; - default: - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_exception - unknown state\n"), -1); - } - } // end switch state - } - break; - case AST_Decl::NT_except: // type is an exception - { - // XXXASG TODO: is this allowed ??? - } - break; - case AST_Decl::NT_typedef: // type is a typedef - { - be_type *temp; - be_typedef *t = be_typedef::narrow_from_decl (bt); - - if (!t) - return -1; - - temp = t->primitive_base_type (); - // make a recursive call - return this->gen_code (t, f, temp); - } // end of switch - //break; unreachable statement! - } - // the enclosing exception will be variable length if the field's type is - // variable length - bexcp->size_type (type->size_type ()); - return 0; -} diff --git a/TAO/TAO_IDL/be/be_state_operation.cpp b/TAO/TAO_IDL/be/be_state_operation.cpp deleted file mode 100644 index 895334e6cf8..00000000000 --- a/TAO/TAO_IDL/be/be_state_operation.cpp +++ /dev/null @@ -1,691 +0,0 @@ -// ============================================================================ -// -// = LIBRARY -// TAO IDL -// -// = FILENAME -// be_state_operation.cpp -// -// = DESCRIPTION -// state based code generation for operations. -// -// = AUTHOR -// Aniruddha Gokhale -// -// ============================================================================ - -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -// return type for operation -be_state_operation::be_state_operation (void) -{ -} - -// generate code for return type of operation -int -be_state_operation::gen_code (be_type *bt, be_decl *d, be_type *type) -{ - TAO_OutStream *os = 0; // output stream - TAO_NL nl; // end line - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - be_operation *bop; - be_interface *bif; // interface in which the operation was defined - - bop = be_operation::narrow_from_decl (d); - if (!bop) - return -1; - - bif = be_interface::narrow_from_scope (bop->defined_in ()); - if (!bif) - return -1; - - switch (cg->state ()) - { - case TAO_CodeGen::TAO_OPERATION_CH: - os = cg->client_header (); - break; - case TAO_CodeGen::TAO_OPERATION_RETURN_TYPE_CS: - case TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_CS: - case TAO_CodeGen::TAO_OPERATION_RETVAL_EXCEPTION_CS: - case TAO_CodeGen::TAO_OPERATION_RETVAL_RETURN_CS: - os = cg->client_stubs (); - break; - case TAO_CodeGen::TAO_OPERATION_SH: - os = cg->server_header (); - break; - case TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_SS: - case TAO_CodeGen::TAO_OPERATION_RETVAL_ASSIGN_SS: - case TAO_CodeGen::TAO_OPERATION_RESULT_SS: - os = cg->server_skeletons (); - break; - } - - if (!type) // not a recursive call - type = bt; - else // recursively called thru a typedef. "type" will have the most primitive - // base class of the typedef - ACE_ASSERT (bt->node_type () == AST_Decl::NT_typedef); - - // generate code based on type. For every case, first downcast to the - // appropriate type. If the downcast fails, return error, else proceed. In - // some cases, the type itself may need code generation, e.g., anonymous - // struct types. - switch (type->node_type ()) - { - case AST_Decl::NT_interface: // type is an obj reference - case AST_Decl::NT_interface_fwd: // type is an obj reference - { - switch (cg->state ()) - { - case TAO_CodeGen::TAO_OPERATION_RETURN_TYPE_CS: - { - *os << bt->name () << "_ptr "; - } - break; - case TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_CS: - { - *os << "CORBA::Object_ptr retval = CORBA::Object::_nil ();" << nl; - } - break; - case TAO_CodeGen::TAO_OPERATION_RETVAL_EXCEPTION_CS: - { - *os << "return " << bt->name () << "::_nil ();\n"; - } - break; - case TAO_CodeGen::TAO_OPERATION_RETVAL_RETURN_CS: - { - *os << "return " << bt->name () << "::_narrow (retval, env);" << nl; - } - break; - case TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_SS: - { - *os << "CORBA::Object_ptr *retval =" - " new CORBA::Object_ptr;" << nl; - *os << "*retval = CORBA::Object::_nil ();" << nl; - } - break; - case TAO_CodeGen::TAO_OPERATION_RETVAL_ASSIGN_SS: - { - *os << "*retval"; // assign to retval - } - break; - case TAO_CodeGen::TAO_OPERATION_RESULT_SS: - { - *os << "result = new CORBA::Any (" << bt->tc_name () << - ", retval, 1); // ORB owns" << nl; - } - break; - case TAO_CodeGen::TAO_OPERATION_CH: - { - // to keep MSVC++ happy - *os << bt->nested_type_name (bif, "_ptr") << " "; - } - break; - default: - { - *os << bt->name () << "_ptr "; - } - } - } - break; - case AST_Decl::NT_pre_defined: // type is predefined type - { - be_predefined_type *bpd = be_predefined_type::narrow_from_decl (type); - - switch (cg->state ()) - { - case TAO_CodeGen::TAO_OPERATION_RETURN_TYPE_CS: - { - // check if the type is an any - if (bpd->pt () == AST_PredefinedType::PT_any) - { - // if it is an any, return a pointer to it - *os << bt->name () << " *"; - } - else if (bpd->pt () == AST_PredefinedType::PT_pseudo) - { - // pseudo object, return a pointer - *os << bt->name () << "_ptr "; - } - else if (bpd->pt () == AST_PredefinedType::PT_void) - { - *os << "void "; - } - else - { - *os << bt->name () << " "; - } - } - break; - case TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_CS: - { - // check if the type is an any - if (bpd->pt () == AST_PredefinedType::PT_any) - { - // if it is an any, return a pointer to it - *os << bt->name () << " *retval;" << nl; - } - else if (bpd->pt () == AST_PredefinedType::PT_pseudo) - { - // pseudo object, return a pointer - *os << bt->name () << "_ptr retval;" << nl; - } - else if (bpd->pt () == AST_PredefinedType::PT_void) - { - // no return variable - } - else - { - *os << bt->name () << " retval;" << nl; - } - } - break; - case TAO_CodeGen::TAO_OPERATION_RETVAL_EXCEPTION_CS: - { - // check if the type is an any - if (bpd->pt () == AST_PredefinedType::PT_any) - { - // if it is an any, return a pointer to it - *os << "return 0;\n"; - } - else if (bpd->pt () == AST_PredefinedType::PT_pseudo) - { - // pseudo object, return a pointer - *os << "return 0;\n"; - } - else if (bpd->pt () == AST_PredefinedType::PT_void) - { - *os << "return;\n"; - } - else - { - *os << "return retval;\n"; - } - } - break; - case TAO_CodeGen::TAO_OPERATION_RETVAL_RETURN_CS: - { - if (bpd->pt () == AST_PredefinedType::PT_void) - { - *os << "return; // no value" << nl; - } - else - { - *os << "return retval;" << nl; - } - } - break; - case TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_SS: - { - // check if the type is an any - if (bpd->pt () == AST_PredefinedType::PT_any) - { - // if it is an any, return a pointer to it - *os << bt->name () << " *retval;" << nl; - } - else if (bpd->pt () == AST_PredefinedType::PT_pseudo) - { - // pseudo object, return a pointer - *os << bt->name () << "_ptr *retval = new " << bt->name () << - "_ptr;" << nl; - } - else - { - *os << bt->name () << " *retval = new " << bt->name () << ";" - << nl; - } - } - break; - case TAO_CodeGen::TAO_OPERATION_RETVAL_ASSIGN_SS: - { - // check if the type is an any - if (bpd->pt () == AST_PredefinedType::PT_any) - { - // if it is an any, return a pointer to it - *os << "retval"; - } - else if (bpd->pt () == AST_PredefinedType::PT_pseudo) - { - // pseudo object, return a pointer - *os << "*retval"; - } - else - { - *os << " *retval"; - } - } - break; - case TAO_CodeGen::TAO_OPERATION_RESULT_SS: - { - if (bpd->pt () == AST_PredefinedType::PT_any) - { - // if it is an any, return a pointer to it - *os << "result = new CORBA::Any (" << bt->tc_name () << - ", retval, 1); // ORB owns" << nl; - } - else if (bpd->pt () == AST_PredefinedType::PT_pseudo) - { - // pseudo object, return a pointer - *os << "result = new CORBA::Any (" << bt->tc_name () << - ", retval, 1); // ORB owns" << nl; - } - else - { - *os << "result = new CORBA::Any (" << bt->tc_name () << - ", retval, 1); // ORB owns" << nl; - } - } - break; - case TAO_CodeGen::TAO_OPERATION_CH: - { - // to keep MSVC++ happy - if (bpd->pt () == AST_PredefinedType::PT_any) - { - // if it is an any, return a pointer to it - *os << bt->nested_type_name (bif, "*") << " "; - } - else if (bpd->pt () == AST_PredefinedType::PT_pseudo) - { - // pseudo object, return a pointer - *os << bt->nested_type_name (bif, "_ptr") << " "; - } - else - { - *os << bt->nested_type_name (bif) << " "; - } - } - break; - default: - { - *os << bt->name (); - // check if the type is an any - if (bpd->pt () == AST_PredefinedType::PT_any) - { - // if it is an any, return a pointer to it - *os << " *"; - } - else if (bpd->pt () == AST_PredefinedType::PT_pseudo) - { - // pseudo object, return a pointer - *os << "_ptr"; - } - } - } // end switch (cg->state()) - } - break; - case AST_Decl::NT_string: // type is a string - { - switch (cg->state ()) - { - case TAO_CodeGen::TAO_OPERATION_RETURN_TYPE_CS: - { - if (bt->node_type () == AST_Decl::NT_typedef) - { - *os << bt->name (); - } - else - { - *os << "char *"; - } - } - break; - case TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_CS: - { - if (bt->node_type () == AST_Decl::NT_typedef) - { - *os << bt->name () << " retval = 0;" << nl; - } - else - { - *os << "char *retval = 0;" << nl; - } - } - break; - case TAO_CodeGen::TAO_OPERATION_RETVAL_EXCEPTION_CS: - { - *os << "return 0;\n"; - } - break; - case TAO_CodeGen::TAO_OPERATION_RETVAL_RETURN_CS: - { - *os << "return retval;" << nl; - } - break; - case TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_SS: - { - if (bt->node_type () == AST_Decl::NT_typedef) - { - *os << bt->name () << " *retval = new " << bt->name () << ";" << nl; - } - else - { - *os << "char **retval = new char*;" << nl; - } - } - break; - case TAO_CodeGen::TAO_OPERATION_RETVAL_ASSIGN_SS: - { - *os << "*retval"; - } - break; - case TAO_CodeGen::TAO_OPERATION_RESULT_SS: - { - *os << "result = new CORBA::Any (" << bt->tc_name () << - ", retval, 1); // ORB owns" << nl; - } - break; - case TAO_CodeGen::TAO_OPERATION_CH: - { - if (bt->node_type () == AST_Decl::NT_typedef) - { - // to keep MSVC++ happy - *os << bt->nested_type_name (bif); - } - else - { - *os << "char *"; - } - } - break; - default: - { - *os << "char *"; - } - } // end of switch cg->state - } - break; - // these are all anonymous types - case AST_Decl::NT_array: // type is an array - { - switch (cg->state ()) - { - case TAO_CodeGen::TAO_OPERATION_RETURN_TYPE_CS: - { - *os << bt->name () << "_slice *"; - } - break; - case TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_CS: - { - *os << bt->name () << "_slice *retval;" << nl; - } - break; - case TAO_CodeGen::TAO_OPERATION_RETVAL_EXCEPTION_CS: - { - *os << "return 0;\n"; - } - break; - case TAO_CodeGen::TAO_OPERATION_RETVAL_RETURN_CS: - { - *os << "return retval;" << nl; - } - break; - case TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_SS: - { - *os << bt->name () << "_slice *retval;" << nl; - } - break; - case TAO_CodeGen::TAO_OPERATION_RETVAL_ASSIGN_SS: - { - *os << "retval"; - } - break; - case TAO_CodeGen::TAO_OPERATION_RESULT_SS: - { - *os << "result = new CORBA::Any (" << bt->tc_name () << - ", retval, 1); // ORB owns" << nl; - } - break; - case TAO_CodeGen::TAO_OPERATION_CH: - { - // to keep MSVC++ happy - *os << bt->nested_type_name (bif, "_slice") << " *"; - } - break; - default: - { - // return a pointer to slice - *os << bt->name () << "_slice *"; - } - } // end of switch cg->state - } - break; - case AST_Decl::NT_sequence: // type is a sequence - // return type is a pointer to sequence - { - switch (cg->state ()) - { - case TAO_CodeGen::TAO_OPERATION_RETURN_TYPE_CS: - { - *os << bt->name () << " *"; - } - break; - case TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_CS: - { - *os << bt->name () << " *retval = 0;" << nl; - } - break; - case TAO_CodeGen::TAO_OPERATION_RETVAL_EXCEPTION_CS: - { - *os << "return 0;\n"; - } - break; - case TAO_CodeGen::TAO_OPERATION_RETVAL_RETURN_CS: - { -#if 0 - be_sequence *seq = be_sequence::narrow_from_decl (type); - // init_mgr method for managed types - switch (seq->managed_type ()) - { - case be_sequence::MNG_OBJREF: - case be_sequence::MNG_STRING: - *os << "retval->init_mgr ();" << nl; - break; - default: - break; - } -#endif - // if we are sequence, call init manager - *os << "return retval;" << nl; - } - break; - case TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_SS: - { - *os << bt->name () << " *retval;" << nl; - } - break; - case TAO_CodeGen::TAO_OPERATION_RETVAL_ASSIGN_SS: - { - *os << "retval"; - } - break; - case TAO_CodeGen::TAO_OPERATION_RESULT_SS: - { - *os << "result = new CORBA::Any (" << bt->tc_name () << - ", retval, 1); // ORB owns" << nl; - } - break; - case TAO_CodeGen::TAO_OPERATION_CH: - { - // to keep MSVC++ happy - *os << bt->nested_type_name (bif) << " *"; - } - break; - default: - { - *os << bt->name () << " *"; - } - } // end of swithc cg->state - } - break; - case AST_Decl::NT_enum: // type is an enum - { - switch (cg->state ()) - { - case TAO_CodeGen::TAO_OPERATION_RETURN_TYPE_CS: - { - *os << bt->name () << " "; - } - break; - case TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_CS: - { - *os << bt->name () << " retval;" << nl; - } - break; - case TAO_CodeGen::TAO_OPERATION_RETVAL_EXCEPTION_CS: - { - *os << "return retval;\n"; - } - break; - case TAO_CodeGen::TAO_OPERATION_RETVAL_RETURN_CS: - { - *os << "return retval;" << nl; - } - break; - case TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_SS: - { - *os << bt->name () << " *retval = new " << bt->name () << ";" << - nl; - } - break; - case TAO_CodeGen::TAO_OPERATION_RETVAL_ASSIGN_SS: - { - *os << "*retval"; - } - break; - case TAO_CodeGen::TAO_OPERATION_RESULT_SS: - { - *os << "result = new CORBA::Any (" << bt->tc_name () << - ", retval, 1); // ORB owns" << nl; - } - break; - case TAO_CodeGen::TAO_OPERATION_CH: - { - // to keep MSVC++ happy - *os << bt->nested_type_name (bif); - } - break; - default: - { - *os << bt->name (); - } - } // end of switch cg->state - } - break; - case AST_Decl::NT_struct: // type is a struct - case AST_Decl::NT_union: // type is a union - { - switch (cg->state ()) - { - case TAO_CodeGen::TAO_OPERATION_RETURN_TYPE_CS: - { - *os << bt->name () << " "; - if (bt->size_type () == be_decl::VARIABLE) - { - *os << "*"; - } - } - break; - case TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_CS: - { - if (bt->size_type () == be_decl::VARIABLE) - { - *os << bt->name () << " *retval;" << nl; - } - else - { - *os << bt->name () << " retval;" << nl; - } - } - break; - case TAO_CodeGen::TAO_OPERATION_RETVAL_EXCEPTION_CS: - { - if (bt->size_type () == be_decl::VARIABLE) - { - *os << "return 0;\n"; - } - else - { - *os << "return retval;\n"; - } - } - break; - case TAO_CodeGen::TAO_OPERATION_RETVAL_RETURN_CS: - { - *os << "return retval;" << nl; - } - break; - case TAO_CodeGen::TAO_OPERATION_RETVAL_DECL_SS: - { - if (type->size_type () == be_decl::VARIABLE) - { - *os << bt->name () << " *retval;" << nl; - } - else - { - *os << bt->name () << " *retval = new " << bt->name () << ";" - << nl; - } - } - break; - case TAO_CodeGen::TAO_OPERATION_RETVAL_ASSIGN_SS: - { - if (type->size_type () == be_decl::VARIABLE) - { - *os << "retval"; - } - else - { - *os << "*retval"; - } - } - break; - case TAO_CodeGen::TAO_OPERATION_RESULT_SS: - { - *os << "result = new CORBA::Any (" << bt->tc_name () << - ", retval, 1); // ORB owns" << nl; - } - break; - case TAO_CodeGen::TAO_OPERATION_CH: - { - // to keep MSVC++ happy - *os << bt->nested_type_name (bif); - // check if we are fixed size or variable sized. Depending on that we - // return a pointer or the aggregate itself - if (type->size_type () == be_decl::VARIABLE) - *os << " *"; - } - break; - default: - { - *os << bt->name (); - // check if we are fixed size or variable sized. Depending on that we - // return a pointer or the aggregate itself - if (type->size_type () == be_decl::VARIABLE) - *os << " *"; - } - } // end of switch cg->state - } - break; - case AST_Decl::NT_except: // type is an exception - { - // XXXASG TODO: is this allowed ??? - } - break; - case AST_Decl::NT_typedef: // type is a typedef - { - be_type *temp; - be_typedef *t = be_typedef::narrow_from_decl (bt); - - if (!t) - return -1; - - temp = t->primitive_base_type (); - // make a recursive call - return this->gen_code (t, d, temp); - } // end of switch - //break; unreachable statement! - } // switch of main switch - return 0; -} diff --git a/TAO/TAO_IDL/be/be_state_sequence.cpp b/TAO/TAO_IDL/be/be_state_sequence.cpp deleted file mode 100644 index ca1b9e11a2a..00000000000 --- a/TAO/TAO_IDL/be/be_state_sequence.cpp +++ /dev/null @@ -1,440 +0,0 @@ -// ============================================================================ -// -// = LIBRARY -// TAO IDL -// -// = FILENAME -// be_state_sequence.cpp -// -// = DESCRIPTION -// state based code generation for sequences. -// -// = AUTHOR -// Aniruddha Gokhale -// -// ============================================================================ - -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -// return type for sequence -be_state_sequence::be_state_sequence (void) -{ -} - -// generate code for sequence type -int -be_state_sequence::gen_code (be_type *bt, be_decl *d, be_type *type) -{ - TAO_OutStream *os = 0; // output stream - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - be_sequence *seq; - - seq = be_sequence::narrow_from_decl (d); - if (!seq) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_sequence.cpp - " - "Bad sequence type\n"), - -1); - } - - switch (cg->state ()) - { - case TAO_CodeGen::TAO_SEQUENCE_BASE_CH: - case TAO_CodeGen::TAO_SEQUENCE_BODY_CH: - case TAO_CodeGen::TAO_SEQELEM_RETTYPE_CH: - os = cg->client_header (); // get client header stream - break; - case TAO_CodeGen::TAO_SEQUENCE_BASE_CS: - case TAO_CodeGen::TAO_SEQUENCE_BODY_CS: - case TAO_CodeGen::TAO_SEQELEM_RETTYPE_CS: - os = cg->client_stubs (); // get client stubs stream - break; - case TAO_CodeGen::TAO_SEQUENCE_BASE_CI: - case TAO_CodeGen::TAO_SEQUENCE_BODY_CI: - case TAO_CodeGen::TAO_SEQELEM_RETTYPE_CI: - os = cg->client_inline (); // get client inline stream - break; - default: - return -1; - } - - if (!type) // not a recursive call - type = bt; - else // recursively called thru a typedef. "type" will have the most primitive - // base class of the typedef - ACE_ASSERT (bt->node_type () == AST_Decl::NT_typedef); - - // enclosing scope in which the sequence element type occurs - be_decl *scope; - if (!bt->defined_in ()) // no outer scope for us - scope = 0; - else - { - scope = be_scope::narrow_from_scope (bt->defined_in ())->decl (); - if (!scope) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_sequence.cpp - " - "bad scope for seq elem type\n"), - -1); - } - } - - // for sequences, all we do is generate the type - switch (type->node_type ()) - { - case AST_Decl::NT_interface: // type is an obj reference - case AST_Decl::NT_interface_fwd: // type is an obj reference - case AST_Decl::NT_string: // type is a string - { - switch (cg->state ()) - { - // if it is the case of sequence base, we generate the code for - // managed types - case TAO_CodeGen::TAO_SEQUENCE_BASE_CH: - if (seq->gen_managed_type_ch () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_sequence.cpp - " - "codegen for managed type\n"), - -1); - } - break; - case TAO_CodeGen::TAO_SEQUENCE_BASE_CS: - if (seq->gen_managed_type_cs () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_sequence.cpp - " - "codegen for managed type\n"), - -1); - } - break; - case TAO_CodeGen::TAO_SEQUENCE_BASE_CI: - if (seq->gen_managed_type_ci () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_sequence.cpp - " - "codegen for managed type\n"), - -1); - } - break; - case TAO_CodeGen::TAO_SEQELEM_RETTYPE_CH: // managed type returned by - // operator [] - { - if ((type->node_type () == AST_Decl::NT_interface) - || (type->node_type () == AST_Decl::NT_interface_fwd)) - { - if (scope) - { - *os << "ACE_NESTED_CLASS (" << scope->name () << "," << - seq->local_name () << "::TAO_ObjRefMngType) "; - } - else - { - *os << seq->local_name () << "::TAO_ObjRefMngType "; - } - } - else // must be a string - { - if (scope) - { - *os << "ACE_NESTED_CLASS (" << scope->name () << "," << - seq->local_name () << "::TAO_StrMngType) "; - } - else - { - *os << seq->local_name () << "::TAO_StrMngType "; - } - } - } - break; - case TAO_CodeGen::TAO_SEQELEM_RETTYPE_CI: - case TAO_CodeGen::TAO_SEQELEM_RETTYPE_CS: - { - if ((type->node_type () == AST_Decl::NT_interface) - || (type->node_type () == AST_Decl::NT_interface_fwd)) - { - *os << seq->name () << "::TAO_ObjRefMngType "; - } - else // must be a string - { - *os << seq->name () << "::TAO_StrMngType "; - } - } - break; - case TAO_CodeGen::TAO_SEQUENCE_BODY_CH: - { - if ((type->node_type () == AST_Decl::NT_interface) - || (type->node_type () == AST_Decl::NT_interface_fwd)) - { - *os << bt->nested_type_name (scope, "_ptr"); - } - else // must be a string - { - *os << "char *"; - } - } - break; - case TAO_CodeGen::TAO_SEQUENCE_BODY_CI: - case TAO_CodeGen::TAO_SEQUENCE_BODY_CS: - { - if ((type->node_type () == AST_Decl::NT_interface) - || (type->node_type () == AST_Decl::NT_interface_fwd)) - { - *os << bt->name () << "_ptr"; - } - else // must be a string - { - *os << "char *"; - } - } - break; - default: - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_sequence.cpp - " - "bad state\n"), - -1); - } - } - } - break; - case AST_Decl::NT_pre_defined: // type is predefined type - { - be_predefined_type *bpd = be_predefined_type::narrow_from_decl (type); - - if (!bpd) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_sequence.cpp - " - "bad type\n"), - -1); - } - if (bpd->pt () == AST_PredefinedType::PT_pseudo) - { - // managed types for pseudo objs - switch (cg->state ()) - { - case TAO_CodeGen::TAO_SEQUENCE_BASE_CH: - if (seq->gen_managed_type_ch () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_sequence.cpp - " - "codegen for managed type\n"), - -1); - } - break; - case TAO_CodeGen::TAO_SEQUENCE_BASE_CS: - if (seq->gen_managed_type_cs () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_sequence.cpp - " - "codegen for managed type\n"), - -1); - } - break; - case TAO_CodeGen::TAO_SEQUENCE_BASE_CI: - if (seq->gen_managed_type_ci () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_sequence.cpp - " - "codegen for managed type\n"), - -1); - } - break; - case TAO_CodeGen::TAO_SEQUENCE_BODY_CH: - *os << bt->nested_type_name (scope, "_ptr"); - break; - case TAO_CodeGen::TAO_SEQUENCE_BODY_CS: - case TAO_CodeGen::TAO_SEQUENCE_BODY_CI: - *os << bt->name () << "_ptr"; - break; - case TAO_CodeGen::TAO_SEQELEM_RETTYPE_CH: // managed type returned by - // operator [] - { - if (scope) - { - *os << "ACE_NESTED_CLASS (" << scope->name () << "," << - seq->local_name () << "::TAO_ObjRefMngType ) "; - } - else - { - *os << seq->local_name () << "::TAO_ObjRefMngType "; - } - } - break; - case TAO_CodeGen::TAO_SEQELEM_RETTYPE_CI: - case TAO_CodeGen::TAO_SEQELEM_RETTYPE_CS: - { - *os << seq->name () << "::TAO_ObjRefMngType "; - } - break; - default: - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_sequence.cpp - " - "bad state\n"), - -1); - } - } // end switch state - } // if pseudo - else - { - // rest of the predefined types - switch (cg->state ()) - { - case TAO_CodeGen::TAO_SEQUENCE_BASE_CH: - case TAO_CodeGen::TAO_SEQUENCE_BASE_CS: - case TAO_CodeGen::TAO_SEQUENCE_BASE_CI: - // nothing to be done - break; - case TAO_CodeGen::TAO_SEQELEM_RETTYPE_CH: - *os << bt->nested_type_name (scope, " &"); - break; - case TAO_CodeGen::TAO_SEQUENCE_BODY_CH: - *os << bt->nested_type_name (scope, " "); - break; - case TAO_CodeGen::TAO_SEQELEM_RETTYPE_CI: - case TAO_CodeGen::TAO_SEQELEM_RETTYPE_CS: - *os << bt->name () << " &"; - break; - case TAO_CodeGen::TAO_SEQUENCE_BODY_CS: - case TAO_CodeGen::TAO_SEQUENCE_BODY_CI: - *os << bt->name () << " "; - break; - default: - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_sequence.cpp - " - "bad state\n"), - -1); - } - } // end of switch - } // end else - } // end case predefined type - break; - case AST_Decl::NT_enum: // type is an enum - case AST_Decl::NT_array: // type is an array - case AST_Decl::NT_struct: // type is a struct - case AST_Decl::NT_union: // type is a union - { - switch (cg->state ()) - { - case TAO_CodeGen::TAO_SEQUENCE_BASE_CH: - case TAO_CodeGen::TAO_SEQUENCE_BASE_CS: - case TAO_CodeGen::TAO_SEQUENCE_BASE_CI: - // nothing to do because we cannot have anonymous data types here - // that are enums or structures or unions. - break; - case TAO_CodeGen::TAO_SEQUENCE_BODY_CH: - *os << bt->nested_type_name (scope, " "); - break; - case TAO_CodeGen::TAO_SEQELEM_RETTYPE_CH: - *os << bt->nested_type_name (scope, " &"); - break; - case TAO_CodeGen::TAO_SEQELEM_RETTYPE_CS: - case TAO_CodeGen::TAO_SEQELEM_RETTYPE_CI: - *os << bt->name () << " &"; - break; - case TAO_CodeGen::TAO_SEQUENCE_BODY_CS: - case TAO_CodeGen::TAO_SEQUENCE_BODY_CI: - *os << bt->name () << " "; - break; - default: - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_sequence.cpp - " - "bad state\n"), - -1); - } - } - } - break; - case AST_Decl::NT_sequence: // type is a sequence - { - switch (cg->state ()) - { - case TAO_CodeGen::TAO_SEQUENCE_BASE_CH: - { - // generate the base type sequence - if (bt->gen_client_header () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_sequence.cpp - " - "Bad sequence type\n"), - -1); - } - } - break; - case TAO_CodeGen::TAO_SEQUENCE_BASE_CS: - { - // generate the base type sequence - if (bt->gen_client_stubs () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_sequence.cpp - " - "Bad sequence type\n"), - -1); - } - } - break; - case TAO_CodeGen::TAO_SEQUENCE_BASE_CI: - { - // generate the base type sequence - if (bt->gen_client_inline () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_sequence.cpp - " - "Bad sequence type\n"), - -1); - } - } - break; - case TAO_CodeGen::TAO_SEQUENCE_BODY_CH: - *os << bt->nested_type_name (scope, " "); - break; - case TAO_CodeGen::TAO_SEQELEM_RETTYPE_CH: - *os << bt->nested_type_name (scope, " &"); - break; - case TAO_CodeGen::TAO_SEQELEM_RETTYPE_CS: - case TAO_CodeGen::TAO_SEQELEM_RETTYPE_CI: - *os << bt->name () << " &"; - break; - case TAO_CodeGen::TAO_SEQUENCE_BODY_CS: - case TAO_CodeGen::TAO_SEQUENCE_BODY_CI: - *os << bt->name () << " "; - break; - default: - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_sequence.cpp - " - "bad state\n"), - -1); - } - } - } - break; - case AST_Decl::NT_except: // type is an exception - { - // XXXASG: Is this case valid ??? - } - break; - case AST_Decl::NT_typedef: // type is a typedef - { - be_type *temp; // most primitive base type - be_typedef *t = be_typedef::narrow_from_decl (bt); - - if (!t) - return -1; - - temp = t->primitive_base_type (); - // make a recursive call - return this->gen_code (t, d, temp); - } - //break; unreachable statement! - } // end of switch - return 0; -} diff --git a/TAO/TAO_IDL/be/be_state_structure.cpp b/TAO/TAO_IDL/be/be_state_structure.cpp deleted file mode 100644 index 88ea8992f2f..00000000000 --- a/TAO/TAO_IDL/be/be_state_structure.cpp +++ /dev/null @@ -1,276 +0,0 @@ -// ============================================================================ -// -// = LIBRARY -// TAO IDL -// -// = FILENAME -// be_state_struct.cpp -// -// = DESCRIPTION -// state based code generation for structs. -// -// = AUTHOR -// Aniruddha Gokhale -// -// ============================================================================ - -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -be_state_struct::be_state_struct (void) -{ -} - -// generate code for structure member -int -be_state_struct ::gen_code (be_type *bt, be_decl *d, be_type *type) -{ - TAO_OutStream *os; // output stream - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - be_field *f; // field node - be_structure *bs; // enclosing structure node - - switch (cg->state ()) - { - case TAO_CodeGen::TAO_STRUCT_CH: - os = cg->client_header (); - break; - case TAO_CodeGen::TAO_STRUCT_CS: - os = cg->client_stubs (); - break; - case TAO_CodeGen::TAO_STRUCT_CI: - os = cg->client_inline (); - break; - } - - f = be_field::narrow_from_decl (d); // downcast to field node - if (!f) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_structure.cpp - " - "Bad field\n"), - -1); - } - - // retrieve the enclosing "struct" node - bs = be_structure::narrow_from_scope (f->defined_in ()); - if (!bs) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_struct.cpp - " - "Bad structure\n"), - -1); - } - - if (!type) // not a recursive call - type = bt; - else // recursively called thru a typedef. "type" will have the most primitive - // base class of the typedef - ACE_ASSERT (bt->node_type () == AST_Decl::NT_typedef); - - // generate code based on type. - switch (type->node_type ()) - { - case AST_Decl::NT_interface: // type is an obj reference - { - switch (cg->state ()) - { - case TAO_CodeGen::TAO_STRUCT_CH: - { - os->indent (); // start from current indentation - *os << bt->nested_type_name (bs, "_var") << " " << f->local_name - () << ";\n"; - } - break; - case TAO_CodeGen::TAO_STRUCT_CI: - { - // nothing - } - break; - case TAO_CodeGen::TAO_STRUCT_CS: - { - // nothing - } - break; - default: - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_struct - unknown state\n"), -1); - } - } // end switch state - } // end case interface - break; - case AST_Decl::NT_pre_defined: // type is predefined type - { - switch (cg->state ()) - { - case TAO_CodeGen::TAO_STRUCT_CH: - { - be_predefined_type *bpd = be_predefined_type::narrow_from_decl - (type); - if (!bpd) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_struct - " - "bad predefined type\n"), -1); - } - os->indent (); // start from current indentation - switch (bpd->pt ()) - { - case AST_PredefinedType::PT_any: - case AST_PredefinedType::PT_pseudo: - *os << bt->nested_type_name (bs) << "_var " << f->local_name - () << ";\n"; - break; - default: - *os << bt->nested_type_name (bs) << " " << f->local_name () - << ";\n"; - } - } - break; - case TAO_CodeGen::TAO_STRUCT_CI: - { - // nothing - } - break; - case TAO_CodeGen::TAO_STRUCT_CS: - { - // nothing - } - break; - default: - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_struct - unknown state\n"), -1); - } - } // end switch state - } - break; - case AST_Decl::NT_string: // type is a string - { - switch (cg->state ()) - { - case TAO_CodeGen::TAO_STRUCT_CH: - { - os->indent (); // start from current indentation - if (bt->node_type () == AST_Decl::NT_typedef) - { - *os << bt->nested_type_name (bs, "_var") << " " << - f->local_name () << ";\n"; - } - else - { - *os << "CORBA::String_var " << f->local_name () << ";\n"; - } - } - break; - case TAO_CodeGen::TAO_STRUCT_CI: - { - } - break; - case TAO_CodeGen::TAO_STRUCT_CS: - { - } - break; - default: - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_struct - unknown state\n"), -1); - } - } // end switch state - } - break; - // these are all anonymous types - case AST_Decl::NT_array: // type is an array - case AST_Decl::NT_sequence: // type is a sequence - case AST_Decl::NT_enum: // type is an enum - case AST_Decl::NT_struct: // type is a struct - case AST_Decl::NT_union: // type is a union - { - switch (cg->state ()) - { - case TAO_CodeGen::TAO_STRUCT_CH: - { - // We first need to generate code for this aggregate type. Check - // if we are not called recursively thru a typedef - if (bt->node_type () != AST_Decl::NT_typedef - && !bt->imported ()) - if (bt->gen_client_header () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_struct - " - "error generating code for type\n"), - -1); - } - // this is not to be generated for arrays - if (bt->node_type () != AST_Decl::NT_array) - { - os->indent (); - *os << bt->nested_type_name (bs) << " " << f->local_name () << - ";\n"; - } - } - break; - case TAO_CodeGen::TAO_STRUCT_CI: - { - // We first need to generate code for this aggregate type. Check - // if we are not called recursively thru a typedef - if (bt->node_type () != AST_Decl::NT_typedef - && !bt->imported ()) - if (bt->gen_client_inline () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_struct - " - "error generating code for type\n"), - -1); - } - } - break; - case TAO_CodeGen::TAO_STRUCT_CS: - { - // We first need to generate code for this aggregate type. Check - // if we are not called recursively thru a typedef - if (bt->node_type () != AST_Decl::NT_typedef - && !bt->imported ()) - if (bt->gen_client_stubs () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_struct - " - "error generating code for type\n"), - -1); - } - } - break; - default: - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_struct - unknown state\n"), -1); - } - } // end switch state - } - break; - case AST_Decl::NT_except: // type is an exception - { - // XXXASG TODO: is this allowed ??? - } - break; - case AST_Decl::NT_typedef: // type is a typedef - { - be_type *temp; - be_typedef *t = be_typedef::narrow_from_decl (bt); - - if (!t) - return -1; - - temp = t->primitive_base_type (); - // make a recursive call - return this->gen_code (t, f, temp); - } // end of switch - //break; unreachable statement! - } - // the enclosing structure will be variable length if the field's type is - // variable length - bs->size_type (type->size_type ()); - return 0; -} diff --git a/TAO/TAO_IDL/be/be_state_typedef.cpp b/TAO/TAO_IDL/be/be_state_typedef.cpp deleted file mode 100644 index 7c83bfa758c..00000000000 --- a/TAO/TAO_IDL/be/be_state_typedef.cpp +++ /dev/null @@ -1,368 +0,0 @@ -// ============================================================================ -// -// = LIBRARY -// TAO IDL -// -// = FILENAME -// be_state_typedef.cpp -// -// = DESCRIPTION -// state based code generation for typedefs. -// -// = AUTHOR -// Aniruddha Gokhale -// -// ============================================================================ - -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -// return type for typedef -be_state_typedef::be_state_typedef (void) -{ -} - -// generate code for structure member -int -be_state_typedef::gen_code (be_type *bt, be_decl *d, be_type *type) -{ - TAO_OutStream *os; // output stream - TAO_NL nl; // end line - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - be_typedef *tdef; // typedef node - be_decl *scope; // enclosing scope in which the typedef occurs - - switch (cg->state ()) - { - case TAO_CodeGen::TAO_TYPEDEF_CH: - os = cg->client_header (); // set the stream to be the client header - break; - case TAO_CodeGen::TAO_TYPEDEF_CI: - os = cg->client_inline (); - break; - case TAO_CodeGen::TAO_TYPEDEF_CS: - os = cg->client_stubs (); - break; - default: - return -1; - } // end of outermost switch - - - tdef = be_typedef::narrow_from_decl (d); // downcast to typedef node - if (!tdef) - return -1; - - scope = be_scope::narrow_from_scope (tdef->defined_in ())->decl (); - - if (!type) // not a recursive call - type = bt; - else // recursively called thru a typedef. "type" will have the most - // primitive - // base class of the typedef - ACE_ASSERT (bt->node_type () == AST_Decl::NT_typedef); - - // the typedef node has the same size type as its base type - tdef->size_type (bt->size_type ()); - - switch (type->node_type ()) - { - case AST_Decl::NT_interface: // type is an obj reference - case AST_Decl::NT_interface_fwd: // type is an obj reference - { - switch (cg->state ()) - { - case TAO_CodeGen::TAO_TYPEDEF_CH: - { - os->indent (); // start from current indentation - - // typedef of an interface results in 3 typedefs as shown below - *os << "typedef " << bt->nested_type_name (scope) << " " << - d->local_name () << ";" << nl; - *os << "typedef " << bt->nested_type_name (scope, "_ptr") << " " << - d->local_name () << "_ptr;" << nl; - *os << "typedef " << bt->nested_type_name (scope, "_var") << " " << - d->local_name () << "_var;" << nl; - *os << "typedef " << bt->nested_type_name (scope, "_out") << " " << - d->local_name () << "_out;\n\n"; - } - break; - default: // nothing to do for other cases - break; - } // end of switch state - } - break; - case AST_Decl::NT_pre_defined: // type is predefined type - { - switch (cg->state ()) - { - case TAO_CodeGen::TAO_TYPEDEF_CH: - { - be_predefined_type *pd = be_predefined_type::narrow_from_decl (type); - - if (!pd) - return -1; - os->indent (); // start from current indentation - *os << "typedef " << bt->nested_type_name (scope) << " " << - d->local_name () << ";"; - // if the predefined type is an ANY, we also define a typedef to _var - if (pd->pt () == AST_PredefinedType::PT_any) - { - *os << nl; - *os << "typedef " << bt->name () << "_var " << d->local_name - () << "_var;"; - } - else if (pd->pt () == AST_PredefinedType::PT_pseudo) - { - // pseudo object - *os << "typedef " << bt->nested_type_name (scope, "_ptr") << - " " << d->local_name () << "_ptr;" << nl; - *os << "typedef " << bt->nested_type_name (scope, "_var") << - " " << d->local_name () << "_var;" << nl; - } - *os << "typedef " << bt->nested_type_name (scope, "_out") << " " - << d->local_name () << "_out;\n\n"; - } // end of case - break; - default: // nothing to do for other cases - break; - } // end switch - } - break; - case AST_Decl::NT_string: // type is a string - { - switch (cg->state ()) - { - case TAO_CodeGen::TAO_TYPEDEF_CH: - { - os->indent (); // start from current indentation - if (bt->node_type () == AST_Decl::NT_typedef) - { - *os << "typedef " << bt->nested_type_name (scope) << " " << - d->local_name () << ";" << nl; - *os << "typedef " << bt->nested_type_name (scope, "_var") << - " " << d->local_name () << "_var;" << nl; - *os << "typedef " << bt->nested_type_name (scope, "_out") << - " " << d->local_name () << "_out;\n\n"; - } - else - { - *os << "typedef CORBA::String " << d->local_name () << ";" << - nl; - *os << "typedef CORBA::String_var " << d->local_name - () << "_var;" << nl; - *os << "typedef CORBA::String_out " << d->local_name - () << "_out;\n\n"; - } - } - break; - default: // nothing to do for the rest of the cases - break; - } // end switch state - } - break; - case AST_Decl::NT_enum: // type is an enum - { - switch (cg->state ()) - { - case TAO_CodeGen::TAO_TYPEDEF_CH: - { - os->indent (); // start from current indentation - // if we are not here recursively, then we need to generate the - // definition first - if (bt->node_type () != AST_Decl::NT_typedef) - { - if (bt->gen_client_header () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "be_state_typedef - enum gen failed\n"), -1); - } - } - *os << "typedef " << bt->nested_type_name (scope) << " " << - d->local_name () << ";" << nl; - *os << "typedef " << bt->nested_type_name (scope, "_out") << " " - << d->local_name () << "_out;\n\n"; - } - break; - default: - break; - } // end of switch - } - break; - // these are all anonymous types - case AST_Decl::NT_array: // type is an array - { - switch (cg->state ()) - { - case TAO_CodeGen::TAO_TYPEDEF_CH: - { - // if we are not here recursively, then we need to generate the - // definition first i.e., this typedef had its immediate base - // class that was an array declaration. The code for arrays will - // handle all the code generation. We just prepend the word - // "typedef". - if (bt->node_type () != AST_Decl::NT_typedef) - { - os->indent (); - *os << "typedef "; - if (bt->gen_client_header () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "be_state_typedef - array gen failed\n"), -1); - } - } - else - { - // we are a typedef node whose immediate base class is also a - // typedefed node to some array node. We simply output a - // number of typedef statements - os->indent (); - *os << "typedef " << bt->nested_type_name (scope) << " " << - d->local_name () << ";" << nl; - *os << "typedef " << bt->nested_type_name (scope, "_slice") << - " " << d->local_name () << "_slice;" << nl; - *os << "typedef " << bt->nested_type_name (scope, "_var") << " " - << d->local_name () << "_var;" << nl; - *os << "typedef " << bt->nested_type_name (scope, "_out") << " " - << d->local_name () << "_out;" << nl; - *os << "typedef " << bt->nested_type_name (scope, "_forany") << " " - << d->local_name () << "_forany;" << nl; - - // typedefs for the auxiliary methods. If we are nested inside - // some scope, these methods become static to the enclosing scope - if (d->is_nested ()) - *os << "static "; - *os << bt->nested_type_name (scope) << "_slice* " << d->local_name () << - "_alloc (void);" << nl; - if (d->is_nested ()) - *os << "static "; - *os << bt->nested_type_name (scope, "_slice") << " *" << - d->local_name () << "_dup (" - << bt->nested_type_name (scope) << "_slice* " << ");" << nl; - if (d->is_nested ()) - *os << "static "; - *os << "void " << bt->nested_type_name (scope) << "_free (" << - d->name () << "_slice *);\n\n"; - } - } - break; - case TAO_CodeGen::TAO_TYPEDEF_CI: - { - // if we are not here recursively, then we need to generate the - // definition first - if (bt->node_type () != AST_Decl::NT_typedef) - { - if (bt->gen_client_inline () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "be_state_typedef - struct/union/seq gen failed\n"), - -1); - } - } - } - break; - case TAO_CodeGen::TAO_TYPEDEF_CS: - { - // if we are not here recursively, then we need to generate the - // definition first - if (bt->node_type () != AST_Decl::NT_typedef) - { - if (bt->gen_client_stubs () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "be_state_typedef - struct/union/seq gen failed\n"), - -1); - } - } - } - break; - default: - break; - } // end of switch - } - break; - case AST_Decl::NT_sequence: // type is a sequence - case AST_Decl::NT_struct: // type is a struct - case AST_Decl::NT_union: // type is a union - { - switch (cg->state ()) - { - case TAO_CodeGen::TAO_TYPEDEF_CH: - { - // if we are not here recursively, then we need to generate the - // definition first - if (bt->node_type () != AST_Decl::NT_typedef) - { - if (bt->gen_client_header () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "be_state_typedef - struct/union/seq gen failed\n"), - -1); - } - } - os->indent (); // start from current indentation - *os << "typedef " << bt->nested_type_name (scope) << " " << - d->local_name () << ";" << nl; - *os << "typedef " << bt->nested_type_name (scope, "_var") << " " - << d->local_name () << "_var;" << nl; - *os << "typedef " << bt->nested_type_name (scope, "_out") << " " - << d->local_name () << "_out;\n\n"; - } - break; - case TAO_CodeGen::TAO_TYPEDEF_CI: - { - // if we are not here recursively, then we need to generate the - // definition first - if (bt->node_type () != AST_Decl::NT_typedef) - { - if (bt->gen_client_inline () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "be_state_typedef - struct/union/seq gen failed\n"), - -1); - } - } - } - break; - case TAO_CodeGen::TAO_TYPEDEF_CS: - { - // if we are not here recursively, then we need to generate the - // definition first - if (bt->node_type () != AST_Decl::NT_typedef) - { - if (bt->gen_client_stubs () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "be_state_typedef - struct/union/seq gen failed\n"), - -1); - } - } - } - break; - default: - break; - } // end of switch state - } - break; - case AST_Decl::NT_except: // type is an exception - { - // XXXASG TODO: is this allowed ??? - } - break; - case AST_Decl::NT_typedef: // type is a typedef - { - be_type *temp; - be_typedef *t = be_typedef::narrow_from_decl (bt); - - if (!t) - return -1; - - temp = t->primitive_base_type (); - // make a recursive call - return this->gen_code (t, tdef, temp); - } // end of case - //break; unreachable statement! - } // end of switch - - return 0; -} diff --git a/TAO/TAO_IDL/be/be_state_union.cpp b/TAO/TAO_IDL/be/be_state_union.cpp deleted file mode 100644 index 91b4edd0f2f..00000000000 --- a/TAO/TAO_IDL/be/be_state_union.cpp +++ /dev/null @@ -1,1144 +0,0 @@ -// ============================================================================ -// -// = LIBRARY -// TAO IDL -// -// = FILENAME -// be_state_union.cpp -// -// = DESCRIPTION -// state based code generation for unions. -// -// = AUTHOR -// Aniruddha Gokhale -// -// ============================================================================ - -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -be_state_union_disctypedefn_ch::be_state_union_disctypedefn_ch (void) -{ -} - -// generate code for union discriminant type in client header -int -be_state_union_disctypedefn_ch::gen_code (be_type *bt, be_decl *d, be_type *type) -{ - TAO_OutStream *os; // output stream - TAO_NL nl; // end line - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - be_union *bu; - - bu = be_union::narrow_from_decl (d); // downcast to union type - if (!bu) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_union_disctypedefn_ch::" - "gen_code - " - "bad union node\n"), -1); - } - - if (!type) // not a recursive call - type = bt; - else // recursively called thru a typedef. "type" will have the most primitive - // base class of the typedef - ACE_ASSERT (bt->node_type () == AST_Decl::NT_typedef); - - os = cg->client_header (); // get client header stream - - // generate code based on type. For every case, first downcast to the - // appropriate type. If the downcast fails, return error, else proceed. In - // some cases, the type itself may need code generation, e.g., anonymous - // struct types. - switch (type->node_type ()) - { - case AST_Decl::NT_interface: // type is an obj reference - case AST_Decl::NT_string: // type is a string - case AST_Decl::NT_array: // type is an array - case AST_Decl::NT_sequence: // type is a sequence - case AST_Decl::NT_struct: // type is a struct - case AST_Decl::NT_union: // type is a union - case AST_Decl::NT_except: // type is an exception - // all these cases are syntax errors which the front-end should have - // flagged as error cases - return -1; - case AST_Decl::NT_pre_defined: // type is predefined type - case AST_Decl::NT_enum: // type is an enum - { - // if the discriminant is an enum, first generate the enum - // definition. However, check that we are not inside a recursive call - if (bt->node_type () == AST_Decl::NT_enum) - if (bt->gen_client_header () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_union_disctypedefn_ch::" - "gen_code - " - "codegen for discrim failed\n"), -1); - } - - os->indent (); - // the set method - *os << "void _d (" << bt->nested_type_name (bu) << ");" << nl; - // the get method - *os << bt->nested_type_name (bu) << " _d (void) const;\n\n"; - } - break; - case AST_Decl::NT_typedef: // type is a typedef - { - // a scoped name must result in one of the allowed types. Hopefully the - // front-end has done a good job of ensuring this. - be_type *temp; // most primitive base type - be_typedef *t = be_typedef::narrow_from_decl (bt); - if (!t) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_union_disctypedefn_ch::" - "gen_code - " - "bad typedef node\n"), -1); - } - - temp = t->primitive_base_type (); - return this->gen_code (t, d, temp); - } - } // end of switch - return 0; -} - -be_state_union_disctypedefn_ci::be_state_union_disctypedefn_ci (void) -{ -} - -// generate code for union discriminant type in client inline -int -be_state_union_disctypedefn_ci::gen_code (be_type *bt, be_decl *d, be_type *type) -{ - TAO_OutStream *os; // output stream - TAO_NL nl; // end line - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - be_union *bu; - - bu = be_union::narrow_from_decl (d); // downcast to union type - if (!bu) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_union_disctypedefn_ci::" - "gen_code - " - "bad union node\n"), -1); - } - - if (!type) // not a recursive call - type = bt; - else // recursively called thru a typedef. "type" will have the most primitive - // base class of the typedef - ACE_ASSERT (bt->node_type () == AST_Decl::NT_typedef); - - os = cg->client_inline (); // get client inline stream - - // generate code based on type. For every case, first downcast to the - // appropriate type. If the downcast fails, return error, else proceed. In - // some cases, the type itself may need code generation, e.g., anonymous - // struct types. - switch (type->node_type ()) - { - case AST_Decl::NT_interface: // type is an obj reference - case AST_Decl::NT_string: // type is a string - case AST_Decl::NT_array: // type is an array - case AST_Decl::NT_sequence: // type is a sequence - case AST_Decl::NT_struct: // type is a struct - case AST_Decl::NT_union: // type is a union - case AST_Decl::NT_except: // type is an exception - // all these cases are syntax errors which the front-end should have - // flagged as error - return -1; - case AST_Decl::NT_pre_defined: // type is predefined type - case AST_Decl::NT_enum: // type is an enum - case AST_Decl::NT_typedef: // type is a typedef - { - os->indent (); - // the set method - *os << "// accessor to set the discriminant" << nl; - *os << "ACE_INLINE void" << nl; - *os << bu->name () << "::_d (" << bt->name () << - " discval)" << nl; - *os << "{\n"; - os->incr_indent (); - *os << "this->disc_ = discval;\n"; - os->decr_indent (); - *os << "}" << nl; - // the get method - *os << "// accessor to get the discriminant" << nl; - *os << "ACE_INLINE " << bt->name () << nl; - *os << bu->name () << "::_d (void) const" << nl; - *os << "{\n"; - os->incr_indent (); - *os << "return this->disc_;\n"; - os->decr_indent (); - *os << "}\n\n"; - } - break; - } // end of switch - return 0; -} - -be_state_union_public_ch::be_state_union_public_ch (void) -{ -} - -// generate code for union branch members in client header. This involves -// generating the set/get methods corresponding to the members -int -be_state_union_public_ch::gen_code (be_type *bt, be_decl *d, be_type *type) -{ - TAO_OutStream *os; // output stream - TAO_NL nl; // end line - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - be_union_branch *ub; // union branch member - be_union *bu; // enclosing union - - os = cg->client_header (); // get client header stream - ub = be_union_branch::narrow_from_decl (d); // downcast to union branch node - if (!ub) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_union_public_ch::" - "gen_code - " - "bad union member\n"), -1); - } - - bu = be_union::narrow_from_scope (ub->defined_in ()); - if (bu == NULL) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_union_public_ch::" - "gen_code - " - "bad union node\n"), -1); - } - - if (!type) // not a recursive call - type = bt; - else // recursively called thru a typedef. "type" will have the most primitive - // base class of the typedef - ACE_ASSERT (bt->node_type () == AST_Decl::NT_typedef); - - // codegen based on node type and the state we are in - switch (type->node_type ()) - { - case AST_Decl::NT_interface: // type is an obj reference - { - os->indent (); // start from current indentation - *os << "void " << ub->local_name () << " (" << bt->nested_type_name - (bu, "_ptr") << ");// set" << nl; - *os << bt->nested_type_name (bu, "_ptr") << " " << ub->local_name () << - " (void) const; // get method\n\n"; - } - break; - case AST_Decl::NT_pre_defined: // type is predefined type - { - be_predefined_type *bpd = be_predefined_type::narrow_from_decl (type); - if (!bpd) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_union_public_ch::" - "gen_code - " - "bad predefined type\n"), -1); - } - - if (bpd->pt () == AST_PredefinedType::PT_pseudo) - { - os->indent (); // start from current indentation - *os << "void " << ub->local_name () << " (" << bt->nested_type_name - (bu) << "_ptr);// set" << nl; - *os << bt->nested_type_name (bu) << "_ptr " << ub->local_name () << - " (void) const; // get method\n\n"; - } - else - { - os->indent (); // start from current indentation - *os << "void " << ub->local_name () << " (" << bt->nested_type_name - (bu) << ");// set" << nl; - *os << bt->nested_type_name (bu) << " " << ub->local_name () << - " (void) const; // get method\n\n"; - } - } - break; - case AST_Decl::NT_enum: // type is an enum - { - // XXXASG - TODO - what if we have a pseudo obj? - // if the type is an enum, we generate its defn first - if (bt->node_type () == AST_Decl::NT_enum) - if (bt->gen_client_header () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_union_public_ch::" - "gen_code - " - "bad union member\n"), -1); - } - - os->indent (); // start from current indentation - *os << "void " << ub->local_name () << " (" << bt->nested_type_name (bu) - << ");// set" << nl; - *os << bt->nested_type_name (bu) << " " << ub->local_name () << - " (void) const; // get method\n\n"; - } - break; - case AST_Decl::NT_string: // type is a string - { - os->indent (); // start from current indentation - if (bt->node_type () == AST_Decl::NT_typedef) - { - // three methods to set the string value - *os << "void " << ub->local_name () << " (" << bt->nested_type_name - (bu) << "); // set" << nl; - *os << "void " << ub->local_name () << " (const " << - bt->nested_type_name (bu) << "); // set" - << nl; - *os << "void " << ub->local_name () << - " (const " << bt->nested_type_name (bu, "_var") << " &); // set" << - nl; - *os << "const " << bt->nested_type_name (bu) << " " << - ub->local_name () << " (void) const; // get method\n\n"; - } - else - { - // three methods to set the string value - *os << "void " << ub->local_name () << " (char *); // set" << nl; - *os << "void " << ub->local_name () << " (const char *); // set" - << nl; - *os << "void " << ub->local_name () << - " (const CORBA::String_var&); // set" << nl; - *os << "const char *" << ub->local_name () << - " (void) const; // get method\n\n"; - } - } - break; - case AST_Decl::NT_array: // type is an array - { - // generate code for the array. So let the array handle code - // generation. Check if this is not a recursive call - if (bt->node_type () != AST_Decl::NT_typedef) - if (bt->gen_client_header () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_union_public_ch::" - "gen_code - " - "codegen for array failed\n"), -1); - } - - os->indent (); - *os << "void " << ub->local_name () << " (" << bt->nested_type_name - (bu) << ");// set" << nl; - *os << bt->nested_type_name (bu, "_slice") << " *" << ub->local_name () << - " (void) const; // get method\n\n"; - - } - break; - case AST_Decl::NT_sequence: // type is a sequence - case AST_Decl::NT_struct: // type is a struct - case AST_Decl::NT_union: // type is a union - { - // generate defn for this aggregate unless we are recursively called - if (bt->node_type () != AST_Decl::NT_typedef) - if (bt->gen_client_header () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_union_public_ch::" - "gen_code - " - "codegen for type failed\n"), -1); - } - - os->indent (); - *os << "void " << ub->local_name () << " (const " << - bt->nested_type_name (bu) << " &);// set" << nl; - *os << "const " << bt->nested_type_name (bu) << " &" << ub->local_name - () << " (void) const; // get method (read only)" << nl; - *os << bt->nested_type_name (bu) << " &" << ub->local_name () << - " (void); // get method (read/write only)\n\n"; - } - break; - case AST_Decl::NT_except: // type is an exception - { - // XXXASG: Is this case valid ??? - } - break; - case AST_Decl::NT_typedef: // type is a typedef - { - be_type *temp; // most primitive base type - be_typedef *t = be_typedef::narrow_from_decl (bt); - - if (!t) - return -1; - - temp = t->primitive_base_type (); - // make a recursive call - return this->gen_code (t, ub, temp); - } - } // end of switch - - // enclosing union is variable if the member is variable - bu->size_type (type->size_type ()); - - return 0; -} - -be_state_union_public_ci::be_state_union_public_ci (void) -{ -} - -// generate code for union branch members in client inline. This involves -// generating the set/get methods corresponding to the members -int -be_state_union_public_ci::gen_code (be_type *bt, be_decl *d, be_type *type) -{ - TAO_OutStream *os; // output stream - TAO_NL nl; // end line - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - be_union_branch *ub; // union branch member - be_union *bu; // enclosing union - - os = cg->client_inline (); // get client inline stream - ub = be_union_branch::narrow_from_decl (d); // downcast to union branch node - if (!ub) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_union_public_ci::" - "gen_code - " - "bad union member\n"), -1); - } - - bu = be_union::narrow_from_scope (ub->defined_in ()); - if (bu == NULL) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_union_public_ci::" - "gen_code - " - "bad union node\n"), -1); - } - - if (!type) // not a recursive call - type = bt; - else // recursively called thru a typedef. "type" will have the most primitive - // base class of the typedef - ACE_ASSERT (bt->node_type () == AST_Decl::NT_typedef); - - switch (type->node_type ()) - { - case AST_Decl::NT_pre_defined: // type is predefined type - case AST_Decl::NT_enum: // type is an enum - case AST_Decl::NT_array: // type is an array - case AST_Decl::NT_interface: // type is an obj reference - { - // for array, generate inline methods if any - // We first need to generate code for this aggregate type. Check - // if we are not called recursively thru a typedef - if (bt->node_type () == AST_Decl::NT_array - && !bt->imported ()) - if (bt->gen_client_inline () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_union_public_ci::" - "gen_code - " - "codegen for array failed\n"), -1); - } - - // set method - os->indent (); // start from current indentation - *os << "// accessor to set the member" << nl; - *os << "ACE_INLINE void" << nl; - *os << bu->name () << "::" << ub->local_name () << " (" << bt->name (); - if (type->node_type () == AST_Decl::NT_interface) - { - // if it is an interface node, we use _ptr as a suffix for the type - *os << "_ptr"; - } - *os << " val)// set" << nl; - *os << "{\n"; - os->incr_indent (); - // set the discriminant to the appropriate label - if (ub->label ()->label_kind () == AST_UnionLabel::UL_label) - { - // valid label - *os << "// set the discriminant val" << nl; - // check if the case label is a symbol or a literal - if (ub->label ()->label_val ()->ec () == AST_Expression::EC_symbol) - { - *os << "this->disc_ = " << ub->label ()->label_val ()->n () - << ";" << nl; - } - else - { - *os << "this->disc_ = " << ub->label ()->label_val () << ";" << - nl; - } - *os << "// set the value" << nl; - if (type->node_type () == AST_Decl::NT_interface) - { - // the private data member is a pointer type - *os << "*this->" << ub->local_name () << "_ = val;\n"; - } - else - { - *os << "this->" << ub->local_name () << "_ = val;\n"; - } - } - else - { - // default label - // XXXASG - TODO - } - os->decr_indent (); - *os << "}" << nl; - - // get method - *os << "// retrieve the member" << nl; - *os << "ACE_INLINE " << bt->name (); - if (type->node_type () == AST_Decl::NT_interface) - { - // for interface type, return a _ptr type - *os << "_ptr"; - } - else if (type->node_type () == AST_Decl::NT_array) - { - // for an array, return a _slice* type - *os << "_slice *"; - } - *os << nl; - *os << bu->name () << "::" << ub->local_name () << - " (void) const" << nl; - *os << "{\n"; - os->incr_indent (); - if (type->node_type () == AST_Decl::NT_interface) - { - *os << "return *this->" << ub->local_name () << "_;\n"; - } - else - { - *os << "return this->" << ub->local_name () << "_;\n"; - } - os->decr_indent (); - *os << "}\n\n"; - } - break; - case AST_Decl::NT_string: // type is a string - { - // three methods to set the string value - - // (1) set method from char* - os->indent (); // start from current indentation - *os << "// accessor to set the member" << nl; - *os << "ACE_INLINE void" << nl; - if (bt->node_type () == AST_Decl::NT_typedef) - { - *os << bu->name () << "::" << ub->local_name () << " (" << bt->name - () << " val)" << nl; - } - else - { - *os << bu->name () << "::" << ub->local_name () << " (char *val)" - << nl; - } - *os << "{\n"; - os->incr_indent (); - // set the discriminant to the appropriate label - if (ub->label ()->label_kind () == AST_UnionLabel::UL_label) - { - // valid label - *os << "// set the discriminant val" << nl; - // check if the case label is a symbol or a literal - if (ub->label ()->label_val ()->ec () == AST_Expression::EC_symbol) - { - *os << "this->disc_ = " << ub->label ()->label_val ()->n () - << ";" << nl; - } - else - { - *os << "this->disc_ = " << ub->label ()->label_val () << ";" << - nl; - } - *os << "// set the value" << nl; - *os << "if (!this->" << ub->local_name () << "_) // does not exist" - << nl ; - *os << "\tthis->" << ub->local_name () << - "_ = new CORBA::String_var (val);" << nl; - *os << "else" << nl; - *os << "\t*this->" << ub->local_name () << "_ = val;\n"; - } - else - { - // default label - // XXXASG - TODO - } - os->decr_indent (); - *os << "}" << nl; - - // (2) set method from const char * - *os << "// accessor to set the member" << nl; - *os << "ACE_INLINE void" << nl; - if (bt->node_type () == AST_Decl::NT_typedef) - { - *os << bu->name () << "::" << ub->local_name () << " (const " << - bt->name () << " val)" << nl; - } - else - { - *os << bu->name () << "::" << ub->local_name () << - " (const char *val)" << nl; - } - *os << "{\n"; - os->incr_indent (); - // set the discriminant to the appropriate label - if (ub->label ()->label_kind () == AST_UnionLabel::UL_label) - { - // valid label - *os << "// set the discriminant val" << nl; - // check if the case label is a symbol or a literal - if (ub->label ()->label_val ()->ec () == AST_Expression::EC_symbol) - { - *os << "this->disc_ = " << ub->label ()->label_val ()->n () - << ";" << nl; - } - else - { - *os << "this->disc_ = " << ub->label ()->label_val () << ";" << - nl; - } - *os << "// set the value" << nl; - *os << "if (!this->" << ub->local_name () << "_) // does not exist" - << nl ; - *os << "\tthis->" << ub->local_name () << - "_ = new CORBA::String_var (val);" << nl; - *os << "else" << nl; - *os << "\t*this->" << ub->local_name () << "_ = val;\n"; - } - else - { - // default label - // XXXASG - TODO - } - os->decr_indent (); - *os << "}" << nl; - - // (3) set from const String_var& - *os << "// accessor to set the member" << nl; - *os << "ACE_INLINE void" << nl; - if (bt->node_type () == AST_Decl::NT_typedef) - { - *os << bu->name () << "::" << ub->local_name () << " (const " << - bt->name () << "_var &val)" << nl; - } - else - { - *os << bu->name () << "::" << ub->local_name () << - " (const CORBA::String_var &val)" << nl; - } - *os << "{\n"; - os->incr_indent (); - // set the discriminant to the appropriate label - if (ub->label ()->label_kind () == AST_UnionLabel::UL_label) - { - // valid label - *os << "// set the discriminant val" << nl; - // check if the case label is a symbol or a literal - if (ub->label ()->label_val ()->ec () == AST_Expression::EC_symbol) - { - *os << "this->disc_ = " << ub->label ()->label_val ()->n () - << ";" << nl; - } - else - { - *os << "this->disc_ = " << ub->label ()->label_val () << ";" << - nl; - } - *os << "// set the value" << nl; - *os << "if (!this->" << ub->local_name () << "_) // does not exist" - << nl ; - *os << "\tthis->" << ub->local_name () << - "_ = new CORBA::String_var (val);" << nl; - *os << "else" << nl; - *os << "\t*this->" << ub->local_name () << "_ = val;\n"; - } - else - { - // default label - // XXXASG - TODO - } - os->decr_indent (); - *os << "}" << nl; - - if (bt->node_type () == AST_Decl::NT_typedef) - { - *os << "ACE_INLINE const " << bt->name () << nl; - } - else - { - *os << "ACE_INLINE const char *" << nl; - } - *os << bu->name () << "::" << ub->local_name () << - " (void) const // get method" << nl; - *os << "{\n"; - os->incr_indent (); - *os << "return *this->" << ub->local_name () << "_;\n"; - os->decr_indent (); - *os << "}\n\n"; - } - break; - case AST_Decl::NT_sequence: // type is a sequence - case AST_Decl::NT_union: // type is a union - { - // We first need to generate code for this aggregate type. Check - // if we are not called recursively thru a typedef - if (bt->node_type () != AST_Decl::NT_typedef - && !bt->imported ()) - if (bt->gen_client_inline () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_union_public_ci::" - "gen_code - " - "codegen for type failed\n"), -1); - } - - os->indent (); - // This case has to be handled differently from structs because the data - // member is a pointer - - // (1) set from a const - *os << "// accessor to set the member" << nl; - *os << "ACE_INLINE void" << nl; - *os << bu->name () << "::" << ub->local_name () << - " (const " << bt->name () << " &val)" << nl; - *os << "{\n"; - os->incr_indent (); - // set the discriminant to the appropriate label - if (ub->label ()->label_kind () == AST_UnionLabel::UL_label) - { - // valid label - *os << "// set the discriminant val" << nl; - // check if the case label is a symbol or a literal - if (ub->label ()->label_val ()->ec () == AST_Expression::EC_symbol) - { - *os << "this->disc_ = " << ub->label ()->label_val ()->n () - << ";" << nl; - } - else - { - *os << "this->disc_ = " << ub->label ()->label_val () << ";" << - nl; - } - *os << "// set the value" << nl; - *os << "*this->" << ub->local_name () << "_ = val;\n"; - } - else - { - // default label - // XXXASG - TODO - } - os->decr_indent (); - *os << "}" << nl; - - // readonly get method - *os << "// readonly get method " << nl; - *os << "ACE_INLINE const " << bt->name () << " &" << nl; - *os << bu->name () << "::" << ub->local_name () << " (void) const" << nl; - *os << "{\n"; - os->incr_indent (); - *os << "return *this->" << ub->local_name () << "_;\n"; - os->decr_indent (); - *os << "}" << nl; - - // read/write get method - *os << "// read/write get method " << nl; - *os << "ACE_INLINE " << bt->name () << " &" << nl; - *os << bu->name () << "::" << ub->local_name () << " (void)" << nl; - *os << "{\n"; - os->incr_indent (); - *os << "return *this->" << ub->local_name () << "_;\n"; - os->decr_indent (); - *os << "}" << nl; - - } - break; - case AST_Decl::NT_struct: // type is a struct - { - // We first need to generate code for this aggregate type. Check - // if we are not called recursively thru a typedef - if (bt->node_type () != AST_Decl::NT_typedef - && !bt->imported ()) - if (bt->gen_client_inline () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_union_public_ci::" - "gen_code - " - "codegen for struct failed\n"), -1); - } - - os->indent (); - - // (1) set from a const - *os << "// accessor to set the member" << nl; - *os << "ACE_INLINE void" << nl; - *os << bu->name () << "::" << ub->local_name () << - " (const " << bt->name () << " &val)" << nl; - *os << "{\n"; - os->incr_indent (); - // set the discriminant to the appropriate label - if (ub->label ()->label_kind () == AST_UnionLabel::UL_label) - { - // valid label - *os << "// set the discriminant val" << nl; - // check if the case label is a symbol or a literal - if (ub->label ()->label_val ()->ec () == AST_Expression::EC_symbol) - { - *os << "this->disc_ = " << ub->label ()->label_val ()->n () - << ";" << nl; - } - else - { - *os << "this->disc_ = " << ub->label ()->label_val () << ";" << - nl; - } - *os << "// set the value" << nl; - *os << "this->" << ub->local_name () << "_ = val;\n"; - } - else - { - // default label - // XXXASG - TODO - } - os->decr_indent (); - *os << "}" << nl; - - // readonly get method - *os << "// readonly get method " << nl; - *os << "ACE_INLINE const " << bt->name () << " &" << nl; - *os << bu->name () << "::" << ub->local_name () << " (void) const" << nl; - *os << "{\n"; - os->incr_indent (); - *os << "return this->" << ub->local_name () << "_;\n"; - os->decr_indent (); - *os << "}" << nl; - - // read/write get method - *os << "// read/write get method " << nl; - *os << "ACE_INLINE " << bt->name () << " &" << nl; - *os << bu->name () << "::" << ub->local_name () << " (void)" << nl; - *os << "{\n"; - os->incr_indent (); - *os << "return this->" << ub->local_name () << "_;\n"; - os->decr_indent (); - *os << "}" << nl; - - } - break; - case AST_Decl::NT_except: // type is an exception - { - // XXXASG: Is this case valid ??? - } - break; - case AST_Decl::NT_typedef: // type is a typedef - { - be_type *temp; // most primitive base type - be_typedef *t = be_typedef::narrow_from_decl (bt); - - if (!t) - return -1; - - temp = t->primitive_base_type (); - // make a recursive call - return this->gen_code (t, ub, temp); - } - } // end of switch - - return 0; -} - -be_state_union_public_cs::be_state_union_public_cs (void) -{ -} - -// generate code for union branch members in client header. This involves -// generating the set/get methods corresponding to the members -int -be_state_union_public_cs::gen_code (be_type *bt, be_decl *d, be_type *type) -{ - TAO_OutStream *os; // output stream - TAO_NL nl; // end line - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - be_union_branch *ub; // union branch member - be_union *bu; // enclosing union - - os = cg->client_stubs (); // get client stubs stream - ub = be_union_branch::narrow_from_decl (d); // downcast to union branch node - if (!ub) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_union_public_cs::" - "gen_code - " - "bad union member\n"), -1); - } - - bu = be_union::narrow_from_scope (ub->defined_in ()); - if (!bu) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_union_public_cs::" - "gen_code - " - "bad union member\n"), -1); - } - - if (!type) // not a recursive call - type = bt; - else // recursively called thru a typedef. "type" will have the most primitive - // base class of the typedef - ACE_ASSERT (bt->node_type () == AST_Decl::NT_typedef); - - switch (cg->state ()) - { - case TAO_CodeGen::TAO_UNION_PUBLIC_CS: - { - switch (type->node_type ()) - { - case AST_Decl::NT_interface: // type is an obj reference - case AST_Decl::NT_pre_defined: // type is predefined type - case AST_Decl::NT_string: // type is a string - { - // nothing - } - break; - case AST_Decl::NT_enum: // type is an enum - { - if (bt->node_type () == AST_Decl::NT_enum) - if (bt->gen_client_stubs () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_union_public_cs::" - "gen_code - " - "codegen for type failed\n"), -1); - } - } - break; - case AST_Decl::NT_array: // type is an array - { - // generate code for the array. So let the array handle code - // generation. Check if this is not a recursive call - if (bt->node_type () != AST_Decl::NT_typedef) - if (bt->gen_client_stubs () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_union_public_cs::" - "gen_code - " - "codegen for type failed\n"), -1); - } - - } - break; - case AST_Decl::NT_sequence: // type is a sequence - case AST_Decl::NT_struct: // type is a struct - case AST_Decl::NT_union: // type is a union - { - // generate defn for this aggregate unless we are recursively called - if (bt->node_type () != AST_Decl::NT_typedef) - if (bt->gen_client_stubs () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_union_public_cs::" - "gen_code - " - "codegen for type failed\n"), -1); - } - } - break; - case AST_Decl::NT_except: // type is an exception - { - // XXXASG: Is this case valid ??? - } - break; - case AST_Decl::NT_typedef: // type is a typedef - { - be_type *temp; // most primitive base type - be_typedef *t = be_typedef::narrow_from_decl (bt); - - if (!t) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_union_private_cs::" - "gen_code - " - "bad typedef\n"), -1); - } - - temp = t->primitive_base_type (); - // make a recursive call - return this->gen_code (t, ub, temp); - } - } // end of switch node type - } - break; - case TAO_CodeGen::TAO_UNION_PUBLIC_ASSIGN_CS: - { - // This state is used when we are generating the copy ctor and - // assignment operator for the union. - // Individual assignment of the members takes place inside a case - // statement because the type of member assigned is based on the value - // of the discriminant - os->indent (); - if (ub->label ()->label_val ()->ec () == AST_Expression::EC_symbol) - { - *os << "case " << ub->label ()->label_val ()->n () << ":\n"; - } - else - { - *os << "case " << ub->label ()->label_val () << ":\n"; - } - os->incr_indent (); - *os << "this->" << ub->local_name () << "_ = u." << ub->local_name () - << "_;" << nl; - *os << "break;\n"; - os->decr_indent (0); - } - break; - } - - return 0; -} - -be_state_union_private_ch::be_state_union_private_ch (void) -{ -} - -int -be_state_union_private_ch::gen_code (be_type *bt, be_decl *d, be_type *type) -{ - TAO_OutStream *os; // output stream - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - be_union_branch *ub; // union branch member - be_union *bu; // enclosing union - - os = cg->client_header (); // get client header stream - ub = be_union_branch::narrow_from_decl (d); // downcast to union branch node - if (!ub) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_union_private_ch::" - "gen_code - " - "bad union member\n"), -1); - } - - bu = be_union::narrow_from_scope (ub->defined_in ()); - if (!bu) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_union_private_ch::" - "gen_code - " - "bad union\n"), -1); - } - - if (!type) // not a recursive call - type = bt; - else // recursively called thru a typedef. "type" will have the most primitive - // base class of the typedef - ACE_ASSERT (bt->node_type () == AST_Decl::NT_typedef); - - // generate code based on type. For every case, first downcast to the - // appropriate type. If the downcast fails, return error, else proceed. In - // some cases, the type itself may need code generation, e.g., anonymous - // struct types. - switch (type->node_type ()) - { - case AST_Decl::NT_interface: // type is an obj reference - { - os->indent (); // start from current indentation - // C++ does not allow an object declaration inside a union. Hence we - // must have a pointer. This changes some of the methods - *os << bt->nested_type_name (bu, "_var") << " *" << ub->local_name () << - "_;\n"; - } - break; - case AST_Decl::NT_pre_defined: // type is predefined type - { - be_predefined_type *bpd = be_predefined_type::narrow_from_decl (type); - if (!bpd) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_state_union_private_ch::" - "gen_code - " - "bad predefined type\n"), -1); - } - - if (bpd->pt () == AST_PredefinedType::PT_pseudo) - { - os->indent (); // start from current indentation - *os << bt->nested_type_name (bu) << "_var " << ub->local_name () << - "_;\n"; - } - else - { - os->indent (); // start from current indentation - *os << bt->nested_type_name (bu) << " " << ub->local_name () << - "_;\n"; - } - } - break; - case AST_Decl::NT_enum: // type is an enum - { - os->indent (); // start from current indentation - *os << bt->nested_type_name (bu) << " " << ub->local_name () << - "_;\n"; - } - break; - case AST_Decl::NT_string: // type is a string - { - os->indent (); // start from current indentation - // C++ does not allow an object declaration inside a union. Hence we - // must have a pointer. This changes some of the methods - if (bt->node_type () == AST_Decl::NT_typedef) - { - *os << bt->nested_type_name (bu, "_var") << " *" << ub->local_name () << - "_;\n"; - } - else - { - *os << "CORBA::String_var *" << ub->local_name () << "_;\n"; - } - } - break; - case AST_Decl::NT_array: // type is an array - { - os->indent (); - *os << bt->nested_type_name (bu, "_slice") << " *" << ub->local_name () << - "_;\n"; - } - break; - case AST_Decl::NT_sequence: // type is a sequence - case AST_Decl::NT_union: // type is a union - { - os->indent (); - // C++ doesn't allow object instances inside unions, so we need a - // pointer - *os << bt->nested_type_name (bu) << " *" << ub->local_name () << "_;\n"; - } - break; - case AST_Decl::NT_struct: // type is a struct - { - os->indent (); - *os << bt->nested_type_name (bu) << " " << ub->local_name () << "_;\n"; - } - break; - case AST_Decl::NT_except: // type is an exception - { - // XXXASG: Is this case valid ??? - } - break; - case AST_Decl::NT_typedef: // type is a typedef - { - be_type *temp; // most primitive base type - be_typedef *t = be_typedef::narrow_from_decl (bt); - - if (!t) - return -1; - - temp = t->primitive_base_type (); - // make a recursive call - return this->gen_code (t, ub, temp); - } - } // end of switch - return 0; -} diff --git a/TAO/TAO_IDL/be/be_string.cpp b/TAO/TAO_IDL/be/be_string.cpp deleted file mode 100644 index 18917d3decf..00000000000 --- a/TAO/TAO_IDL/be/be_string.cpp +++ /dev/null @@ -1,162 +0,0 @@ -// ============================================================================ -// -// = LIBRARY -// TAO IDL -// -// = FILENAME -// be_string.cpp -// -// = DESCRIPTION -// Extension of class AST_Array that provides additional means for C++ -// mapping. -// -// = AUTHOR -// Copyright 1994-1995 by Sun Microsystems, Inc. -// and -// Aniruddha Gokhale -// -// ============================================================================ - -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -/* - * BE_String - */ -be_string::be_string (void) -{ - this->size_type (be_decl::VARIABLE); // always the case -} - -be_string::be_string (AST_Expression *v) - : AST_String (v), - AST_Decl (AST_Decl::NT_string, - new UTL_ScopedName(new Identifier("string", 1, 0, I_FALSE), - NULL), - NULL) -{ - this->size_type (be_decl::VARIABLE); // always the case -} - -be_string::be_string (AST_Expression *v, long wide) - : AST_String (v, wide), - AST_Decl (AST_Decl::NT_string, - wide == 1 - ? new UTL_ScopedName(new Identifier("string",1,0,I_FALSE), - NULL) - : new UTL_ScopedName(new Identifier("wstring_t", - 1, - 0, - I_FALSE), - NULL), - NULL) -{ - this->size_type (be_decl::VARIABLE); // always the case -} - -// overriden method -void -be_string::compute_tc_name (void) -{ - // start with the head as the CORBA namespace - this->tc_name_ = new UTL_ScopedName (new Identifier ("CORBA", 1, 0, I_FALSE), - NULL); - - this->tc_name_->nconc (new UTL_ScopedName (new Identifier ("_tc_string", 1, 0, - I_FALSE), NULL)); -} - -// Code generation - -int -be_string::gen_client_header (void) -{ - TAO_OutStream *ch; // output stream - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - ch = cg->client_header (); - ch->indent (); - *ch << "char *"; - - return 0; -} - -int -be_string::gen_client_stubs (void) -{ - return 0; -} - -int -be_string::gen_server_header (void) -{ - return 0; -} - -int -be_string::gen_server_skeletons (void) -{ - return 0; -} - -// Generates the client-side inline information -int -be_string::gen_client_inline (void) -{ - // nothing to be done - return 0; -} - -// Generates the server-side inline -int -be_string::gen_server_inline (void) -{ - // nothing to be done - return 0; -} - -int -be_string::gen_typecode (void) -{ - TAO_OutStream *cs; // output stream - TAO_NL nl; // end line - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - cs = cg->client_stubs (); - cs->indent (); // start from the current indentation level - // emit the enumeration - *cs << "CORBA::tk_string, " << nl; - *cs << this->max_size () << ", // string length\n"; - return 0; -} - -// compute typecode size -long -be_string::tc_size (void) -{ - // 4 bytes for enumeration, 4 bytes for storing string length - return 4 + 4; -} - -int -be_string::gen_encapsulation (void) -{ - return 0; -} - -long -be_string::tc_encap_len (void) -{ - if (this->encap_len_ == -1) - { - this->encap_len_ = 0; // no encapsulation - } - return this->encap_len_; -} - -// Narrowing -IMPL_NARROW_METHODS2 (be_string, AST_String, be_type) -IMPL_NARROW_FROM_DECL (be_string) diff --git a/TAO/TAO_IDL/be/be_structure.cpp b/TAO/TAO_IDL/be/be_structure.cpp deleted file mode 100644 index 6fc79b6d36a..00000000000 --- a/TAO/TAO_IDL/be/be_structure.cpp +++ /dev/null @@ -1,888 +0,0 @@ -// ============================================================================ -// -// = LIBRARY -// TAO IDL -// -// = FILENAME -// be_structure.cpp -// -// = DESCRIPTION -// Extension of class AST_Structure that provides additional means for C++ -// mapping. -// -// = AUTHOR -// Copyright 1994-1995 by Sun Microsystems, Inc. -// and -// Aniruddha Gokhale -// -// ============================================================================ - -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -/* - * BE_Structure - */ -be_structure::be_structure (void) -{ -} - -be_structure::be_structure (UTL_ScopedName *n, UTL_StrList *p) - : AST_Decl (AST_Decl::NT_struct, n, p), - UTL_Scope (AST_Decl::NT_struct), - member_count_ (-1) -{ -} - -// compute total number of members -int -be_structure::compute_member_count (void) -{ - UTL_ScopeActiveIterator *si; // iterator - AST_Decl *d; // temp node - - this->member_count_ = 0; - - // if there are elements in this scope - if (this->nmembers () > 0) - { - // instantiate a scope iterator. - si = new UTL_ScopeActiveIterator (this, UTL_Scope::IK_decls); - - while (!(si->is_done ())) - { - // get the next AST decl node - d = si->item (); - this->member_count_++; - si->next (); - } // end of while - delete si; // free the iterator object - } - return 0; -} - -// return the member count -int -be_structure::member_count (void) -{ - if (this->member_count_ == -1) - this->compute_member_count (); - - return this->member_count_; -} - -// ---------------------------------------- -// CODE GENERATION METHODS -// ---------------------------------------- - -// Generates the client-side header information for the structure -int -be_structure::gen_client_header (void) -{ - TAO_OutStream *ch; // output stream - TAO_NL nl; // end line - - - if (!this->cli_hdr_gen_) // not already generated - { - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - cg->push (TAO_CodeGen::TAO_STRUCT_CH); // set current code gen state - - ch = cg->client_header (); - - ch->indent (); // start from whatever indentation level we were at - *ch << "struct " << local_name () << nl; - *ch << "{\n"; - ch->incr_indent (0); - - // generate code for field members - if (be_scope::gen_client_header () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_structure::gen_client_header -" - "codegen for scope failed\n"), -1); - } - - ch->decr_indent (); - *ch << "};\n\n"; - - // generate var defn - this->gen_var_defn (); - - // a class is generated for an out defn only for a variable length struct - if (this->size_type () == be_decl::VARIABLE) - { - this->gen_out_defn (); - } - else - { - ch->indent (); - *ch << "typedef " << this->local_name () << " &" << this->local_name - () << "_out;\n\n"; - } - - // generate the typecode decl - if (this->is_nested ()) - { - // we have a scoped name - ch->indent (); - *ch << "static CORBA::TypeCode_ptr " << this->tc_name - ()->last_component () << ";\n\n"; - } - else - { - // we are in the ROOT scope - ch->indent (); - *ch << "extern CORBA::TypeCode_ptr " << this->tc_name - ()->last_component () << ";\n\n"; - } - this->cli_hdr_gen_ = I_TRUE; - cg->pop (); // pop up the current state - } - return 0; -} - -// Generates the client-side stubs for the structure -int -be_structure::gen_client_stubs (void) -{ - TAO_OutStream *cs; // output stream - TAO_NL nl; // end line - - - if (!this->cli_stub_gen_) - { - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - cg->push (TAO_CodeGen::TAO_STRUCT_CS); // set current code gen state - - cs = cg->client_stubs (); - // pass info - cg->node (this); - - // generate the typecode information here - cs->indent (); // start from current indentation level - *cs << "static const CORBA::Long _oc_" << this->flatname () << "[] =" << - nl; - *cs << "{\n"; - cs->incr_indent (0); - // note that we just need the parameters here and hence we generate the - // encapsulation for the parameters - if (this->gen_encapsulation () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_structure::gen_client_stubs -" - "codegen for scope failed\n"), -1); - } - cs->decr_indent (); - *cs << "};" << nl; - - *cs << "static CORBA::TypeCode _tc__tc_" << this->flatname () << - " (CORBA::tk_struct, sizeof (_oc_" << this->flatname () << - "), (unsigned char *) &_oc_" << this->flatname () << - ", CORBA::B_FALSE);" << nl; - *cs << "CORBA::TypeCode_ptr " << this->tc_name () << " = &_tc__tc_" << - this->flatname () << ";\n\n"; - this->cli_stub_gen_ = I_TRUE; - cg->pop (); - } - - return 0; -} - -// Generates the client-side inline information -int -be_structure::gen_client_inline (void) -{ - if (!this->cli_inline_gen_) - { - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - cg->push (TAO_CodeGen::TAO_STRUCT_CI); // set current code gen state - - if (this->gen_var_impl () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_structure::gen_client_inline -" - "_var codegen failed\n"), -1); - } - if (this->size_type () == be_decl::VARIABLE && this->gen_out_impl () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_structure::gen_client_inline -" - "_out codegen failed\n"), -1); - } - if (be_scope::gen_client_inline () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_structure::gen_client_inline -" - "codegen for scope failed\n"), -1); - } - this->cli_inline_gen_ = I_TRUE; - cg->pop (); - } - return 0; -} - -// Generates the server-side header information for the structure -int -be_structure::gen_server_header (void) -{ - // nothing to be done - return 0; -} - -// Generates the server-side skeletons for the structure -int -be_structure::gen_server_skeletons (void) -{ - // nothing to be done - return 0; -} - -// Generates the server-side inline -int -be_structure::gen_server_inline (void) -{ - // nothing to be done - return 0; -} - -// generate the _var definition for ourself -int -be_structure::gen_var_defn (void) -{ - TAO_OutStream *ch; // output stream - TAO_NL nl; // end line - char namebuf [NAMEBUFSIZE]; // names - - ACE_OS::memset (namebuf, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (namebuf, "%s_var", this->local_name ()->get_string ()); - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - ch = cg->client_header (); - - // generate the var definition (always in the client header). - // Depending upon the data type, there are some differences which we account - // for over here. - - ch->indent (); // start with whatever was our current indent level - *ch << "class " << namebuf << nl; - *ch << "{" << nl; - *ch << "public:\n"; - ch->incr_indent (); - // default constr - *ch << namebuf << " (void); // default constructor" << nl; - // constr - *ch << namebuf << " (" << local_name () << " *);" << nl; - // copy constructor - *ch << namebuf << " (const " << namebuf << - " &); // copy constructor" << nl; - // destructor - *ch << "~" << namebuf << " (void); // destructor" << nl; - *ch << nl; - // assignment operator from a pointer - *ch << namebuf << " &operator= (" << local_name () << " *);" << nl; - // assignment from _var - *ch << namebuf << " &operator= (const " << namebuf << " &);" << nl; - - // arrow operator - *ch << local_name () << " *operator-> (void);" << nl; - *ch << "const " << local_name () << " *operator-> (void) const;" << nl; - *ch << nl; - - // other extra types (cast operators, [] operator, and others) - *ch << "operator const " << local_name () << " &() const;" << nl; - *ch << "operator " << local_name () << " &();" << nl; - *ch << "operator " << local_name () << " &() const;" << nl; - *ch << "// in, inout, out, _retn " << nl; - // the return types of in, out, inout, and _retn are based on the parameter - // passing rules and the base type - if (this->size_type () == be_decl::FIXED) - { - *ch << "const " << local_name () << " &in (void) const;" << nl; - *ch << local_name () << " &inout (void);" << nl; - *ch << local_name () << " &out (void);" << nl; - *ch << local_name () << " _retn (void);" << nl; - } - else - { - *ch << "const " << local_name () << " &in (void) const;" << nl; - *ch << local_name () << " &inout (void);" << nl; - *ch << local_name () << " *&out (void);" << nl; - *ch << local_name () << " *_retn (void);" << nl; - } - - // generate an additional member function that returns the underlying pointer - *ch << local_name () << " *ptr(void) const;\n"; - - *ch << "\n"; - ch->decr_indent (); - - // generate the private section - *ch << "private:\n"; - ch->incr_indent (); - *ch << local_name () << " *ptr_;\n"; - ch->decr_indent (); - *ch << "};\n\n"; - - return 0; -} - -// implementation of the _var class. All of these get generated in the inline -// file -int -be_structure::gen_var_impl (void) -{ - TAO_OutStream *ci; // output stream - TAO_NL nl; // end line - char fname [NAMEBUFSIZE]; // to hold the full and - char lname [NAMEBUFSIZE]; // local _var names - - ACE_OS::memset (fname, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (fname, "%s_var", this->fullname ()); - - ACE_OS::memset (lname, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (lname, "%s_var", local_name ()->get_string ()); - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - ci = cg->client_inline (); - - ci->indent (); // start with whatever was our current indent level - - *ci << "// *************************************************************" - << nl; - *ci << "// Inline operations for class " << fname << nl; - *ci << "// *************************************************************\n\n"; - - // default constr - *ci << "ACE_INLINE" << nl; - *ci << fname << "::" << lname << - " (void) // default constructor" << nl; - *ci << "\t" << ": ptr_ (0)" << nl; - *ci << "{}\n\n"; - - // constr from a pointer - ci->indent (); - *ci << "ACE_INLINE" << nl; - *ci << fname << "::" << lname << " (" << name () << " *p)" << nl; - *ci << "\t: ptr_ (p)" << nl; - *ci << "{}\n\n"; - - // copy constructor - ci->indent (); - *ci << "ACE_INLINE" << nl; - *ci << fname << "::" << lname << " (const " << fname << - " &p) // copy constructor" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "if (p.ptr_)" << nl; - *ci << "\tthis->ptr_ = new " << this->name () << "(*p.ptr_);" << nl; - *ci << "else" << nl; - *ci << "\tthis->ptr_ = 0;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // destructor - ci->indent (); - *ci << "ACE_INLINE" << nl; - *ci << fname << "::~" << lname << " (void) // destructor" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "delete this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // assignment operator from a pointer - ci->indent (); - *ci << "ACE_INLINE " << fname << " &" << nl; - *ci << fname << "::operator= (" << name () << - " *p)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "delete this->ptr_;" << nl; - *ci << "this->ptr_ = p;" << nl; - *ci << "return *this;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // assignment operator from _var - ci->indent (); - *ci << "ACE_INLINE " << fname << " &" << nl; - *ci << fname << "::operator= (const " << fname << - " &p)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "if (this != &p)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "delete this->ptr_;" << nl; - *ci << "this->ptr_ = new " << this->name () << " (*p.ptr_);\n"; - ci->decr_indent (); - *ci << "}" << nl; - *ci << "return *this;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // two arrow operators - ci->indent (); - *ci << "ACE_INLINE const " << this->name () << " *" << nl; - *ci << fname << "::operator-> (void) const" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - ci->indent (); - *ci << "ACE_INLINE " << this->name () << " *" << nl; - *ci << fname << "::operator-> (void)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // other extra methods - 3 cast operator () - ci->indent (); - *ci << "ACE_INLINE " << nl; - *ci << fname << "::operator const " << name () << - " &() const // cast" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return *this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - ci->indent (); - *ci << "ACE_INLINE " << nl; - *ci << fname << "::operator " << name () << " &() // cast " << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return *this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - ci->indent (); - *ci << "ACE_INLINE " << nl; - *ci << fname << "::operator " << name () << " &() const// cast " << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return *this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // in, inout, out, and _retn - ci->indent (); - *ci << "ACE_INLINE const " << name () << " &" << nl; - *ci << fname << "::in (void) const" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return *this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - ci->indent (); - *ci << "ACE_INLINE " << name () << " &" << nl; - *ci << fname << "::inout (void)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return *this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // the out is handled differently based on our size type - ci->indent (); - if (this->size_type () == be_decl::VARIABLE) - { - *ci << "// mapping for variable size " << nl; - *ci << "ACE_INLINE " << name () << " *&" << nl; - *ci << fname << "::out (void)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "delete this->ptr_;" << nl; - *ci << "this->ptr_ = 0;" << nl; - *ci << "return this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - ci->indent (); - *ci << "ACE_INLINE " << name () << " *" << nl; - *ci << fname << "::_retn (void)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << this->name () << " *tmp = this->ptr_;" << nl; - *ci << "this->ptr_ = 0;" << nl; - *ci << "return tmp;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - } - else - { - *ci << "// mapping for fixed size " << nl; - *ci << "ACE_INLINE " << name () << " &" << nl; - *ci << fname << "::out (void)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return *this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - ci->indent (); - *ci << "ACE_INLINE " << name () << nl; - *ci << fname << "::_retn (void)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return *this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // the additional ptr () member function - ci->indent (); - *ci << "ACE_INLINE " << name () << " *" << nl; - *ci << fname << "::ptr (void) const" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - } - - return 0; -} - -// generate the _out definition -int -be_structure::gen_out_defn (void) -{ - TAO_OutStream *ch; // output stream - TAO_NL nl; // end line - char namebuf [NAMEBUFSIZE]; // to hold the _out name - - ACE_OS::memset (namebuf, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (namebuf, "%s_out", local_name ()->get_string ()); - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - ch = cg->client_header (); - - // generate the out definition (always in the client header) - ch->indent (); // start with whatever was our current indent level - - *ch << "class " << namebuf << nl; - *ch << "{" << nl; - *ch << "public:\n"; - ch->incr_indent (); - - // No default constructor - - // constructor from a pointer - *ch << namebuf << " (" << local_name () << " *&);" << nl; - // constructor from a _var & - *ch << namebuf << " (" << local_name () << "_var &);" << nl; - // constructor from a _out & - *ch << namebuf << " (" << namebuf << " &);" << nl; - // assignment operator from a _out & - *ch << namebuf << " &operator= (" << namebuf << " &);" << nl; - // assignment operator from a pointer &, cast operator, ptr fn, operator - // -> and any other extra operators - // assignment - *ch << namebuf << " &operator= (" << local_name () << " *);" << nl; - // operator () - *ch << "operator " << local_name () << " *&();" << nl; - // ptr fn - *ch << local_name () << " *&ptr (void);" << nl; - // operator -> - *ch << local_name () << " *operator-> (void);" << nl; - - *ch << "\n"; - ch->decr_indent (); - *ch << "private:\n"; - ch->incr_indent (); - *ch << local_name () << " *&ptr_;" << nl; - *ch << "// assignment from T_var not allowed" << nl; - *ch << "void operator= (const " << local_name () << "_var &);\n"; - - ch->decr_indent (); - *ch << "};\n\n"; - return 0; -} - -int -be_structure::gen_out_impl (void) -{ - TAO_OutStream *ci; // output stream - TAO_NL nl; // end line - char fname [NAMEBUFSIZE]; // to hold the full and - char lname [NAMEBUFSIZE]; // local _out names - - ACE_OS::memset (fname, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (fname, "%s_out", this->fullname ()); - - ACE_OS::memset (lname, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (lname, "%s_out", local_name ()->get_string ()); - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - ci = cg->client_inline (); - - // generate the var implementation in the inline file - - ci->indent (); // start with whatever was our current indent level - - *ci << "// *************************************************************" - << nl; - *ci << "// Inline operations for class " << fname << nl; - *ci << "// *************************************************************\n\n"; - - // constr from a pointer - ci->indent (); - *ci << "ACE_INLINE" << nl; - *ci << fname << "::" << lname << " (" << name () << " *&p)" << nl; - *ci << "\t: ptr_ (p)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "this->ptr_ = 0;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // constructor from _var & - ci->indent (); - *ci << "ACE_INLINE" << nl; - *ci << fname << "::" << lname << " (" << this->name () << - "_var &p) // constructor from _var" << nl; - *ci << "\t: ptr_ (p.out ())" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "delete this->ptr_;" << nl; - *ci << "this->ptr_ = 0;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // copy constructor - ci->indent (); - *ci << "ACE_INLINE" << nl; - *ci << fname << "::" << lname << " (" << fname << - " &p) // copy constructor" << nl; - *ci << "\t: ptr_ (p.ptr_)" << nl; - *ci << "{}\n\n"; - - // assignment operator from _out & - ci->indent (); - *ci << "ACE_INLINE " << fname << " &" << nl; - *ci << fname << "::operator= (" << fname << - " &p)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "this->ptr_ = p.ptr_;" << nl; - *ci << "return *this;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // assignment from _var is not allowed by a private declaration - - // assignment operator from pointer - ci->indent (); - *ci << "ACE_INLINE " << fname << " &" << nl; - *ci << fname << "::operator= (" << this->name () << - " *p)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "this->ptr_ = p;" << nl; - *ci << "return *this;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // other extra methods - cast operator () - ci->indent (); - *ci << "ACE_INLINE " << nl; - *ci << fname << "::operator " << this->name () << - " *&() // cast" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // ptr function - ci->indent (); - *ci << "ACE_INLINE " << this->name () << " *&" << nl; - *ci << fname << "::ptr (void) // ptr" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // operator -> - ci->indent (); - *ci << "ACE_INLINE " << this->name () << " *" << nl; - *ci << fname << "::operator-> (void)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - - return 0; -} - -// generate typecode. -// Typecode for structures comprises the enumerated value followed by the -// encapsulation of the parameters - -int -be_structure::gen_typecode (void) -{ - TAO_OutStream *cs; // output stream - TAO_NL nl; // end line - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - cs = cg->client_stubs (); - cs->indent (); // start from whatever indentation level we were at - - *cs << "CORBA::tk_struct, // typecode kind" << nl; - *cs << this->tc_encap_len () << ", // encapsulation length\n"; - // now emit the encapsulation - cs->incr_indent (0); - if (this->gen_encapsulation () == -1) - { - return -1; - } - cs->decr_indent (); - return 0; -} - -// generate encapsulation -// An encapsulation for ourselves will be necessary when we are part of some -// other IDL type and a typecode for that other type is being generated. This -// will comprise our typecode kind. IDL types with parameters will additionally -// have the encapsulation length and the entire typecode description -int -be_structure::gen_encapsulation (void) -{ - TAO_OutStream *cs; // output stream - TAO_NL nl; // end line - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - long i, arrlen; - long *arr; // an array holding string names converted to array of longs - - cs = cg->client_stubs (); - cs->indent (); // start from whatever indentation level we were at - - *cs << "TAO_ENCAP_BYTE_ORDER, // byte order" << nl; - // generate repoID - *cs << (ACE_OS::strlen (this->repoID ())+1) << ", "; - (void)this->tc_name2long (this->repoID (), arr, arrlen); - for (i=0; i < arrlen; i++) - { - cs->print ("0x%x, ", arr[i]); - } - *cs << " // repository ID = " << this->repoID () << nl; - // generate name - *cs << (ACE_OS::strlen (this->local_name ()->get_string ())+1) << ", "; - (void)this->tc_name2long(this->local_name ()->get_string (), arr, arrlen); - for (i=0; i < arrlen; i++) - { - cs->print ("0x%x, ", arr[i]); - } - *cs << " // name = " << this->local_name () << nl; - // generate the member count - *cs << this->member_count () << ", // member count\n"; - cs->incr_indent (0); - // hand over to the scope to generate the typecode for elements - if (be_scope::gen_encapsulation () == -1) - { - ACE_ERROR ((LM_ERROR, "be_structure: cannot generate typecode for members\n")); - return -1; - } - cs->decr_indent (0); - return 0; -} - -// compute typecode size -long -be_structure::tc_size (void) -{ - // 4 bytes for enumeration, 4 bytes for storing encap length val, followed by the - // actual encapsulation length - return 4 + 4 + this->tc_encap_len (); -} - -// compute encapsulation length -long -be_structure::tc_encap_len (void) -{ - if (this->encap_len_ == -1) // not computed yet - { - this->encap_len_ = 4; // holds the byte order flag - - this->encap_len_ += this->repoID_encap_len (); // repoID - - // do the same thing for the local name - this->encap_len_ += this->name_encap_len (); - - this->encap_len_ += 4; // to hold the member count - - // compute encap length for members - this->encap_len_ += be_scope::tc_encap_len (); - } - return this->encap_len_; -} - -// compute the size type of the node in question -int -be_structure::compute_size_type (void) -{ - UTL_ScopeActiveIterator *si; - AST_Decl *d; - be_decl *bd; - - if (this->nmembers () > 0) - { - // if there are elements in this scope - - si = new UTL_ScopeActiveIterator (this, UTL_Scope::IK_decls); - // instantiate a scope iterator. - - while (!(si->is_done ())) - { - // get the next AST decl node - d = si->item (); - bd = be_decl::narrow_from_decl (d); - if (bd != 0) - { - // our sizetype depends on the sizetype of our members. Although - // previous value of sizetype may get overwritten, we are - // guaranteed by the "size_type" call that once the value reached - // be_decl::VARIABLE, nothing else can overwrite it. - this->size_type (bd->size_type ()); - } - else - { - ACE_DEBUG ((LM_DEBUG, - "WARNING (%N:%l) be_structure::compute_size_type - " - "narrow_from_decl returned 0\n")); - } - si->next (); - } // end of while - delete si; // free the iterator object - } - return 0; -} - -// Narrowing -IMPL_NARROW_METHODS3 (be_structure, AST_Structure, be_scope, be_type) -IMPL_NARROW_FROM_DECL (be_structure) -IMPL_NARROW_FROM_SCOPE (be_structure) diff --git a/TAO/TAO_IDL/be/be_sunsoft.cpp b/TAO/TAO_IDL/be/be_sunsoft.cpp deleted file mode 100644 index f6bbac39a76..00000000000 --- a/TAO/TAO_IDL/be/be_sunsoft.cpp +++ /dev/null @@ -1,108 +0,0 @@ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" -#include "be_sunsoft.h" - -TAO_SunSoft_OutStream::TAO_SunSoft_OutStream (void) - : TAO_OutStream () -{ -} - -TAO_SunSoft_OutStream::~TAO_SunSoft_OutStream (void) -{ -} - -TAO_OutStream & -TAO_SunSoft_OutStream::print (Identifier *id) -{ - ACE_OS::fprintf (this->fp_, id->get_string ()); - return *this; -} - -TAO_OutStream & -TAO_SunSoft_OutStream::print (UTL_IdList *idl) -{ - UTL_IdListActiveIterator *i = new UTL_IdListActiveIterator (idl); - long first = I_TRUE; - long second = I_FALSE; - - while (!(i->is_done ())) - { - if (!first) - *this << "::"; - else if (second) - first = second = I_FALSE; - // print the identifier - *this << i->item (); - if (first) - { - if (ACE_OS::strcmp (i->item ()->get_string (), "") != 0) - // does not start with a "" - first = I_FALSE; - else - second = I_TRUE; - } - i->next (); - } - return *this; -} - -TAO_OutStream& -TAO_SunSoft_OutStream::print (AST_Expression *expr) -{ - AST_Expression::AST_ExprValue *ev = expr->ev (); - - if (ev) - { - switch (ev->et) - { - case AST_Expression::EV_short: - this->TAO_OutStream::print ("%hd", ev->u.sval); - break; - case AST_Expression::EV_ushort: - this->TAO_OutStream::print ("%hu", ev->u.usval); - break; - case AST_Expression::EV_long: - this->TAO_OutStream::print ("%ld", ev->u.lval); - break; - case AST_Expression::EV_ulong: - this->TAO_OutStream::print ("%ld", ev->u.ulval); - break; - case AST_Expression::EV_longlong: - break; - case AST_Expression::EV_ulonglong: - break; - case AST_Expression::EV_float: - this->TAO_OutStream::print ("%f", ev->u.fval); - break; - case AST_Expression::EV_double: - this->TAO_OutStream::print ("%f", ev->u.dval); - break; - case AST_Expression::EV_longdouble: - break; - case AST_Expression::EV_char: - this->TAO_OutStream::print ("'%c'", ev->u.cval); - break; - case AST_Expression::EV_wchar: - break; - case AST_Expression::EV_octet: - this->TAO_OutStream::print ("%c", ev->u.oval); - break; - case AST_Expression::EV_bool: - this->TAO_OutStream::print ("%ld", ev->u.bval); - break; - case AST_Expression::EV_string: - this->TAO_OutStream::print ("\"%s\"", ev->u.strval->get_string ()); - break; - case AST_Expression::EV_wstring: - break; - default: - break; - } - } - else // - { - // XXXASG: need to add code here - } - return *this; -} diff --git a/TAO/TAO_IDL/be/be_type.cpp b/TAO/TAO_IDL/be/be_type.cpp deleted file mode 100644 index e498ac52bc1..00000000000 --- a/TAO/TAO_IDL/be/be_type.cpp +++ /dev/null @@ -1,250 +0,0 @@ -// ============================================================================ -// -// = LIBRARY -// TAO IDL -// -// = FILENAME -// be_type.cpp -// -// = DESCRIPTION -// Extension of class AST_Type that provides additional means for C++ -// mapping. -// -// = AUTHOR -// Copyright 1994-1995 by Sun Microsystems, Inc. -// and -// Aniruddha Gokhale -// -// ============================================================================ - -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -/* - * BE_Type - */ - -be_type::be_type (void) - : tc_name_ (0), - type_name_ (0) -{ -} - -be_type::be_type (AST_Decl::NodeType nt, UTL_ScopedName *n, UTL_StrList *p) - : AST_Decl (nt, n, p), - tc_name_ (0), - type_name_ (0) -{ -} - -// compute the typecode name. The idea is to use the fully scoped name, -// however, prepend a _tc_ to the last component. A slightly different approach -// is required of the predefined types. Hence this method is overridden for -// predefined types. - -void -be_type::compute_tc_name (void) -{ - static char namebuf [200]; - UTL_ScopedName *n; - - this->tc_name_ = NULL; - ACE_OS::memset (namebuf, '\0', 200); - n = this->name (); - while (n->tail () != NULL) - { - if (!this->tc_name_) - { - // does not exist - this->tc_name_ = new UTL_ScopedName (n->head (), NULL); - } - else - { - this->tc_name_->nconc (new UTL_ScopedName (n->head (), NULL)); - } - n = (UTL_ScopedName *)n->tail (); - } - ACE_OS::sprintf (namebuf, "_tc_%s", n->last_component ()->get_string ()); - if (!this->tc_name_) - { - // does not exist - this->tc_name_ = new UTL_ScopedName (new Identifier (ACE_OS::strdup - (namebuf), 1, 0, I_FALSE), NULL); - } - else - { - this->tc_name_->nconc (new UTL_ScopedName (new Identifier (ACE_OS::strdup - (namebuf), 1, - 0, I_FALSE), NULL)); - } - return; -} - -// retrieve typecode name -UTL_ScopedName * -be_type::tc_name (void) -{ - if (!this->tc_name_) - compute_tc_name (); - - return this->tc_name_; -} - -// return the type name using the ACE_NESTED_CLASS macro -char * -be_type::nested_type_name (be_decl *use_scope, char *suffix) -{ - // some compilers do not like generating a fully scoped name for a type that - // was defined in the same enclosing scope in which it was defined. For such, - // we emit a macro defined in the ACE library. - // - - // The tricky part here is that it is not enough to check if the - // typename we are using was defined in the current scope. But we - // need to ensure that it was not defined in any of our ancestor - // scopes as well. If that is the case, then we can generate a fully - // scoped name for that type, else we use the ACE_NESTED_CLASS macro - - // thus we need some sort of relative name to be generated - - static char macro [NAMEBUFSIZE]; - be_decl *def_scope = 0; // our defining scope - char // hold the fully scoped name - def_name [NAMEBUFSIZE], - use_name [NAMEBUFSIZE]; - char // these point to the curr and next component in the scope - *def_curr = def_name, - *def_next, - *use_curr = use_name, - *use_next; - - ACE_OS::memset (macro, '\0', NAMEBUFSIZE); - ACE_OS::memset (def_name, '\0', NAMEBUFSIZE); - ACE_OS::memset (use_name, '\0', NAMEBUFSIZE); - - // traverse every component of the def_scope and use_scope beginning at the - // root and proceeding towards the leaf trying to see if the components - // match. Continue until there is a match and keep accumulating the path - // traversed. This forms the first argument to the ACE_NESTED_CLASS - // macro. Whenever there is no match, the remaining components of the - // def_scope form the second argument - - def_scope = ((this->defined_in ())? - (be_scope::narrow_from_scope (this->defined_in ())->decl ()): - 0); - - if (def_scope && def_scope->node_type () != AST_Decl::NT_root && use_scope) - // if both scopes exist and that we are not in the root scope - { - ACE_OS::strcpy (def_name, def_scope->fullname ()); - ACE_OS::strcpy (use_name, use_scope->fullname ()); - - // find the first occurrence of a :: and advance the next pointers accordingly - def_next = ACE_OS::strstr (def_curr, "::"); - use_next = ACE_OS::strstr (use_curr, "::"); - - if (def_next) - *def_next = 0; - - if (use_next) - *use_next = 0; - - if (!ACE_OS::strcmp (def_curr, use_curr)) - { - // initial prefix matches i.e., they have a common root - // start by initializing the macro - - ACE_OS::sprintf (macro, "ACE_NESTED_CLASS ("); - ACE_OS::strcat (macro, def_curr); // initialize the first argument - - def_curr = (def_next ? (def_next+2) : 0); // skip the :: - use_curr = (use_next ? (use_next+2) : 0); // skip the :: - - while (def_curr && use_curr) - { - // find the first occurrence of a :: and advance the next pointers accordingly - def_next = ACE_OS::strstr (def_curr, "::"); - use_next = ACE_OS::strstr (use_curr, "::"); - - if (def_next) - *def_next = 0; - - if (use_next) - *use_next = 0; - - if (!ACE_OS::strcmp (def_curr, use_curr)) - { - // they have same prefix, append to arg1 - ACE_OS::strcat (macro, "::"); - ACE_OS::strcat (macro, def_curr); - def_curr = (def_next ? (def_next+2) : 0); // skip the :: - use_curr = (use_next ? (use_next+2) : 0); // skip the :: - } - else - { - // no match. This is the end of the first argument. Get out - // of the loop as no more comparisons are necessary - break; - } - } - - // start the 2nd argument of the macro - ACE_OS::strcat (macro, ", "); - - // copy the remaining def_name (if any left) - if (def_curr) - ACE_OS::strcat (macro, def_curr); - - // append our local name - ACE_OS::strcat (macro, this->local_name ()->get_string ()); - if (suffix) - ACE_OS::strcat (macro, suffix); - ACE_OS::strcat (macro, ")"); - return macro; - } // end of if the root prefixes match - } - - // otherwise just emit our fullname - ACE_OS::sprintf (macro, this->fullname ()); - if (suffix) - ACE_OS::strcat (macro, suffix); - - return macro; -} - -// ***************************** -// CODE GENERATION -// ***************************** - -// generate the _var definition for ourself -int -be_type::gen_var_defn (void) -{ - return 0; -} - -// implementation of the _var class. All of these get generated in the inline -// file -int -be_type::gen_var_impl (void) -{ - return 0; -} - -// generate the _out definition -int -be_type::gen_out_defn (void) -{ - return 0; -} - -int -be_type::gen_out_impl (void) -{ - return 0; -} - -// Narrowing -IMPL_NARROW_METHODS2 (be_type, AST_Type, be_decl) -IMPL_NARROW_FROM_DECL (be_type) diff --git a/TAO/TAO_IDL/be/be_typedef.cpp b/TAO/TAO_IDL/be/be_typedef.cpp deleted file mode 100644 index 43640de7ce3..00000000000 --- a/TAO/TAO_IDL/be/be_typedef.cpp +++ /dev/null @@ -1,323 +0,0 @@ -// ============================================================================ -// -// = LIBRARY -// TAO IDL -// -// = FILENAME -// be_typedef.cpp -// -// = DESCRIPTION -// Extension of class AST_Typedef that provides additional means for C++ -// mapping. -// -// = AUTHOR -// Copyright 1994-1995 by Sun Microsystems, Inc. -// and -// Aniruddha Gokhale -// -// ============================================================================ - -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -be_typedef::be_typedef (void) -{ -} - -be_typedef::be_typedef (AST_Type *bt, UTL_ScopedName *n, UTL_StrList *p) - : AST_Typedef (bt, n, p), - AST_Decl (AST_Decl::NT_typedef, n, p) -{ -} - -// given a typedef node, traverse the chain of base types until they are no -// more typedefs, and return that most primitive base type -be_type * -be_typedef::primitive_base_type (void) -{ - be_type *d; - - d = this; - while (d && d->node_type () == AST_Decl::NT_typedef) - { - be_typedef *temp; // temporary - - temp = be_typedef::narrow_from_decl (d); - d = be_type::narrow_from_decl (temp->base_type ()); - } - return d; -} - -int -be_typedef::gen_client_header (void) -{ - be_type *bt; // type node - be_state *s; // state based code gen object - TAO_OutStream *ch; // client header - - if (!this->cli_hdr_gen_) // not already generated - { - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - ch = cg->client_header (); - cg->push (TAO_CodeGen::TAO_TYPEDEF_CH); - s = cg->make_state (); - - bt = be_type::narrow_from_decl (this->base_type ()); - // first generate the mapping for our type. As a side effect, also - // generate the mapping for the typedef - if (!s || !bt || (s->gen_code (bt, this) == -1)) - { - ACE_ERROR ((LM_ERROR, "be_typedef: error generating code for base type\n")); - return -1; - } - - // generate the typecode decl for this typedef node - if (this->is_nested ()) - { - // we have a scoped name - ch->indent (); - *ch << "static CORBA::TypeCode_ptr " << this->tc_name - ()->last_component () << ";\n\n"; - } - else - { - // we are in the ROOT scope - ch->indent (); - *ch << "extern CORBA::TypeCode_ptr " << this->tc_name - ()->last_component () << ";\n\n"; - } - - cg->pop (); - this->cli_hdr_gen_ = I_TRUE; - } - return 0; -} - -int -be_typedef::gen_client_stubs (void) -{ - TAO_OutStream *cs; // output stream - TAO_NL nl; // end line - be_type *bt; - be_state *s; // state based code gen object - - if (!this->cli_stub_gen_) - { - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - cg->push (TAO_CodeGen::TAO_TYPEDEF_CS); // set current code gen state - - cs = cg->client_stubs (); - - s = cg->make_state (); - - bt = be_type::narrow_from_decl (this->base_type ()); - // first generate the mapping for our type. As a side effect, also - // generate the mapping for the typedef - if (!s || !bt || (s->gen_code (bt, this) == -1)) - { - ACE_ERROR ((LM_ERROR, "be_typedef: error generating code for base type\n")); - return -1; - } - - // generate the typecode information here - cs->indent (); // start from current indentation level - *cs << "static const CORBA::Long _oc_" << this->flatname () << "[] =" << - nl; - *cs << "{\n"; - cs->incr_indent (0); - if (this->gen_encapsulation () == -1) - { - ACE_ERROR ((LM_ERROR, "Error generating typecode\n\n")); - return -1; - } - cs->decr_indent (); - *cs << "};" << nl; - - *cs << "static CORBA::TypeCode _tc__tc_" << this->flatname () << - " (CORBA::tk_alias, sizeof (_oc_" << this->flatname () << - "), (unsigned char *) &_oc_" << this->flatname () << - ", CORBA::B_FALSE);" << nl; - *cs << "CORBA::TypeCode_ptr " << this->tc_name () << " = &_tc__tc_" << - this->flatname () << ";\n\n"; - - - this->cli_stub_gen_ = I_TRUE; - cg->pop (); - } - - return 0; -} - -// Generates the client-side inline information -int -be_typedef::gen_client_inline (void) -{ - be_type *bt; // type node - be_state *s; // state based code gen object - - if (!this->cli_inline_gen_) // not already generated - { - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - cg->push (TAO_CodeGen::TAO_TYPEDEF_CI); - s = cg->make_state (); - - bt = be_type::narrow_from_decl (this->base_type ()); - // first generate the mapping for our type - if (!s || !bt || (s->gen_code (bt, this) == -1)) - { - ACE_ERROR ((LM_ERROR, "be_typedef: error generating code for base type\n")); - return -1; - } - - cg->pop (); - this->cli_inline_gen_ = I_TRUE; - } - return 0; -} - -int -be_typedef::gen_server_header (void) -{ - return 0; -} - -int -be_typedef::gen_server_skeletons (void) -{ - return 0; -} - -// Generates the server-side inline -int -be_typedef::gen_server_inline (void) -{ - // nothing to be done - return 0; -} - -int -be_typedef::gen_typecode (void) -{ - TAO_OutStream *cs; // output stream - TAO_NL nl; // end line - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - cs = cg->client_stubs (); - cs->indent (); // start from whatever indentation level we were at - - *cs << "CORBA::tk_alias, // typecode kind for typedefs" << nl; - *cs << this->tc_encap_len () << ", // encapsulation length\n"; - // now emit the encapsulation - cs->incr_indent (0); - if (this->gen_encapsulation () == -1) - { - return -1; - } - - cs->decr_indent (0); - return 0; -} - -// generate encapsulation. A typedef is an alias to its base type -int -be_typedef::gen_encapsulation (void) -{ - TAO_OutStream *cs; // output stream - TAO_NL nl; // end line - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - long i, arrlen; - long *arr; // an array holding string names converted to array of longs - be_type *bt; // base type - - cs = cg->client_stubs (); - cs->indent (); // start from whatever indentation level we were at - - *cs << "TAO_ENCAP_BYTE_ORDER, // byte order" << nl; - // generate repoID - *cs << (ACE_OS::strlen (this->repoID ())+1) << ", "; - (void)this->tc_name2long (this->repoID (), arr, arrlen); - for (i=0; i < arrlen; i++) - { - cs->print ("0x%x, ", arr[i]); - } - *cs << " // repository ID = " << this->repoID () << nl; - - // generate name - *cs << (ACE_OS::strlen (this->local_name ()->get_string ())+1) << ", "; - (void)this->tc_name2long(this->local_name ()->get_string (), arr, arrlen); - for (i=0; i < arrlen; i++) - { - cs->print ("0x%x, ", arr[i]); - } - *cs << " // name = " << this->local_name () << "\n"; - - // generate typecode for the base type - bt = be_type::narrow_from_decl (this->base_type ()); - if (!bt || (bt->gen_typecode () == -1)) - { - ACE_ERROR_RETURN ((LM_ERROR, - "be_typedef::gen_encapsulation failed for base type\n"), - -1); - } - return 0; -} - -long -be_typedef::tc_size (void) -{ - // 4 bytes for enumeration, 4 bytes for storing encap length val, followed by the - // actual encapsulation length - return 4 + 4 + this->tc_encap_len (); -} - -long -be_typedef::tc_encap_len (void) -{ - if (this->encap_len_ == -1) // not computed yet - { - be_type *bt; // base type - this->encap_len_ = 4; // holds the byte order flag - - this->encap_len_ += this->repoID_encap_len (); // repoID - - // do the same thing for the local name - this->encap_len_ += this->name_encap_len (); - - // add the encapsulation length of our base type - bt = be_type::narrow_from_decl (this->base_type ()); - if (!bt) - { - ACE_ERROR ((LM_ERROR, - "be_typedef::tc_encap_len - bad base type\n")); - return 0; - } - this->encap_len_ += bt->tc_size (); - - } - return this->encap_len_; -} - -// compute the size type of the node in question -int -be_typedef::compute_size_type (void) -{ - be_type *type = be_type::narrow_from_decl (this->base_type ()); - if (!type) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_typedef::compute_size_type - " - "bad base type\n"), -1); - } - - // our size type is the same as our type - this->size_type (type->size_type ()); - return 0; -} - -// Narrowing -IMPL_NARROW_METHODS2 (be_typedef, AST_Typedef, be_type) -IMPL_NARROW_FROM_DECL (be_typedef) diff --git a/TAO/TAO_IDL/be/be_union.cpp b/TAO/TAO_IDL/be/be_union.cpp deleted file mode 100644 index b775b25b520..00000000000 --- a/TAO/TAO_IDL/be/be_union.cpp +++ /dev/null @@ -1,1127 +0,0 @@ -// ============================================================================ -// -// = LIBRARY -// TAO IDL -// -// = FILENAME -// be_union.cpp -// -// = DESCRIPTION -// Extension of class AST_Union that provides additional means for C++ -// mapping. -// -// = AUTHOR -// Copyright 1994-1995 by Sun Microsystems, Inc. -// and -// Aniruddha Gokhale -// -// ============================================================================ - -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -/* - * BE_Union - */ - -be_union::be_union (void) -{ -} - -be_union::be_union (AST_ConcreteType *dt, UTL_ScopedName *n, UTL_StrList *p) - : AST_Union (dt, n, p), - AST_Structure (AST_Decl::NT_union, n, p), - AST_Decl (AST_Decl::NT_union, n, p), - UTL_Scope (AST_Decl::NT_union), - member_count_ (-1), - default_index_ (-2) -{ -} - -// compute total number of members -int -be_union::compute_member_count (void) -{ - UTL_ScopeActiveIterator *si; // iterator - AST_Decl *d; // temp node - - this->member_count_ = 0; - - // if there are elements in this scope - if (this->nmembers () > 0) - { - // instantiate a scope iterator. - si = new UTL_ScopeActiveIterator (this, UTL_Scope::IK_decls); - - while (!(si->is_done ())) - { - // get the next AST decl node - d = si->item (); - this->member_count_++; - si->next (); - } // end of while - delete si; // free the iterator object - } - return 0; -} - -// compute total number of members -int -be_union::compute_default_index (void) -{ - UTL_ScopeActiveIterator *si; // iterator - AST_Decl *d; // temp node - be_union_branch *bub; // union branch node - int i = 0; // counter - - this->default_index_ = -1; // if not used at all, this is the value it will - // take - - // if there are elements in this scope - if (this->nmembers () > 0) - { - // instantiate a scope iterator. - si = new UTL_ScopeActiveIterator (this, UTL_Scope::IK_decls); - - while (!(si->is_done ())) - { - // get the next AST decl node - d = si->item (); - if (!d->imported ()) - { - bub = be_union_branch::narrow_from_decl (d); - if (bub->label ()->label_kind () == AST_UnionLabel::UL_default) - this->default_index_ = i; // zero based indexing - i++; - } - si->next (); - } // end of while - delete si; // free the iterator object - } - return 0; -} - -// return the member count -int -be_union::member_count (void) -{ - if (this->member_count_ == -1) - this->compute_member_count (); - - return this->member_count_; -} - -// return the default_index -int -be_union::default_index (void) -{ - if (this->default_index_ == -2) - this->compute_default_index (); - - return this->default_index_; -} - - -// **************************** -// code generation -// **************************** - -int -be_union::gen_client_header (void) -{ - TAO_OutStream *ch; // output stream - TAO_NL nl; // end line - be_type *bt; // type node - be_state *s; // code generation state - - if (!this->cli_hdr_gen_) - { - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - ch = cg->client_header (); - - // generate the ifdefined macro for the array type - ch->gen_ifdef_macro (this->flatname ()); - ch->indent (); // start with the current indentation level - *ch << "class " << local_name () << nl; - *ch << "{" << nl; - *ch << "public:\n"; - ch->incr_indent (); - - // generate default and copy constructors - *ch << local_name () << " (void); // default constructor" << nl; - *ch << local_name () << " (const " << local_name () << - " &); // copy constructor" << nl; - // generate destructor - *ch << "~" << local_name () << " (void); // destructor" << nl; - // generate assignment operator - *ch << local_name () << " &operator= (const " << local_name () << - " &); // copy constructor\n\n"; - - // the discriminant type may have to be defined here if it was an enum - // declaration inside of the union statement. - - cg->push (TAO_CodeGen::TAO_UNION_DISCTYPEDEFN_CH); // set current code gen state - bt = be_type::narrow_from_decl (this->disc_type ()); - if (!bt) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_union::" - "gen_client_header - " - "bad disciminant type\n"), -1); - } - - s = cg->make_state (); // get the code gen object for the current state - if (!s) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_union::" - "gen_client_header - " - "bad state\n"), -1); - } - - if (s->gen_code (bt, this) == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_union::" - "gen_client_header - " - "codegen for discriminant failed\n"), -1); - } - cg->pop (); // revert to previous state - - // now generate the public defn for the union branch members - cg->push (TAO_CodeGen::TAO_UNION_PUBLIC_CH); // set current code gen state - if (be_scope::gen_client_header () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_union::" - "gen_client_header - " - "codegen for public defn of union members\n"), - -1); - } - - cg->pop (); - - // now generate the private data members of the union - cg->push (TAO_CodeGen::TAO_UNION_PRIVATE_CH); // set current code gen state - ch->decr_indent (); - *ch << "private:\n"; - ch->incr_indent (); - *ch << bt->nested_type_name (this) << " disc_;" << nl; // emit the - // ACE_NESTED_CLASS macro - - // the members are inside of a union - *ch << "union" << nl; - *ch << "{\n"; - ch->incr_indent (0); - if (be_scope::gen_client_header () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_union::" - "gen_client_header - " - "codegen for private members of union\n"), -1); - } - - ch->decr_indent (); - *ch << "}; // end of union\n"; - - ch->decr_indent (); - *ch << "};\n\n"; - - // Generate the typecode decl - if (this->is_nested ()) - { - // we have a scoped name - ch->indent (); - *ch << "static CORBA::TypeCode_ptr " << this->tc_name - ()->last_component () << ";\n\n"; - } - else - { - // we are in the ROOT scope - ch->indent (); - *ch << "extern CORBA::TypeCode_ptr " << this->tc_name - ()->last_component () << ";\n\n"; - } - ch->gen_endif (); - - // generate the ifdefined macro for the array type - ch->gen_ifdef_macro (this->flatname (), "_var"); - // generate var defn - if (this->gen_var_defn () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_union::" - "gen_client_header - " - "codegen for _var\n"), -1); - } - ch->gen_endif (); - - // generate the ifdefined macro for the array type - ch->gen_ifdef_macro (this->flatname (), "_out"); - // a class is generated for an out defn only for a variable length struct - if (this->size_type () == be_decl::VARIABLE) - { - if (this->gen_out_defn () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_union::" - "gen_client_header - " - "codegen for _out\n"), -1); - } - } - else - { - ch->indent (); - *ch << "typedef " << this->local_name () << " &" << this->local_name - () << "_out;\n\n"; - } - ch->gen_endif (); - - cg->pop (); - this->cli_hdr_gen_ = I_TRUE; - } - return 0; - } - -int -be_union::gen_client_stubs (void) -{ - TAO_OutStream *cs; // output stream - TAO_NL nl; // end line - - if (!this->cli_stub_gen_) - { - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - cs = cg->client_stubs (); - - // first generate code for any of the members (if required, e.g., - // anonymous sequences, structs, unions, arrays) - cg->push (TAO_CodeGen::TAO_UNION_PUBLIC_CS); // set current code gen state - if (be_scope::gen_client_stubs () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_union::" - "gen_client_stubs - " - "codegen for scope failed\n"), -1); - } - cg->pop (); - - // now generate the operations on the union such as the copy constructor - // and the assignment operator - - *cs << "// *************************************************************" - << nl; - *cs << "// Operations for union " << this->name () << nl; - *cs << "// *************************************************************\n\n"; - - cg->push (TAO_CodeGen::TAO_UNION_PUBLIC_ASSIGN_CS); - - // generate the copy constructor and the assignment operator here - cs->indent (); - *cs << "// copy constructor" << nl; - *cs << this->name () << "::" << this->local_name () << " (const " << - this->name () << " &u)" << nl; - *cs << "{\n"; - cs->incr_indent (); - // first set the discriminant - *cs << "this->disc_ = u.disc_;" << nl; - // now switch based on the disc value - *cs << "switch (this->disc_)" << nl; - *cs << "{\n"; - cs->incr_indent (0); - if (be_scope::gen_client_stubs () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_union::" - "gen_client_stubs - " - "codegen for scope failed\n"), -1); - } - - cs->decr_indent (); - *cs << "}\n"; - cs->decr_indent (); - *cs << "}\n\n"; - - // assignment operator - cs->indent (); - *cs << "// assignment operator" << nl; - *cs << this->name () << " &" << nl; // return type - *cs << this->name () << "::operator= (const " << - this->name () << " &u)" << nl; - *cs << "{\n"; - cs->incr_indent (); - // first set the discriminant - *cs << "this->disc_ = u.disc_;" << nl; - // now switch based on the disc value - *cs << "switch (this->disc_)" << nl; - *cs << "{\n"; - cs->incr_indent (0); - if (be_scope::gen_client_stubs () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_union::" - "gen_client_stubs - " - "codegen for scope failed\n"), -1); - } - - cs->decr_indent (); - *cs << "}" << nl; - *cs << "return *this;\n"; - cs->decr_indent (); - *cs << "}\n\n"; - - // generate the typecode information here - cs->indent (); // start from current indentation level - *cs << "static const CORBA::Long _oc_" << this->flatname () << "[] =" << - nl; - *cs << "{\n"; - cs->incr_indent (0); - if (this->gen_encapsulation () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_union::" - "gen_client_stubs - " - "codegen for encapsulation failed\n"), -1); - } - - cs->decr_indent (); - *cs << "};" << nl; - - *cs << "static CORBA::TypeCode _tc__tc_" << this->flatname () << - " (CORBA::tk_union, sizeof (_oc_" << this->flatname () << - "), (unsigned char *) &_oc_" << this->flatname () << - ", CORBA::B_FALSE);" << nl; - *cs << "CORBA::TypeCode_ptr " << this->tc_name () << " = &_tc__tc_" << - this->flatname () << ";\n\n"; - this->cli_stub_gen_ = I_TRUE; - cg->pop (); - } - return 0; -} - -// Generates the client-side inline information -int -be_union::gen_client_inline (void) -{ - TAO_OutStream *ci; // output stream - TAO_NL nl; // end line - be_type *bt; // type node - be_state *s; // code generation state - - - if (!this->cli_inline_gen_) - { - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - ci = cg->client_inline (); - - *ci << "// *************************************************************" - << nl; - *ci << "// Inline operations for union " << this->name () << nl; - *ci << "// *************************************************************\n\n"; - - // generate the default constructor and the destructor here - ci->indent (); - *ci << "// default constructor" << nl; - *ci << "ACE_INLINE" << nl; - *ci << this->name () << "::" << this->local_name () << " (void)" << nl; - *ci << "{" << nl; - *ci << "}" << nl << nl; - - *ci << "// destructor" << nl; - *ci << "ACE_INLINE" << nl; - *ci << this->name () << "::~" << this->local_name () << " (void)" << nl; - *ci << "{" << nl; - *ci << "}\n\n"; - - // the discriminant type may have to be defined here if it was an enum - // declaration inside of the union statement. - - cg->push (TAO_CodeGen::TAO_UNION_DISCTYPEDEFN_CI); // set current code gen state - bt = be_type::narrow_from_decl (this->disc_type ()); - - s = cg->make_state (); // get the code gen object for the current state - if (!s || !bt || (s->gen_code (bt, this) == -1)) - { - ACE_ERROR ((LM_ERROR, "be_union::gen_client_header\n")); - ACE_ERROR ((LM_ERROR, "Discriminant type generation failure\n")); - return -1; - } - cg->pop (); - - // now generate the implementation of the access methods - cg->push (TAO_CodeGen::TAO_UNION_PUBLIC_CI); // set current code gen state - if (be_scope::gen_client_inline () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_union::" - "gen_client_inline - " - "codegen for scope failed\n"), -1); - } - - cg->pop (); - - // generate the ifdefined macro for the array type - ci->gen_ifdef_macro (this->flatname (), "_var"); - if (this->gen_var_impl () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_union::" - "gen_client_inline - " - "codegen for _var failed\n"), -1); - } - ci->gen_endif (); - - // generate the ifdefined macro for the array type - ci->gen_ifdef_macro (this->flatname (), "_out"); - if (this->size_type () == be_decl::VARIABLE && this->gen_out_impl () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_union::" - "gen_client_inline - " - "codegen for _out failed\n"), -1); - } - ci->gen_endif (); - - this->cli_inline_gen_ = I_TRUE; - } - return 0; -} - -int -be_union::gen_server_header (void) -{ - return 0; -} - -int -be_union::gen_server_skeletons (void) -{ - return 0; -} - -// Generates the server-side inline -int -be_union::gen_server_inline (void) -{ - // nothing to be done - return 0; -} - -// generate typecode. -// Typecode for union comprises the enumerated value followed by the -// encapsulation of the parameters - -// generate the _var definition for ourself -int -be_union::gen_var_defn (void) -{ - TAO_OutStream *ch; // output stream - TAO_NL nl; // end line - char namebuf [NAMEBUFSIZE]; // names - - ACE_OS::memset (namebuf, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (namebuf, "%s_var", this->local_name ()->get_string ()); - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - ch = cg->client_header (); - - // generate the var definition (always in the client header). - // Depending upon the data type, there are some differences which we account - // for over here. - - ch->indent (); // start with whatever was our current indent level - *ch << "class " << namebuf << nl; - *ch << "{" << nl; - *ch << "public:\n"; - ch->incr_indent (); - // default constr - *ch << namebuf << " (void); // default constructor" << nl; - // constr - *ch << namebuf << " (" << local_name () << " *);" << nl; - // copy constructor - *ch << namebuf << " (const " << namebuf << - " &); // copy constructor" << nl; - // destructor - *ch << "~" << namebuf << " (void); // destructor" << nl; - *ch << nl; - // assignment operator from a pointer - *ch << namebuf << " &operator= (" << local_name () << " *);" << nl; - // assignment from _var - *ch << namebuf << " &operator= (const " << namebuf << " &);" << nl; - - // arrow operator - *ch << local_name () << " *operator-> (void);" << nl; - *ch << "const " << local_name () << " *operator-> (void) const;" << nl; - *ch << nl; - - // other extra types (cast operators, [] operator, and others) - *ch << "operator const " << local_name () << " &() const;" << nl; - *ch << "operator " << local_name () << " &();" << nl; - *ch << "operator " << local_name () << " &() const;" << nl; - *ch << "// in, inout, out, _retn " << nl; - // the return types of in, out, inout, and _retn are based on the parameter - // passing rules and the base type - if (this->size_type () == be_decl::FIXED) - { - *ch << "const " << local_name () << " &in (void) const;" << nl; - *ch << local_name () << " &inout (void);" << nl; - *ch << local_name () << " &out (void);" << nl; - *ch << local_name () << " _retn (void);" << nl; - } - else - { - *ch << "const " << local_name () << " &in (void) const;" << nl; - *ch << local_name () << " &inout (void);" << nl; - *ch << local_name () << " *&out (void);" << nl; - *ch << local_name () << " *_retn (void);" << nl; - } - - // generate an additional member function that returns the underlying pointer - *ch << local_name () << " *ptr(void) const;\n"; - - *ch << "\n"; - ch->decr_indent (); - - // generate the private section - *ch << "private:\n"; - ch->incr_indent (); - *ch << local_name () << " *ptr_;\n"; - ch->decr_indent (); - *ch << "};\n\n"; - - return 0; -} - -// implementation of the _var class. All of these get generated in the inline -// file -int -be_union::gen_var_impl (void) -{ - TAO_OutStream *ci; // output stream - TAO_NL nl; // end line - char fname [NAMEBUFSIZE]; // to hold the full and - char lname [NAMEBUFSIZE]; // local _var names - - ACE_OS::memset (fname, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (fname, "%s_var", this->fullname ()); - - ACE_OS::memset (lname, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (lname, "%s_var", local_name ()->get_string ()); - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - ci = cg->client_inline (); - - ci->indent (); // start with whatever was our current indent level - - *ci << "// *************************************************************" - << nl; - *ci << "// Inline operations for class " << fname << nl; - *ci << "// *************************************************************\n\n"; - - // default constr - *ci << "ACE_INLINE" << nl; - *ci << fname << "::" << lname << - " (void) // default constructor" << nl; - *ci << "\t" << ": ptr_ (0)" << nl; - *ci << "{}\n\n"; - - // constr from a pointer - ci->indent (); - *ci << "ACE_INLINE" << nl; - *ci << fname << "::" << lname << " (" << name () << " *p)" << nl; - *ci << "\t: ptr_ (p)" << nl; - *ci << "{}\n\n"; - - // copy constructor - ci->indent (); - *ci << "ACE_INLINE" << nl; - *ci << fname << "::" << lname << " (const " << fname << - " &p) // copy constructor" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "if (p.ptr_)" << nl; - *ci << "\tthis->ptr_ = new " << this->name () << "(*p.ptr_);" << nl; - *ci << "else" << nl; - *ci << "\tthis->ptr_ = 0;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // destructor - ci->indent (); - *ci << "ACE_INLINE" << nl; - *ci << fname << "::~" << lname << " (void) // destructor" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "delete this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // assignment operator from a pointer - ci->indent (); - *ci << "ACE_INLINE " << fname << " &" << nl; - *ci << fname << "::operator= (" << name () << - " *p)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "delete this->ptr_;" << nl; - *ci << "this->ptr_ = p;" << nl; - *ci << "return *this;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // assignment operator from _var - ci->indent (); - *ci << "ACE_INLINE " << fname << " &" << nl; - *ci << fname << "::operator= (const " << fname << - " &p)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "if (this != &p)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "delete this->ptr_;" << nl; - *ci << "this->ptr_ = new " << this->name () << " (*p.ptr_);\n"; - ci->decr_indent (); - *ci << "}" << nl; - *ci << "return *this;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // two arrow operators - ci->indent (); - *ci << "ACE_INLINE const " << this->name () << " *" << nl; - *ci << fname << "::operator-> (void) const" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - ci->indent (); - *ci << "ACE_INLINE " << this->name () << " *" << nl; - *ci << fname << "::operator-> (void)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // other extra methods - 3 cast operator () - ci->indent (); - *ci << "ACE_INLINE " << nl; - *ci << fname << "::operator const " << name () << - " &() const // cast" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return *this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - ci->indent (); - *ci << "ACE_INLINE " << nl; - *ci << fname << "::operator " << name () << " &() // cast " << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return *this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - ci->indent (); - *ci << "ACE_INLINE " << nl; - *ci << fname << "::operator " << name () << " &() const// cast " << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return *this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // in, inout, out, and _retn - ci->indent (); - *ci << "ACE_INLINE const " << name () << " &" << nl; - *ci << fname << "::in (void) const" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return *this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - ci->indent (); - *ci << "ACE_INLINE " << name () << " &" << nl; - *ci << fname << "::inout (void)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return *this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // the out is handled differently based on our size type - ci->indent (); - if (this->size_type () == be_decl::VARIABLE) - { - *ci << "// mapping for variable size " << nl; - *ci << "ACE_INLINE " << name () << " *&" << nl; - *ci << fname << "::out (void)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "delete this->ptr_;" << nl; - *ci << "this->ptr_ = 0;" << nl; - *ci << "return this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - ci->indent (); - *ci << "ACE_INLINE " << name () << " *" << nl; - *ci << fname << "::_retn (void)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << this->name () << " *tmp = this->ptr_;" << nl; - *ci << "this->ptr_ = 0;" << nl; - *ci << "return tmp;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - } - else - { - *ci << "// mapping for fixed size " << nl; - *ci << "ACE_INLINE " << name () << " &" << nl; - *ci << fname << "::out (void)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return *this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - ci->indent (); - *ci << "ACE_INLINE " << name () << nl; - *ci << fname << "::_retn (void)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return *this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // the additional ptr () member function - ci->indent (); - *ci << "ACE_INLINE " << name () << " *" << nl; - *ci << fname << "::ptr (void) const" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - } - - return 0; -} - -// generate the _out definition -int -be_union::gen_out_defn (void) -{ - TAO_OutStream *ch; // output stream - TAO_NL nl; // end line - char namebuf [NAMEBUFSIZE]; // to hold the _out name - - ACE_OS::memset (namebuf, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (namebuf, "%s_out", local_name ()->get_string ()); - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - ch = cg->client_header (); - - // generate the out definition (always in the client header) - ch->indent (); // start with whatever was our current indent level - - *ch << "class " << namebuf << nl; - *ch << "{" << nl; - *ch << "public:\n"; - ch->incr_indent (); - - // No default constructor - - // constructor from a pointer - *ch << namebuf << " (" << local_name () << " *&);" << nl; - // constructor from a _var & - *ch << namebuf << " (" << local_name () << "_var &);" << nl; - // constructor from a _out & - *ch << namebuf << " (" << namebuf << " &);" << nl; - // assignment operator from a _out & - *ch << namebuf << " &operator= (" << namebuf << " &);" << nl; - // assignment operator from a pointer &, cast operator, ptr fn, operator - // -> and any other extra operators - // assignment - *ch << namebuf << " &operator= (" << local_name () << " *);" << nl; - // operator () - *ch << "operator " << local_name () << " *&();" << nl; - // ptr fn - *ch << local_name () << " *&ptr (void);" << nl; - // operator -> - *ch << local_name () << " *operator-> (void);" << nl; - - *ch << "\n"; - ch->decr_indent (); - *ch << "private:\n"; - ch->incr_indent (); - *ch << local_name () << " *&ptr_;" << nl; - *ch << "// assignment from T_var not allowed" << nl; - *ch << "void operator= (const " << local_name () << "_var &);\n"; - - ch->decr_indent (); - *ch << "};\n\n"; - return 0; -} - -int -be_union::gen_out_impl (void) -{ - TAO_OutStream *ci; // output stream - TAO_NL nl; // end line - char fname [NAMEBUFSIZE]; // to hold the full and - char lname [NAMEBUFSIZE]; // local _out names - - ACE_OS::memset (fname, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (fname, "%s_out", this->fullname ()); - - ACE_OS::memset (lname, '\0', NAMEBUFSIZE); - ACE_OS::sprintf (lname, "%s_out", local_name ()->get_string ()); - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - ci = cg->client_inline (); - - // generate the var implementation in the inline file - - ci->indent (); // start with whatever was our current indent level - - *ci << "// *************************************************************" - << nl; - *ci << "// Inline operations for class " << fname << nl; - *ci << "// *************************************************************\n\n"; - - // constr from a pointer - ci->indent (); - *ci << "ACE_INLINE" << nl; - *ci << fname << "::" << lname << " (" << name () << " *&p)" << nl; - *ci << "\t: ptr_ (p)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "this->ptr_ = 0;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // constructor from _var & - ci->indent (); - *ci << "ACE_INLINE" << nl; - *ci << fname << "::" << lname << " (" << this->name () << - "_var &p) // constructor from _var" << nl; - *ci << "\t: ptr_ (p.out ())" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "delete this->ptr_;" << nl; - *ci << "this->ptr_ = 0;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // copy constructor - ci->indent (); - *ci << "ACE_INLINE" << nl; - *ci << fname << "::" << lname << " (" << fname << - " &p) // copy constructor" << nl; - *ci << "\t: ptr_ (p.ptr_)" << nl; - *ci << "{}\n\n"; - - // assignment operator from _out & - ci->indent (); - *ci << "ACE_INLINE " << fname << " &" << nl; - *ci << fname << "::operator= (" << fname << - " &p)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "this->ptr_ = p.ptr_;" << nl; - *ci << "return *this;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // assignment from _var is not allowed by a private declaration - - // assignment operator from pointer - ci->indent (); - *ci << "ACE_INLINE " << fname << " &" << nl; - *ci << fname << "::operator= (" << this->name () << - " *p)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "this->ptr_ = p;" << nl; - *ci << "return *this;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // other extra methods - cast operator () - ci->indent (); - *ci << "ACE_INLINE " << nl; - *ci << fname << "::operator " << this->name () << - " *&() // cast" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // ptr function - ci->indent (); - *ci << "ACE_INLINE " << this->name () << " *&" << nl; - *ci << fname << "::ptr (void) // ptr" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - // operator -> - ci->indent (); - *ci << "ACE_INLINE " << this->name () << " *" << nl; - *ci << fname << "::operator-> (void)" << nl; - *ci << "{\n"; - ci->incr_indent (); - *ci << "return this->ptr_;\n"; - ci->decr_indent (); - *ci << "}\n\n"; - - - return 0; -} - -int -be_union::gen_typecode (void) -{ - TAO_OutStream *cs; // output stream - TAO_NL nl; // end line - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - cs = cg->client_stubs (); - cs->indent (); // start from whatever indentation level we were at - - *cs << "CORBA::tk_union, // typecode kind" << nl; - *cs << this->tc_encap_len () << ", // encapsulation length\n"; - // now emit the encapsulation - return this->gen_encapsulation (); -} - -// generate encapsulation. -// An encapsulation for ourselves will be necessary when we are part of some -// other IDL type and a typecode for that other type is being generated. This -// will comprise our typecode kind. IDL types with parameters will additionally -// have the encapsulation length and the entire typecode description - -int -be_union::gen_encapsulation (void) -{ - TAO_OutStream *cs; // output stream - TAO_NL nl; // end line - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - long i, arrlen; - long *arr; // an array holding string names converted to array of longs - be_type *discrim; - - cs = cg->client_stubs (); - cs->indent (); // start from whatever indentation level we were at - - *cs << "TAO_ENCAP_BYTE_ORDER, // byte order" << nl; - // generate repoID - *cs << (ACE_OS::strlen (this->repoID ())+1) << ", "; - (void)this->tc_name2long (this->repoID (), arr, arrlen); - for (i=0; i < arrlen; i++) - { - cs->print ("0x%x, ", arr[i]); - } - *cs << " // repository ID = " << this->repoID () << nl; - // generate name - *cs << (ACE_OS::strlen (this->local_name ()->get_string ())+1) << ", "; - (void)this->tc_name2long(this->local_name ()->get_string (), arr, arrlen); - for (i=0; i < arrlen; i++) - { - cs->print ("0x%x, ", arr[i]); - } - *cs << " // name = " << this->local_name () << ",\n"; - - // generate typecode for discriminant - discrim = be_type::narrow_from_decl (this->disc_type ()); - if (discrim->gen_typecode () == -1) - { - ACE_ERROR ((LM_ERROR, "be_union: cannot generate typecode for discriminant\n")); - return -1; - } - - // generate the default used flag - cs->indent (); - *cs << this->default_index () << ", // default used index" << nl; - // generate the member count - *cs << this->member_count () << ", // member count\n"; - cs->incr_indent (0); - // hand over to the scope to generate the typecode for elements - if (be_scope::gen_encapsulation () == -1) - { - ACE_ERROR ((LM_ERROR, "be_union: cannot generate code for members\n")); - return -1; - } - cs->decr_indent (0); - return 0; -} - -// compute typecode size -long -be_union::tc_size (void) -{ - // 4 bytes for enumeration, 4 bytes for storing encap length val, followed by the - // actual encapsulation length - return 4 + 4 + this->tc_encap_len (); -} - -long -be_union::tc_encap_len (void) -{ - if (this->encap_len_ == -1) // not computed yet - { - long slen; - be_type *discrim; - - // Macro to avoid "warning: unused parameter" type warning. - ACE_UNUSED_ARG (slen); - - this->encap_len_ = 4; // holds the byte order flag - - this->encap_len_ += this->repoID_encap_len (); // for repoID - - // do the same thing for the local name - this->encap_len_ += this->name_encap_len (); // for name - - // add encapsulation size of discriminant typecode - discrim = be_type::narrow_from_decl (this->disc_type ()); - this->encap_len_ += discrim->tc_size (); - - this->encap_len_ += 4; // to hold the "default used" flag - this->encap_len_ += 4; // to hold the member count - - // compute encap length for members - this->encap_len_ += be_scope::tc_encap_len (); - } - return this->encap_len_; -} - -// Narrowing -IMPL_NARROW_METHODS3 (be_union, AST_Union, be_scope, be_type) -IMPL_NARROW_FROM_DECL (be_union) -IMPL_NARROW_FROM_SCOPE (be_union) diff --git a/TAO/TAO_IDL/be/be_union_branch.cpp b/TAO/TAO_IDL/be/be_union_branch.cpp deleted file mode 100644 index 241fffab0e1..00000000000 --- a/TAO/TAO_IDL/be/be_union_branch.cpp +++ /dev/null @@ -1,189 +0,0 @@ -// ============================================================================ -// -// = LIBRARY -// TAO IDL -// -// = FILENAME -// be_union_branch.cpp -// -// = DESCRIPTION -// Extension of class AST_UnionBranch that provides additional means for C++ -// mapping. -// -// = AUTHOR -// Copyright 1994-1995 by Sun Microsystems, Inc. -// and -// Aniruddha Gokhale -// -// ============================================================================ - -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -/* - * BE_UnionBranch - */ -be_union_branch::be_union_branch (void) -{ -} - -be_union_branch::be_union_branch (AST_UnionLabel *lab, AST_Type *ft, - UTL_ScopedName *n, UTL_StrList *p) - : AST_UnionBranch (lab, ft, n, p), - AST_Field (AST_Decl::NT_union_branch, ft, n, p), - AST_Decl (AST_Decl::NT_union_branch, n, p) -{ -} - -// ---------------------------------------- -// CODE GENERATION METHODS -// ---------------------------------------- - -// Generates the client-side header information for the union_branch -int -be_union_branch::gen_client_header (void) -{ - be_type *bt; // the union_branch type - be_state *s; // state based code gen object - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - bt = be_type::narrow_from_decl (this->field_type ()); - s = cg->make_state (); - if (!s || !bt || (s->gen_code (bt, this) == -1)) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_union_branch::" - "gen_client_header - " - "state based code gen failed\n"), -1); - } - return 0; -} - -// Generates the client-side stubs for the union_branch -int -be_union_branch::gen_client_stubs (void) -{ - be_type *bt; // the union_branch type - be_state *s; // state based code gen object - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - bt = be_type::narrow_from_decl (this->field_type ()); - s = cg->make_state (); - if (!s || !bt || (s->gen_code (bt, this) == -1)) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_union_branch::" - "gen_client_stubs - " - "state based code gen failed\n"), -1); - } - - return 0; -} - -// Generates the client-side inline information -int -be_union_branch::gen_client_inline (void) -{ - be_type *bt; // the union_branch type - be_state *s; // state based code gen object - - // retrieve a singleton instance of the code generator - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - - bt = be_type::narrow_from_decl (this->field_type ()); - s = cg->make_state (); - if (!s || !bt || (s->gen_code (bt, this) == -1)) - { - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) be_union_branch::" - "gen_client_inline - " - "state based code gen failed\n"), -1); - } - return 0; -} - -// Generates the server-side header information for the union_branch -int -be_union_branch::gen_server_header (void) -{ - // nothing to be done - return 0; -} - -// Generates the server-side skeletons for the union_branch -int -be_union_branch::gen_server_skeletons (void) -{ - // nothing to be done - return 0; -} - -// Generates the server-side inline -int -be_union_branch::gen_server_inline (void) -{ - // nothing to be done - return 0; -} - -int -be_union_branch::gen_encapsulation (void) -{ - TAO_OutStream *cs; // output stream - TAO_NL nl; // end line - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - be_type *bt; // our type node - long i, arrlen; - long *arr; // an array holding string names converted to array of longs - - cs = cg->client_stubs (); - cs->indent (); // start from whatever indentation level we were at - - // emit the case label value - *cs << this->label ()->label_val (); - *cs << ", // union case label (evaluated)" << nl; - // emit name - *cs << (ACE_OS::strlen (this->local_name ()->get_string ())+1) << ", "; - (void)this->tc_name2long(this->local_name ()->get_string (), arr, arrlen); - for (i=0; i < arrlen; i++) - { - cs->print ("0x%x, ", arr[i]); - } - *cs << " // name = " << this->local_name () << "\n"; - - // hand over code generation to our type node - bt = be_type::narrow_from_decl (this->field_type ()); - if (!bt) - return -1; - return bt->gen_typecode (); -} - -long -be_union_branch::tc_encap_len (void) -{ - if (this->encap_len_ == -1) - { - be_type *bt; - - this->encap_len_ = 4; // case label; - this->encap_len_ += this->name_encap_len (); // for name - bt = be_type::narrow_from_decl (this->field_type ()); - if (!bt) - { - ACE_ERROR ((LM_ERROR, "be_union_branch: bad field type\n")); - return -1; - } - this->encap_len_ += bt->tc_size (); // note that we add the typecode size - // of the type - } - return this->encap_len_; -} - -// Narrowing -IMPL_NARROW_METHODS2 (be_union_branch, AST_UnionBranch, be_decl) -IMPL_NARROW_FROM_DECL (be_union_branch) diff --git a/TAO/TAO_IDL/be/be_union_label.cpp b/TAO/TAO_IDL/be/be_union_label.cpp deleted file mode 100644 index 54c34769d76..00000000000 --- a/TAO/TAO_IDL/be/be_union_label.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include "idl.h" -#include "idl_extern.h" -#include "be.h" - -/* - * BE_UnionLabel - */ -be_union_label::be_union_label() -{ -} -be_union_label::be_union_label(AST_UnionLabel::UnionLabel ul, - AST_Expression *v) - : AST_UnionLabel(ul, v) -{ -} - |