2013-08-21 23:43:59 +00:00
|
|
|
/*
|
|
|
|
Copyright (c) 2013 Microsoft Corporation. All rights reserved.
|
|
|
|
Released under Apache 2.0 license as described in the file LICENSE.
|
|
|
|
|
|
|
|
Author: Leonardo de Moura
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <map>
|
2013-09-13 23:14:24 +00:00
|
|
|
#include <string>
|
|
|
|
#include "util/sexpr/options.h"
|
2013-08-21 23:43:59 +00:00
|
|
|
|
|
|
|
namespace lean {
|
|
|
|
/**
|
|
|
|
\brief Datastructure for storing information about available
|
|
|
|
configuration options.
|
|
|
|
*/
|
|
|
|
class option_declaration {
|
|
|
|
name m_name;
|
|
|
|
option_kind m_kind;
|
|
|
|
std::string m_default;
|
|
|
|
std::string m_description;
|
|
|
|
public:
|
|
|
|
option_declaration(name const & n, option_kind k, char const * default_val, char const * descr):
|
|
|
|
m_name(n), m_kind(k), m_default(default_val), m_description(descr) {}
|
|
|
|
option_kind kind() const { return m_kind; }
|
|
|
|
name const & get_name() const { return m_name; }
|
|
|
|
std::string const & get_default_value() const { return m_default; }
|
|
|
|
std::string const & get_description() const { return m_description; }
|
2014-09-03 00:42:21 +00:00
|
|
|
/** \brief Display value of this option declaration in \c o.
|
|
|
|
\remark if \c o does not set this option, then the default value is displayed. */
|
|
|
|
void display_value(std::ostream & out, options const & o) const;
|
2013-08-21 23:43:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef std::map<name, option_declaration> option_declarations;
|
2014-09-22 17:27:48 +00:00
|
|
|
void initialize_option_declarations();
|
|
|
|
void finalize_option_declarations();
|
2013-08-21 23:43:59 +00:00
|
|
|
option_declarations const & get_option_declarations();
|
2014-09-22 17:27:48 +00:00
|
|
|
void register_option(name const & n, option_kind k, char const * default_value, char const * description);
|
|
|
|
#define register_bool_option(n, v, d) register_option(n, BoolOption, #v, d)
|
|
|
|
#define register_unsigned_option(n, v, d) register_option(n, UnsignedOption, #v, d)
|
2013-08-21 23:43:59 +00:00
|
|
|
}
|