| Commit message (Collapse) | Author | Age | Files | Lines | |
|---|---|---|---|---|---|
| * | [cup] Add `>>` and `<<` operators, `fork()` buildin and `SYS_execve`HEADmaster | Mustafa Quraish | 2022-02-08 | 4 | -1/+50 |
| | | |||||
| * | [cup] Remove unnecessary function from codegen, add info to README | Mustafa Quraish | 2022-02-07 | 2 | -12/+16 |
| | | |||||
| * | [cup] Self-hosting is now possible! Make some tweaks to match C output | Mustafa Quraish | 2022-02-07 | 6 | -76/+378 |
| | | | | | | | | | | | | 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. | ||||
| * | Add missing files to self-hosted directory | Mustafa Quraish | 2022-02-07 | 3 | -0/+172 |
| | | | | | ... Someone forgot to add them into the repo for a while. | ||||
| * | [cup] Add support for `here` keyword + fix `putu_buffer` bug | Mustafa Quraish | 2022-02-07 | 1 | -0/+16 |
| | | |||||
| * | [cup] Add support for string literals | Mustafa Quraish | 2022-02-07 | 1 | -0/+28 |
| | | |||||
| * | [cup] Port over all the type-checking/pointer arithmetic stuff | Mustafa Quraish | 2022-02-07 | 4 | -26/+252 |
| | | | | | | | | | | 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 ability to import files | Mustafa Quraish | 2022-02-07 | 3 | -15/+76 |
| | | |||||
| * | [C]: Add `here` keyword that evaluates to a string with it's location | Mustafa Quraish | 2022-02-06 | 4 | -18/+19 |
| | | | | | | | | | | It's not really a keyword like the other ones, but just handled completely at the lexer level since it already knows the location of the token, so it injects a string literal instead. We also use this in the self-hosted compiler now for better error reporting for where the error happened internally. | ||||
| * | [cup] Flesh out some more boilerplate based on C implementation | Mustafa Quraish | 2022-02-06 | 2 | -2/+145 |
| | | | | | | | No feature has really been fully added here, just fleshing out some more of the global variables / functions / conditions here so it's easier to implement them later on | ||||
| * | [cup] Add support for global (initialized) variables | Mustafa Quraish | 2022-02-06 | 2 | -1/+58 |
| | | |||||
| * | [cup] Add support for builtin functions, add `print()` | Mustafa Quraish | 2022-02-05 | 4 | -2/+24 |
| | | |||||
| * | [cup] Fix error in codegen for `if` | Mustafa Quraish | 2022-02-05 | 1 | -3/+2 |
| | | |||||
| * | [compiler.cup] Support for+while loops | Mustafa Quraish | 2022-02-05 | 2 | -2/+77 |
| | | |||||
| * | [compiler.cup] Add support for function calls! | Mustafa Quraish | 2022-02-05 | 2 | -10/+128 |
| | | |||||
| * | [compiler.cup] codegen for unary ops, short circuiting &&/|| | Mustafa Quraish | 2022-02-05 | 2 | -1/+66 |
| | | |||||
| * | [compiler.cup] Add codegen for relational + if/conditional support | Mustafa Quraish | 2022-02-05 | 2 | -2/+96 |
| | | |||||
| * | [compiler.cup] Add support for lexically scoped local variables | Mustafa Quraish | 2022-02-05 | 4 | -16/+150 |
| | | |||||
| * | Add implementation of self-hosted compiler so far | Mustafa Quraish | 2022-02-05 | 8 | -0/+1546 |
| 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 | |||||