Refactoring FreeBASIC plugin state machine emitter