Skip to content

Grammar Evolution History

ptitjes edited this page Feb 24, 2015 · 3 revisions

Some notes on the evolution of the grammar

At the beginning (in a far far distant time) the grammar was located at src/main/java/japa/parser/java_1_5.jj

Shelby's comment's patch

commit 6f070b8d84c4ef5a99ad23f167439777a29f3f2d
Author: matozoid <[email protected]>
Date:   Sun Oct 30 18:23:58 2011 +0100

    * Apply "comments patch": http://code.google.com/p/javaparser/issues/detail?id=9#c19

[https://github.com/javaparser/javaparser/commit/6f070b8d84c4ef5a99ad23f167439777a29f3f2d]

Diff for shelby's comment's patch :

git diff -b -w 9eef622a4cec619c7c2188b531e678833d46fe3b..6f070b8d84c4ef5a99ad23f167439777a29f3f2d -- src/main/java/japa/parser/java_1_5.jj

Renamed to src/main/javacc/java_1_5.jj

commit d1ef188a5b099babf8e90eed9082257b52fc53cf
Author: matozoid <[email protected]>
Date:   Sun Oct 30 19:29:19 2011 +0100

    * Put jj file in generate-sources cycle.

 8 files changed, 3422 insertions(+), 4560 deletions(-)

Various fixes

commit 67dda6ae92fcd5c6007da69bf3da1ac5fb9563b3
Author: Chao Shi <[email protected]>
Date:   Mon Mar 11 23:30:12 2013 +0800

    Extract exact position of constructor name

commit 51852bd13fb272b568864fd575544a3c1d7f0af8
Merge: 1af2f52 d313c09
Author: Chao Shi <[email protected]>
Date:   Tue Feb 26 01:08:17 2013 -0800

    Merge pull request #19 from stepinto/exact-position-of-method-name-0222
    
    Extract position of method names in MethodCallExpr

commit d313c09d88ca815ebfa23a9584ff62503a4f73af
Author: Chao Shi <[email protected]>
Date:   Fri Feb 22 20:21:45 2013 +0800

    Extract position of method names in MethodCallExpr
    e.g. position of "println" in System.out.println("hello");

commit a27c8a84c84d7e9b008b14d362555f754a981672
Author: Chao Shi <[email protected]>
Date:   Tue Jan 8 20:15:09 2013 +0800

    Improve performance by not keeping all comment tokens in memory

Including:

-    private Set<Token> special_tokens = null;
+    private Token last_special_token = null;
commit 0f51a40892316c14ed5c8fc143176197c59a3326
Merge: 478dba0 65943ea
Author: matozoid <[email protected]>
Date:   Sat Dec 8 14:03:07 2012 -0800

    Merge pull request #14 from stepinto/fix-issue-13
    
    Improve parser performance

commit 65943eac9435758e07ae365869312c046db1eca3
Author: Chao Shi <[email protected]>
Date:   Sat Dec 8 15:18:14 2012 +0800

    Fixes issue #13.
    
    Replace ArrayList<Token> special_tokens with HashSet.

commit 51e2097ef26906aac24751a30cdd273b5e355941
Author: Chao Shi <[email protected]>
Date:   Sat Dec 8 13:05:12 2012 +0800

    Exposes position information of type/method names.
    
    Adds the following methods:
    - TypeDeclaration#{get,set}NameExpr()
    - MethodDeclaration#{get,set}NameExpr()


commit 807e77f3bcd396251219068ea1a09dc1d782381b
Author: Alexey Morozov <[email protected]>
Date:   Thu Aug 30 17:41:12 2012 +0700

    Support for comments inside different parts of 'if' statement
    
    Signed-off-by: Alexey Morozov <[email protected]>

Support for Java 7

commit 19c23383ff93769a6a74811e012d3c811fcb5121
Author: Donny Nadolny <[email protected]>
Date:   Sat Sep 14 14:33:45 2013 -0400

    Java 7 support: all done, change filename/comments/readme/pom to say 1.7 instead of 1.5

Including: Renamed src/main/javacc/java_1_5.jj -> src/main/javacc/java_1_7.jj

commit cfc05114e4036cebcdfb5ef7e534cb84f4e68e02
Author: Donny Nadolny <[email protected]>
Date:   Sat Sep 14 14:28:54 2013 -0400

    Java 7 support: multi-catch clause

commit e9a207eeccbbed729387e5a121ab6839233c82d6
Author: Donny Nadolny <[email protected]>
Date:   Sat Sep 14 12:32:52 2013 -0400

    Java 7 support: try-with-resources

commit eb45e2279da5010ab3b65545d4f4a4bd6300ce61
Author: Donny Nadolny <[email protected]>
Date:   Sat Sep 14 11:58:48 2013 -0400

    Java 7 support: diamond operator

commit 1b56075c1557a04630cf81aaa9420fee9b8d73d4
Author: Donny Nadolny <[email protected]>
Date:   Sat Sep 14 11:50:10 2013 -0400

    Java 7 support: binary literals and underscores in numeric literals

Various work on comments

commit 17229be0bf37d47628d6055ca0252d3f80724590
Author: Federico Tomassetti <[email protected]>
Date:   Thu Oct 24 20:17:45 2013 +0200

    Printing orphan comments almost work now

commit 3f2c603c32e17f5181fc20383539b571bcada8c0
Author: Federico Tomassetti <[email protected]>
Date:   Thu Oct 24 18:02:38 2013 +0200

    Working on comments dumping...

To spot the differences:

git diff -w -b  16b1771dee2f449f81e89398fc56f97fce290a03..3f2c603c32e17f5181fc20383539b571bcada8c0 -- src/main/javacc/java_1_7.jj
commit 16b1771dee2f449f81e89398fc56f97fce290a03
Author: Federico Tomassetti <[email protected]>
Date:   Mon Oct 21 18:24:46 2013 +0200

    Avoiding comments to be associated to other comments
    (Node.setComment should not be used on Comment)