extern "C" {
#include "masc_dll.h"
}

class Masc {
	struct BackEnd *bend;
	int id;
public:
	void setcallback(int (__stdcall *cfunc)(const char *proc_name, struct BackEnd *bend, struct Token *ptr_tok)) {
		masc_callback(cfunc);
	}
	void run(const char *source) {
		id = masc_run(source,bend);
	}

	void setbend(BackEnd *bend) {
		this->bend = bend;
	}

	void stop() {
		masc_stop(bend);
	}
	
	char *operator[](char *str) {
		struct symNode *node_ptr;
		node_ptr = Search(&bend->g_stable.root,str);
		return print_FixString(node_ptr->str_value);
	}

	struct symNode *getvar(char *str) {
			struct symNode *node_ptr;
			node_ptr = Search(&bend->g_stable.root,str);
			return node_ptr;
	}


	struct BackEnd* getbend() { return bend; }
	int getid() { return id; }
};

