Binary operation expression (e.g., a + b, a && b)
| 386 | |
| 387 | |
| 388 | class BinOp(Expr): |
| 389 | """Binary operation expression (e.g., a + b, a && b)""" |
| 390 | |
| 391 | def __init__(self, op: BinOpKind, left: Expr, right: Expr, expr_type: LLType): |
| 392 | super().__init__(expr_type) |
| 393 | self.op = op # Operator kind |
| 394 | self.left = left # Left operand |
| 395 | self.right = right # Right operand |
| 396 | |
| 397 | def __str__(self) -> str: |
| 398 | return f"BinOp(op={self.op}, left={self.left}, right={self.right}, type={self.type})" |
| 399 | |
| 400 | def __repr__(self) -> str: |
| 401 | return f"({self.type}({repr(self.left)} {bin_op_kind_str(self.op)} {repr(self.right)}))" |
| 402 | |
| 403 | |
| 404 | # Tensor Access |
no outgoing calls