Preparation of compounds containing alloxazine or isoalloxazine nucleus