-
Notifications
You must be signed in to change notification settings - Fork 0
Tokens
MichaΕ Dul edited this page May 23, 2023
·
1 revision
t_TYPE = r"π’|βΊοΈ|π|π "
t_LEFTARROW = r"<"
t_RIGHTARROW = r">"
t_FLOAT = r"(\+|-)?\d+\.\d+"
t_INT = r"(\+|-)?\d+"
t_BOOLEAN = r"β
|β"
t_STRING = r"\".*\"|βοΈ\β.*\β"
t_NONE = r"π"
t_IDENTIFIER = r"[a-zA-Z_][a-zA-Z0-9_]*"
t_CLASS = r"ποΈ"
t_INHERITS = r"π¨βπ¦"
t_SELF = r"π€"
t_CONSTRUCTOR = r"ποΈ"
t_FUNCTION = r"πΊ"
t_RETURNARROW = r"->"
t_LBRACE = r"\{"
t_RBRACE = r"\}"
t_LPAREN = r"\("
t_RPAREN = r"\)"
t_LBRACKET = r"\["
t_RBRACKET = r"\]"
t_COLON = r":"
t_COMMA = r","
t_DOT = r"\."
# assignment operators
t_ASSIGN = r"="
t_PLUSASSIGN = r"\+="
t_MINUSASSIGN = r"-="
t_TIMESASSIGN = r"\*="
t_DIVIDEASSIGN = r"/="
t_MODULOASSIGN = r"%="
t_POWERASSIGN = r"\^="
t_FLOORASSIGN = r"//="
# arithmetic operators
t_PLUS = r"\+"
t_MINUS = r"-"
t_TIMES = r"\*"
t_DIVIDE = r"/"
t_MODULO = r"%"
t_POWER = r"\^"
t_FLOOR = r"//"
# comparison operators
t_LESS = r"π"
t_LESSEQUAL = r"πβοΈ"
t_GREATER = r"π"
t_GREATEREQUAL = r"πβοΈ"
t_EQUAL = r"βοΈ"
# logical operators
t_AND = r"and"
t_OR = r"or"
t_NOT = r"not"
# data structures
t_LIST = r"π"
t_TUPLE = r"πΌ"
t_DICT = r"πΊοΈ"
t_SET = r"ποΈ"
# if and match
t_TREE = r"π²"
t_LEAF = r"π"
t_FALLENLEAF = r"π"
# loops
t_LOOP = r"π"
# flow control
t_BREAK = r"π"
t_CONTINUE = r"π¦"
t_RETURN = r"π¦"
t_PASS = r"π¦₯"
# importing
t_IMPORT = r"π’"
t_FROM = r"ποΈ"
t_AS = r"π€Ώ"
# aliases
t_PRINT = r"π¨οΈ"
t_NEWLINE = r'\n'
# comments
t_MULTILINECOMMENT = r"π¬β¬οΈ(.|\n)*?π¬β¬οΈ\n"
t_ONELINECOMMENT = r"π¬.*\n"
Pint Programming Language
MichaΕ Dul, Arkadiusz Paterak