36 lines
509 B
C
36 lines
509 B
C
#ifndef LEXER_H
|
|
#define LEXER_H
|
|
|
|
#include <stdlib.h>
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
#include <ctype.h>
|
|
#include "list.h"
|
|
#include "tokenizer.h"
|
|
|
|
typedef enum {
|
|
TK_Add,
|
|
TK_Sub,
|
|
TK_Mul,
|
|
TK_Div,
|
|
TK_Power,
|
|
TK_LParam,
|
|
TK_RParam,
|
|
TK_LBracket,
|
|
TK_RBracket,
|
|
TK_String,
|
|
TK_Number,
|
|
TK_Hex,
|
|
TK_Opcode,
|
|
TK_Register,
|
|
TK_Label
|
|
} TokenType;
|
|
|
|
typedef struct {
|
|
TokenType type;
|
|
char* value;
|
|
} Token;
|
|
|
|
List* GenerateTokensFromFile(const char*);
|
|
|
|
#endif |