idk why i made this lmao
This commit is contained in:
commit
080cbc9fb0
5
Makefile
Normal file
5
Makefile
Normal 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
17
README.md
Normal 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
14
compiler/hell.l
Normal 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
9
examples/example.hell
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
import hell:std.ioutils
|
||||||
|
|
||||||
|
func
|
||||||
|
main(int argc, str argv[])
|
||||||
|
{
|
||||||
|
while (1) {
|
||||||
|
hell:std.ioutils.writeln("Hello\n");
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user