aboutsummaryrefslogtreecommitdiff
path: root/std/common.cup
Commit message (Collapse)AuthorAgeFilesLines
* [cup] Add `>>` and `<<` operators, `fork()` buildin and `SYS_execve`HEADmasterMustafa Quraish2022-02-081-3/+33
|
* [cup] Add support for `here` keyword + fix `putu_buffer` bugMustafa Quraish2022-02-071-3/+3
|
* [compiler.cup] Add support for function calls!Mustafa Quraish2022-02-051-1/+1
|
* [compiler.cup] Add support for lexically scoped local variablesMustafa Quraish2022-02-051-0/+16
|
* Some very minor fixes (look at message)Mustafa Quraish2022-02-051-1/+2
| | | | | (1) Add support for escaped single quotes (2) Fix `putu_buffer` in `std/common.cup`
* Add `lseek` and `mmap` syscall infoMustafa Quraish2022-02-051-0/+8
|
* Miscellaneous stdlib additionsMustafa Quraish2022-02-051-5/+41
| | | | | | - `close()` syscall - `putu_buffer()` - toy `malloc()` which can allocate from a 1gb pool without freeing.
* Add `void` type and allow void* to be assigned to other ptr typesMustafa Quraish2022-02-051-2/+6
|
* Allow `builtins.c` to inject constants into program, use for syscallsMustafa Quraish2022-02-051-21/+109
| | | | | | We can now directly expose the `syscallN()` APIs to the program and define the `open()`, `write()` etc syscalls in the stdlib. This simplifies the implementation a decent bunch :^)
* Minor fixes, rearranging, whitespace trimming. No functional changes.Mustafa Quraish2022-02-041-4/+9
|
* Add helper to create builtins for syscalls + implement `read()`Mustafa Quraish2022-02-031-1/+1
| | | | | | | | | | This was possible, but very tedious to do by hand before. Now we automate it based on the number of arguments. Note that currently we can't just add `syscall3()` etc as builtins because the actual numbers for the system calls vary from one system to another, and we want to maintain support for macOS and Linux (at least for now).
* Remove `putc` intrinsic and replace with `write(fd, buf, size)`Mustafa Quraish2022-02-031-5/+17
| | | | | `putc`, `puts`, and `putnum` in `std/common.cup` are now implemented in terms of the `write()` syscall.
* Move all common utilities to `std/common.cup`Mustafa Quraish2022-02-031-0/+73
In the future we can split this into multiple files if we need to, after we've added to ability to handle more complex input graphs without parsing the same file twice.