title: What is the difference between Lexical grammar and Syntactic grammar?
body: <p>I am reading The Java Language Specification 8.</p>
  
  <p>I am trying to understand Chapter 2. Grammars. </p>
  
  <p>Here's what I have already learned: </p>
  
  <ol>
  <li><p>Semantics:<br>
  Semantics is the study of meaning.</p></li>
  <li><p>Meaning:<br>
  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.</p></li>
  <li><p>Syntax:<br>
  Syntax is all about the structure of sentences, and what determines which words go where.</p></li>
  <li><p>Production:<br>
  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.</p></li>
  <li><p>Alphabet:<br>
  A non-empty set is called alphabet when its intended use in string operations shall be indicated.</p></li>
  <li><p>Lexeme:<br>
  A lexeme is a string of characters which forms a syntactic unit.</p></li>
  <li><p>Syntactic unit:<br>
  Sentence is the "highest" (i.e., largest) syntactic unit,<br>
  the lowest (i.e., smallest) syntactic units are words,<br>
  the intermediate syntactic units are the phrases.</p></li>
  <li><p>Token:<br>
  A token is a structure representing a lexeme that explicitly indicates its categorization for the purpose of parsing.</p></li>
  <li><p>Grammar:<br>
  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.</p></li>
  <li>Lexical grammar:<br>
  A lexical grammar is a formal grammar defining the syntax of tokens. </li>
  </ol>
  
  <p>I could not find out what syntactic grammar is.</p>