In a way that follows the rules of grammar; from a grammatical perspective.
English formation from 'grammatical' plus the adverb-forming suffix '-ly' (from Old English 'lice' meaning 'body' or 'manner'), creating a word to describe how something is done in a grammatical way.
It's fascinating that we needed to create this adverb to talk about *how* we do things according to grammar rules—it shows that even as grammarians made rules, they had to keep creating new words to talk about those rules!
Complete word intelligence in one call. Free tier — 50 lookups/day.