- C frontend broken for now

- If statements work properly now (hopefully)
- still issues with while loops pushing vars to the stack. need scoping
  implemented to fix this!

- refactored registers.rs and fixed faulty logic.
- made register allocation optimisations
This commit is contained in:
2026-02-08 00:14:18 +00:00
parent e9329eca95
commit 6699333b2c
9 changed files with 745 additions and 232 deletions
+4 -4
View File
@@ -2,11 +2,11 @@ use common::logging::log;
use crate::model::{CompilerError, Program};
use parser::{ParseResult, Parser};
use semantic_analyser::Analyser;
// use semantic_analyser::Analyser;
pub mod lexer;
pub mod parser;
pub mod semantic_analyser;
// pub mod semantic_analyser;
pub fn generate_ast(input: &str) -> Result<Program, CompilerError> {
log("Tokenising Input...");
@@ -30,8 +30,8 @@ pub fn generate_ast(input: &str) -> Result<Program, CompilerError> {
log("Analyzing AST...");
log("Checking Type Information...");
let analyser = Analyser::new();
analyser.analyse(ast.clone()).unwrap();
// let mut analyser = Analyser::new();
// analyser.analyse(ast.clone()).unwrap();
log("Type Checking Complete...");
Ok(ast)