From fc4756d384b47dbc6f36d9556bd5718f63be9eea Mon Sep 17 00:00:00 2001 From: Natapat Samutpong Date: Sun, 13 Mar 2022 13:05:50 +0700 Subject: [PATCH] how works :scream: --- README.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/README.md b/README.md index 8fff8ca..c067dd4 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,40 @@ end; Note: Everything in this project can be changed at anytime! (I'm still finding out what work best for lots of thing) if you have an idea, feel free to create an issues about it, or even create a PR! (I'd be very happy) +# How it works +```sml + Source (.hz) + | crates/main + v + Lexer produce Token + | crates/lexer + v + Parser produce AST + | crates/parser + v + Diagnostic(Parsing) + | \ crates/diagnostic + | \ + Pass Fail -> Print error -> Exit + | + v + Lowerer(?) produce HIR + | crates/hir + v + Diagnostic(Lowering) + | \ crates/diagnostic + v \ + Pass Fail -> Print error -> Exit + | + v + Command Codegen produce C++ + (spawn) | crates/codegen + | | + v v + clang++ -----*-----> Executable +(Command) +``` + # Prerequistie - `clang++`(preferred, default) or any C++ compiler - `make` for Makefile