flows
¶
Module for controle flow AST.
Classes:
-
ForCountLoopExpr
–AST class for a simple Count-Controlled
For
Loop expression. -
ForCountLoopStmt
–AST class for a simple Count-Controlled
For
Loop statement. -
ForRangeLoopExpr
–AST class for
For
Range Expression. -
ForRangeLoopStmt
–AST class for
For
Range Statement. -
IfExpr
–AST class for
if
expression. -
IfStmt
–AST class for
if
statement. -
WhileExpr
–AST class for
while
expression. -
WhileStmt
–AST class for
while
statement.
ForCountLoopExpr
¶
ForCountLoopExpr(initializer: InlineVariableDeclaration, condition: Expr, update: Expr, body: Block, loc: SourceLocation = NO_SOURCE_LOCATION, parent: Optional[ASTNodes] = None)
Bases: Expr
AST class for a simple Count-Controlled For
Loop expression.
This is a very basic for
loop, used by languages like C or C++.
Methods:
-
get_struct
–Return the AST structure of the object.
-
to_json
–Return an json string that represents the object.
-
to_yaml
–Return an yaml string that represents the object.
Source code in src/astx/flows.py
304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return the AST structure of the object.
Source code in src/astx/flows.py
328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 |
|
to_json
¶
Return an json string that represents the object.
Source code in src/astx/base.py
265 266 267 |
|
to_yaml
¶
Return an yaml string that represents the object.
Source code in src/astx/base.py
259 260 261 262 263 |
|
ForCountLoopStmt
¶
ForCountLoopStmt(initializer: InlineVariableDeclaration, condition: Expr, update: Expr, body: Block, loc: SourceLocation = NO_SOURCE_LOCATION, parent: Optional[ASTNodes] = None)
Bases: StatementType
AST class for a simple Count-Controlled For
Loop statement.
This is a very basic for
loop, used by languages like C or C++.
Methods:
-
get_struct
–Return the AST structure of the object.
-
to_json
–Return an json string that represents the object.
-
to_yaml
–Return an yaml string that represents the object.
Source code in src/astx/flows.py
248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return the AST structure of the object.
Source code in src/astx/flows.py
272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 |
|
to_json
¶
Return an json string that represents the object.
Source code in src/astx/base.py
265 266 267 |
|
to_yaml
¶
Return an yaml string that represents the object.
Source code in src/astx/base.py
259 260 261 262 263 |
|
ForRangeLoopExpr
¶
ForRangeLoopExpr(variable: InlineVariableDeclaration, start: Expr, end: Expr, step: Expr, body: Block, loc: SourceLocation = NO_SOURCE_LOCATION, parent: Optional[ASTNodes] = None)
Bases: Expr
AST class for For
Range Expression.
Methods:
-
get_struct
–Return the AST structure of the object.
-
to_json
–Return an json string that represents the object.
-
to_yaml
–Return an yaml string that represents the object.
Source code in src/astx/flows.py
186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return the AST structure of the object.
Source code in src/astx/flows.py
215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 |
|
to_json
¶
Return an json string that represents the object.
Source code in src/astx/base.py
265 266 267 |
|
to_yaml
¶
Return an yaml string that represents the object.
Source code in src/astx/base.py
259 260 261 262 263 |
|
ForRangeLoopStmt
¶
ForRangeLoopStmt(variable: InlineVariableDeclaration, start: Expr, end: Expr, step: Expr, body: Block, loc: SourceLocation = NO_SOURCE_LOCATION, parent: Optional[ASTNodes] = None)
Bases: StatementType
AST class for For
Range Statement.
Methods:
-
get_struct
–Return the AST structure of the object.
-
to_json
–Return an json string that represents the object.
-
to_yaml
–Return an yaml string that represents the object.
Source code in src/astx/flows.py
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return the AST structure of the object.
Source code in src/astx/flows.py
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 |
|
to_json
¶
Return an json string that represents the object.
Source code in src/astx/base.py
265 266 267 |
|
to_yaml
¶
Return an yaml string that represents the object.
Source code in src/astx/base.py
259 260 261 262 263 |
|
IfExpr
¶
IfExpr(condition: Expr, then: Block, else_: Optional[Block] = None, loc: SourceLocation = NO_SOURCE_LOCATION, parent: Optional[ASTNodes] = None)
Bases: Expr
AST class for if
expression.
Methods:
-
get_struct
–Return the AST structure of the object.
-
to_json
–Return an json string that represents the object.
-
to_yaml
–Return an yaml string that represents the object.
Source code in src/astx/flows.py
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return the AST structure of the object.
Source code in src/astx/flows.py
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
|
to_json
¶
Return an json string that represents the object.
Source code in src/astx/base.py
265 266 267 |
|
to_yaml
¶
Return an yaml string that represents the object.
Source code in src/astx/base.py
259 260 261 262 263 |
|
IfStmt
¶
IfStmt(condition: Expr, then: Block, else_: Optional[Block] = None, loc: SourceLocation = NO_SOURCE_LOCATION, parent: Optional[ASTNodes] = None)
Bases: StatementType
AST class for if
statement.
Methods:
-
get_struct
–Return the AST structure of the object.
-
to_json
–Return an json string that represents the object.
-
to_yaml
–Return an yaml string that represents the object.
Source code in src/astx/flows.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return the AST structure of the object.
Source code in src/astx/flows.py
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
|
to_json
¶
Return an json string that represents the object.
Source code in src/astx/base.py
265 266 267 |
|
to_yaml
¶
Return an yaml string that represents the object.
Source code in src/astx/base.py
259 260 261 262 263 |
|
WhileExpr
¶
WhileExpr(condition: Expr, body: Block, loc: SourceLocation = NO_SOURCE_LOCATION, parent: Optional[ASTNodes] = None)
Bases: Expr
AST class for while
expression.
Methods:
-
get_struct
–Return the AST structure of the object.
-
to_json
–Return an json string that represents the object.
-
to_yaml
–Return an yaml string that represents the object.
Source code in src/astx/flows.py
392 393 394 395 396 397 398 399 400 401 402 403 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return the AST structure of the object.
Source code in src/astx/flows.py
409 410 411 412 413 414 415 416 417 418 419 420 |
|
to_json
¶
Return an json string that represents the object.
Source code in src/astx/base.py
265 266 267 |
|
to_yaml
¶
Return an yaml string that represents the object.
Source code in src/astx/base.py
259 260 261 262 263 |
|
WhileStmt
¶
WhileStmt(condition: Expr, body: Block, loc: SourceLocation = NO_SOURCE_LOCATION, parent: Optional[ASTNodes] = None)
Bases: StatementType
AST class for while
statement.
Methods:
-
get_struct
–Return the AST structure of the object.
-
to_json
–Return an json string that represents the object.
-
to_yaml
–Return an yaml string that represents the object.
Source code in src/astx/flows.py
353 354 355 356 357 358 359 360 361 362 363 364 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return the AST structure of the object.
Source code in src/astx/flows.py
370 371 372 373 374 375 376 377 378 379 380 381 |
|
to_json
¶
Return an json string that represents the object.
Source code in src/astx/base.py
265 266 267 |
|
to_yaml
¶
Return an yaml string that represents the object.
Source code in src/astx/base.py
259 260 261 262 263 |
|