mirror of https://git.sr.ht/~garritfra/sabre
Garrit Franke
3 years ago
4 changed files with 25 additions and 2 deletions
@ -0,0 +1,7 @@
|
||||
use crate::parser::node_type::Program; |
||||
|
||||
pub mod x86; |
||||
|
||||
pub trait Generator { |
||||
fn generate(prog: Program) -> String; |
||||
} |
@ -0,0 +1,10 @@
|
||||
use crate::generator::Generator; |
||||
use crate::parser::node_type::Program; |
||||
|
||||
pub struct X86Generator; |
||||
|
||||
impl Generator for X86Generator { |
||||
fn generate(prog: Program) -> String { |
||||
return prog.func.into_iter().map(|f| format!("{:#?}", f)).collect(); |
||||
} |
||||
} |
Loading…
Reference in new issue