Skip to main content

Writer

Trait Writer 

Source
pub trait Writer: Send + Sync {
    // Required methods
    fn language(&self) -> &'static str;
    fn extension(&self) -> &'static str;
    fn write(&self, program: &Program) -> String;
}
Expand description

A writer emits the IR as source code in a target language.

Required Methods§

Source

fn language(&self) -> &'static str

Language identifier (e.g., “lua”, “typescript”).

Source

fn extension(&self) -> &'static str

File extension for output (e.g., “lua”).

Source

fn write(&self, program: &Program) -> String

Emit the IR as source code.

Implementors§