idk why i made this lmao

This commit is contained in:
Liam Waldron 2023-12-04 19:33:10 -05:00
commit 080cbc9fb0
4 changed files with 45 additions and 0 deletions

5
Makefile Normal file
View File

@ -0,0 +1,5 @@
all:
flex hell.l
gcc lex.yy.c -lfl
clean:
rm lex.yy.c a.out

17
README.md Normal file
View File

@ -0,0 +1,17 @@
# Highly Extreme Level Language (hell)
HELL is a "programming language" I made when I was bored.
# How does it work?
It's a lexical analyzer that translates a custom syntax into C and compiles it.
That's it.
# Installation
idk copy compiler to $PATH or something
# Documentation
ill get to it eventually

14
compiler/hell.l Normal file
View File

@ -0,0 +1,14 @@
%%
"func" { printf("int"); }
local { printf("static"); }
"import" { printf("#include"); }
"str" { printf("char"); }
/* Library declarations */
"hell:std.ioutils" { printf("<stdio.h>"); }
"hell:std.ioutils.writeln" { printf("printf"); }
"hell:std.ioutils.readln" { printf("scanf"); }

9
examples/example.hell Normal file
View File

@ -0,0 +1,9 @@
import hell:std.ioutils
func
main(int argc, str argv[])
{
while (1) {
hell:std.ioutils.writeln("Hello\n");
}
}