21 lines
481 B
Python
21 lines
481 B
Python
# Copyright (c) PARRRATE T&V 2021. All rights reserved.
|
|
|
|
from typing import TypeVar, Generic
|
|
|
|
from bu4.parsing.extensions.abstractextension import AbstractExtension
|
|
|
|
__all__ = ('AbstractParser',)
|
|
|
|
T = TypeVar('T')
|
|
|
|
|
|
class AbstractParser(Generic[T]):
|
|
def read(self) -> int:
|
|
raise NotImplementedError
|
|
|
|
def parse_name(self) -> bytes:
|
|
raise NotImplementedError
|
|
|
|
def extension_for(self, code: int) -> AbstractExtension[T]:
|
|
raise NotImplementedError
|