From 545584660f4ab4d223535a77a0d04ef103344de0 Mon Sep 17 00:00:00 2001 From: Liam Waldron Date: Mon, 10 Mar 2025 15:20:09 -0400 Subject: [PATCH] 3/10 --- Makefile | 8 +++++--- compiler/hell.l | 13 +++++++++++++ examples/example.hell | 4 ++++ 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index ef513c0..643bba7 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,11 @@ all: flex compiler/hell.l - gcc lex.yy.c -lfl -o hellp + gcc lex.yy.c -lfl -o compiler/hellp install: - install hellp /usr/bin + install compiler/hellp /usr/bin + install compiler/hellc /usr/bin clean: - rm lex.yy.c hellp + rm /compiler/lex.yy.c /compiler/hellp uninstall: rm /usr/bin/hellp + rm /usr/bin/hellc diff --git a/compiler/hell.l b/compiler/hell.l index 5467261..4b8231d 100644 --- a/compiler/hell.l +++ b/compiler/hell.l @@ -7,6 +7,15 @@ local { printf("static"); } "str" { printf("char"); } +/*** Data types ***/ + +"integer" { printf("int"); } +"decimal" { printf("float"); } +"character" { printf("char"); } +"large_decimal" { printf("double"); } +"CLion" { printf("void"); } + + /*** Library declarations ***/ /* ioutils */ @@ -15,6 +24,10 @@ local { printf("static"); } "hell:std.ioutils.writeln" { printf("printf"); } "hell:std.ioutils.readln" { printf("scanf"); } + /* procutils */ + +"hell:std.unix" { printf(""); } + /* keygen */ "hell:std.keygen" { printf(""); } diff --git a/examples/example.hell b/examples/example.hell index 0d77570..a482e36 100644 --- a/examples/example.hell +++ b/examples/example.hell @@ -1,3 +1,7 @@ +// +// example.hell +// + import hell:std.ioutils func