CAS/Interpreter.hpp

29 lines
613 B
C++
Raw Normal View History

2018-09-29 20:50:11 +00:00
#pragma once
#include <vector>
#include <map>
#include <string>
#include "Token.hpp"
class Interpreter
{
public:
static double interpret(std::string _string);
2018-09-29 20:50:11 +00:00
private:
static bool scanForErrors();
static bool getResult();
static bool createSymbolList(std::vector<Symbol*>& symbols);
static bool createOrderedTokenList(std::vector<Symbol*> symbols, std::vector<NonChar*>& tokens);
static std::string string;
static std::string numbers;
static std::string operators;
static std::map<char, unsigned int> operation_order;
static double result;
static bool justNumber;
};