flows
¶
Module for controle flow AST.
ForCountLoop
¶
ForCountLoop(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++.
Source code in src/astx/flows.py
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return the AST structure of the object.
Source code in src/astx/flows.py
161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 |
|
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 |
|
ForRangeLoop
¶
ForRangeLoop(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
Loop Range statement.
Source code in src/astx/flows.py
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return the AST structure of the object.
Source code in src/astx/flows.py
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
|
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 |
|
If
¶
If(condition: Expr, then: Block, else_: Optional[Block] = None, loc: SourceLocation = NO_SOURCE_LOCATION, parent: Optional[ASTNodes] = None)
Bases: StatementType
AST class for if
statement.
Source code in src/astx/flows.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return the AST structure of the object.
Source code in src/astx/flows.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
|
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 |
|
While
¶
While(condition: Expr, body: Block, loc: SourceLocation = NO_SOURCE_LOCATION, parent: Optional[ASTNodes] = None)
Bases: StatementType
AST class for while
statement.
Source code in src/astx/flows.py
186 187 188 189 190 191 192 193 194 195 196 197 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return the AST structure of the object.
Source code in src/astx/flows.py
203 204 205 206 207 208 209 210 211 212 213 214 |
|
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 |
|