diff --git a/src/vm/obj/syn/parser.lalrpop b/src/vm/obj/syn/parser.lalrpop deleted file mode 100644 index 45232f2..0000000 --- a/src/vm/obj/syn/parser.lalrpop +++ /dev/null @@ -1,58 +0,0 @@ -use std::str::FromStr; -use crate::vm::{ - common::Addr, - inst::*, - obj::syn::{unescape_string, ast::*}, - reg::*, -}; - -grammar; - -Label: String = { - r"[a-zA-Z_][a-zA-Z0-9_]*" => String::from(<>), -} - -Number: u64 = { - => u64::from_str(&s[1..]).unwrap(), - => u64::from_str_radix(&s[3..], 16).unwrap(), - => u64::from_str_radix(&s[3..], 2).unwrap(), -} - -String: String = { - => { - let len = s.len(); - unescape_string(&s[1..len-1]) - } -} - -Reg: Reg = { - r"%ip" => todo!(), - r"%sp" => todo!(), - r"%fp" => todo!(), - r"%flags" => todo!(), - r"%nil" => todo!(), - r"%status" => todo!(), - r"%r[0-9]{1,2}" => todo!(), -} - -ValueDecl: ValueDecl = { - r"\.u64" => ValueDecl::U64(<>), - r"\.u32" => ValueDecl::U32(<>), - r"\.u16" => ValueDecl::U16(<>), - r"\.u8" => ValueDecl::U8(<>), - r"\.string" => ValueDecl::String(<>), - r"\.zstring" => ValueDecl::ZString(<>), -} - -SectionOrg: SectionOrg = { - => SectionOrg::Start(start), - r"\.\." => SectionOrg::Range(start, end), -} - -Section: SectionBlock = { - -} - -pub Sections: Vec = { - => <>, -}