From: Brendan Hansen Date: Mon, 19 Apr 2021 15:54:28 +0000 (-0500) Subject: starting work on C compilation. X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=600750b3ce9e16f476826d885ff034c6d6d4c72d;p=onyx.git starting work on C compilation. --- diff --git a/bin/onyx b/bin/onyx index c7d579b5..063e96de 100755 Binary files a/bin/onyx and b/bin/onyx differ diff --git a/build.bat b/build.bat index 730d3119..3e3bc625 100644 --- a/build.bat +++ b/build.bat @@ -1,6 +1,6 @@ @echo off -set SOURCE_FILES=src/onyx.c src/onyxastnodes.c src/onyxbuiltins.c src/onyxchecker.c src/onyxclone.c src/onyxdoc.c src/onyxentities.c src/onyxerrors.c src/onyxlex.c src/onyxparser.c src/onyxsymres.c src/onyxtypes.c src/onyxutils.c src/onyxwasm.c +set SOURCE_FILES=src/onyx.c src/onyxastnodes.c src/onyxbuiltins.c src/onyxchecker.c src/onyxclone.c src/onyxdoc.c src/onyxentities.c src/onyxerrors.c src/onyxlex.c src/onyxparser.c src/onyxsymres.c src/onyxtypes.c src/onyxutils.c src/onyxwasm.c src/onyxc.c if "%1" == "1" ( set FLAGS=/O2 /MT /Z7 @@ -13,4 +13,4 @@ del *.ilk > NUL 2> NUL cl.exe %FLAGS% /I include /std:c17 /Tc %SOURCE_FILES% /link /DEBUG /OUT:onyx.exe /incremental:no /opt:ref /subsystem:console -del *.obj > NUL 2> NUL \ No newline at end of file +del *.obj > NUL 2> NUL diff --git a/build.sh b/build.sh index 07fbeb47..567e92f8 100755 --- a/build.sh +++ b/build.sh @@ -7,7 +7,7 @@ sudo cp -r ./core/ "$CORE_DIR" [ "$1" = "libs_only" ] && exit 0 -C_FILES="onyx onyxastnodes onyxbuiltins onyxchecker onyxclone onyxdoc onyxentities onyxerrors onyxlex onyxparser onyxsymres onyxtypes onyxutils onyxwasm" +C_FILES="onyx onyxastnodes onyxbuiltins onyxchecker onyxclone onyxdoc onyxentities onyxerrors onyxlex onyxparser onyxsymres onyxtypes onyxutils onyxwasm onyxc" TARGET='./bin/onyx' CC='gcc' diff --git a/include/onyxc.h b/include/onyxc.h new file mode 100644 index 00000000..3ea25584 --- /dev/null +++ b/include/onyxc.h @@ -0,0 +1,27 @@ +#ifndef ONYXC_H +#define ONYXC_H + +#include "bh.h" +#include "onyxastnodes.h" + +typedef struct CMemoryReservation { + i32 number; + i32 size; + char* initial_value; +} CMemoryReservation; + +typedef struct CStringLiteral { + i32 number; + i32 size; + char* data; +} CStringLiteral; + +typedef struct CFile { + + bh_arr(CMemoryReservation) memory_reservations; + bh_arr(CStringLiteral) string_literals; + +} CFile; + + +#endif diff --git a/src/onyxc.c b/src/onyxc.c new file mode 100644 index 00000000..2f2fcf4e --- /dev/null +++ b/src/onyxc.c @@ -0,0 +1,3 @@ +#include "onyxc.h" + +