Skip to content

Commit

Permalink
+ add compiler folder and starting point
Browse files Browse the repository at this point in the history
+ add gitignore and cmake
  • Loading branch information
Juyas committed Feb 15, 2022
1 parent 0120255 commit e53ba63
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/cmake-build-debug/
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
cmake_minimum_required(VERSION 3.21)
project(Turing_Complete C)

set(CMAKE_C_STANDARD 11)

include_directories(Compiler)

add_executable(Turing_Complete
Compiler/main.c)
39 changes: 39 additions & 0 deletions Compiler/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
//
// Created on 15.02.2022.
//

#include <stdio.h>
#include <stdlib.h>

typedef enum {
NUMBER, ARRAY
} VarType;

typedef struct Variable {

};

int main(int argc, char *argv[]) {

printf("\n");
for (int i = 1; i < argc; i++) {
printf("%s\n", argv[i]);
}


}

char *readFile(char *fileName) {
FILE *fp = fopen(fileName, "r");
if(fp == NULL)
{
printf("ERROR, compiler doesnt like your file. (or just cannot find it) \"%s\"", fileName);
return NULL;
}
fseek(fp, 0, SEEK_END);
long size = ftell(fp);
rewind(fp);
long file_data_len = size * sizeof(char);
char* buffer = malloc(file_data_len);
//TODO
}

0 comments on commit e53ba63

Please sign in to comment.