what's the definition of grammar
For the rules of the English language, see English grammar. For other uses, see Grammar (disambiguation). In linguistics, grammar (From Greek: γραμματική) is the set of structural rules governing the composition of clauses, phrases, and words in any given natural language. The term refers also to the study of such rules, and this field includes morphology, syntax, and phonology, often complemented by phonetics, semantics, and pragmatics.
syntax. A subcategory of linguistics, syntax is the study of sentence structure and the rules that govern it. From a linguistic point of view, the rules of grammar as published in textbooks are irrelevant; what's important is that syntax categorizes the way the sentences are stored in our brain.