-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compiling natty with 3.4 antlr-runtime ? #60
Comments
I haven't attempted to migrate natty to ANTLR 3.4, but I'd be more than happy to merge in a tested pull request. |
Thanks for reply :-) I'll give it a try to make it work with 3.4 ANTLR, but given I did not used antlr before probably slim chance I could figure it out. It seems almost like new antler is getting into some infinity loop and just hanging on :( |
Just faced with the problem using drools-compiler 6.0.1 which requires antlr-runtime 3.5. |
I was successful with compiling natty with antlr 3.5. Encountered problems:
Code changes here: https://github.com/azhemoytuk/natty |
azhemoytuk I tried your changes and had the same issue. I fixed it by changing the following in the ParseListener. Changed from: to The build still took me about an hour tho. |
This should solve some dependency conflicts regarding antlr-runtime, since natty currently doesn't work with versions higher than antlr-runtime 3.2. See joestelmach/natty#60 for the related bug report.
+1 to this, would like to use Natty in a Hadoop/HBase project with hard ANTLR dependencies. The org.graylog2.repackaged version is working for me however. |
The main problem I've had when trying to upgrade ANTLR past 3.2 was the removal of the conversion timeout property, which would cause crazy slow compile times. I've finally been able to rework the grammar to compile quickly with ANTLR 3.3+ (fc0ff4c), but it looks like 3.3 and 3.4+ have their own compatibility issues with natty, so I'm trying to upgrade one step at a time. |
@azhemoytuk : would you mind sending a pull request for your changes in NattyTokenSource? And @clementcm for your changes in ParseListener? I've verified these changes work just fine with the recent grammar changes, and compile time is down to around 10 seconds on my machine. I'd like to make sure you both get marked as a contributor. Thanks! |
@joestelmach I am trying to create a pull request to your antlr33 branch. I upgraded to Antlr3.5 with my ParseListener changes. I got ode too large for try statement error when I build with Maven. I don't get this error with eclipse build. Have you ever run into this problem before? [ERROR] COMPILATION ERROR : |
I'm seeing this as well with 3.4 and 3.5. If you want to build against 3.3 for now we can get a change in to fix the API differences introduced in 3.3. Then I'll take a look at the code too large issue (which should be unrelated to these changes) Thanks for the help! |
I tired to upgrade Antlr to 3.3 to your antlr33 branch. All test cases failed as follow. Your Master branch does not have this problem. Feb 09, 2015 2:31:04 PM com.joestelmach.natty.Parser singleParse |
You'll need azhemoytuk's changes to get past the NPE's, but feel free to send a pull request with just your changes to ParseListener and I can manage any integration trouble on my end. |
Oops forgot to merge his code. Now the pull request is sent. Thanks. |
I just released version 0.10 - give it a spin. |
Thanks Joe! It passed all my test cases except one. I'vd opened an issue #108. |
Thanks Joe, that's the great news! |
Sweet. Thank you very much Joe! |
Not sure what I am doing wrong; getting error: |
The project is configured to build easily with Maven. Take a look at the pom.xml file for the proper dependencies, which does indicate you're using the wrong version of ANTLR (3.5.2 is required) |
Hi Joe,
On 11/4/16 10:01 AM, Joe Stelmach wrote:
|
Hi,
I wanna wrap natty (awesome lib!!!) in HIve UDF. Unfortunately hive is using antlr-runtime 3.4, so I have no option but to compile natty with antlr plugin antlr 3.4.
Compilation just hangs. I was wandering did you tried to migrate to 3.4 and do you have any hints how to do this (also 0.8 natty can not run in 3.4 antlr enviroment if fails with java.lang.NoSuchMethodError: org.antlr.runtime.debug.DebugEventListener.enterDecision(I)V )
All the best,
Nemanja.
PS: More detail
Running 0.8 natty in 3.4 antlr runtime throws
java.lang.NoSuchMethodError: org.antlr.runtime.debug.DebugEventListener.enterDecision(I)V
My compilation setup
https://github.com/klout/natty/compare/joestelmach:master...master
antlr 3.0.1 (was 2.7.7) works just fine with runtime 3.2
antlr-runtime 3.4 (was 3.2)
Compilation (cmd - mvn clean install -DskipTests -Pnon-debug -X) hangs on:
As a result, alternative(s) 3 were disabled for that input
warning(200): com/joestelmach/natty/generated/DateParser.g:775:3:
Decision can match input such as "IN WHITE_SPACE ONE WHITE_SPACE SECOND" using multiple alternatives: 2, 3
As a result, alternative(s) 3 were disabled for that input
As a result, alternative(s) 3 were disabled for that input
And fails after 55min (3.2 antlr-runtime env compiles in 23sec) with:
org.apache.maven.lifecycle.LifecycleExecutionException: ANTLR caught 2 build errors.
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: ANTLR caught 2 build errors.
at org.antlr.mojo.antlr3.Antlr3Mojo.execute(Antlr3Mojo.java:384)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
... 17 more
The text was updated successfully, but these errors were encountered: