Skip to content

Latest commit

 

History

History
executable file
·
28 lines (20 loc) · 1.67 KB

File metadata and controls

executable file
·
28 lines (20 loc) · 1.67 KB


Java 1.7 Grammar

Here is a Java 1.7 grammar for SableCC.

Remarks

  • This grammar requires SableCC 3.7 or newer.
  • After automatic inlining, the grammar becomes LALR(1).
  • The complete parser requires a Unicode preprocessor in addition to the normal lexer/parser. The code of a complete parser program is provided.
  • The parser has not been tested with Java files containing unusual Unicode characters. It should work, but we would appreciate any feedback you have.
  • The grammar is based on the natural grammar exposed throughout the text of the the Java Language Specification Java SE 7 Edition 2012-07-27. It is not based on the LL grammar exposed in Chapter 18.
  • The grammar is annotated with various issues discovered while transcribing the grammar and resolving its conflicts.

Java 1.7 Grammar Files ==

Additional Files

  • UnicodeLetter.java: This file contains a class that could be used to improve the lexical part of the Java 1.7 grammar.
  • java-1.7-non-lalr.sablecc: This file contains the grammar as it was before the LALR(1) changes.