summaryrefslogtreecommitdiff
path: root/modules/CIAO/tools/IDL3_to_IDL2/identifier_helper.h
diff options
context:
space:
mode:
Diffstat (limited to 'modules/CIAO/tools/IDL3_to_IDL2/identifier_helper.h')
-rw-r--r--modules/CIAO/tools/IDL3_to_IDL2/identifier_helper.h66
1 files changed, 66 insertions, 0 deletions
diff --git a/modules/CIAO/tools/IDL3_to_IDL2/identifier_helper.h b/modules/CIAO/tools/IDL3_to_IDL2/identifier_helper.h
new file mode 100644
index 00000000000..a6a6fcc88df
--- /dev/null
+++ b/modules/CIAO/tools/IDL3_to_IDL2/identifier_helper.h
@@ -0,0 +1,66 @@
+// $Id$
+
+/* -*- c++ -*- */
+// ============================================================================
+//
+// = LIBRARY
+// TAO_IDL3_TO_IDL2_BE_DLL
+//
+// = FILENAME
+// identifier_helper.h
+//
+// = DESCRIPTION
+// Utilities associated with UTL_Identifier.
+//
+// = AUTHOR
+// Jeff Parsons <j.parsons@vanderbilt.edu>
+//
+// ============================================================================
+
+#ifndef IDENTIFIER_HELPER_H
+#define IDENTIFIER_HELPER_H
+
+#include "utl_scoped_name.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "TAO_IDL3_TO_IDL2_BE_Export.h"
+#include "ace/SString.h"
+
+class Identifier;
+
+struct TAO_IDL3_TO_IDL2_BE_Export IdentifierHelper
+{
+ //
+ // = TITLE
+ // IdentifierHelper.
+ //
+ // = DESCRIPTION
+ // 1) keeps escape (leading underscore character in generated
+ // identifier in IDL
+ // 2) removes the '_' escape character when the identifier is
+ // part of another identifier such as in provides_XXX
+ // 3) removes any '_cxx_' in generated IDL
+
+ static Identifier *
+ original_local_name (Identifier * local_name);
+
+ // Removes '_cxx_ from segments of a scoped name, and optionally
+ // de-escape the last segment, if it's to be appended to.
+ static ACE_CString
+ orig_sn (UTL_ScopedName * scoped_name, bool appended_to = false);
+
+ // Detects case-insensitive match with IDL keyword.
+ static bool
+ is_idl_keyword (Identifier * local_name);
+
+ // Preserves the 'escape' (leading underscore) in a
+ // generated identifier if necessary.
+ static ACE_CString
+ try_escape (Identifier * local_name);
+};
+
+#endif /* IDENTIFIER_HELPER_H */
+