You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
410 B
14 lines
410 B
use crate::asm::instr::{lower, Op};
|
|
use crate::asm::instr::op::AsmModule;
|
|
|
|
pub mod data;
|
|
pub mod error;
|
|
pub mod instr;
|
|
pub mod parse;
|
|
pub mod patches;
|
|
|
|
/// Parse a program from string and assemble a low level instruction sequence from it.
|
|
pub fn assemble(source: &str, parsers: &[Box<dyn AsmModule>]) -> Result<Vec<Op>, error::Error> {
|
|
let parsed = parse::parse(source, parsers)?;
|
|
Ok(lower(parsed)?)
|
|
}
|
|
|