grammar (*.javatar-grammar) is used to assigned a name to Java elements such as keywords, strings or similar just like TextMate's grammar. This allow to get informations about document more accurate.
have it own parser that will parse your document using this grammar. Since is using GrammarParser, its grammars are also a GrammarParser's grammar.
More informations about how grammar works is on GrammarParser readme.