Organise source in correspondence with grammar hierarchy