Skip to content

ppvm_vihaco (crate)

ppvm_vihaco

ppvm_vihaco

Modules

classPPVMModulesource

ppvm_vihaco::PPVMModule

Rust type alias. A fully resolved PPVM module, ready to load into a [`PPVM`].

Signature
pub type PPVMModule = LocalModule<PPVMInstruction, Value, Type, PPVMDeviceInfo>
source

functioncompile_programsource

ppvm_vihaco::compile_program

pub fn compile_program(source: &str) -> Result<PPVMModule>

Parameters

NameTypeDescription
source&amp;str

Returns

Result<PPVMModule>

source

functiondump_filesource

ppvm_vihaco::dump_file

pub fn dump_file(input_path: &str, output_path: &str) -> Result<()>

Parameters

NameTypeDescription
input_path&amp;str
output_path&amp;str

Returns

Result<()>

Read a `.sst` file and dump it to a `.ssb` bytecode file.

source

functiondump_programsource

ppvm_vihaco::dump_program

pub fn dump_program(program: &str, output_path: &str) -> Result<()>

Parameters

NameTypeDescription
program&amp;str
output_path&amp;str

Returns

Result<()>

Dump `.sst` source to a `.ssb` bytecode file.

source

functionload_module_filesource

ppvm_vihaco::load_module_file

pub fn load_module_file(path: &str) -> Result<PPVMModule>

Parameters

NameTypeDescription
path&amp;str

Returns

Result<PPVMModule>

Read a file and produce a loadable module, auto-detecting the format: a leading PPVM magic is parsed as `.ssb` bytecode, otherwise as `.sst` source. Mirrors PPVM::load_file but returns the module so it can be compiled once and run for many shots.

source

functionparse_programsource

ppvm_vihaco::parse_program

Signature
pub fn parse_program(source: &str) -> Result<ParsedModule<Instruction, SurfaceType, Vec<PPVMHeader>>>

Parameters

NameTypeDescription
source&amp;str

Returns

Result<ParsedModule<Instruction, SurfaceType, Vec<PPVMHeader>>>

Parse `.sst` source into the unresolved AST.

source

functionrun_filesource

ppvm_vihaco::run_file

pub fn run_file(path: &str) -> Result<PPVM>

Parameters

NameTypeDescription
path&amp;str

Returns

Result<PPVM>

source

functionrun_programsource

ppvm_vihaco::run_program

pub fn run_program(program: &str) -> Result<PPVM>

Parameters

NameTypeDescription
program&amp;str

Returns

Result<PPVM>

source