/* Copyright (c) 2014 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Author: Leonardo de Moura */ #pragma once #include #include #include "kernel/environment.h" namespace lean { class tactic {}; // TODO(Leo): remove after tactic framework is ported to Lean 0.2 class parser; typedef std::function command_fn; typedef std::function tactic_command_fn; template struct cmd_info_tmpl { name m_name; std::string m_descr; F m_fn; public: cmd_info_tmpl(name const & n, char const * d, F const & fn): m_name(n), m_descr(d), m_fn(fn) {} cmd_info_tmpl() {} name const & get_name() const { return m_name; } std::string const & get_descr() const { return m_descr; } F const & get_fn() const { return m_fn; } }; typedef cmd_info_tmpl cmd_info; typedef cmd_info_tmpl tactic_cmd_info; typedef rb_map cmd_table; typedef rb_map tactic_cmd_table; inline void add_cmd(cmd_table & t, cmd_info const & cmd) { t.insert(cmd.get_name(), cmd); } }