The standard already includes a reference implementation for CASE OF ENDOF ENDCASE, but it it tucked away in annex A Rationale instead of the more traditional annex E used by most other reference implementations; hence it does not show up when browsing to this page online. So maybe that makes this more of a web page request than yet another reference implementation - but to make life easier for the next reader: