Trait oursh::program::Program[][src]

pub trait Program: Sized + Debug + Run {
    type Command: Command;
    fn parse<R: BufRead>(reader: R) -> Result<Self>;
fn commands(&self) -> &[Self::Command]; }
Expand description

A program is as large as a file or as small as a line.

Each program is to be treated as a complete single language entity, with the explicit exception of {#} blocks, which act as bridges between programs.

Working Thoughts

  • Is simply iterating a collection of commands really the correct semantics for all the types of programs we want?
  • What language information do we still need to store?

Associated Types

The type of each of this program’s commands.

Required methods

Parse a whole program from the given reader.

Return a list of all the commands in this program.

Implementors