OCL 2.0 grammar for SableCC 3.2

written by Raphael

As promised in my post from 12/20/2010 I've released my modified OCL 2.0 grammar file I'm using for my bachelor thesis on github.

I've made some changes in order to cope with the changes introduced in OCL 2.0, as well as to address some shortcomings the original version had.

For more details see the README included in the repository.

Cheers, Raphael

Related links:


Parsing OCL utilizing SableCC

written by Raphael

After nearly a month of DIY OCL parsing I decided to throw it all away and start anew using SableCC 3.2. There is an OCL 1.5 grammar for SableCC 2.0, which did not work with version 3.2. After some tweaks I was able to get the grammar to work.

Switching to SableCC was a very good idea even tho the documentation on version 3.2 is scarce. The OCL parsing works well. SableCC generates a lot of Java classes which can be used to transform the generated concrete syntax tree (CST).

The only problem is that the generated CST is quite complex. SableCC 3.2 comes with the option to significantly reduce the size of the generated CST by specifying a mapping the the underlying abstract syntax tree. It seems like a good idea to update the grammar to work with an AST mapping as well, but I'm not quite sure if it fits into my bachelor thesis. As soon as I'm sure what to do, and how to do it, I'm going to publish the OCL grammar I've updated.

Cheers, Raphael


A first presentation

written by Raphael

This monday I had my first presentation of my bachelor thesis about the 'Transformation of OCL to Schematron'. Needless to say that I have been incredible nervous about this because I was not sure if I had worked hard enough the first month. It turned out that there were no major concerns with my thesis. Lucky me :)

The basic approach to the transformation stayed the same - I just added some specific tidbits. Here's a small excerpt from my presentation:

The first images presents how I am planning on working on my bachelor thesis. I'd like to see my thesis as an iterative process which consists of:

  1. thinking about how to transform a small piece of OCL to Schematron
  2. trying to program the small transformation
  3. evaluate if the transformation matches all my needs

bachelor thesis planning

The second images presents the transformation itself:

  1. parse OCL input file
    • split input into single OCL expressions
    • type those OCL expressions according to OCL ConcreteSyntax
  2. transform single OCL expressions according to given transformation rules
  3. create Schematron output file

OCL transformation