summaryrefslogtreecommitdiff
path: root/TAO/TAO_IDL/be/be_scope.cpp
diff options
context:
space:
mode:
authorgokhale <asgokhale@users.noreply.github.com>1997-12-18 21:32:57 +0000
committergokhale <asgokhale@users.noreply.github.com>1997-12-18 21:32:57 +0000
commitecdc0d5ea167eea2eea95e0e2d5c3e77fbd7d753 (patch)
tree0ab83f18abce5c661f58778c9a33bf93044e59d7 /TAO/TAO_IDL/be/be_scope.cpp
parentc511ebf65beb0693e5127f503a27f16d472f02a7 (diff)
downloadATCD-ecdc0d5ea167eea2eea95e0e2d5c3e77fbd7d753.tar.gz
*** empty log message ***
Diffstat (limited to 'TAO/TAO_IDL/be/be_scope.cpp')
-rw-r--r--TAO/TAO_IDL/be/be_scope.cpp73
1 files changed, 72 insertions, 1 deletions
diff --git a/TAO/TAO_IDL/be/be_scope.cpp b/TAO/TAO_IDL/be/be_scope.cpp
index 4b653b0a2a1..e25ddf47fc5 100644
--- a/TAO/TAO_IDL/be/be_scope.cpp
+++ b/TAO/TAO_IDL/be/be_scope.cpp
@@ -7,12 +7,14 @@
// Default Constructor
be_scope::be_scope (void)
+ : comma_ (0)
{
}
// Constructor
be_scope::be_scope (AST_Decl::NodeType type)
- : UTL_Scope (type)
+ : UTL_Scope (type),
+ comma_ (0)
{
}
@@ -21,12 +23,20 @@ be_scope::~be_scope (void)
}
// Code generation methods
+void
+be_scope::comma (unsigned short comma)
+{
+ this->comma_ = comma;
+}
+
int
be_scope::gen_client_header (void)
{
UTL_ScopeActiveIterator *si;
AST_Decl *d;
be_decl *bd;
+ TAO_CodeGen *cg = TAO_CODEGEN::instance ();
+ TAO_OutStream *os = cg->client_header (); // output stream
if (this->nmembers () > 0)
{
@@ -73,6 +83,10 @@ be_scope::gen_client_header (void)
}
} // no imported
si->next ();
+ if (!si->is_done () && this->comma_)
+ {
+ *os << ", "; // generate a comma
+ }
} // end of while
delete si; // free the iterator object
}
@@ -85,6 +99,8 @@ be_scope::gen_client_stubs (void)
UTL_ScopeActiveIterator *si;
AST_Decl *d;
be_decl *bd;
+ TAO_CodeGen *cg = TAO_CODEGEN::instance ();
+ TAO_OutStream *os = cg->client_stubs (); // output stream
if (this->nmembers () > 0)
{
@@ -125,6 +141,10 @@ be_scope::gen_client_stubs (void)
}
} // not imported
si->next ();
+ if (!si->is_done () && this->comma_)
+ {
+ *os << ", "; // generate a comma
+ }
} // end of while
delete si; // free the iterator object
}
@@ -137,6 +157,8 @@ be_scope::gen_client_inline (void)
UTL_ScopeActiveIterator *si;
AST_Decl *d;
be_decl *bd;
+ TAO_CodeGen *cg = TAO_CODEGEN::instance ();
+ TAO_OutStream *os = cg->client_inline (); // output stream
if (this->nmembers () > 0)
{
@@ -175,6 +197,10 @@ be_scope::gen_client_inline (void)
}
} // not imported
si->next ();
+ if (!si->is_done () && this->comma_)
+ {
+ *os << ", "; // generate a comma
+ }
} // end of while
delete si; // free the iterator object
}
@@ -187,6 +213,8 @@ be_scope::gen_server_header (void)
UTL_ScopeActiveIterator *si;
AST_Decl *d;
be_decl *bd;
+ TAO_CodeGen *cg = TAO_CODEGEN::instance ();
+ TAO_OutStream *os = cg->server_header (); // output stream
if (this->nmembers () > 0)
{
@@ -227,6 +255,10 @@ be_scope::gen_server_header (void)
}
} // not imported
si->next ();
+ if (!si->is_done () && this->comma_)
+ {
+ *os << ", "; // generate a comma
+ }
} // end of while
delete si; // free the iterator object
}
@@ -239,6 +271,8 @@ be_scope::gen_server_skeletons (void)
UTL_ScopeActiveIterator *si;
AST_Decl *d;
be_decl *bd;
+ TAO_CodeGen *cg = TAO_CODEGEN::instance ();
+ TAO_OutStream *os = cg->server_skeletons (); // output stream
if (this->nmembers () > 0)
{
@@ -278,6 +312,10 @@ be_scope::gen_server_skeletons (void)
}
} // not imported
si->next ();
+ if (!si->is_done () && this->comma_)
+ {
+ *os << ", "; // generate a comma
+ }
} // end of while
delete si; // free the iterator object
}
@@ -290,6 +328,8 @@ be_scope::gen_server_inline (void)
UTL_ScopeActiveIterator *si;
AST_Decl *d;
be_decl *bd;
+ TAO_CodeGen *cg = TAO_CODEGEN::instance ();
+ TAO_OutStream *os = cg->server_inline (); // output stream
if (this->nmembers () > 0)
{
@@ -329,6 +369,10 @@ be_scope::gen_server_inline (void)
}
}
si->next ();
+ if (!si->is_done () && this->comma_)
+ {
+ *os << ", "; // generate a comma
+ }
} // end of while
delete si; // free the iterator object
}
@@ -408,6 +452,33 @@ be_scope::tc_encap_len (void)
return encap_len;
}
+// return the scope created by this node (if one exists, else NULL)
+be_decl *
+be_scope::decl (void)
+{
+ switch (this->scope_node_type())
+ {
+ case AST_Decl::NT_interface:
+ return be_interface::narrow_from_scope (this);
+ case AST_Decl::NT_module:
+ return be_module::narrow_from_scope (this);
+ case AST_Decl::NT_root:
+ return be_root::narrow_from_scope (this);
+ case AST_Decl::NT_except:
+ return be_exception::narrow_from_scope (this);
+ case AST_Decl::NT_union:
+ return be_union::narrow_from_scope (this);
+ case AST_Decl::NT_struct:
+ return be_structure::narrow_from_scope (this);
+ case AST_Decl::NT_enum:
+ return be_enum::narrow_from_scope (this);
+ case AST_Decl::NT_op:
+ return be_operation::narrow_from_scope (this);
+ default:
+ return (be_decl *)0;
+ }
+}
+
// narrowing methods
IMPL_NARROW_METHODS1 (be_scope, UTL_Scope)
IMPL_NARROW_FROM_SCOPE (be_scope)