pchapin / scala

Scalaness: A stagged programming system for embedded systems based on Scala.
0 stars 0 forks source link

Create a method to pretty print nesT types? #10

Open pchapin opened 11 years ago

pchapin commented 11 years ago

The representation of nesT types is currently abstract (a collection of case objects and case classes). This is fine for internal use but it is ugly to display. It would be nice to have a method that converts the abstract representation of a nesT type into something that looks more like the way types are written in nesT programs. For example we want something like

Array(Pointer(UInt8), 10)

to be displayed as

uint8_t *[10]

Fully correct handling of this conversion might be tricky due to the somewhat odd syntax of types used by C like languages. It should be relatively easy, however, to get an approximately correct version of the method. I expect this method will be useful in error and debug messages produced by the Scalaness compiler.