Phasor 2.2.0
Stack VM based Programming Language
Loading...
Searching...
No Matches
Repl.hpp
Go to the documentation of this file.
1#pragma once
2
4#include <filesystem>
5#include <memory>
6#include <string>
7#include <vector>
8
9/* Forward-declare Phasor::VM so the C++ gods are pleased with me */
10namespace Phasor { class VM; }
11
12namespace Phasor
13{
14
15struct AppArgs
16{
17 int scriptArgc = 0;
18 char **scriptArgv = nullptr;
19 char **envp = nullptr;
20};
21
26class Repl
27{
28 public:
29 Repl(int argc, char *argv[], char *envp[]);
30 int run();
31
32 private:
33 int runRepl();
34 static void runSourceString(const std::string &source, VM &vm);
35
36 std::unique_ptr<VM> createVm();
37
39};
40
41} // namespace Phasor
int run()
Definition Repl.cpp:25
Repl(int argc, char *argv[], char *envp[])
Definition Repl.cpp:20
int runRepl()
Definition Repl.cpp:30
static void runSourceString(const std::string &source, VM &vm)
Definition Repl.cpp:37
std::unique_ptr< VM > createVm()
Definition Repl.cpp:50
AppArgs m_args
Definition Repl.hpp:38
Virtual Machine.
Definition VM.hpp:18
The Phasor Programming Language and Runtime.
Definition AST.hpp:8
char ** scriptArgv
Definition Repl.hpp:18
char ** envp
Definition Repl.hpp:19