diff --git a/compiler/hell.l b/compiler/hell.l index bd0c7b0..5467261 100644 --- a/compiler/hell.l +++ b/compiler/hell.l @@ -7,8 +7,20 @@ local { printf("static"); } "str" { printf("char"); } - /* Library declarations */ + /*** Library declarations ***/ + + /* ioutils */ "hell:std.ioutils" { printf(""); } "hell:std.ioutils.writeln" { printf("printf"); } "hell:std.ioutils.readln" { printf("scanf"); } + + /* keygen */ + +"hell:std.keygen" { printf(""); } +"hell:std.keygen.gen" { printf("keygen_gen"); } + + /* rng */ + +"hell:std.rng" { printf(" ${INFILE}.new + if [ "$?" != 0 ]; then + printf "${0}: error: HELL preprocessor failed to run\n" + exit 1 + fi + + printf "compiling ${INFILE}\n" + gcc ${INFILE}.new -o ${INFILE} + if [ "$?" != 0 ]; then + printf "${0}: error: C compiler failed to run\n" + exit 1 + fi + + printf "finished compiling\n" + exit 0 + ;; + -*|--*) + usage_small "$@" + exit 0 + ;; +esac + +usage_small "$@" +exit 1