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