The concept of a SNAT-based code generator spans two layers:
The ground layer is the decomposition of document construction into primitive operations
The top layer is a metadata model enabling the implementation of those primitives
The ground layer is independent of a particular source data media type, as long as the source data can be viewed as a collection of distinct items. The metadata model, on the other hand, must specify the construction of code which can be applied to sets of source data items. Such code will usually rely on a particular media type. We conclude that
A SNAT-based code generator is tied to a particular source data media type
The dependency is restricted to the metadata model
Note. As mentioned before, the dependency on a single media type can be removed by a preliminary step translating various media types into a single media type whose transformation is natively supported. For example, an XML-dependent code generator can be easily extended to support JSON, CSV and HTML data sources.
In general, the task of designing a SNAT-based code generator can be redefined as the design of a metadata model which enables a generic implementation of the primitive operations using metadata as sole input. The model comprises three submodels:
metadata item model – defines the names and semantics of metadata items
metadata value model – defines the interpretation of metadata item values
code assembly model – defines how to assemble the source code of primitives from metadata