Update homework 1 and 2

This commit is contained in:
Jeehoon Kang
2020-03-26 03:38:20 +09:00
parent 241a66fcc1
commit 8938a7ad8f
40 changed files with 5171 additions and 1504 deletions

26
src/irgen/mod.rs Normal file
View File

@@ -0,0 +1,26 @@
use core::fmt;
use lang_c::ast::*;
use crate::*;
#[derive(Default)]
pub struct Irgen {}
#[derive(Debug, PartialEq)]
pub struct IrgenError {}
impl fmt::Display for IrgenError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "IrgenError")
}
}
impl Translate<TranslationUnit> for Irgen {
type Target = ir::TranslationUnit;
type Error = IrgenError;
fn translate(&mut self, _unit: &TranslationUnit) -> Result<Self::Target, Self::Error> {
todo!("homework 2")
}
}