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