implementing Expr::GenerateScript