aboutsummaryrefslogtreecommitdiff
path: root/compiler/lexer.cup
Commit message (Collapse)AuthorAgeFilesLines
* [cup] Add `>>` and `<<` operators, `fork()` buildin and `SYS_execve`HEADmasterMustafa Quraish2022-02-081-0/+4
|
* [cup] Self-hosting is now possible! Make some tweaks to match C outputMustafa Quraish2022-02-071-10/+5
| | | | | | | | | | | 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 `here` keyword + fix `putu_buffer` bugMustafa Quraish2022-02-071-0/+16
|
* [cup] Add ability to import filesMustafa Quraish2022-02-071-0/+13
|
* [C]: Add `here` keyword that evaluates to a string with it's locationMustafa Quraish2022-02-061-1/+1
| | | | | | | | | 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.
* [compiler.cup] Add support for lexically scoped local variablesMustafa Quraish2022-02-051-5/+0
|
* Add implementation of self-hosted compiler so farMustafa Quraish2022-02-051-0/+288
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