Lang types
lang_types
LIST_ELEMENT_TYPE = ListLangBool | ListLangInt
module-attribute
ListLangType
Source code in xdsl/frontend/listlang/lang_types.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | |
from_xdsl(xdsl_type: Attribute) -> ListLangType
staticmethod
Source code in xdsl/frontend/listlang/lang_types.py
13 14 15 16 17 18 19 20 21 22 23 | |
__str__() -> str
Source code in xdsl/frontend/listlang/lang_types.py
25 | |
xdsl() -> Attribute
Source code in xdsl/frontend/listlang/lang_types.py
26 | |
print(builder: Builder, value: SSAValue)
Source code in xdsl/frontend/listlang/lang_types.py
27 | |
get_method(method: str) -> Method | None
Source code in xdsl/frontend/listlang/lang_types.py
28 29 | |
ListLangInt
dataclass
Bases: ListLangType
Source code in xdsl/frontend/listlang/lang_types.py
32 33 34 35 36 37 38 39 40 41 | |
__init__() -> None
__str__() -> str
Source code in xdsl/frontend/listlang/lang_types.py
34 35 | |
xdsl() -> builtin.IntegerType
Source code in xdsl/frontend/listlang/lang_types.py
37 38 | |
print(builder: Builder, value: SSAValue)
Source code in xdsl/frontend/listlang/lang_types.py
40 41 | |
ListLangBool
dataclass
Bases: ListLangType
Source code in xdsl/frontend/listlang/lang_types.py
44 45 46 47 48 49 50 51 52 53 | |
__init__() -> None
__str__() -> str
Source code in xdsl/frontend/listlang/lang_types.py
46 47 | |
xdsl() -> builtin.IntegerType
Source code in xdsl/frontend/listlang/lang_types.py
49 50 | |
print(builder: Builder, value: SSAValue)
Source code in xdsl/frontend/listlang/lang_types.py
52 53 | |
ListLangList
dataclass
Bases: ListLangType
Source code in xdsl/frontend/listlang/lang_types.py
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | |
element_type: LIST_ELEMENT_TYPE
instance-attribute
__init__(element_type: LIST_ELEMENT_TYPE) -> None
__str__() -> str
Source code in xdsl/frontend/listlang/lang_types.py
63 64 | |
xdsl() -> list_dialect.ListType
Source code in xdsl/frontend/listlang/lang_types.py
66 67 | |
print(builder: Builder, value: SSAValue)
Source code in xdsl/frontend/listlang/lang_types.py
69 70 | |
get_method(method: str) -> Method | None
Source code in xdsl/frontend/listlang/lang_types.py
72 73 74 75 76 77 78 79 | |
TypedExpression
dataclass
Source code in xdsl/frontend/listlang/lang_types.py
82 83 84 85 | |
value: SSAValue
instance-attribute
typ: ListLangType
instance-attribute
__init__(value: SSAValue, typ: ListLangType) -> None
Method
Source code in xdsl/frontend/listlang/lang_types.py
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 | |
name: str
instance-attribute
get_lambda_arg_type(x: ListLangType) -> Sequence[ListLangType] | None
From the type on which the method was invoked, returns the types of the arguments of the method's lambda if there is one, or None if there is no lambda.
Source code in xdsl/frontend/listlang/lang_types.py
94 95 96 97 98 99 100 | |
build(builder: Builder, x: Located[TypedExpression], lambd: Located[tuple[Block, ListLangType]] | None) -> TypedExpression
Builds the method's execution.
lambd contains a free-standing block containing the lambda
instructions that must be inlined as needed, and the type of the final
expression of the block. The associated location is the location of
the result expression.
Source code in xdsl/frontend/listlang/lang_types.py
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 | |
ListLenMethod
Bases: Method
Source code in xdsl/frontend/listlang/lang_types.py
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 | |
name = 'len'
class-attribute
instance-attribute
get_lambda_arg_type(x: ListLangType) -> Sequence[ListLangType] | None
Source code in xdsl/frontend/listlang/lang_types.py
122 123 | |
build(builder: Builder, x: Located[TypedExpression], lambd: Located[tuple[Block, ListLangType]] | None) -> TypedExpression
Source code in xdsl/frontend/listlang/lang_types.py
125 126 127 128 129 130 131 132 133 134 135 | |
ListMapMethod
Bases: Method
Source code in xdsl/frontend/listlang/lang_types.py
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 | |
name = 'map'
class-attribute
instance-attribute
get_lambda_arg_type(x: ListLangType) -> Sequence[ListLangType] | None
Source code in xdsl/frontend/listlang/lang_types.py
141 142 143 | |
build(builder: Builder, x: Located[TypedExpression], lambd: Located[tuple[Block, ListLangType]] | None) -> TypedExpression
Source code in xdsl/frontend/listlang/lang_types.py
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 | |