starting work on C compilation.
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Mon, 19 Apr 2021 15:54:28 +0000 (10:54 -0500)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Mon, 19 Apr 2021 15:54:28 +0000 (10:54 -0500)
bin/onyx
build.bat
build.sh
include/onyxc.h [new file with mode: 0644]
src/onyxc.c [new file with mode: 0644]

index c7d579b5b06ced6b2e0f836ae578b5c7911d6af0..063e96decd24a57efb8d055814b7c4fb53a4e59b 100755 (executable)
Binary files a/bin/onyx and b/bin/onyx differ
index 730d3119006a2ddc7bd76f295da989daccd4b7a0..3e3bc625429c83d1ba423bd418f3655a21f7c0c0 100644 (file)
--- 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
index 07fbeb47b4d2776a8baa6852cb77b491feb41f65..567e92f843b7228d6b2653a239891a46110b3a20 100755 (executable)
--- 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 (file)
index 0000000..3ea2558
--- /dev/null
@@ -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 (file)
index 0000000..2f2fcf4
--- /dev/null
@@ -0,0 +1,3 @@
+#include "onyxc.h"
+
+