updated compiler to support multiple frontends and backends

This commit is contained in:
2026-02-05 01:09:14 +00:00
parent 8d130a870c
commit a35cfbe864
14 changed files with 1737 additions and 324 deletions
+15
View File
@@ -0,0 +1,15 @@
use crate::model::{CompilerError, Program};
mod c;
mod dsc;
pub fn compiler_frontend(ext: &str, data: &str) -> Result<Program, CompilerError> {
match ext {
"dsc" => Ok(dsc::generate_ast(&data)?),
"c" => Ok(c::generate_ast(&data)?),
_ => Err(CompilerError::Generic(format!(
"File type {} not supported",
ext
))),
}
}