An extension of the scheme grammar concept given by Urschler is formalized. It is also show that, in the usual hierarchy of the theory of formal languages, the language generated by the scheme grammar is regular (type 3). The last section gives the description of a system for the automatic structuring of programs, which applies these concepts to the Mills algorithm with some modifications.