Semantics is the study of meaning in language. It examines how meaning is constructed and understood based on linguistic forms like words, phrases, sentences and larger texts. There are different types of meaning including lexical, grammatical, denotative and connotative. Meaning can shift over time through processes like generalization, specialization, amelioration and pejoration. Semantic relationships exist between concepts like synonyms, antonyms, hyponyms and hypernyms. Semantics plays an important role in language processing by analyzing syntax trees and enforcing rules to prepare for code generation.