upd: first version of atom
This commit is contained in:
@ -2,21 +2,26 @@
|
||||
#define NAMESCOPE_H
|
||||
|
||||
#include <any>
|
||||
#include <stack>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
#include "utils.h"
|
||||
|
||||
class NameScopeClass {
|
||||
;
|
||||
class FucntionContainer {
|
||||
struct FunctionItem {
|
||||
;
|
||||
};
|
||||
};
|
||||
struct FunctionItem
|
||||
{
|
||||
;
|
||||
};
|
||||
struct FucntionContainer
|
||||
{
|
||||
;
|
||||
class VariableContainer {
|
||||
std::unordered_map<std::string, std::any> GlobalScope;
|
||||
std::stack<std::unordered_map<std::string, std::any>> StackScopes;
|
||||
|
||||
public:
|
||||
void CreateFrame();
|
||||
void DestroyFrame();
|
||||
std::any ReadVariable(const std::string &name);
|
||||
void WriteVariable(const std::string &name, const std::any &value);
|
||||
};
|
||||
#endif
|
@ -2,8 +2,13 @@
|
||||
#define UTILS_H
|
||||
#include <any>
|
||||
#include <exception>
|
||||
#include <iomanip>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "int2048/int2048.h"
|
||||
class InterpretException : public std::exception {
|
||||
public:
|
||||
InterpretException() {}
|
||||
@ -38,4 +43,15 @@ struct FlowType {
|
||||
};
|
||||
|
||||
struct NoneType {};
|
||||
|
||||
ZYM::int2048 Any2Int(const std::any &value);
|
||||
double Any2Float(const std::any &value);
|
||||
std::string Any2String(const std::any &value);
|
||||
bool Any2Bool(const std::any &value);
|
||||
|
||||
struct RawVarible {
|
||||
std::string name;
|
||||
RawVarible() {}
|
||||
RawVarible(const std::string &name) : name(name) {}
|
||||
};
|
||||
#endif
|
Reference in New Issue
Block a user