From 080cbc9fb0ce959546f0077a1a4b66055341039a Mon Sep 17 00:00:00 2001 From: Liam Waldron Date: Mon, 4 Dec 2023 19:33:10 -0500 Subject: [PATCH] idk why i made this lmao --- Makefile | 5 +++++ README.md | 17 +++++++++++++++++ compiler/hell.l | 14 ++++++++++++++ examples/example.hell | 9 +++++++++ 4 files changed, 45 insertions(+) create mode 100644 Makefile create mode 100644 README.md create mode 100644 compiler/hell.l create mode 100644 examples/example.hell diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..f45f05e --- /dev/null +++ b/Makefile @@ -0,0 +1,5 @@ +all: + flex hell.l + gcc lex.yy.c -lfl +clean: + rm lex.yy.c a.out diff --git a/README.md b/README.md new file mode 100644 index 0000000..8dcd869 --- /dev/null +++ b/README.md @@ -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 diff --git a/compiler/hell.l b/compiler/hell.l new file mode 100644 index 0000000..bd0c7b0 --- /dev/null +++ b/compiler/hell.l @@ -0,0 +1,14 @@ +%% +"func" { printf("int"); } + +local { printf("static"); } + +"import" { printf("#include"); } + +"str" { printf("char"); } + + /* Library declarations */ + +"hell:std.ioutils" { printf(""); } +"hell:std.ioutils.writeln" { printf("printf"); } +"hell:std.ioutils.readln" { printf("scanf"); } diff --git a/examples/example.hell b/examples/example.hell new file mode 100644 index 0000000..0d77570 --- /dev/null +++ b/examples/example.hell @@ -0,0 +1,9 @@ +import hell:std.ioutils + +func +main(int argc, str argv[]) +{ + while (1) { + hell:std.ioutils.writeln("Hello\n"); + } +}