The partially free word order in German belongs to the class of phenomena in natural language that require a close interaction between syntax and pragmatics
Partially free word order as it occurs in German and probably to some extent in all natural languages arises through the interaction of potentially conflicting ordering principles.
Stuart M. Shieber, Susan U. Stucky, Hans Uszkoreit, & Jane J. Robinson
Metagrammatical formalisms that combine context-free phrase structure rules and metarules (MPS grammars) allow concise statement of generalizations about the syntax of natural languages.
Grammars contain rules for generating sentences. Metarules are statements about these rules. They are metagrammatical devices that can be used to generate rules of the grammar or to encode certain relations among them such as redundancies in their form.