1 | //----------------------------------------------------------- |
---|
2 | // Copyright Christian Arnault LAL-Orsay CNRS |
---|
3 | // arnault@lal.in2p3.fr |
---|
4 | // Modified by garonne@lal.in2p3.fr |
---|
5 | // See the complete license in cmt_license.txt "http://www.cecill.info". |
---|
6 | //----------------------------------------------------------- |
---|
7 | |
---|
8 | #ifndef __cmt_parser_h__ |
---|
9 | #define __cmt_parser_h__ |
---|
10 | |
---|
11 | /* |
---|
12 | Generation of shell scripts : |
---|
13 | We consider for the moment only csh and sh |
---|
14 | */ |
---|
15 | typedef enum |
---|
16 | { |
---|
17 | Csh, |
---|
18 | Sh, |
---|
19 | Bat, |
---|
20 | Make, |
---|
21 | Requirements, |
---|
22 | Xml |
---|
23 | } PrintMode; |
---|
24 | |
---|
25 | typedef enum |
---|
26 | { |
---|
27 | mgr_style, |
---|
28 | cmt_style, |
---|
29 | // no_version_style, |
---|
30 | none_style |
---|
31 | } CmtDirStyle; |
---|
32 | |
---|
33 | typedef enum |
---|
34 | { |
---|
35 | default_structuring_style, |
---|
36 | with_version_directory, |
---|
37 | without_version_directory |
---|
38 | } CmtStructuringStyle; |
---|
39 | |
---|
40 | typedef enum |
---|
41 | { |
---|
42 | default_filtering_mode, |
---|
43 | block_private_uses, |
---|
44 | reach_private_uses |
---|
45 | } CmtScopeFilteringMode; |
---|
46 | |
---|
47 | /* |
---|
48 | Commands correspond to keywords in the requirements file. |
---|
49 | */ |
---|
50 | typedef enum |
---|
51 | { |
---|
52 | CommandNone, |
---|
53 | CommandAction, |
---|
54 | CommandAlias, |
---|
55 | CommandApplication, |
---|
56 | CommandApplyPattern, |
---|
57 | CommandApplyTag, |
---|
58 | CommandAuthor, |
---|
59 | CommandBranches, |
---|
60 | CommandBuildStrategy, |
---|
61 | CommandCleanupScript, |
---|
62 | CommandCmtPathPattern, |
---|
63 | CommandDocument, |
---|
64 | CommandEndPrivate, |
---|
65 | CommandEndPublic, |
---|
66 | CommandIgnorePattern, |
---|
67 | CommandIncludeDirs, |
---|
68 | CommandIncludePath, |
---|
69 | CommandLanguage, |
---|
70 | CommandLibrary, |
---|
71 | CommandMacro, |
---|
72 | CommandMacroPrepend, |
---|
73 | CommandMacroAppend, |
---|
74 | CommandMacroRemove, |
---|
75 | CommandMacroRemoveRegexp, |
---|
76 | CommandMacroRemoveAll, |
---|
77 | CommandMacroRemoveAllRegexp, |
---|
78 | CommandMakeFragment, |
---|
79 | CommandManager, |
---|
80 | CommandPackage, |
---|
81 | CommandPath, |
---|
82 | CommandPathAppend, |
---|
83 | CommandPathPrepend, |
---|
84 | CommandPathRemove, |
---|
85 | CommandPathRemoveRegexp, |
---|
86 | CommandPattern, |
---|
87 | CommandPrivate, |
---|
88 | CommandProject, |
---|
89 | CommandProjectAuthor, |
---|
90 | CommandPublic, |
---|
91 | CommandSet, |
---|
92 | CommandSetAppend, |
---|
93 | CommandSetPrepend, |
---|
94 | CommandSetRemove, |
---|
95 | CommandSetRemoveRegexp, |
---|
96 | CommandSetupScript, |
---|
97 | CommandSetupStrategy, |
---|
98 | CommandStructureStrategy, |
---|
99 | CommandTag, |
---|
100 | CommandTagExclude, |
---|
101 | CommandUse, |
---|
102 | CommandVersion, |
---|
103 | CommandVersionStrategy, |
---|
104 | Commands |
---|
105 | } CommandType; |
---|
106 | |
---|
107 | /* |
---|
108 | The scope is modified while the requirements file is read |
---|
109 | when the keywords public or private are met. |
---|
110 | It is also set to public when a used requirements file is read. |
---|
111 | */ |
---|
112 | |
---|
113 | typedef enum |
---|
114 | { |
---|
115 | DeveloperMode, |
---|
116 | UserMode |
---|
117 | } AccessMode; |
---|
118 | |
---|
119 | typedef enum |
---|
120 | { |
---|
121 | ScopeUnspecified, |
---|
122 | ScopePublic, |
---|
123 | ScopePrivate |
---|
124 | } ScopeType; |
---|
125 | |
---|
126 | typedef enum |
---|
127 | { |
---|
128 | Unspecified = -1, |
---|
129 | Off = 0, |
---|
130 | On = 1 |
---|
131 | } State; |
---|
132 | |
---|
133 | typedef enum |
---|
134 | { |
---|
135 | PriorityLowest = 0, |
---|
136 | PriorityDefault = 1, |
---|
137 | PriorityVersion = 2, |
---|
138 | PriorityUname = 3, |
---|
139 | PrioritySite = 4, |
---|
140 | PriorityUserTag = 5, |
---|
141 | PriorityTag = 6, |
---|
142 | PriorityConfig = 7, |
---|
143 | PriorityArgument = 8 |
---|
144 | } Priority; |
---|
145 | |
---|
146 | typedef enum |
---|
147 | { |
---|
148 | SetupScript, |
---|
149 | CleanupScript |
---|
150 | } ScriptType; |
---|
151 | |
---|
152 | // |
---|
153 | // Build strategy is a mix of various options |
---|
154 | // + predefined values should be multiples of 2^n |
---|
155 | // + effective value is an OR of these options |
---|
156 | // + all options should be specified inthis enum as pairs |
---|
157 | // of <option> - no<option>. One of them being preset to zero |
---|
158 | // (which represents the default) the other being set to a unique 2^n value. |
---|
159 | // |
---|
160 | typedef enum |
---|
161 | { |
---|
162 | Prototypes = 0x1, |
---|
163 | NoPrototypes = Prototypes << 1, |
---|
164 | DefaultPrototypesStrategy = Prototypes, |
---|
165 | PrototypesMask = Prototypes | NoPrototypes, |
---|
166 | |
---|
167 | WithInstallArea = NoPrototypes << 1, |
---|
168 | WithoutInstallArea = WithInstallArea << 1, |
---|
169 | DefaultInstallAreaStrategy = WithoutInstallArea, |
---|
170 | InstallAreaMask = WithInstallArea | WithoutInstallArea, |
---|
171 | |
---|
172 | BuildStrategyMask = PrototypesMask | InstallAreaMask, |
---|
173 | |
---|
174 | DefaultBuildStrategy = DefaultPrototypesStrategy | DefaultInstallAreaStrategy |
---|
175 | } BuildStrategy; |
---|
176 | |
---|
177 | typedef enum |
---|
178 | { |
---|
179 | SetupConfig = 0x1, |
---|
180 | SetupNoConfig = SetupConfig << 1, |
---|
181 | SetupConfigMask = SetupConfig | SetupNoConfig, |
---|
182 | |
---|
183 | SetupRoot = SetupNoConfig << 1, |
---|
184 | SetupNoRoot = SetupRoot << 1, |
---|
185 | SetupRootMask = SetupRoot | SetupNoRoot, |
---|
186 | |
---|
187 | SetupCleanup = SetupNoRoot << 1, |
---|
188 | SetupNoCleanup = SetupCleanup << 1, |
---|
189 | SetupCleanupMask = SetupCleanup | SetupNoCleanup, |
---|
190 | |
---|
191 | SetupStrategyMask = SetupConfigMask | SetupRootMask | SetupCleanupMask, |
---|
192 | |
---|
193 | DefaultSetupStrategy = SetupConfig | SetupRoot | SetupCleanup |
---|
194 | } SetupStrategy; |
---|
195 | |
---|
196 | typedef enum |
---|
197 | { |
---|
198 | WithVersionDirectory = 0x1, |
---|
199 | WithoutVersionDirectory = WithVersionDirectory << 1, |
---|
200 | DefaultVersionDirectoryStrategy = WithVersionDirectory, |
---|
201 | VersionDirectoryMask = WithVersionDirectory | WithoutVersionDirectory, |
---|
202 | |
---|
203 | StructureStrategyMask = VersionDirectoryMask, |
---|
204 | |
---|
205 | DefaultStructureStrategy = DefaultVersionDirectoryStrategy |
---|
206 | } StructureStrategy; |
---|
207 | |
---|
208 | typedef enum |
---|
209 | { |
---|
210 | Application, |
---|
211 | Library, |
---|
212 | Document |
---|
213 | } ConstituentType; |
---|
214 | |
---|
215 | /* |
---|
216 | Command line action |
---|
217 | */ |
---|
218 | typedef enum |
---|
219 | { |
---|
220 | action_none, |
---|
221 | action_awk, |
---|
222 | action_broadcast, |
---|
223 | |
---|
224 | action_build, |
---|
225 | |
---|
226 | action_build_constituent_makefile, |
---|
227 | action_build_constituent_config, |
---|
228 | action_build_constituents_makefile, |
---|
229 | action_build_constituents_config, |
---|
230 | action_build_broadcast_config, |
---|
231 | action_build_dependencies, |
---|
232 | action_build_library_links, |
---|
233 | action_build_make_setup, |
---|
234 | action_build_msdev, |
---|
235 | action_build_CMT_pacman, |
---|
236 | // Visual Studio.net Support |
---|
237 | action_build_vsnet, |
---|
238 | action_build_os9_makefile, |
---|
239 | action_build_prototype, |
---|
240 | action_build_readme, |
---|
241 | action_build_tag_makefile, |
---|
242 | action_build_temporary_name, |
---|
243 | action_build_triggers, |
---|
244 | action_build_windefs, |
---|
245 | |
---|
246 | action_check, |
---|
247 | |
---|
248 | action_check_configuration, |
---|
249 | action_check_files, |
---|
250 | action_check_version, |
---|
251 | action_checkout, |
---|
252 | action_cleanup, |
---|
253 | action_config, |
---|
254 | action_create, |
---|
255 | action_create_project, |
---|
256 | action_cvsbranches, |
---|
257 | action_cvssubpackages, |
---|
258 | action_cvssubprojects, |
---|
259 | action_cvstags, |
---|
260 | action_do, |
---|
261 | action_expand_model, |
---|
262 | action_filter, |
---|
263 | action_help, |
---|
264 | action_load, |
---|
265 | action_lock, |
---|
266 | action_relocate, |
---|
267 | action_remove, |
---|
268 | action_remove_library_links, |
---|
269 | action_run, |
---|
270 | action_run_sequence, |
---|
271 | |
---|
272 | action_set_version, |
---|
273 | action_set_versions, |
---|
274 | |
---|
275 | action_setup, |
---|
276 | |
---|
277 | action_show, |
---|
278 | |
---|
279 | action_show_action, |
---|
280 | action_show_action_value, |
---|
281 | action_show_action_names, |
---|
282 | action_show_actions, |
---|
283 | action_show_all_tags, |
---|
284 | action_show_applied_patterns, |
---|
285 | action_show_author, |
---|
286 | action_show_branches, |
---|
287 | action_show_clients, |
---|
288 | action_show_cmtpath_patterns, |
---|
289 | action_show_constituent, |
---|
290 | action_show_constituent_names, |
---|
291 | action_show_constituents, |
---|
292 | action_show_container, |
---|
293 | action_show_cycles, |
---|
294 | action_show_fragment, |
---|
295 | action_show_fragments, |
---|
296 | action_show_groups, |
---|
297 | action_show_include_dirs, |
---|
298 | action_show_language, |
---|
299 | action_show_languages, |
---|
300 | action_show_macro, |
---|
301 | action_show_macro_value, |
---|
302 | action_show_macro_names, |
---|
303 | action_show_macros, |
---|
304 | action_show_manager, |
---|
305 | action_show_packages, |
---|
306 | action_show_path, |
---|
307 | action_show_pattern, |
---|
308 | action_show_pattern_names, |
---|
309 | action_show_patterns, |
---|
310 | action_show_projects, |
---|
311 | action_show_project_author, |
---|
312 | action_show_setup, |
---|
313 | action_show_pwd, |
---|
314 | action_show_set, |
---|
315 | action_show_set_names, |
---|
316 | action_show_set_value, |
---|
317 | action_show_sets, |
---|
318 | action_show_strategies, |
---|
319 | action_show_tags, |
---|
320 | action_show_use_paths, |
---|
321 | action_show_uses, |
---|
322 | action_show_version, |
---|
323 | action_show_versions, |
---|
324 | |
---|
325 | action_system, |
---|
326 | action_unlock, |
---|
327 | action_version |
---|
328 | } ActionType; |
---|
329 | |
---|
330 | #define SLASH '/' |
---|
331 | |
---|
332 | class Use; |
---|
333 | typedef Use* UseRef; |
---|
334 | |
---|
335 | #include "cmt_std.h" |
---|
336 | #include "cmt_string.h" |
---|
337 | #include "cmt_vector.h" |
---|
338 | #include "cmt.h" |
---|
339 | |
---|
340 | #endif |
---|