Extend Head with two more arguments (on behalf DCG compilation).
The solution below is one option. Using =.. and append is the
alternative. In the current version (5.3.2), the =.. is actually
slightly faster, but it creates less garbage.
Extend a non-terminal with the DCG difference list List\Tail.
The position term is extended as well to reflect the layout of
the created term. The additional variables are located at the
end of the Rule.