use crate::SymbolTable;
use leo_ast::Function;
use leo_span::Symbol;
use indexmap::IndexMap;
pub struct CodeGenerator<'a> {
pub(crate) symbol_table: &'a SymbolTable,
pub(crate) next_register: u64,
pub(crate) current_function: Option<&'a Function>,
pub(crate) variable_mapping: IndexMap<&'a Symbol, String>,
pub(crate) composite_mapping: IndexMap<&'a Symbol, (bool, String)>,
pub(crate) is_transition_function: bool,
pub(crate) in_finalize: bool,
}
impl<'a> CodeGenerator<'a> {
pub fn new(symbol_table: &'a SymbolTable) -> Self {
Self {
symbol_table,
next_register: 0,
current_function: None,
variable_mapping: IndexMap::new(),
composite_mapping: IndexMap::new(),
is_transition_function: false,
in_finalize: false,
}
}
}