(1) Primarily magmatic through crystallization from highly fractionated, acidic residual melts in granite pegmatites. (2) Hydrothermal-pneumatolytic in greisens and quartz veins through impregnation of boron- and fluorine-rich fluid phases in the perimagmatic zone of tin granites. (3) Metasomatic in skarn deposits through the interaction of metal-bearing fluids with carbonate country rock.