callables
¶
Module for callable ASTx.
Argument
¶
Argument(name: str, type_: ExprType, mutability: MutabilityKind = MutabilityKind.constant, default: Expr = UNDEFINED, loc: SourceLocation = NO_SOURCE_LOCATION, parent: Optional[ASTNodes] = None)
Bases: Variable
AST class for argument definition.
Source code in src/astx/callables.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return a string that represents the object.
Source code in src/astx/callables.py
58 59 60 61 62 |
|
to_json
¶
Return an json string that represents the object.
Source code in src/astx/base.py
217 218 219 |
|
to_yaml
¶
Return an yaml string that represents the object.
Source code in src/astx/base.py
211 212 213 214 215 |
|
Arguments
¶
Bases: ASTNodes
AST class for argument definition.
Source code in src/astx/callables.py
69 70 71 72 |
|
append
¶
append(value: AST) -> None
Append a new node to the stack.
Source code in src/astx/base.py
259 260 261 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return a string that represents the object.
Source code in src/astx/callables.py
78 79 80 81 82 83 84 85 86 87 |
|
to_json
¶
Return an json string that represents the object.
Source code in src/astx/base.py
217 218 219 |
|
to_yaml
¶
Return an yaml string that represents the object.
Source code in src/astx/base.py
211 212 213 214 215 |
|
Function
¶
Function(prototype: FunctionPrototype, body: Block, loc: SourceLocation = NO_SOURCE_LOCATION, parent: Optional[ASTNodes] = None)
Bases: StatementType
AST class for function definition.
Source code in src/astx/callables.py
206 207 208 209 210 211 212 213 214 215 216 217 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Get the AST structure that represent the object.
Source code in src/astx/callables.py
237 238 239 240 241 242 243 244 245 246 247 |
|
to_json
¶
Return an json string that represents the object.
Source code in src/astx/base.py
217 218 219 |
|
to_yaml
¶
Return an yaml string that represents the object.
Source code in src/astx/base.py
211 212 213 214 215 |
|
FunctionCall
¶
FunctionCall(fn: Function, args: tuple[DataType, ...], loc: SourceLocation = NO_SOURCE_LOCATION, parent: Optional[ASTNodes] = None)
Bases: DataType
AST class for function call.
Source code in src/astx/callables.py
97 98 99 100 101 102 103 104 105 106 107 108 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return the AST structure of the object.
Source code in src/astx/callables.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 |
|
to_json
¶
Return an json string that represents the object.
Source code in src/astx/base.py
217 218 219 |
|
to_yaml
¶
Return an yaml string that represents the object.
Source code in src/astx/base.py
211 212 213 214 215 |
|
FunctionPrototype
¶
FunctionPrototype(name: str, args: Arguments, return_type: ExprType, scope: ScopeKind = ScopeKind.global_, visibility: VisibilityKind = VisibilityKind.public, loc: SourceLocation = NO_SOURCE_LOCATION, parent: Optional[ASTNodes] = None)
Bases: StatementType
AST class for function prototype declaration.
Source code in src/astx/callables.py
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Get the AST structure that represent the object.
Source code in src/astx/callables.py
166 167 168 |
|
to_json
¶
Return an json string that represents the object.
Source code in src/astx/base.py
217 218 219 |
|
to_yaml
¶
Return an yaml string that represents the object.
Source code in src/astx/base.py
211 212 213 214 215 |
|
FunctionReturn
¶
FunctionReturn(value: DataType, loc: SourceLocation = NO_SOURCE_LOCATION, parent: Optional[ASTNodes] = None)
Bases: StatementType
AST class for function return
statement.
Source code in src/astx/callables.py
177 178 179 180 181 182 183 184 185 186 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return the AST structure of the object.
Source code in src/astx/callables.py
192 193 194 195 196 |
|
to_json
¶
Return an json string that represents the object.
Source code in src/astx/base.py
217 218 219 |
|
to_yaml
¶
Return an yaml string that represents the object.
Source code in src/astx/base.py
211 212 213 214 215 |
|