Yes there are, it's Article 50 of the Treaty on European Union. Scotland, Gibraltar, or whatever other country/region, will be considered as new applications for EU membership as the previous application was by a "different" country. This was reiterated by the EU during the Scottish referendum, this is no different.
[1] I am no lawyer nor politician, I have no idea how easy this would be from any practical point of view
Italy is also having problems with separatists.
Venice want to become a city-state republic again, and the Italian islands also made moves about wanting independence.
Italy is very aware of this, and in the past last time someone tried a independence stunt (some guy built a artificial island and declared independence) Italy bombed the shit out it.
Italian and Spanish "estabilishment" politicians are probably panicking now, since independence movements might consider UK leaving the EU, and the potential for Scotland to leave UK, "inspiration" to make their own moves.
† This is not meant as a nationalist slur, or a conflation of identities - it is meant in terms of political sentiments and voting patterns. Scotland and Northern Ireland are far more devolved.