2.3. The Syntactic Grammar

A syntactic grammar for the Java programming language is given in Chapters 4, 6-10, 14, and 15. This grammar has tokens defined by the lexical grammar as its terminal symbols. It defines a set of productions, starting from the goal symbol CompilationUnit7.3), that describe how sequences of tokens can form syntactically correct programs.

Chapter 18 also gives a syntactic grammar for the Java programming language, better suited to implementation than exposition. The same language is accepted by both syntactic grammars.

Get The Java® Language Specification, Java SE 7 Edition, Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.