use syntax::ext::base::ExtCtxt;
use syntax::parse::parser::Parser;
use syntax::parse::PResult;

// mod parser;
// mod compiler;
mod data;

use ::State;
use serialize::Ident;
use arch::Arch;

#[derive(Clone, Debug)]
pub struct ArchMIPS {

}

impl Default for ArchMIPS {
    fn default() -> ArchMIPS {
        ArchMIPS { }
    }
}

impl Arch for Archx64 {
    fn name(&self) -> &str {
        "MIPS"
    }

    fn set_features(&mut self, ecx: &ExtCtxt, features: &[Ident]) {
        for &Ident {span, ref node} in features {
            self.features |= match &*node.name.as_str() {
                e => {
                    ecx.span_err(span, &format!("Architecture MIPS does not support feature '{}'", e));
                    continue;
                }
            }
        }
    }

    fn compile_instruction<'a>(&self, state: &mut State, ecx: &mut ExtCtxt, parser: &mut Parser<'a>) -> PResult<'a, ()> {
        unimplemented!()
        /*let instruction = parser::parse_instruction(state, ecx, parser)?;
        let span = instruction.2;

        if let Err(Some(e)) = compiler::compile_instruction(state, ecx, instruction) {
            ecx.span_err(span, &e);
        }
        Ok(())*/
    }
}