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