Numeric case not implemented

Topics related to the use of Oberon language features
Post Reply
hansklaver
Posts: 3
Joined: Sun Aug 18, 2013 7:24 pm
Location: Netherlands

Numeric case not implemented

Post by hansklaver » Tue Mar 22, 2016 6:59 pm

In Astrobe for FPGA RISC5 using a CASE statement with a selector (case label) of type INTEGER or BYTE gives a compiler error "numeric case not implemented". I would not have expected this, because the language report does not mention it, and in the discussions on this forum I was unable to find anything about it.

Where can one find information on the limitations of the CASE-statement for this compiler?
Hans Klaver

cfbsoftware
Site Admin
Posts: 525
Joined: Fri Dec 31, 2010 12:30 pm
Contact:

Re: Numeric case not implemented

Post by cfbsoftware » Tue Mar 22, 2016 9:31 pm

Omissions, restrictions, extensions and changes to Oberon in the RISC5 implementation are listed on Prof Wirth's website in the document Oberon At A Glance. One of the items listed under Omissions and Restrictions is "Case statement for extended types only"

The whole of ProjectOberon was implemented without the use of any numeric CASE statements and the Project Oberon 2013 documentation only has examples of the use of the more recent type-test form of the CASE statement. This form of CASE statement is also now included in the Oberon Language Report.

There have been a number of discussions related to how the numeric CASE statement could be implemented in Oberon for RISC5 on the ETH Oberon Mailing list. I initially thought that suitable instructions did not exist in the RISC5 instruction set to implement the numeric CASE statement efficiently but have had second thoughts since then.

The Astrobe Cortex-M3, Cortex-M4 and Cortex-M7 Oberon compilers support both the numeric and type-test forms of the CASE statement.

cfbsoftware
Site Admin
Posts: 525
Joined: Fri Dec 31, 2010 12:30 pm
Contact:

Re: Numeric case not implemented

Post by cfbsoftware » Sun Dec 25, 2016 11:52 am

cfbsoftware wrote:I initially thought that suitable instructions did not exist in the RISC5 instruction set to implement the numeric CASE statement efficiently but have had second thoughts since then.
We have now completed this work (for CHAR as well as INTEGER and BYTE) as described in the message Numeric CASE has now been implemented.

Post Reply