pub trait ControlFlowGenerator {
// Required methods
fn generate_if_then_else(
&mut self,
condition: &Expr,
then_block: &[Stmt],
else_block: Option<&[Stmt]>,
) -> Result<()>;
fn generate_while_loop(
&mut self,
condition: &Expr,
body: &[Stmt],
) -> Result<()>;
fn generate_for_loop(
&mut self,
variable: &str,
start: &Expr,
end: &Expr,
step: Option<&Expr>,
body: &[Stmt],
direction: ForDirection,
) -> Result<()>;
fn generate_repeat_loop(
&mut self,
body: &[Stmt],
condition: &Expr,
) -> Result<()>;
}Expand description
Control flow generation trait
Required Methods§
Sourcefn generate_if_then_else(
&mut self,
condition: &Expr,
then_block: &[Stmt],
else_block: Option<&[Stmt]>,
) -> Result<()>
fn generate_if_then_else( &mut self, condition: &Expr, then_block: &[Stmt], else_block: Option<&[Stmt]>, ) -> Result<()>
Generate if-then-else structure
Sourcefn generate_while_loop(&mut self, condition: &Expr, body: &[Stmt]) -> Result<()>
fn generate_while_loop(&mut self, condition: &Expr, body: &[Stmt]) -> Result<()>
Generate while loop