SterlingLang/include/SterlingCompiler.h

54 lines
918 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,
TOK_STRING,
TOK_RAW,
TOK_PREPROCESSOR,
} TKN_CTX;
typedef struct Token_s {
int size;
TKN_CTX ctx;
char *data;
} Token_t;
//builtin type: if x86_64, then since i use simd, should align them
typedef struct vec2 {
float x;
float y;
float _padding1;
float _padding2;
} __attribute__((aligned(16)));//losing 8 byte
typedef struct vec3 {
float x;
float y;
float z;
float _padding;
} __attribute__((aligned(16)));//losing 4 byte
typedef struct vec4 {
float x;
float y;
float z;
float w;
} __attribute__((aligned(16)));
#endif