def __init__(self, expr): Statement.__init__(self, "WriteStatement") self._kids = [expr]
def __init__(self, v): Statement.__init__(self, "ReadStatement") self._kids.append(v)
def __init__(self, expr, thenPart, elsePart): Statement.__init__(self, "IfStatement") # _kids[0] = expr # _kids[1] = thenPart # _kids[2] = elsePart self._kids = [expr, thenPart, elsePart]
def __init__(self, v, expr): Statement.__init__(self, "AssignmentStatement") self._kids = [v, expr]