def def_error_type(cls, _id, pattern, message, *args): from ezmlex.tokens import def_token, token from ezmlex.patterns import ccat tab = cls.error_types() def_token(tab, _id, pattern, _id, *args) token(tab, _id).is_error = lambda cls : True token(tab, _id).message = lambda cls : message
def error_type(cls, _id): from ezmlex.tokens import token return token(cls.error_types(), _id)
def token_type(cls, _id): from ezmlex.tokens import token return token(cls.token_types(), _id)