Grammar studies the way in which words/morphemes join to form meaningful sentences. Grammar is a set of constraints on the possible sequences of symbols expressed as rules or principles. Syntax is the basic ingredient of grammar. Grammar tells us the difference between sets of sentences.
Fundamental Units
There are five fundamental units of grammatical structure: morpheme, word, phrase, clause, and sentence. Morpheme is the lowest unit. Morphemes joined to form word. Phrase and clause are group of words. While phrase does not have subject and predicate, clause does have its own subject and predicate. In a sentence, Joe sings, Joe is subject and sings is predicate. Sentence is also a group of words that convey some meaning.
Note that what is described above is called traditional grammar. Subject, predicate, etc are called grammatical functions. Parts-of-speech such as verb, noun, adjective are called grammatical categories.
Computational grammars are those that are meant for Natural Language processing. They should be detailed, precise and exhaustive. They should be descriptive grammars so that computers can correctly interpret and apply them.
For Further Study
1. Pushpinder Syal, D.V.Jindal, An Inroduction to Linguistics, Second Edition, PHI, 2009.
2. Andrew Radford, Minimalist Sytax, Cambridge Universtiy Press, 2004.