gfy-cpp
Loading...
Searching...
No Matches
interpreter.hpp
Go to the documentation of this file.
1#ifndef __INTERPRETER_HPP__
2#define __INTERPRETER_HPP__
3
4#include "lexer.hpp"
5#include "memory.hpp"
6
7#include <vector>
8#include <string>
9
11 public:
18 Interpreter(const char* source);
19
26 Interpreter(const string& source) : Interpreter(source.c_str()) {}
27
35 void run();
36
37 private:
38 size_t curr_tk = 0;
39 vector<Token> tokens;
41
50 void import_module(const string& module_path);
51
60 void handle_keyword(const string& keyword);
61};
62
63#endif
Definition interpreter.hpp:10
Interpreter(const char *source)
Constructor.
Definition interpreter.cpp:7
vector< Token > tokens
Definition interpreter.hpp:39
size_t curr_tk
Definition interpreter.hpp:38
void run()
Run the interpreter.
Definition interpreter.cpp:17
Memory memory
Definition interpreter.hpp:40
void import_module(const string &module_path)
Import a module.
Definition interpreter.cpp:37
Interpreter(const string &source)
Constructor.
Definition interpreter.hpp:26
void handle_keyword(const string &keyword)
Handle a keyword.
Definition interpreter.cpp:60
Memory class.
Definition memory.hpp:44