PyCharm ANTLR4 Plugin (Feature Request?)

125 views
Skip to first unread message

Robert Jacobson

unread,
Mar 31, 2015, 9:26:59 PM3/31/15
to antlr-di...@googlegroups.com
I sure would love an ANTLR plugin for PyCharm like the one for IntelliJ IDEA. In fact, the IntelliJ plugin is installable in PyCharm, but I can't see that it does anything. 

Best,

Robert

Eric Vergnaud

unread,
Apr 2, 2015, 11:50:55 PM4/2/15
to antlr-di...@googlegroups.com
Hi
the intellij plugin is for Java only.
maybe you can write a plugin for PyCharm + AntLR for Python

Eric

Terence Parr

unread,
Apr 3, 2015, 11:39:08 AM4/3/15
to antlr-di...@googlegroups.com
it *might* actually work as pycharm is also in java with same api. you’d have to change the config xml file and try it
T
--
You received this message because you are subscribed to the Google Groups "antlr-discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to antlr-discussi...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Robert Jacobson

unread,
Apr 3, 2015, 12:53:56 PM4/3/15
to antlr-di...@googlegroups.com
Are you suggesting that the antlr devs aren't magical software elves that can grant my every wish before the weekend? ;)

> maybe you can write a plugin for PyCharm + AntLR for Python

The thought has crossed my mind more than once. But as a pretenure academic I have to prioritize my projects based on what my institution thinks should "count." Maybe I could get an undergrad to do it....

Best,

Robert

Terence Parr

unread,
Apr 3, 2015, 1:40:34 PM4/3/15
to antlr-di...@googlegroups.com
it might just work. see:

http://confluence.jetbrains.net/display/IDEADEV/Plugin+Compatibility+with+IntelliJ+Platform+Products

then in plugin.xml change this:

<!-- please see http://confluence.jetbrains.net/display/IDEADEV/Plugin+Compatibility+with+IntelliJ+Platform+Products
on how to target different products -->
<!-- uncomment to enable plugin in all products
<depends>com.intellij.modules.lang</depends>
—>

Ter

Jay Shaffstall

unread,
Aug 18, 2015, 12:55:43 PM8/18/15
to antlr-discussion

I can confirm that the IntelliJ ANTLR 4 plugin does work in PyCharm if you edit the plugin.xml.  Here's what I did:

1) Downloaded the plugin zip file from the IntelliJ plugin repository

2) Unzipped the file

3) In the lib directory, extracted the intellij-plugin-v4.jar file (use any zip extractor)

4) Inside the extracted jar directory, go into META-INF and edit plugin.xml.  Uncomment out the line mentioned above.

5) Recreate the jar file (zip up the extracted directories again, then rename the file to .jar)

6) Recreate the original plugin zip file again by zipping up the extracted directory

7) Import into PyCharm using the load plugin from disk option in the plugin setttings

Finally, in any grammar where you want a Python target generated, include in the .g4 file:

options
{
language=Python3;
}

Or 

options
{
language=Python2;
}

Depending on what version of Python you're targeting.

The "auto-generate parser upon save" option doesn't seem to work, but you can still generate the parser through the Tools menu.

Terence Parr

unread,
Aug 19, 2015, 2:23:19 PM8/19/15
to antlr-di...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages