commit cbc97864c99571d2435d009d80f63a595c7bdaba Author: ItzzCode <51547168+ItzzCode@users.noreply.github.com> Date: Tue Oct 18 22:21:42 2022 -0400 init 2 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b8a713d --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.vscode +*.exe \ No newline at end of file diff --git a/compiler.cpp b/compiler.cpp new file mode 100644 index 0000000..2ac280b --- /dev/null +++ b/compiler.cpp @@ -0,0 +1,33 @@ +#include "global.h" + +#include + +class tokens { + public: + enum type { + comment, + variable, + integer, + string, + construct + }; + + type tokenType; + char* tokenValue; + + tokens( type aTokenType, char* aTokenValue ) { + tokenType = aTokenType; + tokenValue = aTokenValue; + } +}; + + +tokens getTok( char code[] ) { + if( code[0] == '#' ) + return tokens(tokens::comment, ""); + return tokens(tokens::comment, ""); +} + +void compiler( char filename[] ) { + std::cout << getTok(filename).tokenType << ' ' << getTok(filename).tokenValue; +} \ No newline at end of file diff --git a/global.h b/global.h new file mode 100644 index 0000000..48242b7 --- /dev/null +++ b/global.h @@ -0,0 +1,8 @@ +#pragma once + +#define DEBUG 1 +#if DEBUG == 1 + #define LOG(x) std::cout << x << "\n"; +#else + #define LOG(x) +#endif \ No newline at end of file diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..407c39e --- /dev/null +++ b/main.cpp @@ -0,0 +1,21 @@ +#include + +#include "compiler.cpp" +#include "global.h" + +void help() { + LOG("Help called") + std::cout << "ITLC v0.0.0\n\nUSAGE:\n\titlc [File] {-h} {-o}"; +} + +int main( int argc, char *argv[] ) { + LOG("Program start") + if( argc == 1 ) { + help(); + } else { + LOG(argv[1]) + compiler("# a aa "); + } + + return 0; +} \ No newline at end of file diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..7e8bcd7 --- /dev/null +++ b/readme.md @@ -0,0 +1,3 @@ +# TreeLang + +Treeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee