diff options
author | gokhale <asgokhale@users.noreply.github.com> | 1997-11-16 02:26:57 +0000 |
---|---|---|
committer | gokhale <asgokhale@users.noreply.github.com> | 1997-11-16 02:26:57 +0000 |
commit | 6c97890b241922a584c2900689cd5d51c3192abc (patch) | |
tree | 0ff814809d5039c47fa119db1b9773f4b0bbbfef /TAO/TAO_IDL | |
parent | 82dac79f292da6cce442f433c9c9998b5a0c01d7 (diff) | |
download | ATCD-6c97890b241922a584c2900689cd5d51c3192abc.tar.gz |
new files, some changes
CVS:
CVS:
CVS:
CVS:
Diffstat (limited to 'TAO/TAO_IDL')
-rw-r--r-- | TAO/TAO_IDL/be/Makefile | 989 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_operation.cpp | 8 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_sequence.cpp | 75 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_state.cpp | 3074 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_state_argument.cpp | 1025 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_state_array.cpp | 118 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_state_attribute.cpp | 35 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_state_operation.cpp | 601 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_state_sequence.cpp | 171 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_state_structure.cpp | 128 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_state_typedef.cpp | 321 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_state_union.cpp | 855 |
12 files changed, 4057 insertions, 3343 deletions
diff --git a/TAO/TAO_IDL/be/Makefile b/TAO/TAO_IDL/be/Makefile index 7e36710174b..5c5c70d8a89 100644 --- a/TAO/TAO_IDL/be/Makefile +++ b/TAO/TAO_IDL/be/Makefile @@ -41,6 +41,14 @@ BE_FILES = \ be_args \ be_helper \ be_state \ + be_state_array \ + be_state_argument \ + be_state_attribute \ + be_state_operation \ + be_state_sequence \ + be_state_structure \ + be_state_typedef \ + be_state_union \ be_codegen \ be_factory \ be_sunsoft \ @@ -89,7 +97,8 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE # 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 ../include/intlmacros.h \ +.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/stdcpp.h \ @@ -97,14 +106,13 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE $(ACE_ROOT)/ace/Trace.h \ $(ACE_ROOT)/ace/Log_Msg.h \ $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ $(ACE_ROOT)/ace/Log_Priority.h \ $(ACE_ROOT)/ace/Log_Record.i \ - ../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 \ + $(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 \ @@ -159,7 +167,7 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE ../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 \ - ../include/intlmacros.h \ + $(ACE_ROOT)/ace/ACE.h \ $(ACE_ROOT)/ace/OS.h \ $(ACE_ROOT)/ace/config.h \ $(ACE_ROOT)/ace/stdcpp.h \ @@ -167,14 +175,13 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE $(ACE_ROOT)/ace/Trace.h \ $(ACE_ROOT)/ace/Log_Msg.h \ $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ $(ACE_ROOT)/ace/Log_Priority.h \ $(ACE_ROOT)/ace/Log_Record.i \ - ../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 \ + $(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 \ @@ -229,7 +236,7 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE ../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 \ - ../include/intlmacros.h \ + $(ACE_ROOT)/ace/ACE.h \ $(ACE_ROOT)/ace/OS.h \ $(ACE_ROOT)/ace/config.h \ $(ACE_ROOT)/ace/stdcpp.h \ @@ -237,14 +244,13 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE $(ACE_ROOT)/ace/Trace.h \ $(ACE_ROOT)/ace/Log_Msg.h \ $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ $(ACE_ROOT)/ace/Log_Priority.h \ $(ACE_ROOT)/ace/Log_Record.i \ - ../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 \ + $(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 \ @@ -299,7 +305,7 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE ../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 \ - ../include/intlmacros.h \ + $(ACE_ROOT)/ace/ACE.h \ $(ACE_ROOT)/ace/OS.h \ $(ACE_ROOT)/ace/config.h \ $(ACE_ROOT)/ace/stdcpp.h \ @@ -307,14 +313,13 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE $(ACE_ROOT)/ace/Trace.h \ $(ACE_ROOT)/ace/Log_Msg.h \ $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ $(ACE_ROOT)/ace/Log_Priority.h \ $(ACE_ROOT)/ace/Log_Record.i \ - ../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 \ + $(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 \ @@ -368,7 +373,8 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE ../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 ../include/intlmacros.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/stdcpp.h \ @@ -376,14 +382,13 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE $(ACE_ROOT)/ace/Trace.h \ $(ACE_ROOT)/ace/Log_Msg.h \ $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ $(ACE_ROOT)/ace/Log_Priority.h \ $(ACE_ROOT)/ace/Log_Record.i \ - ../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 \ + $(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 \ @@ -438,7 +443,7 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE ../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 \ - ../include/intlmacros.h \ + $(ACE_ROOT)/ace/ACE.h \ $(ACE_ROOT)/ace/OS.h \ $(ACE_ROOT)/ace/config.h \ $(ACE_ROOT)/ace/stdcpp.h \ @@ -446,14 +451,13 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE $(ACE_ROOT)/ace/Trace.h \ $(ACE_ROOT)/ace/Log_Msg.h \ $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ $(ACE_ROOT)/ace/Log_Priority.h \ $(ACE_ROOT)/ace/Log_Record.i \ - ../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 \ + $(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 \ @@ -508,7 +512,7 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE ../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 \ - ../include/intlmacros.h \ + $(ACE_ROOT)/ace/ACE.h \ $(ACE_ROOT)/ace/OS.h \ $(ACE_ROOT)/ace/config.h \ $(ACE_ROOT)/ace/stdcpp.h \ @@ -516,14 +520,13 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE $(ACE_ROOT)/ace/Trace.h \ $(ACE_ROOT)/ace/Log_Msg.h \ $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ $(ACE_ROOT)/ace/Log_Priority.h \ $(ACE_ROOT)/ace/Log_Record.i \ - ../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 \ + $(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 \ @@ -578,7 +581,7 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE ../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 \ - ../include/intlmacros.h \ + $(ACE_ROOT)/ace/ACE.h \ $(ACE_ROOT)/ace/OS.h \ $(ACE_ROOT)/ace/config.h \ $(ACE_ROOT)/ace/stdcpp.h \ @@ -586,14 +589,13 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE $(ACE_ROOT)/ace/Trace.h \ $(ACE_ROOT)/ace/Log_Msg.h \ $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ $(ACE_ROOT)/ace/Log_Priority.h \ $(ACE_ROOT)/ace/Log_Record.i \ - ../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 \ + $(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 \ @@ -647,7 +649,8 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE ../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 ../include/intlmacros.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/stdcpp.h \ @@ -655,14 +658,13 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE $(ACE_ROOT)/ace/Trace.h \ $(ACE_ROOT)/ace/Log_Msg.h \ $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ $(ACE_ROOT)/ace/Log_Priority.h \ $(ACE_ROOT)/ace/Log_Record.i \ - ../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 \ + $(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 \ @@ -717,7 +719,7 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE ../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 \ - ../include/intlmacros.h \ + $(ACE_ROOT)/ace/ACE.h \ $(ACE_ROOT)/ace/OS.h \ $(ACE_ROOT)/ace/config.h \ $(ACE_ROOT)/ace/stdcpp.h \ @@ -725,14 +727,13 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE $(ACE_ROOT)/ace/Trace.h \ $(ACE_ROOT)/ace/Log_Msg.h \ $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ $(ACE_ROOT)/ace/Log_Priority.h \ $(ACE_ROOT)/ace/Log_Record.i \ - ../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 \ + $(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 \ @@ -787,7 +788,7 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE ../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 \ - ../include/intlmacros.h \ + $(ACE_ROOT)/ace/ACE.h \ $(ACE_ROOT)/ace/OS.h \ $(ACE_ROOT)/ace/config.h \ $(ACE_ROOT)/ace/stdcpp.h \ @@ -795,14 +796,13 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE $(ACE_ROOT)/ace/Trace.h \ $(ACE_ROOT)/ace/Log_Msg.h \ $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ $(ACE_ROOT)/ace/Log_Priority.h \ $(ACE_ROOT)/ace/Log_Record.i \ - ../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 \ + $(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 \ @@ -856,7 +856,8 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE ../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 ../include/intlmacros.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/stdcpp.h \ @@ -864,14 +865,13 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE $(ACE_ROOT)/ace/Trace.h \ $(ACE_ROOT)/ace/Log_Msg.h \ $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ $(ACE_ROOT)/ace/Log_Priority.h \ $(ACE_ROOT)/ace/Log_Record.i \ - ../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 \ + $(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 \ @@ -926,7 +926,7 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE ../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 \ - ../include/intlmacros.h \ + $(ACE_ROOT)/ace/ACE.h \ $(ACE_ROOT)/ace/OS.h \ $(ACE_ROOT)/ace/config.h \ $(ACE_ROOT)/ace/stdcpp.h \ @@ -934,14 +934,13 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE $(ACE_ROOT)/ace/Trace.h \ $(ACE_ROOT)/ace/Log_Msg.h \ $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ $(ACE_ROOT)/ace/Log_Priority.h \ $(ACE_ROOT)/ace/Log_Record.i \ - ../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 \ + $(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 \ @@ -996,7 +995,7 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE ../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 \ - ../include/intlmacros.h \ + $(ACE_ROOT)/ace/ACE.h \ $(ACE_ROOT)/ace/OS.h \ $(ACE_ROOT)/ace/config.h \ $(ACE_ROOT)/ace/stdcpp.h \ @@ -1004,14 +1003,13 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE $(ACE_ROOT)/ace/Trace.h \ $(ACE_ROOT)/ace/Log_Msg.h \ $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ $(ACE_ROOT)/ace/Log_Priority.h \ $(ACE_ROOT)/ace/Log_Record.i \ - ../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 \ + $(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 \ @@ -1065,7 +1063,8 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE ../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 ../include/intlmacros.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/stdcpp.h \ @@ -1073,14 +1072,13 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE $(ACE_ROOT)/ace/Trace.h \ $(ACE_ROOT)/ace/Log_Msg.h \ $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ $(ACE_ROOT)/ace/Log_Priority.h \ $(ACE_ROOT)/ace/Log_Record.i \ - ../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 \ + $(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 \ @@ -1135,7 +1133,7 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE ../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 \ - ../include/intlmacros.h \ + $(ACE_ROOT)/ace/ACE.h \ $(ACE_ROOT)/ace/OS.h \ $(ACE_ROOT)/ace/config.h \ $(ACE_ROOT)/ace/stdcpp.h \ @@ -1143,14 +1141,13 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE $(ACE_ROOT)/ace/Trace.h \ $(ACE_ROOT)/ace/Log_Msg.h \ $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ $(ACE_ROOT)/ace/Log_Priority.h \ $(ACE_ROOT)/ace/Log_Record.i \ - ../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 \ + $(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 \ @@ -1204,7 +1201,8 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE ../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 ../include/intlmacros.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/stdcpp.h \ @@ -1212,14 +1210,13 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE $(ACE_ROOT)/ace/Trace.h \ $(ACE_ROOT)/ace/Log_Msg.h \ $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ $(ACE_ROOT)/ace/Log_Priority.h \ $(ACE_ROOT)/ace/Log_Record.i \ - ../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 \ + $(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 \ @@ -1274,7 +1271,7 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE ../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 \ - ../include/intlmacros.h \ + $(ACE_ROOT)/ace/ACE.h \ $(ACE_ROOT)/ace/OS.h \ $(ACE_ROOT)/ace/config.h \ $(ACE_ROOT)/ace/stdcpp.h \ @@ -1282,14 +1279,13 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE $(ACE_ROOT)/ace/Trace.h \ $(ACE_ROOT)/ace/Log_Msg.h \ $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ $(ACE_ROOT)/ace/Log_Priority.h \ $(ACE_ROOT)/ace/Log_Record.i \ - ../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 \ + $(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 \ @@ -1343,7 +1339,8 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE ../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 ../include/intlmacros.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/stdcpp.h \ @@ -1351,14 +1348,13 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE $(ACE_ROOT)/ace/Trace.h \ $(ACE_ROOT)/ace/Log_Msg.h \ $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ $(ACE_ROOT)/ace/Log_Priority.h \ $(ACE_ROOT)/ace/Log_Record.i \ - ../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 \ + $(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 \ @@ -1412,7 +1408,8 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE ../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 ../include/intlmacros.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/stdcpp.h \ @@ -1420,14 +1417,13 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE $(ACE_ROOT)/ace/Trace.h \ $(ACE_ROOT)/ace/Log_Msg.h \ $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ $(ACE_ROOT)/ace/Log_Priority.h \ $(ACE_ROOT)/ace/Log_Record.i \ - ../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 \ + $(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 \ @@ -1481,7 +1477,8 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE ../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 ../include/intlmacros.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/stdcpp.h \ @@ -1489,14 +1486,13 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE $(ACE_ROOT)/ace/Trace.h \ $(ACE_ROOT)/ace/Log_Msg.h \ $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ $(ACE_ROOT)/ace/Log_Priority.h \ $(ACE_ROOT)/ace/Log_Record.i \ - ../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 \ + $(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 \ @@ -1551,7 +1547,7 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE ../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 \ - ../include/intlmacros.h \ + $(ACE_ROOT)/ace/ACE.h \ $(ACE_ROOT)/ace/OS.h \ $(ACE_ROOT)/ace/config.h \ $(ACE_ROOT)/ace/stdcpp.h \ @@ -1559,14 +1555,13 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE $(ACE_ROOT)/ace/Trace.h \ $(ACE_ROOT)/ace/Log_Msg.h \ $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ $(ACE_ROOT)/ace/Log_Priority.h \ $(ACE_ROOT)/ace/Log_Record.i \ - ../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 \ + $(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 \ @@ -1621,7 +1616,7 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE ../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 \ - ../include/intlmacros.h \ + $(ACE_ROOT)/ace/ACE.h \ $(ACE_ROOT)/ace/OS.h \ $(ACE_ROOT)/ace/config.h \ $(ACE_ROOT)/ace/stdcpp.h \ @@ -1629,14 +1624,13 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE $(ACE_ROOT)/ace/Trace.h \ $(ACE_ROOT)/ace/Log_Msg.h \ $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ $(ACE_ROOT)/ace/Log_Priority.h \ $(ACE_ROOT)/ace/Log_Record.i \ - ../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 \ + $(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 \ @@ -1691,7 +1685,7 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE ../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 \ - ../include/intlmacros.h \ + $(ACE_ROOT)/ace/ACE.h \ $(ACE_ROOT)/ace/OS.h \ $(ACE_ROOT)/ace/config.h \ $(ACE_ROOT)/ace/stdcpp.h \ @@ -1699,14 +1693,82 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE $(ACE_ROOT)/ace/Trace.h \ $(ACE_ROOT)/ace/Log_Msg.h \ $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/ACE.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 \ + ../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/stdcpp.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 \ - ../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 \ + $(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 \ @@ -1760,7 +1822,8 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE ../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 ../include/intlmacros.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/stdcpp.h \ @@ -1768,14 +1831,82 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE $(ACE_ROOT)/ace/Trace.h \ $(ACE_ROOT)/ace/Log_Msg.h \ $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/ACE.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 \ + ../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/stdcpp.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 \ - ../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 \ + $(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 \ @@ -1829,7 +1960,8 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE ../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 ../include/intlmacros.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/stdcpp.h \ @@ -1837,14 +1969,82 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE $(ACE_ROOT)/ace/Trace.h \ $(ACE_ROOT)/ace/Log_Msg.h \ $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/ACE.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 \ + ../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/stdcpp.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 \ - ../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 \ + $(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 \ @@ -1898,7 +2098,8 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE ../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 ../include/intlmacros.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/stdcpp.h \ @@ -1906,14 +2107,82 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE $(ACE_ROOT)/ace/Trace.h \ $(ACE_ROOT)/ace/Log_Msg.h \ $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/ACE.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 \ + ../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/stdcpp.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 \ - ../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 \ + $(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 \ @@ -1967,7 +2236,8 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE ../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 ../include/intlmacros.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/stdcpp.h \ @@ -1975,14 +2245,82 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE $(ACE_ROOT)/ace/Trace.h \ $(ACE_ROOT)/ace/Log_Msg.h \ $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/ACE.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 \ + ../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/stdcpp.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 \ - ../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 \ + $(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 \ @@ -2036,7 +2374,8 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE ../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 ../include/intlmacros.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/stdcpp.h \ @@ -2044,14 +2383,82 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE $(ACE_ROOT)/ace/Trace.h \ $(ACE_ROOT)/ace/Log_Msg.h \ $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/ACE.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 \ + ../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/stdcpp.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 \ - ../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 \ + $(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 \ @@ -2105,7 +2512,8 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE ../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 ../include/intlmacros.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/stdcpp.h \ @@ -2113,14 +2521,82 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE $(ACE_ROOT)/ace/Trace.h \ $(ACE_ROOT)/ace/Log_Msg.h \ $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/ACE.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 \ + ../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/stdcpp.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 \ - ../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 \ + $(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 \ @@ -2174,7 +2650,8 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE ../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 ../include/intlmacros.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/stdcpp.h \ @@ -2182,14 +2659,82 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE $(ACE_ROOT)/ace/Trace.h \ $(ACE_ROOT)/ace/Log_Msg.h \ $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/ACE.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 \ + ../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/stdcpp.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 \ - ../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 \ + $(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 \ @@ -2244,7 +2789,8 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE ../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 ../include/intlmacros.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/stdcpp.h \ @@ -2252,14 +2798,13 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE $(ACE_ROOT)/ace/Trace.h \ $(ACE_ROOT)/ace/Log_Msg.h \ $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ $(ACE_ROOT)/ace/Log_Priority.h \ $(ACE_ROOT)/ace/Log_Record.i \ - ../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 \ + $(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 \ @@ -2314,7 +2859,8 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE ../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 ../include/intlmacros.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/stdcpp.h \ @@ -2322,14 +2868,13 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE $(ACE_ROOT)/ace/Trace.h \ $(ACE_ROOT)/ace/Log_Msg.h \ $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ $(ACE_ROOT)/ace/Log_Priority.h \ $(ACE_ROOT)/ace/Log_Record.i \ - ../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 \ + $(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 \ @@ -2383,7 +2928,8 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE ../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 ../include/intlmacros.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/stdcpp.h \ @@ -2391,14 +2937,13 @@ CPPFLAGS += -I../include -I../be_include -I. -DCPP_LOCATION=\"$(CXX)\" -DIDL_CFE $(ACE_ROOT)/ace/Trace.h \ $(ACE_ROOT)/ace/Log_Msg.h \ $(ACE_ROOT)/ace/Log_Record.h \ - $(ACE_ROOT)/ace/ACE.h \ - $(ACE_ROOT)/ace/Version.h \ - $(ACE_ROOT)/ace/ACE.i \ $(ACE_ROOT)/ace/Log_Priority.h \ $(ACE_ROOT)/ace/Log_Record.i \ - ../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 \ + $(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 \ diff --git a/TAO/TAO_IDL/be/be_operation.cpp b/TAO/TAO_IDL/be/be_operation.cpp index a43451c5379..76a696f0374 100644 --- a/TAO/TAO_IDL/be/be_operation.cpp +++ b/TAO/TAO_IDL/be/be_operation.cpp @@ -446,7 +446,7 @@ be_operation::gen_server_skeletons (void) << this->local_name () << "_skel (" << "CORBA::ServerRequest &_tao_server_request, " << "CORBA::Object_ptr _tao_object_reference, " - << "CORBA::Environment &_tao_enviroment)" << nl; + << "CORBA::Environment &_tao_environment)" << nl; *ss << "{\n"; ss->incr_indent (); // define an NVList to hold arguments @@ -563,13 +563,13 @@ be_operation::gen_server_skeletons (void) switch (bd->direction ()) { case AST_Argument::dir_IN: - *ss << "CORBA::ARG_IN, _tao_enviroment);" << nl; + *ss << "CORBA::ARG_IN, _tao_environment);" << nl; break; case AST_Argument::dir_INOUT: - *ss << "CORBA::ARG_INOUT, _tao_enviroment);" << nl; + *ss << "CORBA::ARG_INOUT, _tao_environment);" << nl; break; case AST_Argument::dir_OUT: - *ss << "CORBA::ARG_OUT, _tao_enviroment);" << nl; + *ss << "CORBA::ARG_OUT, _tao_environment);" << nl; break; } } // end if argument node diff --git a/TAO/TAO_IDL/be/be_sequence.cpp b/TAO/TAO_IDL/be/be_sequence.cpp index 663c3a2a768..62abff2520c 100644 --- a/TAO/TAO_IDL/be/be_sequence.cpp +++ b/TAO/TAO_IDL/be/be_sequence.cpp @@ -62,55 +62,46 @@ be_sequence::create_name (void) d = cg->node (); // retrieve the node that was passed in via the CodeGen - // object + // object if (!d) return -1; // error, we cannot be free standing. - if (d->node_type () == AST_Decl::NT_typedef) - { - // we are a named sequence. We will assume the same name as the typedef - // node - this->set_name ((UTL_ScopedName *)d->name ()->copy ()); - } - else - { - // we generate a name for ourselves. Start by generating a local name + // we generate a name for ourselves. Start by generating a local name - ACE_OS::memset (namebuf, '\0', 200); - ACE_OS::sprintf (namebuf, "_seq_%s", d->local_name ()->get_string ()); + ACE_OS::memset (namebuf, '\0', 200); + ACE_OS::sprintf (namebuf, "_tao__seq_%s", d->local_name ()->get_string ()); - if (d->node_type () == AST_Decl::NT_sequence) - { - // this means that we are an anonymous sequence who happens to be a - // base type of the sequence denoted by the node "d". - // Hence we set our enclosing scope to be the node "d" - this->set_defined_in (DeclAsScope (d)); - } + if (d->node_type () == AST_Decl::NT_sequence) + { + // this means that we are an anonymous sequence who happens to be a + // base type of the sequence denoted by the node "d". + // Hence we set our enclosing scope to be the node "d" + this->set_defined_in (DeclAsScope (d)); + } - // now set our fully scoped name + // now set our fully scoped name - // now see if we have a fully scoped name. - scope = be_decl::narrow_from_decl (ScopeAsDecl (this->defined_in ())); - if (scope != NULL) - { - // 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; - } + // now see if we have a fully scoped name. + scope = be_decl::narrow_from_decl (ScopeAsDecl (this->defined_in ())); + if (scope != NULL) + { + // 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; } @@ -1316,8 +1307,6 @@ be_sequence::gen_encapsulation (void) 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 diff --git a/TAO/TAO_IDL/be/be_state.cpp b/TAO/TAO_IDL/be/be_state.cpp index d79ca94e212..879d2dade3c 100644 --- a/TAO/TAO_IDL/be/be_state.cpp +++ b/TAO/TAO_IDL/be/be_state.cpp @@ -10,8 +10,6 @@ // state based code generation. // // = AUTHOR -// Copyright 1994-1995 by Sun Microsystems, Inc. -// and // Aniruddha Gokhale // // ============================================================================ @@ -30,3078 +28,6 @@ be_state::~be_state (void) { } -// constructor -be_state_attribute::be_state_attribute (void) -{ -} - -int -be_state_attribute::gen_code (be_type *bt, be_decl *d, be_type *type) -{ - // Macro to avoid "warning: unused parameter" type warning. - ACE_UNUSED_ARG (bt); - ACE_UNUSED_ARG (d); - ACE_UNUSED_ARG (type); - - return 0; -} - -// ==== all subclasses of be_state ====== - -be_state_struct_ch::be_state_struct_ch (void) -{ -} - -// generate code for structure member -int -be_state_struct_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_field *f; // field node - be_structure *bs; // enclosing structure node - - // Macro to avoid "warning: unused parameter" type warning. - ACE_UNUSED_ARG (nl); - - os = cg->client_header (); // get client header stream - f = be_field::narrow_from_decl (d); // downcast to field node - if (!f) - return -1; - - bs = be_structure::narrow_from_scope (f->defined_in ()); - if (bs == NULL) - return -1; - - // pass the field node just incase it is needed - 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. 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 - *os << bt->nested_type_name (bs, "_var") << " " << f->local_name () << - ";\n\n"; - } - break; - case AST_Decl::NT_pre_defined: // type is predefined type - { - os->indent (); // start from current indentation - *os << bt->nested_type_name (bs) << " " << f->local_name () << ";\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) - { - *os << bt->nested_type_name (bs, "_var") << " " << f->local_name () << ";\n\n"; - } - else - { - *os << "CORBA::String_var " << f->local_name () << ";\n\n"; - } - } - 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 - { - // 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) - if (bt->gen_client_header () == -1) - return -1; - - os->indent (); - *os << bt->nested_type_name (bs) << " " << f->local_name () << ";\n\n"; - } - 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; - } - // the enclosing structure will be variable length the field is variable - // length - bs->size_type (type->size_type ()); - return 0; -} - -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) - 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); - - 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) - return -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) - return -1; - temp = t->primitive_base_type (); - return this->gen_code (t, d, temp); - } - break; - } // 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) - 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); - - 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) - return -1; - - bu = be_union::narrow_from_scope (ub->defined_in ()); - if (bu == NULL) - return -1; - - // pass the union branch node just incase it is needed - cg->node (ub); - - 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 - *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 - case AST_Decl::NT_enum: // type is an enum - { - // 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) - return -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) - return -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) - return -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); - } - break; - } // 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) - return -1; - - bu = be_union::narrow_from_scope (ub->defined_in ()); - if (bu == NULL) - 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); - - // 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_pre_defined: // type is predefined type - case AST_Decl::NT_enum: // type is an enum - case AST_Decl::NT_interface: // type is an obj reference - case AST_Decl::NT_array: // type is an array - { - // 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; - *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 (); - *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; - - // return const char* - if (bt->node_type () == AST_Decl::NT_typedef) - { - *os << "ACE_INLINE " << 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_struct: // type is a struct - case AST_Decl::NT_union: // type is a union - { - 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); - } - break; - } // end of switch - - 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_NL nl; // end line - TAO_CodeGen *cg = TAO_CODEGEN::instance (); - be_union_branch *ub; // union branch member - be_union *bu; // enclosing union - - // Macro to avoid "warning: unused parameter" type warning. - ACE_UNUSED_ARG (nl); - - os = cg->client_header (); // get client header stream - ub = be_union_branch::narrow_from_decl (d); // downcast to union branch node - if (!ub) - return -1; - - bu = be_union::narrow_from_scope (ub->defined_in ()); - if (bu == NULL) - 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); - - // 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 - *os << bt->nested_type_name (bu, "_var") << " " << ub->local_name () << - "_;\n"; - } - break; - case AST_Decl::NT_pre_defined: // type is predefined type - 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 - 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_struct: // type is a struct - case AST_Decl::NT_union: // type is a union - { - 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); - } - break; - } // end of switch - return 0; -} - -// 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 ();" << nl; - } - 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 << bt->name () << "_ptr retval;"; // callee - // allocates - // some stupid problems arising out of casting to the bt->name type - *os << "CORBA::Object_ptr retval;" << nl; // callee allocates - } - break; - case TAO_CodeGen::TAO_OPERATION_RETVAL_ASSIGN_SS: - { - *os << "retval"; // assign to retval - } - 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;" << nl; - } - else if (bpd->pt () == AST_PredefinedType::PT_pseudo) - { - // pseudo object, return a pointer - *os << "return 0;" << nl; - } - else if (bpd->pt () == AST_PredefinedType::PT_void) - { - *os << "return;" << nl; - } - else - { - *os << "return retval;" << nl; - } - } - 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;" << 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; - 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;" << nl; - } - 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;" << nl; - } - else - { - *os << "char *retval;" << nl; - } - } - break; - case TAO_CodeGen::TAO_OPERATION_RETVAL_ASSIGN_SS: - { - *os << "retval"; - } - 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;" << nl; - } - 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_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;" << nl; - } - 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;" << nl; - } - break; - case TAO_CodeGen::TAO_OPERATION_RETVAL_ASSIGN_SS: - { - *os << "retval"; - } - 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;" << nl; - } - 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_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;" << nl; - } - else - { - *os << "return retval;" << nl; - } - } - 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_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; - } // switch of main switch - return 0; -} - -// return type for argument -be_state_argument::be_state_argument (void) -{ -} - -// generate code for return type of argument -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: - 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_UPCALL_SS: - os = cg->server_skeletons (); - break; - } - - arg = be_argument::narrow_from_decl (d); - if (!arg) - return -1; - - // get the scope of the arg which is the operation. Its scope is the - // interface node - bif = be_interface::narrow_from_scope (ScopeAsDecl (arg->defined_in - ())->defined_in ()); - if (!bif) - 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); - - // find the direction of the argument. Depending on the direction and the - // type, generate the mapping - 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 (arg->direction ()) - { - case AST_Argument::dir_IN: - // what state are we in - switch (cg->state ()) - { - case TAO_CodeGen::TAO_ARGUMENT_VARDECL_SS: - { - *os << bt->name () << "_ptr "; - // declare a variable - *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_CH: - { - // to keep the MSVC++ compiler happy - *os << bt->nested_type_name (bif, "_ptr") << " "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: - { - *os << arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_SH: - default: - { - *os << bt->name () << "_ptr "; - } - } // switch state - break; - case AST_Argument::dir_INOUT: - switch (cg->state ()) - { - case TAO_CodeGen::TAO_ARGUMENT_VARDECL_SS: - { - *os << bt->name () << "_ptr "; - // declare a variable - *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 () << - ", 1); // ORB owns" << nl; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_CH: - { - // to keep the MSVC++ compiler happy - *os << bt->nested_type_name (bif, "_ptr") << " &"; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_SH: - default: - { - *os << bt->name () << "_ptr &"; - } - } // 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 "; - *os << arg->local_name () << ";" << nl; - *os << bt->name () << "_out " << arg->local_name () << - "_out (" << 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_CH: - { - // to keep the MSVC++ compiler happy - *os << bt->nested_type_name (bif, "_out") << " "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: - { - *os << arg->local_name () << "_out, "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_SH: - default: - { - *os << bt->name () << "_out "; - } - } // 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; - // 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_CH: - { - *os << "const " << bt->nested_type_name (bif) << " &"; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: - { - *os << arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_SH: - default: - { - *os << "const " << bt->name () << " &"; - } - } // 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 () << ";" << 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_CH: - { - *os << "const " << bt->nested_type_name (bif) << " &"; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: - { - *os << arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_SH: - default: - { - *os << bt->name () << " &"; - } - } // 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 () << " *"; - *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 () << - ", 1); // ORB owns" << nl; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_CH: - { - *os << bt->nested_type_name (bif, "_out") << " "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: - { - *os << arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_SH: - default: - { - *os << bt->name () << "_out "; - } - } // end switch state - break; - } // end switch direction - } // end of if - else if (bpd->pt () == AST_PredefinedType::PT_pseudo) - { - 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 "; - *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_CH: - { - *os << bt->nested_type_name (bif, "_ptr") << " "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: - { - *os << arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_SH: - default: - { - *os << bt->name () << "_ptr "; - } - } // 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 "; - *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 () << - ", 1); // ORB owns" << nl; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_CH: - { - *os << bt->nested_type_name (bif, "_ptr") << " &"; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: - { - *os << arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_SH: - default: - { - *os << bt->name () << "_ptr &"; - } - } // 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 "; - *os << arg->local_name () << ";" << nl; - *os << bt->name () << "_out "; - *os << arg->local_name () << "_out (" << 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_CH: - { - *os << bt->nested_type_name (bif, "_out") << " "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: - { - *os << arg->local_name () << "_out, "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_SH: - default: - { - *os << bt->name () << "_out "; - } - } // end switch state - break; - } // end switch direction - } // end else if - else - { - 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; - // 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_CH: - { - *os << bt->nested_type_name (bif); - } - break; - case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: - { - *os << arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_SH: - default: - { - *os << bt->name (); - } - } // 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 () << ";" << - 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_CH: - { - *os << bt->nested_type_name (bif) << " &"; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: - { - *os << arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_SH: - default: - { - *os << bt->name () << " &"; - } - } // 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 () << ";" << - 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_CH: - { - *os << bt->nested_type_name (bif, "_out"); - } - break; - case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: - { - *os << arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_SH: - default: - { - *os << bt->name () << "_out"; - } - } // 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: - { - // declare a variable - *os << "char *" << 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_UPCALL_SS: - { - *os << arg->local_name () << ", "; - } - break; - default: - { - *os << "const char *"; - } - } // end switch state - break; - case AST_Argument::dir_INOUT: - switch (cg->state ()) - { - case TAO_CodeGen::TAO_ARGUMENT_VARDECL_SS: - { - // declare a variable - *os << "char *" << 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_UPCALL_SS: - { - *os << arg->local_name () << ", "; - } - break; - default: - { - *os << "char *&"; - } - } // end switch state - break; - case AST_Argument::dir_OUT: - switch (cg->state ()) - { - case TAO_CodeGen::TAO_ARGUMENT_VARDECL_SS: - { - // declare a variable - *os << "char *" << 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_CH: - { - *os << bt->nested_type_name (bif, "_out"); - } - break; - case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: - { - *os << arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_SH: - default: - { - *os << bt->name () << "_out"; - } - } // 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; - // 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_CH: - { - // to keep the MSVC++ compiler happy - *os << "const " << bt->nested_type_name (bif); - } - break; - case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: - { - *os << arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_SH: - default: - { - *os << "const " << bt->name (); - } - } // 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_CH: - { - // to keep the MSVC++ compiler happy - if (bt->size_type () == be_decl::VARIABLE) - { - *os << bt->nested_type_name (bif, "_slice") << " *"; - } - else - { - *os << bt->nested_type_name (bif); - } - } - break; - case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: - { - *os << arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_SH: - default: - { - *os << bt->name (); - if (bt->size_type () == be_decl::VARIABLE) - { - *os << "_slice *"; - } - } - } // 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_CH: - { - // to keep the MSVC++ compiler happy - *os << bt->nested_type_name (bif, "_out") << " "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: - { - *os << arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_SH: - default: - { - *os << bt->name () << "_out"; - } - } // 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; - // 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_CH: - { - // to keep the MSVC++ compiler happy - *os << "const " << bt->nested_type_name (bif) << " &"; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: - { - *os << arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_SH: - default: - { - *os << "const " << bt->name () << " &"; - } - } // 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 () << - ";" << 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_CH: - { - // to keep the MSVC++ compiler happy - *os << bt->nested_type_name (bif) << " &"; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: - { - *os << arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_SH: - default: - { - *os << bt->name () << " &"; - } - } // end switch state - } // end case - break; - case AST_Argument::dir_OUT: - { - switch (cg->state ()) - { - case TAO_CodeGen::TAO_ARGUMENT_VARDECL_SS: - { - if (bt->size_type () == be_decl::VARIABLE) - { - // declare a variable - *os << bt->name () << " *" << arg->local_name () << ";" << - nl; - *os << bt->name () << "_out " << arg->local_name () << - "_out (" << 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; - } - else - { - // declare a variable - *os << bt->name () << " " << 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; - } // end else - } - break; - case TAO_CodeGen::TAO_ARGUMENT_CH: - { - // to keep the MSVC++ compiler happy - *os << bt->nested_type_name (bif, "_out") << " "; - } - 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_SH: - default: - { - *os << bt->name () << "_out"; - break; - } - } // 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; - // 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_CH: - { - // to keep the MSVC++ compiler happy - *os << bt->nested_type_name (bif); - } - break; - case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: - { - *os << arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_SH: - default: - { - *os << bt->name (); - } - } // 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 () << ";" << - 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_CH: - { - // to keep the MSVC++ compiler happy - *os << bt->nested_type_name (bif) << " &"; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: - { - *os << arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_SH: - default: - { - *os << bt->name () << " &"; - } - } // 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 () << ";" << - 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_CH: - { - // to keep the MSVC++ compiler happy - *os << bt->nested_type_name (bif, "_out") << " "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: - { - *os << arg->local_name () << ", "; - } - break; - case TAO_CodeGen::TAO_ARGUMENT_SH: - default: - { - *os << bt->name () << "_out"; - } - } // 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; -} - -// 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; - - // pass the typedef node, just in case it is needed - cg->node (tdef); - - scope = be_decl::narrow_from_decl (ScopeAsDecl (tdef->defined_in ())); - - 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 - if (bt->node_type () != AST_Decl::NT_typedef) - { - if (bt->gen_client_header () == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - "be_state_typedef - array gen failed\n"), -1); - } - } - os->indent (); - *os << "typedef " << bt->name () << " " << d->local_name () << - ";" << nl; - *os << "typedef " << bt->name () << "_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 << d->name () << "_slice* " << d->local_name () << - "_alloc (void);" << nl; - if (d->is_nested ()) - *os << "static "; - *os << d->name () << "_slice* " << d->local_name () << "_dup (" - << d->name () << "_slice* " << ");" << nl; - if (d->is_nested ()) - *os << "static "; - *os << "void " << d->name () << "_free (" << d->name () << - "_slice *);\n\n"; - } - break; - default: - break; - } // end of switch - } - break; - case AST_Decl::NT_sequence: // type is a sequence - { - 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 - seq gen failed\n"), - -1); - } - } - } - 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 - 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 - seq gen failed\n"), - -1); - } - } - } - break; - default: - break; - } // end of switch 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_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); - } - } - } - 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); - } - } - } - 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; - } // end of switch - - return 0; -} - -// 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; - } - return 0; -} - -// 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) - return -1; - - switch (cg->state ()) - { - case TAO_CodeGen::TAO_SEQUENCE_BASE_CH: - case TAO_CodeGen::TAO_SEQUENCE_BODY_CH: - os = cg->client_header (); // get client header stream - break; - case TAO_CodeGen::TAO_SEQUENCE_BASE_CS: - case TAO_CodeGen::TAO_SEQUENCE_BODY_CS: - os = cg->client_stubs (); // get client stubs stream - break; - case TAO_CodeGen::TAO_SEQUENCE_BASE_CI: - case TAO_CodeGen::TAO_SEQUENCE_BODY_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 typedef occurs - be_decl *scope = - be_decl::narrow_from_decl (ScopeAsDecl (bt->defined_in ())); - - // 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_string: // type is a string - { - switch (cg->state ()) - { - case TAO_CodeGen::TAO_SEQUENCE_BASE_CH: - case TAO_CodeGen::TAO_SEQUENCE_BASE_CS: - case TAO_CodeGen::TAO_SEQUENCE_BASE_CI: - break; - case TAO_CodeGen::TAO_SEQUENCE_BODY_CH: - *os << bt->nested_type_name (scope, "_var"); - break; - case TAO_CodeGen::TAO_SEQUENCE_BODY_CS: - case TAO_CodeGen::TAO_SEQUENCE_BODY_CI: - default: - *os << bt->name () << "_var"; - } - } - break; - 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_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: - break; - case TAO_CodeGen::TAO_SEQUENCE_BODY_CH: - *os << bt->nested_type_name (scope, ""); - break; - case TAO_CodeGen::TAO_SEQUENCE_BODY_CS: - case TAO_CodeGen::TAO_SEQUENCE_BODY_CI: - default: - *os << bt->name (); - } - } - 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) - { - return -1; - } - } - break; - case TAO_CodeGen::TAO_SEQUENCE_BASE_CS: - { - // generate the base type sequence - if (bt->gen_client_stubs () == -1) - { - return -1; - } - } - break; - case TAO_CodeGen::TAO_SEQUENCE_BASE_CI: - { - // generate the base type sequence - if (bt->gen_client_inline () == -1) - { - return -1; - } - } - break; - case TAO_CodeGen::TAO_SEQUENCE_BODY_CH: - *os << bt->nested_type_name (scope, ""); - break; - case TAO_CodeGen::TAO_SEQUENCE_BODY_CS: - case TAO_CodeGen::TAO_SEQUENCE_BODY_CI: - default: - *os << bt->name (); - } - } - 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; - } // end of switch - return 0; -} - #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) template class ACE_Singleton<be_state_struct_ch, ACE_SYNCH_RECURSIVE_MUTEX>; template class ACE_Singleton<be_state_union_disctypedefn_ch, ACE_SYNCH_RECURSIVE_MUTEX>; diff --git a/TAO/TAO_IDL/be/be_state_argument.cpp b/TAO/TAO_IDL/be/be_state_argument.cpp new file mode 100644 index 00000000000..7b0df401f2e --- /dev/null +++ b/TAO/TAO_IDL/be/be_state_argument.cpp @@ -0,0 +1,1025 @@ +// ============================================================================ +// +// = 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 return type of argument +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: + 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_UPCALL_SS: + os = cg->server_skeletons (); + break; + } + + arg = be_argument::narrow_from_decl (d); + if (!arg) + return -1; + + // get the scope of the arg which is the operation. Its scope is the + // interface node + bif = be_interface::narrow_from_scope (ScopeAsDecl (arg->defined_in + ())->defined_in ()); + if (!bif) + 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); + + // find the direction of the argument. Depending on the direction and the + // type, generate the mapping + 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 (arg->direction ()) + { + case AST_Argument::dir_IN: + // what state are we in + switch (cg->state ()) + { + case TAO_CodeGen::TAO_ARGUMENT_VARDECL_SS: + { + *os << bt->name () << "_ptr "; + // declare a variable + *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_CH: + { + // to keep the MSVC++ compiler happy + *os << bt->nested_type_name (bif, "_ptr") << " "; + } + break; + case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: + { + *os << arg->local_name () << ", "; + } + break; + case TAO_CodeGen::TAO_ARGUMENT_SH: + default: + { + *os << bt->name () << "_ptr "; + } + } // switch state + break; + case AST_Argument::dir_INOUT: + switch (cg->state ()) + { + case TAO_CodeGen::TAO_ARGUMENT_VARDECL_SS: + { + *os << bt->name () << "_ptr "; + // declare a variable + *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 () << + ", 1); // ORB owns" << nl; + } + break; + case TAO_CodeGen::TAO_ARGUMENT_CH: + { + // to keep the MSVC++ compiler happy + *os << bt->nested_type_name (bif, "_ptr") << " &"; + } + break; + case TAO_CodeGen::TAO_ARGUMENT_SH: + default: + { + *os << bt->name () << "_ptr &"; + } + } // 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 "; + *os << arg->local_name () << ";" << nl; + *os << bt->name () << "_out " << arg->local_name () << + "_out (" << 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_CH: + { + // to keep the MSVC++ compiler happy + *os << bt->nested_type_name (bif, "_out") << " "; + } + break; + case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: + { + *os << arg->local_name () << "_out, "; + } + break; + case TAO_CodeGen::TAO_ARGUMENT_SH: + default: + { + *os << bt->name () << "_out "; + } + } // 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; + // 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_CH: + { + *os << "const " << bt->nested_type_name (bif) << " &"; + } + break; + case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: + { + *os << arg->local_name () << ", "; + } + break; + case TAO_CodeGen::TAO_ARGUMENT_SH: + default: + { + *os << "const " << bt->name () << " &"; + } + } // 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 () << ";" << 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_CH: + { + *os << "const " << bt->nested_type_name (bif) << " &"; + } + break; + case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: + { + *os << arg->local_name () << ", "; + } + break; + case TAO_CodeGen::TAO_ARGUMENT_SH: + default: + { + *os << bt->name () << " &"; + } + } // 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 () << " *"; + *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 () << + ", 1); // ORB owns" << nl; + } + break; + case TAO_CodeGen::TAO_ARGUMENT_CH: + { + *os << bt->nested_type_name (bif, "_out") << " "; + } + break; + case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: + { + *os << arg->local_name () << ", "; + } + break; + case TAO_CodeGen::TAO_ARGUMENT_SH: + default: + { + *os << bt->name () << "_out "; + } + } // end switch state + break; + } // end switch direction + } // end of if + else if (bpd->pt () == AST_PredefinedType::PT_pseudo) + { + 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 "; + *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_CH: + { + *os << bt->nested_type_name (bif, "_ptr") << " "; + } + break; + case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: + { + *os << arg->local_name () << ", "; + } + break; + case TAO_CodeGen::TAO_ARGUMENT_SH: + default: + { + *os << bt->name () << "_ptr "; + } + } // 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 "; + *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 () << + ", 1); // ORB owns" << nl; + } + break; + case TAO_CodeGen::TAO_ARGUMENT_CH: + { + *os << bt->nested_type_name (bif, "_ptr") << " &"; + } + break; + case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: + { + *os << arg->local_name () << ", "; + } + break; + case TAO_CodeGen::TAO_ARGUMENT_SH: + default: + { + *os << bt->name () << "_ptr &"; + } + } // 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 "; + *os << arg->local_name () << ";" << nl; + *os << bt->name () << "_out "; + *os << arg->local_name () << "_out (" << 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_CH: + { + *os << bt->nested_type_name (bif, "_out") << " "; + } + break; + case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: + { + *os << arg->local_name () << "_out, "; + } + break; + case TAO_CodeGen::TAO_ARGUMENT_SH: + default: + { + *os << bt->name () << "_out "; + } + } // end switch state + break; + } // end switch direction + } // end else if + else + { + 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; + // 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_CH: + { + *os << bt->nested_type_name (bif); + } + break; + case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: + { + *os << arg->local_name () << ", "; + } + break; + case TAO_CodeGen::TAO_ARGUMENT_SH: + default: + { + *os << bt->name (); + } + } // 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 () << ";" << + 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_CH: + { + *os << bt->nested_type_name (bif) << " &"; + } + break; + case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: + { + *os << arg->local_name () << ", "; + } + break; + case TAO_CodeGen::TAO_ARGUMENT_SH: + default: + { + *os << bt->name () << " &"; + } + } // 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 () << ";" << + 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_CH: + { + *os << bt->nested_type_name (bif, "_out"); + } + break; + case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: + { + *os << arg->local_name () << ", "; + } + break; + case TAO_CodeGen::TAO_ARGUMENT_SH: + default: + { + *os << bt->name () << "_out"; + } + } // 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: + { + // declare a variable + *os << "char *" << 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_UPCALL_SS: + { + *os << arg->local_name () << ", "; + } + break; + default: + { + *os << "const char *"; + } + } // end switch state + break; + case AST_Argument::dir_INOUT: + switch (cg->state ()) + { + case TAO_CodeGen::TAO_ARGUMENT_VARDECL_SS: + { + // declare a variable + *os << "char *" << 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_UPCALL_SS: + { + *os << arg->local_name () << ", "; + } + break; + default: + { + *os << "char *&"; + } + } // end switch state + break; + case AST_Argument::dir_OUT: + switch (cg->state ()) + { + case TAO_CodeGen::TAO_ARGUMENT_VARDECL_SS: + { + // declare a variable + *os << "char *" << 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_CH: + { + *os << bt->nested_type_name (bif, "_out"); + } + break; + case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: + { + *os << arg->local_name () << ", "; + } + break; + case TAO_CodeGen::TAO_ARGUMENT_SH: + default: + { + *os << bt->name () << "_out"; + } + } // 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; + // 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_CH: + { + // to keep the MSVC++ compiler happy + *os << "const " << bt->nested_type_name (bif); + } + break; + case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: + { + *os << arg->local_name () << ", "; + } + break; + case TAO_CodeGen::TAO_ARGUMENT_SH: + default: + { + *os << "const " << bt->name (); + } + } // 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_CH: + { + // to keep the MSVC++ compiler happy + if (bt->size_type () == be_decl::VARIABLE) + { + *os << bt->nested_type_name (bif, "_slice") << " *"; + } + else + { + *os << bt->nested_type_name (bif); + } + } + break; + case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: + { + *os << arg->local_name () << ", "; + } + break; + case TAO_CodeGen::TAO_ARGUMENT_SH: + default: + { + *os << bt->name (); + if (bt->size_type () == be_decl::VARIABLE) + { + *os << "_slice *"; + } + } + } // 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_CH: + { + // to keep the MSVC++ compiler happy + *os << bt->nested_type_name (bif, "_out") << " "; + } + break; + case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: + { + *os << arg->local_name () << ", "; + } + break; + case TAO_CodeGen::TAO_ARGUMENT_SH: + default: + { + *os << bt->name () << "_out"; + } + } // 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; + // 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_CH: + { + // to keep the MSVC++ compiler happy + *os << "const " << bt->nested_type_name (bif) << " &"; + } + break; + case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: + { + *os << arg->local_name () << ", "; + } + break; + case TAO_CodeGen::TAO_ARGUMENT_SH: + default: + { + *os << "const " << bt->name () << " &"; + } + } // 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 () << + ";" << 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_CH: + { + // to keep the MSVC++ compiler happy + *os << bt->nested_type_name (bif) << " &"; + } + break; + case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: + { + *os << arg->local_name () << ", "; + } + break; + case TAO_CodeGen::TAO_ARGUMENT_SH: + default: + { + *os << bt->name () << " &"; + } + } // end switch state + } // end case + break; + case AST_Argument::dir_OUT: + { + switch (cg->state ()) + { + case TAO_CodeGen::TAO_ARGUMENT_VARDECL_SS: + { + if (bt->size_type () == be_decl::VARIABLE) + { + // declare a variable + *os << bt->name () << " *" << arg->local_name () << ";" << + nl; + *os << bt->name () << "_out " << arg->local_name () << + "_out (" << 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; + } + else + { + // declare a variable + *os << bt->name () << " " << 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; + } // end else + } + break; + case TAO_CodeGen::TAO_ARGUMENT_CH: + { + // to keep the MSVC++ compiler happy + *os << bt->nested_type_name (bif, "_out") << " "; + } + 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_SH: + default: + { + *os << bt->name () << "_out"; + break; + } + } // 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; + // 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_CH: + { + // to keep the MSVC++ compiler happy + *os << bt->nested_type_name (bif); + } + break; + case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: + { + *os << arg->local_name () << ", "; + } + break; + case TAO_CodeGen::TAO_ARGUMENT_SH: + default: + { + *os << bt->name (); + } + } // 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 () << ";" << + 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_CH: + { + // to keep the MSVC++ compiler happy + *os << bt->nested_type_name (bif) << " &"; + } + break; + case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: + { + *os << arg->local_name () << ", "; + } + break; + case TAO_CodeGen::TAO_ARGUMENT_SH: + default: + { + *os << bt->name () << " &"; + } + } // 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 () << ";" << + 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_CH: + { + // to keep the MSVC++ compiler happy + *os << bt->nested_type_name (bif, "_out") << " "; + } + break; + case TAO_CodeGen::TAO_ARGUMENT_UPCALL_SS: + { + *os << arg->local_name () << ", "; + } + break; + case TAO_CodeGen::TAO_ARGUMENT_SH: + default: + { + *os << bt->name () << "_out"; + } + } // 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 new file mode 100644 index 00000000000..9cde1ac08d7 --- /dev/null +++ b/TAO/TAO_IDL/be/be_state_array.cpp @@ -0,0 +1,118 @@ +// ============================================================================ +// +// = 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; + } + return 0; +} diff --git a/TAO/TAO_IDL/be/be_state_attribute.cpp b/TAO/TAO_IDL/be/be_state_attribute.cpp new file mode 100644 index 00000000000..aa85a7a7842 --- /dev/null +++ b/TAO/TAO_IDL/be/be_state_attribute.cpp @@ -0,0 +1,35 @@ +// ============================================================================ +// +// = 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) +{ + // Macro to avoid "warning: unused parameter" type warning. + ACE_UNUSED_ARG (bt); + ACE_UNUSED_ARG (d); + ACE_UNUSED_ARG (type); + + return 0; +} diff --git a/TAO/TAO_IDL/be/be_state_operation.cpp b/TAO/TAO_IDL/be/be_state_operation.cpp new file mode 100644 index 00000000000..f48cca18c98 --- /dev/null +++ b/TAO/TAO_IDL/be/be_state_operation.cpp @@ -0,0 +1,601 @@ +// ============================================================================ +// +// = 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 ();" << nl; + } + 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 << bt->name () << "_ptr retval;"; // callee + // allocates + // some stupid problems arising out of casting to the bt->name type + *os << "CORBA::Object_ptr retval;" << nl; // callee allocates + } + break; + case TAO_CodeGen::TAO_OPERATION_RETVAL_ASSIGN_SS: + { + *os << "retval"; // assign to retval + } + 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;" << nl; + } + else if (bpd->pt () == AST_PredefinedType::PT_pseudo) + { + // pseudo object, return a pointer + *os << "return 0;" << nl; + } + else if (bpd->pt () == AST_PredefinedType::PT_void) + { + *os << "return;" << nl; + } + else + { + *os << "return retval;" << nl; + } + } + 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;" << 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; + 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;" << nl; + } + 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;" << nl; + } + else + { + *os << "char *retval;" << nl; + } + } + break; + case TAO_CodeGen::TAO_OPERATION_RETVAL_ASSIGN_SS: + { + *os << "retval"; + } + 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;" << nl; + } + 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_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;" << nl; + } + 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;" << nl; + } + break; + case TAO_CodeGen::TAO_OPERATION_RETVAL_ASSIGN_SS: + { + *os << "retval"; + } + 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;" << nl; + } + 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_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;" << nl; + } + else + { + *os << "return retval;" << nl; + } + } + 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_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; + } // 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 new file mode 100644 index 00000000000..1a2de492205 --- /dev/null +++ b/TAO/TAO_IDL/be/be_state_sequence.cpp @@ -0,0 +1,171 @@ +// ============================================================================ +// +// = 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) + return -1; + + switch (cg->state ()) + { + case TAO_CodeGen::TAO_SEQUENCE_BASE_CH: + case TAO_CodeGen::TAO_SEQUENCE_BODY_CH: + os = cg->client_header (); // get client header stream + break; + case TAO_CodeGen::TAO_SEQUENCE_BASE_CS: + case TAO_CodeGen::TAO_SEQUENCE_BODY_CS: + os = cg->client_stubs (); // get client stubs stream + break; + case TAO_CodeGen::TAO_SEQUENCE_BASE_CI: + case TAO_CodeGen::TAO_SEQUENCE_BODY_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 typedef occurs + be_decl *scope = + be_decl::narrow_from_decl (ScopeAsDecl (bt->defined_in ())); + + // 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_string: // type is a string + { + switch (cg->state ()) + { + case TAO_CodeGen::TAO_SEQUENCE_BASE_CH: + case TAO_CodeGen::TAO_SEQUENCE_BASE_CS: + case TAO_CodeGen::TAO_SEQUENCE_BASE_CI: + break; + case TAO_CodeGen::TAO_SEQUENCE_BODY_CH: + *os << bt->nested_type_name (scope, "_var"); + break; + case TAO_CodeGen::TAO_SEQUENCE_BODY_CS: + case TAO_CodeGen::TAO_SEQUENCE_BODY_CI: + default: + *os << bt->name () << "_var"; + } + } + break; + 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_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: + break; + case TAO_CodeGen::TAO_SEQUENCE_BODY_CH: + *os << bt->nested_type_name (scope, ""); + break; + case TAO_CodeGen::TAO_SEQUENCE_BODY_CS: + case TAO_CodeGen::TAO_SEQUENCE_BODY_CI: + default: + *os << bt->name (); + } + } + 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) + { + return -1; + } + } + break; + case TAO_CodeGen::TAO_SEQUENCE_BASE_CS: + { + // generate the base type sequence + if (bt->gen_client_stubs () == -1) + { + return -1; + } + } + break; + case TAO_CodeGen::TAO_SEQUENCE_BASE_CI: + { + // generate the base type sequence + if (bt->gen_client_inline () == -1) + { + return -1; + } + } + break; + case TAO_CodeGen::TAO_SEQUENCE_BODY_CH: + *os << bt->nested_type_name (scope, ""); + break; + case TAO_CodeGen::TAO_SEQUENCE_BODY_CS: + case TAO_CodeGen::TAO_SEQUENCE_BODY_CI: + default: + *os << bt->name (); + } + } + 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; + } // 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 new file mode 100644 index 00000000000..0d5e3500286 --- /dev/null +++ b/TAO/TAO_IDL/be/be_state_structure.cpp @@ -0,0 +1,128 @@ +// ============================================================================ +// +// = 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_ch::be_state_struct_ch (void) +{ +} + +// generate code for structure member +int +be_state_struct_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_field *f; // field node + be_structure *bs; // enclosing structure node + + // Macro to avoid "warning: unused parameter" type warning. + ACE_UNUSED_ARG (nl); + + os = cg->client_header (); // get client header stream + f = be_field::narrow_from_decl (d); // downcast to field node + if (!f) + return -1; + + bs = be_structure::narrow_from_scope (f->defined_in ()); + if (bs == NULL) + return -1; + + // pass the field node just incase it is needed + 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. 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 + *os << bt->nested_type_name (bs, "_var") << " " << f->local_name () << + ";\n\n"; + } + break; + case AST_Decl::NT_pre_defined: // type is predefined type + { + os->indent (); // start from current indentation + *os << bt->nested_type_name (bs) << " " << f->local_name () << ";\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) + { + *os << bt->nested_type_name (bs, "_var") << " " << f->local_name () << ";\n\n"; + } + else + { + *os << "CORBA::String_var " << f->local_name () << ";\n\n"; + } + } + 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 + { + // 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) + if (bt->gen_client_header () == -1) + return -1; + + os->indent (); + *os << bt->nested_type_name (bs) << " " << f->local_name () << ";\n\n"; + } + 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; + } + // the enclosing structure will be variable length the field 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 new file mode 100644 index 00000000000..41f633ef0ac --- /dev/null +++ b/TAO/TAO_IDL/be/be_state_typedef.cpp @@ -0,0 +1,321 @@ +// ============================================================================ +// +// = 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; + + // pass the typedef node, just in case it is needed + cg->node (tdef); + + scope = be_decl::narrow_from_decl (ScopeAsDecl (tdef->defined_in ())); + + 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 + if (bt->node_type () != AST_Decl::NT_typedef) + { + if (bt->gen_client_header () == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, + "be_state_typedef - array gen failed\n"), -1); + } + } + os->indent (); + *os << "typedef " << bt->name () << " " << d->local_name () << + ";" << nl; + *os << "typedef " << bt->name () << "_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 << d->name () << "_slice* " << d->local_name () << + "_alloc (void);" << nl; + if (d->is_nested ()) + *os << "static "; + *os << d->name () << "_slice* " << d->local_name () << "_dup (" + << d->name () << "_slice* " << ");" << nl; + if (d->is_nested ()) + *os << "static "; + *os << "void " << d->name () << "_free (" << d->name () << + "_slice *);\n\n"; + } + 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; + } // 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 new file mode 100644 index 00000000000..a97ec5fc2e7 --- /dev/null +++ b/TAO/TAO_IDL/be/be_state_union.cpp @@ -0,0 +1,855 @@ +// ============================================================================ +// +// = 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) + 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); + + 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) + return -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) + return -1; + temp = t->primitive_base_type (); + return this->gen_code (t, d, temp); + } + break; + } // 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) + 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); + + 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) + return -1; + + bu = be_union::narrow_from_scope (ub->defined_in ()); + if (bu == NULL) + return -1; + + // pass the union branch node just incase it is needed + cg->node (ub); + + 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 + *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 + case AST_Decl::NT_enum: // type is an enum + { + // 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) + return -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) + return -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) + return -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); + } + break; + } // 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) + return -1; + + bu = be_union::narrow_from_scope (ub->defined_in ()); + if (bu == NULL) + 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); + + 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 + { + // 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; + + // return const char* + if (bt->node_type () == AST_Decl::NT_typedef) + { + *os << "ACE_INLINE " << 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 + { + 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 + { + 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); + } + break; + } // end of switch + + 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_NL nl; // end line + TAO_CodeGen *cg = TAO_CODEGEN::instance (); + be_union_branch *ub; // union branch member + be_union *bu; // enclosing union + + // Macro to avoid "warning: unused parameter" type warning. + ACE_UNUSED_ARG (nl); + + os = cg->client_header (); // get client header stream + ub = be_union_branch::narrow_from_decl (d); // downcast to union branch node + if (!ub) + return -1; + + bu = be_union::narrow_from_scope (ub->defined_in ()); + if (bu == NULL) + 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); + + // 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 + 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); + } + break; + } // end of switch + return 0; +} |