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 def_token_type(cls, _id, pattern, *args): from ezmlex.tokens import def_token from ezmlex.patterns import ccat def_token(cls.token_types(), _id, ccat(pattern), *args)