This commit is contained in:
ItzzCode 2022-10-18 22:21:42 -04:00
commit cbc97864c9
5 changed files with 67 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
.vscode
*.exe

33
compiler.cpp Normal file
View File

@ -0,0 +1,33 @@
#include "global.h"
#include <tuple>
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;
}

8
global.h Normal file
View File

@ -0,0 +1,8 @@
#pragma once
#define DEBUG 1
#if DEBUG == 1
#define LOG(x) std::cout << x << "\n";
#else
#define LOG(x)
#endif

21
main.cpp Normal file
View File

@ -0,0 +1,21 @@
#include <iostream>
#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;
}

3
readme.md Normal file
View File

@ -0,0 +1,3 @@
# TreeLang
Treeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee