68 lines
1.4 KiB
C
68 lines
1.4 KiB
C
#ifndef SCIRPT_TOKENS_H
|
|
#define SCIRPT_TOKENS_H
|
|
|
|
#include "scirpt/position.h"
|
|
#include <stddef.h>
|
|
|
|
typedef enum {
|
|
ScirptTokenTypeEof,
|
|
ScirptTokenTypeInvalidChar,
|
|
ScirptTokenTypeMalformedComment,
|
|
ScirptTokenTypeMalformedString,
|
|
ScirptTokenTypeId,
|
|
ScirptTokenTypeInt,
|
|
ScirptTokenTypeDecimals,
|
|
ScirptTokenTypeString,
|
|
ScirptTokenTypeLParen,
|
|
ScirptTokenTypeRParen,
|
|
ScirptTokenTypeLBrace,
|
|
ScirptTokenTypeRBrace,
|
|
ScirptTokenTypeLBracket,
|
|
ScirptTokenTypeRBracket,
|
|
ScirptTokenTypeDot,
|
|
ScirptTokenTypeComma,
|
|
ScirptTokenTypeColon,
|
|
ScirptTokenTypeSemicolon,
|
|
ScirptTokenTypePlus,
|
|
ScirptTokenTypePlusEqual,
|
|
ScirptTokenTypeMinus,
|
|
ScirptTokenTypeMinusEqual,
|
|
ScirptTokenTypeAsterisk,
|
|
ScirptTokenTypeAsteriskEqual,
|
|
ScirptTokenTypeSlash,
|
|
ScirptTokenTypeSlashEqual,
|
|
ScirptTokenTypePercent,
|
|
ScirptTokenTypePercentEqual,
|
|
ScirptTokenTypeEqual,
|
|
ScirptTokenTypeEqualEqual,
|
|
ScirptTokenTypeExclamation,
|
|
ScirptTokenTypeExclamationEqual,
|
|
ScirptTokenTypeLt,
|
|
ScirptTokenTypeLtEqual,
|
|
ScirptTokenTypeGt,
|
|
ScirptTokenTypeGtEqual,
|
|
ScirptTokenTypeNull,
|
|
ScirptTokenTypeFalse,
|
|
ScirptTokenTypeTrue,
|
|
ScirptTokenTypeNot,
|
|
ScirptTokenTypeAnd,
|
|
ScirptTokenTypeOr,
|
|
ScirptTokenTypeLet,
|
|
ScirptTokenTypeIf,
|
|
ScirptTokenTypeElse,
|
|
ScirptTokenTypeWhile,
|
|
ScirptTokenTypeFor,
|
|
ScirptTokenTypeIn,
|
|
ScirptTokenTypeBreak,
|
|
ScirptTokenTypeFn,
|
|
ScirptTokenTypeReturn,
|
|
} ScirptTokenType;
|
|
|
|
typedef struct {
|
|
ScirptTokenType type;
|
|
ScirptPosition pos;
|
|
size_t length;
|
|
} ScirptToken;
|
|
|
|
#endif
|