#ifndef __cmt_parser_h__
#define __cmt_parser_h__

/*
  Generation of shell scripts :
  We consider for the moment only csh and sh
  */
typedef enum
{
  Csh,
  Sh,
  Bat,
  Make
} PrintMode;

typedef enum
{
  mgr_style,
  cmt_style,
  none_style
} CmtDirStyle;

/*
  Commands correspond to keywords in the requirements file.
  */
typedef enum
{
  CommandNone,
  CommandAlias,            /* alias            */
  CommandApplication,      /* application      */
  CommandApplyPattern,     /* apply_pattern    */
  CommandAuthor,           /* author           */
  CommandBranches,         /* branch           */
  CommandBuildStrategy,    /* build strategy   */
  CommandCleanupScript,    /* user script      */
  CommandDocument,         /* document         */
  CommandIgnorePattern,    /* ignore_pattern   */
  CommandIncludeDirs,      /* include_dirs     */
  CommandIncludePath,      /* include_path     */
  CommandLanguage,         /* language         */
  CommandLibrary,          /* library          */
  CommandMacro,            /* macro            */
  CommandMacroPrepend,     /* +macro           */
  CommandMacroAppend,      /* macro+           */
  CommandMacroRemove,      /* macro-           */
  CommandMacroRemoveAll,   /* macro--          */
  CommandMakeFragment,     /* make_fragment    */
  CommandManager,          /* package manager  */
  CommandPackage,          /* package name     */
  CommandPath,             /* package path     */
  CommandPathAppend,       /* path             */
  CommandPathPrepend,      /* path             */
  CommandPathRemove,       /* path             */
  CommandPattern,          /* pattern          */
  CommandPrivate,          /* private          */
  CommandPublic,           /* public           */
  CommandSet,              /* set              */
  CommandSetAppend,        /* set_append       */
  CommandSetPrepend,       /* set_prepend      */
  CommandSetRemove,        /* set_remove       */
  CommandSetupScript,      /* user script      */
  CommandTag,              /* tag              */
  CommandTagExclude,       /* tag_exclude      */
  CommandUse,              /* use              */
  CommandVersion,          /* package version  */
  CommandVersionStrategy,  /* version strategy */
  Commands
} CommandType;

/*
  The scope is modified while the requirements file is read
  when the keywords public or private are met.
  It is also set to public when a used requirements file is read.
  */

typedef enum
{
  DeveloperMode,
  UserMode
} AccessMode;

typedef enum
{
  ScopeUnspecified,
  ScopePublic,
  ScopePrivate
} ScopeType;

typedef enum
{
  Unspecified = -1,
  Off = 0,
  On = 1
} State;

typedef enum
{
  PriorityLowest = 0,
  PriorityDefault = 1,
  PriorityUname = 2,
  PrioritySite = 3,
  PriorityUserTag = 4,
  PriorityTag = 5,
  PriorityConfig = 6,
  PriorityArgument = 7
} Priority;

typedef enum
{
  SetupScript,
  CleanupScript
} ScriptType;

typedef enum
{
  BestFit,            // The current default
  BestFitNoCheck,     // The current default without compatibility check
  FirstChoice,        // The first reference will not be overridden
  LastChoice,         // The last reference wins
  KeepAll,            // Keep all uses

  Strategies
} VersionStrategy;

//
// Build strategy is a mix of various options
//  + predefined values should be multiples of 2^n
//  + effective value is an OR of these options
//  + all options should be specified inthis enum as pairs
//    of <option> - no<option>. One of them being preset to zero
//    (which represents the default) the other being set to a unique 2^n value.
//
typedef enum
{
  PrototypesMask = 0x1,
  Prototypes = 0x0,
  NoPrototypes = PrototypesMask,

  KeepMakefilesMask = 0x2,
  RebuildMakefiles = 0x0,
  KeepMakefiles = KeepMakefilesMask,

  DefaultBuildStrategy = Prototypes | RebuildMakefiles
} BuildStrategy;

typedef enum
{
  Application,
  Library,
  Document
} ConstituentType;

/*
  Command line action
  */
typedef enum
{
  action_none,
  action_awk,
  action_broadcast,

  action_build_constituent_makefile,
  action_build_constituents_makefile,
  action_build_dependencies,
  action_build_library_links,
  action_build_make_setup,
  action_build_msdev,
  action_build_os9_makefile,
  action_build_prototype,
  action_build_readme,
  action_build_tag_makefile,
  action_build_temporary_name,
  action_build_triggers,
  action_build_windefs,

  action_check_configuration,
  action_check_files,
  action_check_version,
  action_checkout,          // HSG - add to handle the checkout command
  action_cleanup,
  action_config,
  action_create,
  action_cvsbranches,
  action_cvssubpackages,
  action_cvstags,
  action_expand_model,
  action_filter,            // CA  - handle free text filtering
  action_help,
  action_load,
  action_lock,
  action_remove,
  action_remove_library_links,
  action_run,
  action_run_sequence,
  action_setup,

  action_show_all_tags,
  action_show_applied_patterns,
  action_show_author,                // s a
  action_show_branches,              // s b
  action_show_clients,               // s cl
  action_show_constituent,
  action_show_constituent_names,     // s c...
  action_show_constituents,          // s c...
  action_show_fragment,              // s f
  action_show_fragments,             // s fragments
  action_show_groups,                // s groups
  action_show_include_dirs,
  action_show_language,              // s l
  action_show_languages,             // s languages
  action_show_macro,                 // s m
  action_show_macro_names,
  action_show_macro_value,           // s macro_value
  action_show_macros,                // s macros
  action_show_manager,               // s manager
  action_show_packages,              // s packages
  action_show_path,                  // s path
  action_show_pattern,
  action_show_pattern_names,
  action_show_patterns,
  action_show_pwd,                   // s pwd
  action_show_set,                   // s s
  action_show_set_names,
  action_show_set_value,             // s set_value
  action_show_sets,                  // s sets
  action_show_strategies,            // s strategies
  action_show_tags,                  // s tags
  action_show_uses,                  // s u
  action_show_version,               // s version
  action_show_versions,              // s versions

  action_system,
  action_unlock,
  action_version
} ActionType;

#define SLASH '/'

class Use;
typedef Use* UseRef;

#include "cmt_std.h"
#include "cmt_string.h"
#include "cmt_vector.h"
#include "cmt.h"

#endif
