After looking at the Beremiz iec2c compiler source, I decided that modifying it to fit into this project is probably not the way to go.
Few years ago when I was searching the net for similar projects to gather some stuff for my potential graduate thesis, there was just a