API reference
python:astx:astx.flows.CaseStmt
class CaseStmt
CaseStmt(body: Block, condition: Optional[Expr] = None, default: bool = False, loc: SourceLocation = NO_SOURCE_LOCATION, parent: Optional[ASTNodes] = None)
Source: packages/astx/src/astx/flows.py:1060
AST class for a case in a Switch statement.
Attributes
-
kind — Type: ASTKind
-
condition — Type: Optional[Expr]
-
body — Type: Block
-
default — Type: bool
Methods
-
__init__ — Initialize the CaseStmt instance.
-
__str__ — Return a string representation of the object.
-
get_struct — Return the AST structure of the object.