forked from MightyPork/crsn
parent
2269d759c6
commit
b7345144e0
@ -1,6 +1,27 @@ |
|||||||
pub use parse::ArithOps; |
use crsn::module::{CrsnExtension, ParseOpRes}; |
||||||
|
use crsn::asm::parse::arg_parser::ArgParser; |
||||||
|
use crsn::asm::error::CrsnError; |
||||||
|
use crsn::asm::instr::Op; |
||||||
|
|
||||||
mod defs; |
mod defs; |
||||||
mod parse; |
mod parse; |
||||||
mod exec; |
mod exec; |
||||||
|
|
||||||
|
#[derive(Debug, Clone)] |
||||||
|
pub struct ArithOps; |
||||||
|
|
||||||
|
impl ArithOps { |
||||||
|
pub fn new() -> Box<dyn CrsnExtension> { |
||||||
|
Box::new(Self) |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
impl CrsnExtension for ArithOps { |
||||||
|
fn name(&self) -> &'static str { |
||||||
|
"arith" |
||||||
|
} |
||||||
|
|
||||||
|
fn parse_op(&self, keyword: &str, args: ArgParser) -> Result<ParseOpRes<Op>, CrsnError> { |
||||||
|
parse::parse(keyword, args) |
||||||
|
} |
||||||
|
} |
||||||
|
@ -1,6 +1,27 @@ |
|||||||
pub use parse::StackOps; |
use crsn::module::{CrsnExtension, ParseOpRes}; |
||||||
|
use crsn::asm::parse::arg_parser::ArgParser; |
||||||
|
use crsn::asm::instr::Op; |
||||||
|
use crsn::asm::error::CrsnError; |
||||||
|
|
||||||
mod defs; |
mod defs; |
||||||
mod parse; |
mod parse; |
||||||
mod exec; |
mod exec; |
||||||
|
|
||||||
|
#[derive(Debug, Clone)] |
||||||
|
pub struct StackOps; |
||||||
|
|
||||||
|
impl StackOps { |
||||||
|
pub fn new() -> Box<dyn CrsnExtension> { |
||||||
|
Box::new(Self) |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
impl CrsnExtension for StackOps { |
||||||
|
fn name(&self) -> &'static str { |
||||||
|
"stacks" |
||||||
|
} |
||||||
|
|
||||||
|
fn parse_op(&self, keyword: &str, args: ArgParser) -> Result<ParseOpRes<Op>, CrsnError> { |
||||||
|
parse::parse(keyword, args) |
||||||
|
} |
||||||
|
} |
||||||
|
Loading…
Reference in new issue