pub struct C;
Expand description
The type for the C target which implements the Target
trait.
This allows the compiler to target the C language.
Trait Implementations§
Source§impl Architecture for C
impl Architecture for C
Source§fn supports_input(&self, i: &Input) -> bool
fn supports_input(&self, i: &Input) -> bool
Whether or not the target architecture supports the given input (mode + channel).
Source§fn supports_output(&self, o: &Output) -> bool
fn supports_output(&self, o: &Output) -> bool
Whether or not the target architecture supports the given output (mode + channel).
Source§fn std_op(&mut self, op: &StandardOp) -> Result<String, String>
fn std_op(&mut self, op: &StandardOp) -> Result<String, String>
Compile a
StandardOp
instruction.Source§fn end(&mut self, matching: &CoreOp, fun: Option<usize>) -> String
fn end(&mut self, matching: &CoreOp, fun: Option<usize>) -> String
Compile an
End
instruction (with the matching If
or While
or Function
)Source§fn declare_proc(&mut self, label_id: usize) -> String
fn declare_proc(&mut self, label_id: usize) -> String
Compile the declaration of a procedure.
Source§fn supports_floats(&self) -> bool
fn supports_floats(&self) -> bool
Whether or not the target architecture supports floating point.
Source§fn get(&mut self, src: &Input) -> Result<String, String>
fn get(&mut self, src: &Input) -> Result<String, String>
Get a value from the given input stream (mode + channel).
Source§fn put(&mut self, dst: &Output) -> Result<String, String>
fn put(&mut self, dst: &Output) -> Result<String, String>
Put a value to the given output stream (mode + channel).
Source§fn peek(&mut self) -> Result<String, String>
fn peek(&mut self) -> Result<String, String>
Peek a value from the device connected to the program.
Source§fn poke(&mut self) -> Result<String, String>
fn poke(&mut self) -> Result<String, String>
Poke a value to the device connected to the program.
Source§fn post_funs(&self, funs: Vec<i32>) -> Option<String>
fn post_funs(&self, funs: Vec<i32>) -> Option<String>
The code after the function definitions.
Source§fn pre_funs(&self, _funs: Vec<i32>) -> Option<String>
fn pre_funs(&self, _funs: Vec<i32>) -> Option<String>
The code before the function definitions.
Source§fn indentation(&self) -> Option<String>
fn indentation(&self) -> Option<String>
The string used for indentation.
Source§impl CompiledTarget for C
impl CompiledTarget for C
fn build_op( &mut self, op: &CoreOp, matching_ops: &mut Vec<CoreOp>, matching_funs: &mut Vec<usize>, current_fun: &mut usize, indent: &mut usize, ) -> Result<String, String>
fn build_std_op( &mut self, std_op: &StandardOp, matching_ops: &mut Vec<CoreOp>, matching_funs: &mut Vec<usize>, current_fun: &mut usize, indent: &mut usize, ) -> Result<String, String>
Source§fn build_core(&mut self, program: &CoreProgram) -> Result<String, String>
fn build_core(&mut self, program: &CoreProgram) -> Result<String, String>
Compile the core variant of the machine code (must be implemented for every target).
Auto Trait Implementations§
impl Freeze for C
impl RefUnwindSafe for C
impl Send for C
impl Sync for C
impl Unpin for C
impl UnwindSafe for C
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more