Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / TAO_IDL / be_include / be_identifier_helper.h
blob9a3e8e1d00a1001bb8f4bd7d27517852057adda4
2 /* -*- c++ -*- */
3 //=============================================================================
4 /**
5 * @file be_identifier_helper.h
7 * Utilities associated with UTL_Identifier.
9 * @author Jeff Parsons <j.parsons@vanderbilt.edu>
11 //=============================================================================
14 #ifndef BE_IDENTIFIER_HELPER_H
15 #define BE_IDENTIFIER_HELPER_H
17 #include "utl_scoped_name.h"
19 #if !defined (ACE_LACKS_PRAGMA_ONCE)
20 # pragma once
21 #endif /* ACE_LACKS_PRAGMA_ONCE */
23 #include "TAO_IDL_BE_Export.h"
24 #include "ace/SString.h"
26 class Identifier;
27 class be_type;
28 class be_visitor;
30 /**
31 * 1) keeps escape (leading underscore character in generated identifier in IDL
32 * 2) removes the '_' escape character when the identifier is
33 * part of another identifier such as in provides_XXX
34 * 3) removes any '_cxx_' in generated IDL
36 struct TAO_IDL_BE_Export IdentifierHelper
38 static const char *
39 type_name (be_type *t, be_visitor *visitor);
41 static Identifier *
42 original_local_name (Identifier * local_name);
44 // Removes '_cxx_ from segments of a scoped name, and optionally
45 // de-escape the last segment, if it's to be appended to.
46 static ACE_CString
47 orig_sn (UTL_ScopedName * scoped_name, bool for_idl = true);
49 // Detects case-insensitive match with IDL keyword.
50 static bool
51 is_idl_keyword (Identifier * local_name);
53 // Preserves the 'escape' (leading underscore) in a
54 // generated identifier if necessary.
55 static ACE_CString
56 try_escape (Identifier * local_name);
58 static ACE_CString tmp_retval_;
61 #endif /* BE_IDENTIFIER_HELPER_H */