summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2004-06-30 16:59:22 +0000
committerparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2004-06-30 16:59:22 +0000
commit1e3c517574a1e0bfc50f897c1ecbc53001d2a986 (patch)
tree4654c4c86fd47fd053f2d8111ec2753a3a006070
parent46b51e9ad4ed4364031f8ca72ab640b391105fae (diff)
downloadATCD-1e3c517574a1e0bfc50f897c1ecbc53001d2a986.tar.gz
ChangeLogTag: Wed Jun 30 11:55:46 2004 Jeff Parsons <j.parsons@vanderbilt.edu>
-rw-r--r--TAO/ChangeLog11
-rw-r--r--TAO/TAO_IDL/ast/ast_root.cpp22
-rw-r--r--TAO/TAO_IDL/include/ast_root.h2
-rw-r--r--TAO/TAO_IDL/include/utl_scope.h2
4 files changed, 36 insertions, 1 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index 3d9387479ef..c8f615711e7 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,3 +1,14 @@
+Wed Jun 30 11:55:46 2004 Jeff Parsons <j.parsons@vanderbilt.edu>
+
+ * TAO_IDL/ast/ast_root.cpp:
+ * TAO_IDLinclude/ast_root.h:
+ * TAO_IDLinclude/utl_scope.h:
+
+ Made the nmembers() method of UTL_Scope virtual and
+ added an override in AST_Root, so we can get a member
+ count of the global scope without the predefined types
+ and other keyword entries that are added at startup.
+
Wed Jun 30 06:50:37 2004 Jeff Parsons <j.parsons@vanderbilt.edu>
* orbsvcs/IFR_Service/IFR_Service.mpc:
diff --git a/TAO/TAO_IDL/ast/ast_root.cpp b/TAO/TAO_IDL/ast/ast_root.cpp
index 48faea6e113..843c6d42e43 100644
--- a/TAO/TAO_IDL/ast/ast_root.cpp
+++ b/TAO/TAO_IDL/ast/ast_root.cpp
@@ -103,6 +103,28 @@ AST_Root::~AST_Root (void)
{
}
+// Overrides the one in UTL_Scope - this one doesn't
+// count the predefined types.
+unsigned long
+AST_Root::nmembers (void)
+{
+ unsigned long retval = 0;
+
+ for (UTL_ScopeActiveIterator si (this, UTL_Scope::IK_decls);
+ !si.is_done ();
+ si.next ())
+ {
+ if (si.item ()->node_type () == AST_Decl::NT_pre_defined)
+ {
+ continue;
+ }
+
+ ++retval;
+ }
+
+ return retval;
+}
+
// Add this AST_Sequence to the locally defined types in this scope.
AST_Sequence *
AST_Root::fe_add_sequence (AST_Sequence *t)
diff --git a/TAO/TAO_IDL/include/ast_root.h b/TAO/TAO_IDL/include/ast_root.h
index f8bbacdfa57..d4779ba367a 100644
--- a/TAO/TAO_IDL/include/ast_root.h
+++ b/TAO/TAO_IDL/include/ast_root.h
@@ -79,6 +79,8 @@ public:
AST_Root (UTL_ScopedName *n);
virtual ~AST_Root (void);
+
+ virtual unsigned long nmembers (void);
// Narrowing.
DEF_NARROW_METHODS1(AST_Root, AST_Module);
diff --git a/TAO/TAO_IDL/include/utl_scope.h b/TAO/TAO_IDL/include/utl_scope.h
index e3628846478..3c27c937b50 100644
--- a/TAO/TAO_IDL/include/utl_scope.h
+++ b/TAO/TAO_IDL/include/utl_scope.h
@@ -244,7 +244,7 @@ public:
virtual AST_Decl *look_in_previous (Identifier *);
// How many entries are used?
- unsigned long nmembers (void);
+ virtual unsigned long nmembers (void);
// Add to decls. Node represents a local declaration
// The new decl e is inserted after ex if ex is not 0.