Phasor 2.2.0
Stack VM based Programming Language
Loading...
Searching...
No Matches
shell_main.cpp
Go to the documentation of this file.
1#include <Shell.hpp>
2
3#include <cstdint>
4#include <cstdio>
5#include <cstdlib>
6#include <iostream>
7#include <fstream>
8#include <filesystem>
9#include <string>
10#include <vector>
11
12
14
15// Forward declare native runtime entry points (linked in from the runtime library)
16extern "C" void exec(const unsigned char embeddedBytecode[], size_t embeddedBytecodeSize, const char *moduleName,
17 const void *nativeFunctionsVector, const int argc, const char **argv);
18
19// Main entry point
20int main(int argc, char *argv[], char *envp[])
21{
22 int exitCode = 1;
23
24 try
25 {
26 exec(embeddedBytecode, embeddedBytecodeSize, moduleName.c_str(), nullptr, argc, (const char **)argv);
27 exitCode = 0;
28 }
29 catch (const std::exception &e)
30 {
31 std::cerr << "Runtime Error: " << e.what() << "\n";
32 return 1;
33 }
34
35 return exitCode;
36}
fn main()
The main execution loop of the Phasor Shell.
Definition Shell.dox:38
void exec(const unsigned char embeddedBytecode[], size_t embeddedBytecodeSize, const char *moduleName, const void *nativeFunctionsVector, const int argc, const char **argv)