Halliday & Matthiessen (2014: 731):
A text is meaningful because it is an actualisation of the potential that constitutes the linguistic system; it is for this reason that the study of discourse (‘text linguistics’) cannot properly be separated from the study of the grammar that lies behind it.