API reference
python:astx:astx.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:910
Declared as: python:astx:astx.flows.CaseStmt
AST class for a case in a Switch statement.
Attributes
-
kind — Kind of value or operation.; Type: ASTKind
-
condition — Condition controlling the operation.; Type: Optional[Expr]
-
body — Statements forming the body.; Type: Block
-
default — Default used when no value is supplied.; Type: bool
-
loc — Type: SourceLocation
-
comment — Type: str
-
parent — Type: Optional[ASTNodes]
-
ref — Type: str
Methods
-
__init__ — Initialize the CaseStmt instance.
-
__str__ — Return a string representation of the object.
-
get_struct — Return the AST structure of the object.