Represents a node of the AST (operation).
| 318 | |
| 319 | |
| 320 | class Node: |
| 321 | """ |
| 322 | Represents a node of the AST (operation). |
| 323 | """ |
| 324 | |
| 325 | def __init__(self, kind: NodeKind, ntype: VariableType, value: str, left: Optional[Node] = None, right: Optional[Node] = None, middle: Optional[Node] = None): |
| 326 | self.kind = kind |
| 327 | self.ntype = ntype |
| 328 | self.value = value |
| 329 | self.left = left |
| 330 | self.right = right |
| 331 | self.middle = middle |
| 332 | |
| 333 | def __str__(self) -> str: |
| 334 | attrs = [] |
| 335 | for key, value in vars(self).items(): |
| 336 | attrs.append(f"{key}={value}") |
| 337 | return f"{self.__class__.__name__}({', '.join(attrs)})" |
| 338 | |
| 339 | |
| 340 | class Operand: |
no outgoing calls
no test coverage detected