You are trying to translate some really badly written Verilog. I suggest you find a better source, or a Verilog tutorial/reference book. Or better still - understand what you're trying to do and write your own.
Im going to give a direct translation, written in equally bad formatting (though I assume you'll just copy and paste anyway, rather than try and understand it):