syntax: studies of the rules for forming admissible sentences
grammar: the branch of linguistics that deals with syntax and morphology (and sometimes also deals with semantics)
petrology: the branch of geology that studies rocks: their origin and formation and mineral composition and classification