1
0
Fork 0
mirror of https://github.com/Lyxal/Keta.git synced 2024-08-14 23:53:13 +00:00
Keta/ekg/TokenLib.py
2019-12-28 11:14:53 +11:00

30 lines
632 B
Python

# A Simple Token Class For Ekg
class Token():
def __init__(self, name: str, value: str) -> None:
self.tkn_name: str = name
self.tkn_value: str = value
def get_name(self) -> str:
return self.tkn_name
def get_value(self) -> str:
return self.tkn_value
def get_data(self) -> (str, str):
return (self.tkn_name, self.tkn_value)
def set_name(self, name: str):
self.tkn_name = name
def set_value(self, value: str):
self.tkn_value = name
# Token names
INSTRUCTION = "instruction"
BLOCK = "block"
STRING = "string"
INTEGER = "integer"
ESCAPE = "escape"