forked from timvandermeij/whitespace-interpreter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Parser.h
27 lines (22 loc) · 843 Bytes
/
Parser.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#ifndef PARSER_H
#define PARSER_H
#include <vector>
#include <string>
#include <iostream>
#include <cmath>
#include "Interpreter.h"
#include "Exceptions.h"
class Parser {
public:
std::vector<Token> tokenize(const std::string &);
Program tokensToProgram(const std::vector<Token> &);
private:
Mode determineMode(const Token, const Token);
long long tokensToNumber(const std::vector<Token> &, size_t &);
void processStackManip(const std::vector<Token> &, Program &, size_t &);
void processArith(const std::vector<Token> &, Program &, size_t &);
void processHeapAcc(const std::vector<Token> &, Program &, size_t &);
void processFlowCont(const std::vector<Token> &, Program &, size_t &);
void processIO(const std::vector<Token> &, Program &, size_t &);
};
#endif