| 1561 | |
| 1562 | |
| 1563 | class _Node: |
| 1564 | def __init__(self, type, first, second=None): |
| 1565 | self.type = type |
| 1566 | self.first = first |
| 1567 | self.second = second |
| 1568 | |
| 1569 | def __eq__(self, other): |
| 1570 | return ( |
| 1571 | isinstance(other, _Node) |
| 1572 | and self.type == other.type |
| 1573 | and self.first == other.first |
| 1574 | and self.second == other.second |
| 1575 | ) |
| 1576 | |
| 1577 | def __repr__(self): |
| 1578 | return f"Node({self.type!r}, {self.first!r}, {self.second!r})" |
| 1579 | |
| 1580 | |
| 1581 | class Parser: |
no outgoing calls