46-12-204. Plea alternatives. (1) A defendant may plead guilty, not guilty, or, with the consent of the court and the prosecutor, nolo contendere. If a defendant refuses to plead or if a defendant corporation fails to appear, the court shall enter a plea of not guilty.
(2) The court may not accept a plea of guilty or nolo contendere without first determining that the plea is voluntary and not the result of force or threats or of promises apart from the plea agreement. The court shall also inquire as to whether the defendant's willingness to plead guilty or nolo contendere results from prior discussions between the prosecutor and the defendant or the defendant's attorney.
(3) With the approval of the court and the consent of the prosecutor, a defendant may enter a plea of guilty or nolo contendere, reserving the right, on appeal from the judgment, to review the adverse determination of any specified pretrial motion. If the defendant prevails on appeal, the defendant must be allowed to withdraw the plea.