AST as class