#include <interpreter.hpp>
|
| Interpreter (const char *source) |
| Constructor.
|
|
| Interpreter (const string &source) |
| Constructor.
|
|
void | run () |
| Run the interpreter.
|
|
◆ Interpreter() [1/2]
Interpreter::Interpreter |
( |
const char * | source | ) |
|
Constructor.
Constructor for the interpreter.
- Parameters
-
source | Source code to interpret |
◆ Interpreter() [2/2]
Interpreter::Interpreter |
( |
const string & | source | ) |
|
|
inline |
Constructor.
Constructor for the interpreter.
- Parameters
-
source | Source code to interpret |
◆ handle_keyword()
void Interpreter::handle_keyword |
( |
const string & | keyword | ) |
|
|
private |
Handle a keyword.
Handle a keyword. The function is called when the interpreter finds a keyword in the source code. It checks the keyword and executes the corresponding action.
- Parameters
-
◆ import_module()
void Interpreter::import_module |
( |
const string & | module_path | ) |
|
|
private |
Import a module.
Import a module into the current source code. The function reads the module file, generates the tokens, checks for errors and inserts the token list.
- Parameters
-
module_path | Path to the module file |
◆ run()
void Interpreter::run |
( |
| ) |
|
Run the interpreter.
Run the interpreter. It takes the tokens generated by the lexer and interprets them. In case of an error, the function throws an exception containing the error message.
◆ curr_tk
size_t Interpreter::curr_tk = 0 |
|
private |
◆ memory
◆ tokens
vector<Token> Interpreter::tokens |
|
private |
The documentation for this class was generated from the following files: