32 lines
677 B
C++
32 lines
677 B
C++
#pragma once
|
|
|
|
#include <unordered_map>
|
|
#include <iostream>
|
|
|
|
#include "ast/ast.hpp"
|
|
#include "util/input.hpp"
|
|
|
|
namespace fsh {
|
|
|
|
//Glavna singleton klasa za shell
|
|
class fsh {
|
|
public:
|
|
std::unordered_map<std::string, std::string>
|
|
environment; //Omogucava komandama da cuvaju informacije kroz upotrebe
|
|
|
|
static fsh& instance() {
|
|
static fsh f;
|
|
return f;
|
|
}
|
|
|
|
void run_line(std::string& line, std::istream& in = util::cin, std::ostream& out = std::cout);
|
|
void run();
|
|
|
|
private:
|
|
fsh() {
|
|
environment["PROMPT"] = "$";
|
|
environment["QUIT"] = "";
|
|
}
|
|
};
|
|
|
|
} |