use super::temp; pub enum Location { InFrame { offset: usize, }, Register(temp::TempName), } pub enum Escape { No, Yes, } pub trait Frame { fn new(name: temp::TempLabel, formals: Vec) -> Self; fn name(&self) -> temp::TempLabel; fn formals(&self) -> &[Location]; fn alloc_local(&mut self, escapes: Escape) -> Location; } pub struct Amd64Frame { name: temp::TempLabel, } impl Frame for Amd64Frame { fn new(name: temp::TempLabel, formals: Vec) -> Self { Amd64Frame { name, } } fn name(&self) -> temp::TempLabel { self.name } fn formals(&self) -> &[Location] { unimplemented!(); } fn alloc_local(&mut self, escapes: Escape) -> Location { unimplemented!(); } }