from viper.lexer.lexemes import *


class AST:
    pass


class BinOp(AST):
    def __init__(self, op: Operator, left: Lexeme, right: Lexeme):
        self.op = op
        self.left = left
        self.right = right


class UnOpPre(AST):
    def __init__(self, op: Operator, arg: Lexeme):
        self.op = op
        self.arg = arg


class UnOpPost(AST):
    def __init__(self, arg: Lexeme, op: Operator):
        self.arg = arg
        self.op = op


class Num(AST):
    def __init__(self, token: Number):
        self.token = token
        self.value = float(token.text)

@@ -2,471 +2,186 @@
 rom 
-viper.lexer.lexemes import *%0A%0A%0Aclass AST:%0A    pass%0A%0A%0Aclass BinOp(AST):%0A    def __init__(self, op: Operator, left: Lexeme, right: Lexeme):%0A        self.op = op%0A        self.left = left%0A        self.right = right%0A%0A%0Aclass UnOpPre(AST):%0A    def __init__(self, op: Operator, arg: Lexeme):%0A        self.op = op%0A        self.arg = arg%0A%0A%0Aclass UnOpPost(AST):%0A    def __init__(self, arg: Lexeme, op: Operator):%0A        self.arg = arg%0A        self.op = op%0A%0A%0Aclass Num(AST):
+typing import Any, Dict%0A%0A%0Aclass ASTNode:%0A    def __init__(self, production_name: str, params: Dict%5Bstr, Any%5D):%0A        self._name = production_name%0A        self._params = params%0A
 %0A   
@@ -191,99 +191,86 @@
 f __
-init
+repr
 __(self
-, token: Number):%0A        self.token = token%0A        self.value = float(token.text)
+):%0A        return %22AST_%22 + self._name + %22(%22 + repr(self._params) + %22)%22
 %0A

Revise AST node