operators
¶
ASTx classes for the operators.
Classes:
-
AssignmentExpr
–AST class for assignment expressions.
-
VariableAssignment
–AST class for variable declaration.
-
WalrusOp
–AST class for the Walrus (assignment expression) operator.
AssignmentExpr
¶
AssignmentExpr(targets: Iterable[Expr] | ASTNodes[Expr], value: Expr, loc: SourceLocation = NO_SOURCE_LOCATION, parent: Optional[ASTNodes] = None)
Bases: Expr
AST class for assignment expressions.
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/operators.py
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return the AST structure of the object.
Source code in src/astx/operators.py
86 87 88 89 90 91 92 93 94 95 96 97 |
|
to_json
¶
Return an json string that represents the object.
Source code in src/astx/base.py
294 295 296 |
|
to_yaml
¶
Return an yaml string that represents the object.
Source code in src/astx/base.py
288 289 290 291 292 |
|
VariableAssignment
¶
VariableAssignment(name: str, value: Expr, loc: SourceLocation = NO_SOURCE_LOCATION, parent: Optional[ASTNodes] = None)
Bases: StatementType
AST class for variable declaration.
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/operators.py
108 109 110 111 112 113 114 115 116 117 118 119 120 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return the AST structure of the object.
Source code in src/astx/operators.py
126 127 128 129 130 |
|
to_json
¶
Return an json string that represents the object.
Source code in src/astx/base.py
294 295 296 |
|
to_yaml
¶
Return an yaml string that represents the object.
Source code in src/astx/base.py
288 289 290 291 292 |
|
WalrusOp
¶
Bases: DataType
AST class for the Walrus (assignment expression) operator.
Methods:
-
get_struct
–Return the AST structure that represents 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/operators.py
29 30 31 32 33 34 35 36 37 38 39 |
|
get_struct
¶
get_struct(simplified: bool = False) -> ReprStruct
Return the AST structure that represents the object.
Source code in src/astx/operators.py
45 46 47 48 49 50 51 52 |
|
to_json
¶
Return an json string that represents the object.
Source code in src/astx/base.py
294 295 296 |
|
to_yaml
¶
Return an yaml string that represents the object.
Source code in src/astx/base.py
288 289 290 291 292 |
|