hell/compiler/hell.l

27 lines
530 B
Plaintext

%%
"func" { printf("int"); }
local { printf("static"); }
"import" { printf("#include"); }
"str" { printf("char"); }
/*** Library declarations ***/
/* ioutils */
"hell:std.ioutils" { printf("<stdio.h>"); }
"hell:std.ioutils.writeln" { printf("printf"); }
"hell:std.ioutils.readln" { printf("scanf"); }
/* keygen */
"hell:std.keygen" { printf("<hellkeygen.h>"); }
"hell:std.keygen.gen" { printf("keygen_gen"); }
/* rng */
"hell:std.rng" { printf("<hellrng.h"); }
"hell:std.rng.gen" { printf("rng_randint"); }