moved lexer functions to Lexer.c and included Lexer.c

This commit is contained in:
SinusFox
2023-05-09 15:25:14 +02:00
parent d548a90254
commit 9cde0cf1df
2 changed files with 33 additions and 31 deletions
+31
View File
@@ -0,0 +1,31 @@
#include "Lexer.h"
int start(char* src) {
// if (src != NULL) {
// return _GET_NEXT_CHARACTER_;
// } else {
// return _STOP_;
// }
return _STOP_; // placeholder
}
int getNextCharacter() {
return _STOP_; // placeholder
}
int readIdentifier() {
return _STOP_; // placeholder
}
int readNumLit() {
return _STOP_; // placeholder
}
int readOperator() {
return _STOP_; // placeholder
}
int readPunctuation() {
return _STOP_; // placeholder
}
+2 -31
View File
@@ -1,35 +1,6 @@
#include <stdio.h> #include <stdio.h>
#include "Lexer.h" #include "Lexer.h"
#include "Lexer.c"
int start(char* sourcecode) {
// if (sourcecode != NULL) {
// return _GET_NEXT_CHARACTER_;
// } else {
// return _STOP_;
// }
return _STOP_; // placeholder
}
int getNextCharacter() {
return _STOP_; // placeholder
}
int readIdentifier() {
return _STOP_; // placeholder
}
int readNumLit() {
return _STOP_; // placeholder
}
int readOperator() {
return _STOP_; // placeholder
}
int readPunctuation() {
return _STOP_; // placeholder
}
int main() { int main() {
char* sourcecode = "Hello World the second - I coded this before. So yeah, FOXES ARE SUPERIOR.\nBut the professor wants us to write the following: \"index = 2 * count + 42;\"\n\n"; char* sourcecode = "Hello World the second - I coded this before. So yeah, FOXES ARE SUPERIOR.\nBut the professor wants us to write the following: \"index = 2 * count + 42;\"\n\n";
@@ -60,7 +31,7 @@ int main() {
} }
} while (lexer_state != _STOP_); } while (lexer_state != _STOP_);
printf("Lexer exited with code "); // printf("Lexer exited with code ");
// printf(lexer_state); // printf(lexer_state);
return 0; return 0;