[LEX] Token definition

This commit is contained in:
Tiago Sousa 2023-04-30 23:09:21 +01:00
parent d581a14459
commit 842c344ef1

28
src/lexer.py Normal file
View file

@ -0,0 +1,28 @@
import ply.lex as lex
tokens = [
"ID",
"STR"
"DATE",
"TIME",
"DATETIME",
"INT",
"FLOAT", # need to implement exponents check https://toml.io/en/
"HEX",
"BIN",
"OCT",
"INF",
"NAN",
"COMMENT",
]
def t_COMMENT(t):
r"#.*"
pass
t_ignore = "\n\t "
literals = "[]{},="
lexer = lex.lex()