Crates.io | yotc |
lib.rs | yotc |
version | 0.3.0 |
source | src |
created_at | 2020-05-21 02:41:16.57067 |
updated_at | 2020-06-21 23:29:41.294149 |
description | LLVM frontend for yot - a toy language. |
homepage | https://github.com/akmin04/yot-lang |
repository | https://github.com/akmin04/yot-lang |
max_upload_size | |
id | 243995 |
size | 66,883 |
LLVM frontend for yot - a toy language.
Loosely based off of LLVM Kaleidoscope
cargo install yotc
gcc
needs to be in PATHyotc (path to file)
yotc --help
for more optionsint
and functions must return an int
as well. Comparison operators return 1 or 0@sum[a, b] {
-> a + b // -> is the return keyword
}
@sum[a, b] -> a + b;
@!print[_, _];
sum(a, b);
@a = 5;
@a;
@b = a + 5;
=
, +
, -
, *
, /
, ==
, !=
, <
, >
, <=
, >=
.
@a = (-b + 5) - 10 / -(5 - -2);
//
and tokens are ignored until the end of the linemain
function entry pointexamples/
equals_ten.yot
with yotc equals_ten.yot -f object-file
io.cpp
with g++ io.cc equals_ten.o
to generate an executable