Recently there has been significant interest in using causal modelling techniques to understand the structure of physical theories. However, the notion of `causation' is limiting - insisting that a physical theory must involve causal structure already places significant constraints on the form that theory may take. Thus in this paper, we aim to set out a more general structural framework. We argue that any quantitative physical theory can be represented in the form of a generative program, i.e. a list of instructions showing how to generate the empirical data; the information-processing structure associated with this program can be represented by a directed acyclic graph (DAG). We suggest that these graphs can be interpreted as encoding relations of `ontological priority,' and that ontological priority is a suitable generalisation of causation which applies even to theories that don't have a natural causal structure. We discuss some applications of our framework to philosophical questions about realism, operationalism, free will, locality and fine-tuning.