add proxy for the first part and try to develop the second part

This commit is contained in:
Pierre Geeraert
2025-12-03 12:08:56 +00:00
parent 6c34d510e5
commit 460f18d85a
1095 changed files with 358799 additions and 5 deletions
@@ -0,0 +1,69 @@
from .exceptions import ParseError
from .util._common import _prints
class Tokenizer:
def __init__(self, *args, **kwargs):
super().__init__()
def error(self, *args, **kwargs):
raise ParseError(_prints(*args, **kwargs))
@property
def filename(self):
raise NotImplementedError
@property
def ignorecase(self):
raise NotImplementedError
@property
def pos(self):
raise NotImplementedError
def goto(self, pos):
raise NotImplementedError
def atend(self):
raise NotImplementedError
def ateol(self):
raise NotImplementedError
@property
def current(self):
raise NotImplementedError
@property
def token(self):
return self.current
def next(self):
raise NotImplementedError
def next_token(self):
raise NotImplementedError
def match(self, token):
raise NotImplementedError
def matchre(self, pattern):
raise NotImplementedError
def posline(self, pos):
raise NotImplementedError
def line_info(self, pos=None):
raise NotImplementedError
def get_lines(self, start=None, end=None):
raise NotImplementedError
def lookahead(self):
raise NotImplementedError
def lookahead_pos(self):
if self.atend():
return ''
info = self.line_info()
return '~%d:%d' % (info.line + 1, info.col + 1)