aboutsummaryrefslogtreecommitdiff
path: root/compiler/codegen.cup
Commit message (Collapse)AuthorAgeFilesLines
* [cup] Add `>>` and `<<` operators, `fork()` buildin and `SYS_execve`HEADmasterMustafa Quraish2022-02-081-0/+15
|
* [cup] Remove unnecessary function from codegen, add info to READMEMustafa Quraish2022-02-071-11/+2
|
* [cup] Self-hosting is now possible! Make some tweaks to match C outputMustafa Quraish2022-02-071-35/+89
| | | | | | | | | | | A bit of a chonky commit, but this ports over the remaining (well, almost) everything from the C implementation to the self-hosted compiler. The only things that really remain right now are (1) defer support and (2) support for constants in local scopes. There were used barely enough so for now their uses have been removed, but I'll implement them back later. Not sure how useful (2) is though.
* [cup] Add support for string literalsMustafa Quraish2022-02-071-0/+28
|
* [cup] Port over all the type-checking/pointer arithmetic stuffMustafa Quraish2022-02-071-0/+5
| | | | | | | | | There's still some work to be done when checking function call args, etc, but the general mechanism of actually propagating the type back up the AST is now here from the C compiler. ... Not to say that was very good, but it's passable enough for now. More improvements to come in the future!
* [cup] Add support for global (initialized) variablesMustafa Quraish2022-02-061-0/+21
|
* [cup] Add support for builtin functions, add `print()`Mustafa Quraish2022-02-051-0/+3
|
* [cup] Fix error in codegen for `if`Mustafa Quraish2022-02-051-3/+2
|
* [compiler.cup] Support for+while loopsMustafa Quraish2022-02-051-0/+26
|
* [compiler.cup] Add support for function calls!Mustafa Quraish2022-02-051-0/+24
|
* [compiler.cup] codegen for unary ops, short circuiting &&/||Mustafa Quraish2022-02-051-0/+66
|
* [compiler.cup] Add codegen for relational + if/conditional supportMustafa Quraish2022-02-051-2/+83
|
* [compiler.cup] Add support for lexically scoped local variablesMustafa Quraish2022-02-051-0/+37
|
* Add implementation of self-hosted compiler so farMustafa Quraish2022-02-051-0/+151
There's also a `run.sh2` script which does the following: - Compiles the C compiler `build/cupcc` - Compiles the self-hosted compiler `build/cup.out` (with `cupcc`) - Compiles the specified file on CLI with `build/cup.out` - Runs this exectuable and shows the output