I am reading The Java Language Specification 8.
I am trying to understand Chapter 2. Grammars.
Here's what I have already learned:
Semantics:
Semantics is the study of meaning.
Meaning:
Meaning, in semantics, is defined as being Extension: The thing in the world that the word/phrase refers to, plus Intention: The concepts/mental images that the word/phrase evokes.
Syntax:
Syntax is all about the structure of sentences, and what determines which words go where.
Production:
A production or production rule in computer science is a rewrite rule specifying a symbol substitution that can be recursively performed to generate new symbol sequences.
Alphabet:
A non-empty set is called alphabet when its intended use in string operations shall be indicated.
Lexeme:
A lexeme is a string of characters which forms a syntactic unit.
Syntactic unit:
Sentence is the "highest" (i.e., largest) syntactic unit,
the lowest (i.e., smallest) syntactic units are words,
the intermediate syntactic units are the phrases.
Token:
A token is a structure representing a lexeme that explicitly indicates its categorization for the purpose of parsing.
Grammar:
A grammar (when the context is not given, often called a formal grammar for clarity) is a set of production rules for strings in a formal language.
The rules describe how to form strings from the language's alphabet that are valid according to the language's syntax.
A formal grammar is a set of rules for rewriting strings, along with a "start symbol" from which rewriting starts.
I could not find out what syntactic grammar is.
A more expansive definition of "syntax" would be the set of all ordered combinations of symbols which form a correct document, in the given language. Thus, "syntactic grammar" can be summarily described as the portion of the language's grammar that describes how various tokens can be ordered, to form meaningful phrases.
Of course this folds back on your provided definition of "lexical grammar", so allow me to highlight the major difference--lexical grammar describes the structure of the lexicon, that is, every token (word) used in the language. Syntactical grammar describes how phrases and documents are formed from those tokens.