Crates.io | ezc |
lib.rs | ezc |
version | 0.2.0 |
source | src |
created_at | 2020-10-31 20:52:46.522794 |
updated_at | 2020-11-02 12:52:35.028558 |
description | A compiler for ez |
homepage | https://github.com/g-w1/ezc |
repository | https://github.com/g-w1/ezc |
max_upload_size | |
id | 307323 |
size | 337,208 |
Compiler for ez
.
This is for an independent study in school.
ez
should resemble englishez
in another language (zig, rust, c, asm, ..)To run just do ezc file
use -g
flag for debug info (it will generate a out.asm file). then you can open in gdb or lldb
To get the standard library pass -stdlib-path /path/to/stdlib
to the compiler. To compile the standard library, go into the lib directory in this compiler. Then run zig build
in that directory and find the library in zig-cache/lib/libstd.a
. You will probably need pretty close to master branch zig. You can find that here: https://ziglang.org/download/.
To test the code: cargo test
To test the generated code you can do cd tests; ./test.sh
. Note: this requires gcc
.
HAS_NO_ZIG=1 cargo ...(whatever command you want)
. This may be useful if you are on a system without zig or want to provide your own standard library.lexer
ast (structs for ast items)
parser
codegen
immutable assignments
mutable variables
semantic analysis.
expressions (the start of recursive parsing)
if statements
loops
fancy compile errors (with carets)
functions
modules
char literals
standard library
io
arrays and string literals
finish blog bost
finish documentation
remove all the TODO
s