45 lines
794 B
C
45 lines
794 B
C
#ifndef STERLING_COMPILER_H
|
|
# define STERLING_COMPILER_H
|
|
|
|
#include <stdint.h>
|
|
#include <stdbool.h>
|
|
#include <stddef.h>
|
|
#include <stdlib.h>
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
#include <ctype.h>
|
|
|
|
//simd
|
|
# ifdef __x86_64__
|
|
# include <x86intrin.h>
|
|
# endif
|
|
|
|
typedef enum {
|
|
TOK_NONE = 1 << 0,
|
|
TOK_RAW = 1 << 1,
|
|
TOK_STRING = 1 << 2,
|
|
TOK_OP = 1 << 3,
|
|
TOK_PREPROC = 1 << 4,
|
|
TOK_COMMENT = 1 << 5,
|
|
TOK_KEY = 1 << 6,
|
|
TOK_ID = 1 << 7 // New: For variable/function names
|
|
} TKN_CTX;
|
|
|
|
typedef struct Token_s {
|
|
size_t size;
|
|
TKN_CTX ctx;
|
|
char *data;
|
|
} Token_t;
|
|
|
|
typedef struct {
|
|
char *op;
|
|
size_t len;
|
|
} MultiOp;
|
|
|
|
typedef struct {
|
|
const char *name;
|
|
TKN_CTX ctx;
|
|
} KeywordEntry;
|
|
|
|
#endif
|