JezK
Edit File: core.cpython-39.pyc
a �#�_� � @ sx d dl mZ ddlmZmZmZ ddlmZm Z m Z G dd� de�ZG dd� de�Z G d d � d e�ZG dd� de�ZG d d� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�Zdd� Zdd � ZG d!d"� d"e�ZG d#d$� d$e�ZG d%d&� d&e�ZG d'd(� d(e�ZG d)d*� d*e�ZG d+d,� d,e�Z G d-d.� d.e�ZG d/d0� d0e�Z!G d1d2� d2e�Z"G d3d4� d4e�Z#G d5d6� d6e�Z$G d7d8� d8e�Z%G d9d:� d:e�Z&G d;d<� d<e�Z'G d=d>� d>e�Z(G d?d@� d@e�Z)G dAdB� dBe�Z*G dCdD� dDe�Z+G dEdF� dFe�Z,G dGdH� dHe�Z-G dIdJ� dJe�Z.e.dK�Z.G dLdM� dMe�Z/e/dK�Z/dKS )N� )�Struct� )�BytesIO�advance_iterator�bchr)� Container� ListContainer� LazyContainerc @ s e Zd Zg ZdS )�ConstructErrorN��__name__� __module__�__qualname__� __slots__� r r �;/usr/lib/python3.9/site-packages/elftools/construct/core.pyr s r c @ s e Zd Zg ZdS )� FieldErrorNr r r r r r s r c @ s e Zd Zg ZdS )�SizeofErrorNr r r r r r s r c @ s e Zd Zg ZdS )�AdaptationErrorNr r r r r r s r c @ s e Zd Zg ZdS )� ArrayErrorNr r r r r r s r c @ s e Zd Zg ZdS )� RangeErrorNr r r r r r s r c @ s e Zd Zg ZdS )�SwitchErrorNr r r r r r s r c @ s e Zd Zg ZdS )�SelectErrorNr r r r r r s r c @ s e Zd Zg ZdS )�TerminatorErrorNr r r r r r s r c @ s� e Zd ZdZdZdZdZdZddgZd,d d �Z dd� Z d d� Zdd� Zdd� Z dd� Zdd� Zdd� Zdd� Zdd� Zdd� Zdd � Zd!d"� Zd#d$� Zd%d&� Zd-d(d)�Zd*d+� Zd'S ).� Constructax The mother of all constructs. This object is generally not directly instantiated, and it does not directly implement parsing and building, so it is largely only of interest to subclass implementors. The external user API: * parse() * parse_stream() * build() * build_stream() * sizeof() Subclass authors should not override the external methods. Instead, another API is available: * _parse() * _build() * _sizeof() There is also a flag API: * _set_flag() * _clear_flag() * _inherit_flags() * _is_flag() And stateful copying: * __getstate__() * __setstate__() Attributes and Inheritance ========================== All constructs have a name and flags. The name is used for naming struct members and context dictionaries. Note that the name can either be a string, or None if the name is not needed. A single underscore ("_") is a reserved name, and so are names starting with a less-than character ("<"). The name should be descriptive, short, and valid as a Python identifier, although these rules are not enforced. The flags specify additional behavioral information about this construct. Flags are used by enclosing constructs to determine a proper course of action. Flags are inherited by default, from inner subconstructs to outer constructs. The enclosing construct may set new flags or clear existing ones, as necessary. For example, if FLAG_COPY_CONTEXT is set, repeaters will pass a copy of the context for each iteration, which is necessary for OnDemand parsing. r � � � �name�conflagsr c C sJ |d ur:t |�turtd|��|dks0|�d�r:td|��|| _|| _d S )Nzname must be a string or None�_�<z reserved name)�type�str� TypeError� startswith� ValueErrorr r )�selfr �flagsr r r �__init__] s zConstruct.__init__c C s d| j j| jf S )Nz%s(%r))� __class__r r �r'