generator: Added conversion for unions

Also removed all assumptions for parameters when
ParserVersion >= 3