Stream
stream
T = TypeVar('T')
module-attribute
TCov = TypeVar('TCov', covariant=True)
module-attribute
TCon = TypeVar('TCon', contravariant=True)
module-attribute
ReadableStream
Bases: ABC, Generic[TCov]
Abstract base class for readable stream interpreter model objects.
Source code in xdsl/interpreters/utils/stream.py
12 13 14 15 16 17 18 19 | |
read() -> TCov
abstractmethod
Source code in xdsl/interpreters/utils/stream.py
17 18 19 | |
WritableStream
Bases: ABC, Generic[TCon]
Abstract base class for readable stream interpreter model objects.
Source code in xdsl/interpreters/utils/stream.py
22 23 24 25 26 27 28 29 | |
write(value: TCon) -> None
abstractmethod
Source code in xdsl/interpreters/utils/stream.py
27 28 29 | |
Nats
dataclass
Bases: ReadableStream[int]
A stream designed for testing, outputs the next natural number each time it's read.
Source code in xdsl/interpreters/utils/stream.py
32 33 34 35 36 37 38 39 40 41 42 | |
index = 0
class-attribute
instance-attribute
__init__() -> None
read() -> int
Source code in xdsl/interpreters/utils/stream.py
40 41 42 | |
Acc
dataclass
Bases: WritableStream[int]
A stream designed for testing, appends the next natural number written.
Source code in xdsl/interpreters/utils/stream.py
45 46 47 48 49 50 51 52 53 54 | |
values: list[int] = field(default_factory=(list[int]))
class-attribute
instance-attribute
__init__(values: list[int] = list[int]()) -> None
write(value: int) -> None
Source code in xdsl/interpreters/utils/stream.py
53 54 | |