sx/sx/__init__.py

36 lines
1.5 KiB
Python

from .core import parse, dump, sizeof, offsetof, default, context
from .core.base import Params, Context, Type, to_type, Error
from .core.io import Stream, Segment, to_stream, Endian, BitAlignment
from .core.expr import BaseExpr, Expr, const, infer, bool_, not_, and_, or_, in_, len_, int_, float_
from .core.meta import Wrapper, Generic
del core
from .types.data import Nothing, Implied, Ignored, Pad, Data, data, Bits, bit, nibble
from .types.num import (
Bool, Int, Float, bool8, int8, uint8, byte,
int16, uint16, int16be, int16le, uint16be, uint16le, word,
int32, uint32, int32be, int32le, uint32be, uint32le, dword,
int64, uint64, int64be, int64le, uint64be, uint64le, qword,
intbe, intle, uintbe, uintle,
float16, float16le, float16be, binary16, binary16le, binary16be, half,
float32, float32le, float32be, binary32, binary32le, binary32be,
float64, float64le, float64be, binary64, binary64le, binary64be, double,
)
from .types.str import Str, CStr, cstr, wcstr, utf8cstr, utf16cstr
from .types.seq import Arr, Tuple
from .types.struct import StructType, Struct, Union
from .types.transforms import Default, Preproc, Proc, Mapped, Enum, Check, Fixed
from .types.control import Switch, If
from .types.io import Sized, Terminated, Ref, AlignTo, AlignedTo, Lazy, Tell
del types
# Compatibility
Static = Calc = Implied
Transform = Proc
__all__ = [k for k in globals() if not k.startswith('_')]
# Extra types that shouldn't pollute the namespace they're mass-imported into
bool = bool8
float = float32