1extern crate lazy_static;
3extern crate bitflags;
4extern crate byteorder;
5
6use std::collections::HashMap;
7
8mod common;
10pub mod arch;
12mod directive;
14
15pub use common::{Const, Expr, Ident, Number, NumericRepr, JumpOffset, Size, Stmt, Value};
16pub use directive::{Directive, MalformedDirectiveError};
17
18struct Dynasm {
22 target: Box<dyn arch::Arch>,
23 stmts: Vec<common::Stmt>
24}
25
26struct DynasmOpmap {
29 pub arch: String
30}
31
32pub struct State<'a> {
34 pub stmts: &'a mut Vec<common::Stmt>,
35 pub target: &'a str,
36 pub file_data: &'a mut DynasmData,
37}
38
39pub struct DynasmData {
40 pub current_arch: Box<dyn arch::Arch>,
41 pub aliases: HashMap<String, String>,
42}
43
44impl DynasmData {
45 pub fn new() -> DynasmData {
47 DynasmData {
48 current_arch:
49 arch::from_str(arch::CURRENT_ARCH).expect("Default architecture is invalid"),
50 aliases: HashMap::new(),
51 }
52 }
53}