“A motion for judgment on the pleadings has the same function as a general demurrer but is made after the time for demurrer has expired. A motion for judgment on the pleadings may be made by any party to the action or by the court sua sponte.”
[California Practice Guide: Civil Procedure Before Trial [citations to primary sources omitted]]