AST based calculator