pub mod generator;
pub use generator::*;
mod visit_expressions;
mod visit_program;
mod visit_statements;
mod visit_type;
use crate::{CallGraph, Pass, StructGraph, SymbolTable};
use leo_ast::{Ast, Program};
use leo_errors::Result;
impl<'a> Pass for CodeGenerator<'a> {
type Input = (&'a Ast, &'a SymbolTable, &'a StructGraph, &'a CallGraph, &'a Program);
type Output = Result<String>;
fn do_pass((ast, symbol_table, struct_graph, call_graph, program): Self::Input) -> Self::Output {
let mut generator = Self::new(symbol_table, struct_graph, call_graph, program);
let bytecode = generator.visit_program(ast.as_repr());
Ok(bytecode)
}
}