codebased/include/scirpt/token.h
2023-04-12 01:59:42 +02:00

47 lines
923 B
C

#ifndef SCIRPT_TOKENS_H
#define SCIRPT_TOKENS_H
#include "scirpt/position.h"
#include <stddef.h>
typedef enum {
ScirptTokenTypeEof,
ScirptTokenTypeInvalidChar,
ScirptTokenTypeId,
ScirptTokenTypeInt,
ScirptTokenTypeString,
ScirptTokenTypeLParen,
ScirptTokenTypeRParen,
ScirptTokenTypeLBrace,
ScirptTokenTypeRBrace,
ScirptTokenTypeLBracket,
ScirptTokenTypeRBracket,
ScirptTokenTypeDot,
ScirptTokenTypeComma,
ScirptTokenTypeColon,
ScirptTokenTypeSemicolon,
ScirptTokenTypePlus,
ScirptTokenTypeMinus,
ScirptTokenTypeAsterisk,
ScirptTokenTypeNull,
ScirptTokenTypeFalse,
ScirptTokenTypeTrue,
ScirptTokenTypeLet,
ScirptTokenTypeIf,
ScirptTokenTypeElse,
ScirptTokenTypeWhile,
ScirptTokenTypeFor,
ScirptTokenTypeIn,
ScirptTokenTypeBreak,
ScirptTokenTypeFn,
ScirptTokenTypeReturn,
} ScirptTokenType;
typedef struct {
ScirptTokenType type;
ScirptPosition pos;
size_t length;
} ScirptToken;
#endif