eclipse-modisco / org.eclipse.modisco

Eclipse Public License 2.0
0 stars 0 forks source link

Maintain Antlr currency #1036

Closed eclipse-modisco-bot closed 3 days ago

eclipse-modisco-bot commented 3 days ago

| --- | --- | | Bugzilla Link | 553058 | | Status | RESOLVED FIXED | | Importance | P3 normal | | Reported | Nov 14, 2019 09:52 EDT | | Modified | Nov 25, 2019 08:42 EDT | | Blocks | 552988 | | Reporter | Ed Willink |

Description

Modisco currently uses Antlr 3.0.0 which is no longer in Orbit.

Changing to 3.2.0 reveals serious source, and probably runtime, incompatibilities.

Rebuilding with 3.2.0 seems easy and the 4 org.eclipse.modisco.jee.jsp.discoverer.tests tests that construct JSPLexer/JSPParser are still green.

Rebuilding with 4.3.0 fails, changed -fo command line, changed internal synyax, which perhaps explains why 3.2.0 is the version preferred by many projects, albeit with a patch for Xtext.

4.5 / 4.7 would seem equally problematic.

Let's go with 3.2.0.

eclipse-modisco-bot commented 3 days ago

By Ed Willink on Nov 14, 2019 11:01

(In reply to Ed Willink from comment #0)

Rebuilding with 3.2.0 seems easy

...

Rebuilding with 4.3.0 fails

Hmm. Not so easy. Retying 3.2 indeed generates good Java bit has an NPE

error(10): internal error: Can't get property indirectDelegates using method get/isIndirectDelegates from org.antlr.tool.Grammar instance : java.lang.NullPointerException\ java.util.Objects.requireNonNull(Unknown Source)\ java.util.ArrayList.removeAll(Unknown Source)\ org.antlr.tool.CompositeGrammar.getIndirectDelegates(CompositeGrammar.java:222)\ org.antlr.tool.Grammar.getIndirectDelegates(Grammar.java:2620)\ sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

but it generates 'good' Java files anyway. https://github.com/malteseduck/sonar-xquery-plugin/issues/19 suggests using Java 7.

Attempting to regenerate with 3.0.0 or 3.0.1 hits a no Manifest problem. The following works, using 3.2 to provide the missing antlr package.

java -cp antlr-3.0.jar;antlr-3.2.jar org.antlr.Tool -fo output -lib . JSP.g

This gives similar but not quite identical files to master.

--

https://github.com/malteseduck/sonar-xquery-plugin/issues/19 suggests using Java 7. No Java 7 on my laptop; use Java 5.

"C:\Program Files\Java\jdk1.5.0_22\bin\java.exe" -jar antlr-3.2.jar -fo output -lib . JSP.g

It works and is only slightly different to the Java 8 generation with NPE.

eclipse-modisco-bot commented 3 days ago

By Ed Willink on Nov 25, 2019 08:42

Migration to 3.2.0 pushed to master for 2019-12M3.