2010-01-30 07:26:05 +03:00
|
|
|
#ifndef BUILTIN_H_
|
|
|
|
#define BUILTIN_H_
|
|
|
|
|
2011-09-03 08:10:36 +04:00
|
|
|
#include <string>
|
|
|
|
#include <boost/unordered_map.hpp>
|
2010-01-30 07:26:05 +03:00
|
|
|
|
2011-11-06 21:37:12 +04:00
|
|
|
class Builtins
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
typedef boost::unordered_map<std::string, class AbstractFunction*> FunctionContainer;
|
|
|
|
typedef boost::unordered_map<std::string, class AbstractModule*> ModuleContainer;
|
|
|
|
|
|
|
|
static Builtins *instance(bool erase = false);
|
|
|
|
static void init(const char *name, class AbstractModule *module);
|
|
|
|
static void init(const char *name, class AbstractFunction *function);
|
|
|
|
void initialize();
|
|
|
|
std::string isDeprecated(const std::string &name);
|
|
|
|
|
|
|
|
const FunctionContainer &functions() { return this->builtinfunctions; }
|
|
|
|
const ModuleContainer &modules() { return this->builtinmodules; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
Builtins() { }
|
|
|
|
~Builtins();
|
|
|
|
|
|
|
|
FunctionContainer builtinfunctions;
|
|
|
|
ModuleContainer builtinmodules;
|
|
|
|
|
|
|
|
boost::unordered_map<std::string, std::string> deprecations;
|
|
|
|
};
|
2010-01-30 07:26:05 +03:00
|
|
|
|
2011-11-05 20:04:09 +04:00
|
|
|
extern void register_builtin(class Context &ctx);
|
|
|
|
|
2010-01-30 07:26:05 +03:00
|
|
|
#endif
|