Skip to content

Commit

Permalink
Add token
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed Dec 24, 2023
1 parent 01c330a commit b7f7c68
Show file tree
Hide file tree
Showing 3 changed files with 137 additions and 2 deletions.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Copyright 2023 the JayCeS authors. All rights reserved. MIT license.
# Copyright 2023 the JayCeS authors. All rights reserved.
#
# MIT license.

cmake_minimum_required(VERSION 3.16.0)

Expand Down
131 changes: 131 additions & 0 deletions include/Token.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
#ifndef __TOKEN_H__
/**
* Copyright 2023 the JayCeS authors. All rights reserved.
*
* MIT license.
*/
#define __TOKEN_H__

namespace jayces {
/**
* @brief Token kind
* @desc Type of token
*/
enum TokenKind {
LOAD,
IMPORT,

VAR,
CONST,
ENUM,
TYPE,
STRUCT,
FUN,
OPERATOR,
RETURN,
IF,
ELSE,
FOR,
WHILE,
SWITCH,
CAST,
DEFER,

BREAK,
CONTINUE,

TYPE_SIZE,
TYPE_ALLIGN,
VALUE_SIZE,

TRUE,
FALSE,
NULL,
UNDEFINED,

VARARGS,

DOT,
DOT_DOT,
COMMA,
COLON,
COLON_COLON,
SEMICOLON,
AT,

PLUS,
MINUS,
STAR,
SLASH,
PERCENT,

OR,
OR_OR,
AND,
AND_AND,
XOR,

NOT,

EQUAL,
EQUAL_EQUAL,
BANG,
BANG_EQUAL,
GREATER,
GREATER_EQUAL,
SMALLER,
SMALLER_EQUAL,

RIGHT_SHIFT,
RIGHT_SHIFT_EQUAL,
LEFT_SHIFT,
LEFT_SHIFT_EQUAL,

PLUS_EQUAL,
MINUS_EQUAL,
STAR_EQUAL,
SLASH_EQUAL,
PARCENT_EQUAL,

OR_EQUAL,
AND_EQUAL,
XOR_EQUAL,

PLUS_PLUS,
MINUS_MINUS,

RIGHT_ARROW,

OPEN_PAREN,
CLOSE_PAREN,
OPEN_BRACKET,
CLOSE_BRACKET,
OPEN_BRACE,
CLOSE_BRACE,

IDENTIFIER,
STRING,
CHARACTER,

INT,
INT1,
INT8,
INT16,
INT32,
INT64,

UINT8,
UINT16,
UINT32,
UINT64,

FLOAT,
FLOAT32,
FLOAT64,

INVALID,
END_OF_FILE,
};
}

#endif /* __TOKEN_H__ */
4 changes: 3 additions & 1 deletion scripts/build.bat
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
:: Copyright 2023 the JayCeS authors. All rights reserved. MIT license.
:: Copyright 2023 the JayCeS authors. All rights reserved.
::
:: MIT license.

@echo off

Expand Down

0 comments on commit b7f7c68

Please sign in to comment.