Code cleanup. Converting a number lexeme to a proper integer setup but not done yet. So number tokens don't have a valid value.
This commit is contained in:
@@ -1,14 +0,0 @@
|
||||
#ifndef LEXER_H
|
||||
#define LEXER_H
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include "list.h"
|
||||
#include "tokenizer.h"
|
||||
#include "token.h"
|
||||
|
||||
List* GetTokensFromLine(char*);
|
||||
|
||||
#endif
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
#define OPCODES_H
|
||||
|
||||
#include <string.h>
|
||||
#include "lexer.h"
|
||||
#include "token.h"
|
||||
|
||||
#define OPCODECOUNT 10
|
||||
#define REGISTERCOUNT 8
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include "stdlib.h"
|
||||
#include "token.h"
|
||||
#include "list.h"
|
||||
|
||||
+7
-2
@@ -2,6 +2,9 @@
|
||||
#define TOKEN_H
|
||||
|
||||
#include "stdlib.h"
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
|
||||
typedef enum {
|
||||
PLUS,
|
||||
@@ -30,10 +33,12 @@ typedef enum {
|
||||
|
||||
typedef struct {
|
||||
TokenType type;
|
||||
char* value;
|
||||
char* lexeme;
|
||||
void* value;
|
||||
int line;
|
||||
} Token;
|
||||
|
||||
Token* CreateToken(TokenType type, char* value);
|
||||
Token* CreateToken(char*, void*, int, TokenType);
|
||||
void FreeToken(Token*);
|
||||
|
||||
#endif
|
||||
@@ -1,13 +0,0 @@
|
||||
#ifndef TOKENIZER_H
|
||||
#define TOKENIZER_H
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "list.h"
|
||||
|
||||
List* GetTokens(const char *);
|
||||
char* GetToken(char*);
|
||||
char* PeekNextToken(void);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user