summaryrefslogtreecommitdiff
path: root/TAO/TAO_IDL/be/be_visitor_typecode/struct_typecode.cpp
diff options
context:
space:
mode:
authorOssama Othman <ossama-othman@users.noreply.github.com>2005-04-07 07:09:04 +0000
committerOssama Othman <ossama-othman@users.noreply.github.com>2005-04-07 07:09:04 +0000
commit8319a669fba764e5cdde95e2dcb176064742beab (patch)
tree454c6cbc3188e14623aa55ee6e08ee4006de2ff7 /TAO/TAO_IDL/be/be_visitor_typecode/struct_typecode.cpp
parent343568aeefd140dc5811005ec2beb0aa5fc9fd57 (diff)
downloadATCD-8319a669fba764e5cdde95e2dcb176064742beab.tar.gz
ChangeLogTag:Thu Apr 7 00:05:22 2005 Ossama Othman <ossama@dre.vanderbilt.edu>
Diffstat (limited to 'TAO/TAO_IDL/be/be_visitor_typecode/struct_typecode.cpp')
-rw-r--r--TAO/TAO_IDL/be/be_visitor_typecode/struct_typecode.cpp45
1 files changed, 39 insertions, 6 deletions
diff --git a/TAO/TAO_IDL/be/be_visitor_typecode/struct_typecode.cpp b/TAO/TAO_IDL/be/be_visitor_typecode/struct_typecode.cpp
index c30c8bee68a..bab39ebf858 100644
--- a/TAO/TAO_IDL/be/be_visitor_typecode/struct_typecode.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_typecode/struct_typecode.cpp
@@ -17,15 +17,48 @@
TAO::be_visitor_struct_typecode::be_visitor_struct_typecode (
- be_visitor_context * ctx,
- bool is_exception)
- : be_visitor_typecode_defn (ctx),
- is_exception_ (is_exception)
+ be_visitor_context * ctx)
+ : be_visitor_typecode_defn (ctx)
+ , in_recursion_ (false)
{
}
int
-TAO::be_visitor_struct_typecode::visit_structure (AST_Structure * node)
+TAO::be_visitor_struct_typecode::visit_structure (be_structure * node)
+{
+ if (this->in_recursion_)
+ {
+ // Nothing to do yet.
+
+ /**
+ * @todo Merge recursive struct TypeCode generation code.
+ */
+ return 0;
+ }
+ else
+ {
+ this->in_recursion_ = true;
+ }
+
+ static bool const is_exception = false;
+
+ return this->visit (node, is_exception);
+}
+
+int
+TAO::be_visitor_struct_typecode::visit_exception (be_exception * node)
+{
+ // No need to check for recursion since exceptions are never
+ // recursive.
+
+ static bool const is_exception = true;
+
+ return this->visit (node, is_exception);
+}
+
+int
+TAO::be_visitor_struct_typecode::visit (AST_Structure * node,
+ bool is_exception)
{
TAO_OutStream & os = *this->ctx_->stream ();
@@ -75,7 +108,7 @@ TAO::be_visitor_struct_typecode::visit_structure (AST_Structure * node)
<< " TAO::Null_RefCount_Policy>"
<< be_idt_nl
<< "_tao_tc_" << node->flat_name () << " (" << be_idt_nl
- << "CORBA::tk_" << (this->is_exception_ ? "except" : "struct") << ","
+ << "CORBA::tk_" << (is_exception ? "except" : "struct") << ","
<< be_nl
<< "\"" << node->repoID () << "\"," << be_nl
<< "\"" << node->original_local_name () << "\"," << be_nl