Grammar is the set of structural rules that govern the composition of clauses, phrases, and words in any given natural language. These rules apply at several levels, from sound (phonology) to meaning (semantics), and include the rules by which words combine to form phrases and clauses. Grammar also encompasses morphological and syntactic rules, which govern the structure of words and sentences.