| 1 | class Location: |
| 2 | def __init__(self, file, current_element, line, column, line_end, column_end): |
| 3 | self.file = file |
| 4 | self.current_element = current_element |
| 5 | self.line = line |
| 6 | self.column = column |
| 7 | self.line_end = line_end |
| 8 | self.column_end = column_end |
| 9 | |
| 10 | class ElemBase: |
| 11 | def __init__(self): |
| 12 | pass |
| 13 | |
| 14 | |
| 15 | class Expression(ElemBase): |
| 16 | def __init__(self, expr): |
| 17 | ElemBase.__init__(self) |
| 18 | self.expr = expr |
| 19 | |
| 20 | def __str__(self): |
| 21 | return self.expr |
| 22 | |
| 23 | class Identifier(ElemBase): |
| 24 | def __init__(self, ident): |
| 25 | ElemBase.__init__(self) |
| 26 | self.ident = ident |
| 27 | |
| 28 | def __str__(self): |
| 29 | return self.ident |