Decision Tables

One thing that is nice about the projectional editor in MPS is that you cannot just use textual notations, but also, for example, tables. We’ve built a little decision table. It uses a two-dimensional tabular projection to render the two dimensions that are and’ed together. Below is an example and a test case.

We’ve also added a gswitch expression, it’s a generified switch that can be used in expression context. It can use any boolean expression in the cases and is translated to a bunch of if/else statements wrapped in an inline function to put it into expression context. The decision tables are translated to nested gswitch expressions.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s