Info
ArgumentField dataclass
ArgumentField(
kw_only: bool,
alias: Optional[str],
type: types.TypeAttribute,
print: bool = True,
group: bool = False,
)
Bases: Field
group class-attribute
instance-attribute
group: bool = False
if True
, this argument is annotated with Tuple[SSAValue, ...]
print class-attribute
instance-attribute
print: bool = True
if True
, this argument name is printed in the signature.
type instance-attribute
type: TypeAttribute
type of the argument, will be used in validation.
AttributeField dataclass
AttributeField(
kw_only: bool,
alias: Optional[str],
default: Any,
init: bool,
repr: bool,
default_factory: Optional[Callable[[], Attribute]],
type: types.TypeAttribute,
pytype: bool = False,
)
Bases: Field
pytype class-attribute
instance-attribute
pytype: bool = False
if True
, annotation is a python type hint instead of TypeAttribute
StatementFields dataclass
StatementFields(
std_args: dict[str, ArgumentField] = dict(),
kw_args: dict[str, ArgumentField] = dict(),
results: dict[str, ResultField] = dict(),
regions: dict[str, RegionField] = dict(),
blocks: dict[str, BlockField] = dict(),
attributes: dict[str, AttributeField] = dict(),
)
args property
args
iterable of all argument fields.
attributes class-attribute
instance-attribute
attributes: dict[str, AttributeField] = field(
default_factory=dict
)
attributes of the statement.
blocks class-attribute
instance-attribute
blocks: dict[str, BlockField] = field(default_factory=dict)
blocks of the statement.
kw_args class-attribute
instance-attribute
kw_args: dict[str, ArgumentField] = field(
default_factory=dict
)
keyword-only arguments of the statement.
regions class-attribute
instance-attribute
regions: dict[str, RegionField] = field(
default_factory=dict
)
regions of the statement.
required_names cached
property
required_names
set of all fields that do not have a default value.
results class-attribute
instance-attribute
results: dict[str, ResultField] = field(
default_factory=dict
)
results of the statement.
std_args class-attribute
instance-attribute
std_args: dict[str, ArgumentField] = field(
default_factory=dict
)
standard arguments of the statement.
argument
argument(
type: types.TypeAttribute = types.Any,
*,
print: bool = True,
kw_only: bool = False,
alias: Optional[str] = None
) -> Any
Field specifier for arguments.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
type(TypeAttribute) | type of the argument, will be used in validation. | required | |
print(bool) | if | required | |
kw_only(bool) | if | required | |
alias(Optional[str]) | an alias for the argument name in the | required |
Source code in src/kirin/decl/info.py
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
|
block
block(
*,
init: bool = True,
repr: bool = True,
kw_only: bool = True,
alias: Optional[str] = None,
default_factory: Callable[[], Block] = Block
) -> Any
Field specifier for blocks.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
init(bool) | if | required | |
repr(bool) | if | required | |
kw_only(bool) | if | required | |
alias(Optional[str]) | an alias for the block field name in the | required | |
default_factory(Callable[[], | Block] | a factory function to create a default block. | required |
Source code in src/kirin/decl/info.py
199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 |
|
region
region(
*,
init: bool = True,
repr: bool = True,
kw_only: bool = True,
alias: Optional[str] = None,
multi: bool = False,
default_factory: Callable[[], Region] = Region
) -> Any
Field specifier for regions.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
init(bool) | if | required | |
repr(bool) | if | required | |
kw_only(bool) | if | required | |
alias(Optional[str]) | an alias for the region field name in the | required | |
multi(bool) | if | required | |
default_factory(Callable[[], | Region] | a factory function to create a default region. | required |
Source code in src/kirin/decl/info.py
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 |
|
result
result(
type: types.TypeAttribute = types.Any,
*,
init: bool = False,
repr: bool = True,
kw_only: bool = True,
alias: Optional[str] = None
) -> Any
Field specifier for results.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
type(TypeAttribute) | type of the result. | required | |
init(bool) | if | required | |
repr(bool) | if | required | |
kw_only(bool) | if | required | |
alias(Optional[str]) | an alias for the result field name in the | required |
Source code in src/kirin/decl/info.py
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 |
|