From 10839ebbc0121e8c209681879f39469df0816fe1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ya=C4=9Fmur=20Oymak?= Date: Sat, 19 Jan 2019 19:40:59 +0300 Subject: [PATCH] Update README.md Closes #21 --- README.md | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4f488d1..97e81fe 100644 --- a/README.md +++ b/README.md @@ -1 +1,41 @@ -# congenial-elucidator \ No newline at end of file +# congenial-elucidator +congenial-elucidator is a compiler for the xpln programming language, targeting MIPS architecture. +Actually, for a slightly modified version of xpln, targeting SPIM simulator. + +## yalalr +congenial-elucidator is written using (yalalr)[https://github.com/bozsahin/yalalr]. +See the instructions there for usage. + +## Example programs +Under the `xpln/` directory, there are sample xpln programs. +Some of them are taken from (Berk Özbalcı's xpln stress test)[https://gist.github.com/bozbalci/13bae202aab2fbe50be2bc474fc82292]. +Under `mips/`, there are target codes for each of the example programs, as compiled by congenial-elucidator. + +## What's missing +* Sadly, no floating point support. Integers only. + +## What's different from original specs +* Function definitions at the top: Grammar was slightly modified to simplify code generation, +in the new grammar function definitions come before the main body and there can be no +function definitions between statements. + +## What can be improved +* Determine stack frame size dynamically. Currently, all functions have a fixed +stack frame size, which is 512 bytes. Ideally, we should determine at compile time +how much stack space to allocate for each function. +* Use unsigned arithmetic for address computations. + +## Known problems +* Grammar is not LALR(1). It haven't caused any harm (yet) though; I think +LALR parser generator's default decisions save me there. +* Return value of main is ignored. I couldn't find out how to return a value from +a program in SPIM. I don't know if it's possible. + +## Acknowledgements +I would like to thank Prof. Dr. Cem Bozşahin (@bozsahin) for the awesome course! +Actually, a "course" would be an understatement for this; it was more like +a journey from heaven to hell and back to heaven again, all in one semester. +Also see (bozsahin/ceng444)[https://github.com/bozsahin/ceng444]. + +I would also like to thank Berk Özbalcı (@bozbalci) for his friendship and support, +and also his (xpln stress test)[https://gist.github.com/bozbalci/13bae202aab2fbe50be2bc474fc82292].