Semantic and pragmatic meanings are closely related to each other. The semantic meaning of a sentence (or utterance) usually precedes its pragmatic meaning, however, it is possible for the pragmatic meaning to be understood and analyzed before the semantic one in some special situations.
On the one hand, we might understand from a person's tone of voice that they want something, without knowing what it is that they want.
On the other hand, sometimes we understand a person's attitude toward an idea without even hearing (or reading) the whole sentence.