#include <sysio/vm/backend.hpp>
#include <sysio/vm/error_codes.hpp>
#include <sysio/vm/host_function.hpp>
#include <sysio/vm/watchdog.hpp>
#include <iostream>
#include <string>
#include "hello.wasm.hpp"
Go to the source code of this file.
|
| SYS_VM_PRECONDITION (test_name, SYS_VM_INVOKE_ON(const char *, [&](auto &&nm, auto &&... rest) { std::string s=nm;if(s=="sys-vm2") throw "failure";})) int main(int argc |
|
| rhf_t::add<&example_host_methods::print_num > ("env", "print_num") |
|
| rhf_t::add<&example_host_methods::sysio_assert > ("env", "sysio_assert") |
|
| rhf_t::add<&example_host_methods::print_name, test_name > ("env", "print_name") |
|
| rhf_t::add<&example_host_methods::memset > ("env", "memset") |
|
| rhf_t::add<&example_host_methods::print_span > ("env", "print_span") |
|
backend_t | bkend (hello_wasm, ehm, &wa) |
|
| bkend (ehm, "env", "apply",(uint64_t) std::atoi(argv[1]),(uint64_t) std::atoi(argv[2]),(uint64_t) std::atoi(argv[3])) |
|
| catch (...) |
|
◆ backend_t
◆ rhf_t
◆ bkend() [1/2]
◆ bkend() [2/2]
◆ catch()
Definition at line 85 of file hello_driver.cpp.
85{ std::cerr << "sys-vm interpreter error\n"; }
◆ rhf_t::add<&example_host_methods::memset >()
◆ rhf_t::add<&example_host_methods::print_name, test_name >()
◆ rhf_t::add<&example_host_methods::print_num >()
◆ rhf_t::add<&example_host_methods::print_span >()
◆ rhf_t::add<&example_host_methods::sysio_assert >()
◆ SYS_VM_PRECONDITION()
SYS_VM_PRECONDITION |
( |
test_name | , |
|
|
SYS_VM_INVOKE_ON(const char *,[&](auto &&nm, auto &&... rest) { std::string s=nm; if(s=="sys-vm2") throw "failure"; }) | ) |
Simple implementation of an interpreter using sys-vm.
◆ argv
Initial value:{
if (argc < 4) {
std::cerr << "Please enter three numbers\n";
return -1;
}
Definition at line 52 of file hello_driver.cpp.
52 {
53 if (argc < 4) {
54 std::cerr << "Please enter three numbers\n";
55 return -1;
56 }
◆ field
◆ return
◆ try
◆ wd