Use =default for skeleton copy constructor
[ACE_TAO.git] / TAO / TAO_IDL / include / fe_utils.h
blobfddc6e5202d166a293ad45d8b4266cd4b3032810
1 #ifndef FE_UTILS_H
2 #define FE_UTILS_H
4 #include "ace/Unbounded_Queue.h"
6 #include "ast_decl.h"
7 #include "ast_expression.h"
8 #include "ast_predefined_type.h"
10 class UTL_StrList;
11 class UTL_IdList;
12 typedef UTL_IdList UTL_ScopedName;
13 class UTL_NameList;
14 class AST_PortType;
15 class AST_Enum;
16 class AST_Component;
17 class AST_Uses;
18 class AST_Template_Module;
20 struct TAO_IDL_FE_Export FE_Utils
22 struct T_Param_Info
24 AST_Decl::NodeType type_;
25 AST_Expression::ExprType const_type_;
26 AST_Enum *enum_const_type_decl_;
27 ACE_CString name_;
28 ACE_CString seq_param_ref_;
30 T_Param_Info ();
33 typedef ACE_Unbounded_Queue<T_Param_Info> T_PARAMLIST_INFO;
35 static bool duplicate_param_id (T_PARAMLIST_INFO *params);
37 struct T_ARGLIST : ACE_Unbounded_Queue<AST_Decl *>
39 void destroy ();
42 /// Convert from a predefined type to an expression type.
43 static AST_Expression::ExprType
44 PredefinedTypeToExprType (AST_PredefinedType::PredefinedType);
46 /// Convert from an expression type to a predefined type.
47 static AST_PredefinedType::PredefinedType
48 ExprTypeToPredefinedType (AST_Expression::ExprType);
50 /// Parses a string with double colons. Caller owns return
51 /// value.
52 static UTL_ScopedName *
53 string_to_scoped_name (const char *s);
55 /// Takes an #include filename generated by the preprocessor, and
56 /// strips off any command line -I prefix that may have been
57 /// prepended.
58 static const char *
59 stripped_preproc_include (const char *name);
61 /// We must do this in the front end since the executor
62 /// mapping IDL will have these data types.
63 static void
64 create_uses_multiple_stuff (AST_Component *c,
65 AST_Uses *u,
66 const char *prefix = "");
68 /// For the executor IDL file, when a pragma ciao ami receptacle
69 /// name is multiplex.
70 static void
71 create_implied_ami_uses_stuff ();
73 /// Case insensitive for Windows, otherwise not.
74 static int
75 path_cmp (const char *s, const char *t);
77 /// To tell if we have to handle a Windows path with spaces.
78 static bool
79 hasspace (const char *s);
81 /// Check if 'param' is a sequence of a previous param, and if
82 /// so, if the previous param exists.
83 static ACE_CString
84 check_for_seq_of_param (FE_Utils::T_PARAMLIST_INFO *list);
86 /// Attempt to open file for reading until it is found in one of the
87 /// supplied include paths. If the file was successfully opened, the
88 /// directory within which it was found is returned as well.
89 static FILE *
90 open_included_file (char const * filename,
91 char const *& directory);
93 static bool
94 is_include_file_found (ACE_CString & inc_file,
95 UTL_String * idl_file_name);
97 /// Validate the included idl files, somefiles might have been
98 /// ignored by the preprocessor.
99 static void
100 validate_included_idl_files ();
102 /// Check if included file is in TAO specific include dirs.
103 static bool
104 validate_orb_include (UTL_String *);
106 /// Strips _cxx_ prefix for use in port names.
107 static void
108 original_local_name (Identifier *local_name);
110 /// Types, constants and exceptions can be redefined in
111 /// derived interfaces, modules may be reopened, forward
112 /// declarations may be repeated, etc.
113 static bool
114 can_be_redefined (AST_Decl *prev_dec,
115 AST_Decl *curr_decl);
117 /// Called any time there is a possible error from
118 /// referencing a decl contained in a template module,
119 /// but not via an alias.
120 static void
121 tmpl_mod_ref_check (AST_Decl *context,
122 AST_Decl *ref);
124 private:
125 static bool
126 check_one_seq_of_param (FE_Utils::T_PARAMLIST_INFO *list,
127 ACE_CString &param_id,
128 size_t index);
130 static AST_Template_Module *
131 get_tm_container (AST_Decl *contained);
134 #endif /* FE_UTILS_H */