Giter Club home page Giter Club logo

antlr4ide's Introduction

Maintenance This project has not seen commits/updates for several years now. It is no longer maintained.

Build Status Download

ANTLR 4 IDE

ANTLR 4 IDE

Features

Welcome

This is brand new version of the old ANTLR IDE. The new IDE supports ANTLR 4.x and it was created to run on Eclipse 4.x

The old ANTLR IDE isn't supported anymore. When I wrote it, I was young and didn't know what was doing ;)

Don't get me wrong, the old version did a very good work from user point of view, it just I'm not proud of the code base because is kind of complex and had a poor quality.

The main reason of complexity of the old IDE was in Dynamic Language ToolKit (DLTK) dependency. The DLTK project didn't evolve so much over the last few years and doing something in DLTK is very very complex and require a lot of work.

Now, the new IDE was built on XText. XText is great for building DSL with Eclipse IDE support, so if you are not familiar with XText go and see it.

See link to ANTLR tools for a comparison of ANTLR4IDE with other development tools for ANTLR.

Eclipse Installation

Prerequisites

  • Eclipse 4.4 Luna Xtext Complete SDK(Needs to be version 2.7.3)
  • Eclipse Faceted Project Framework (Tested with 3.4.0) Eclipse Faceted
  • Project Framework JDT Enablement(Tested with 3.4.0) ANTLR 4 SDK A
  • A copy of the antlr-4.x-complete.jar (4.5 at the time of writing)

Installation

  1. Install Eclipse (4.4 Luna)
    1. Download it from https://www.eclipse.org/downloads/
  2. Install XText 2.7.3
    1. Go to Help > Install New Software...
    2. Enter http://download.eclipse.org/modeling/tmf/xtext/updates/composite/releases/ in the Work With textbox
    3. Hit Enter and wait for the list to load (this will take a few moments)
    4. Expand the Xtext node and check Xtext Complete SDK (ensure the version is 2.7.3x)
    5. Click Next, agree to the EULA, and click finish
    6. Let the installer finish and restart Eclipse
  3. Install Faceted Project Framework
    1. Go to Help > Install New Software...
    2. Enter http://download.eclipse.org/releases/luna in the Work With textbox
    3. Hit Enter and wait for the list to load (this will take a few moments)
    4. In the filter text box enter Facet
    5. Select Eclipse Faceted Project Framework and Eclipse Faceted Project Framework JDT Enablement
    6. Click Next, agree to the EULA, and click finish
    7. Let the installer finish and restart Eclipse
  4. Install ANTLR 4 IDE
    1. Go to Help > Eclipse Marketplace...
    2. Search for antlr
    3. Choose ANTLR 4 IDE (make sure it's ANTLR 4 IDE not ANTLR IDE)
    4. Click Install
    5. Let the installer finish clicking ok if it prompts and restart Eclipse
  5. Obtain a copy of antlr-4.x-complete.jar
    1. Download the file from here
    2. Save it somewhere you'll remember

Creating a project in Eclipse

  1. Go to File > New Project > Project
  2. Expand the General Tab and select ANTLR 4 Project (if you don't see this see step 4 of setup)
  3. Click Next, give the project a name and click Finish
  4. Once the project is complete right click the project and click Properties
  5. Go to Project Facets and click Convert to faceted form... (if you don't see this see step 3 of setup)
  6. Check the Java project facet and click Apply (if you don't see this see step 3 of setup)
  7. Click OK, let the solution rebuild, open the properties again
  8. Go to Java Build Path, click the Source tab
  9. Click Add Folder... and check Project > target > generated-sources > antlr4, click OK
  10. Click the Libraries tab
  11. Add External JARs..., find your copy of antlr-4.x-complete.jar, click Open
  12. Go to ANTLR 4 > Tool, click Apply if a pop-up appears
  13. Check Enable project specific settings
  14. Click Add, find your copy of antlr-4.x-complete.jar, click Open
  15. Check 4.x
  16. Click Apply, click Yes to rebuild, click OK to exit the properties

Usage

The new IDE is very simple to use all the files with a *.g4 extension will be opened by the ANTLR 4 Editor. So, just open a *.g4 file and play with it.
See grammars examples at https://github.com/antlr/grammars-v4

Code Generation

Code is automatically generated on save if the grammar is valid. You can turn off this feature by going to: Window > Preferences > ANTLR 4 > Tool and uncheck the "Tool is activated" option. From there you can configure a couple more of options.

You can find the generated code in the target/generated-sources/antlr4 (same directory as antlr4-maven-plugin)

Manual Code Generation

You can fire a code generation action by selecting a *.g4 file from the Package Explorer, right click: Run As > ANTLR 4.

A default ANTLR 4 launch configuration will be created. You can modify the generated launch configuration by going to: Run > External Tools > External Tools Configurations... from there you will see the launch configuration and how to set or override code generation options

Syntax Diagrams

To open the Syntax Diagram view go to: Window > Show View > Other search and select: Syntax Diagram

Eclipse Example

  1. Create a new ANTLR Project following the steps above
  2. Create a new class with the code below
  3. Run
  4. In the console write Hello there and Ctrl + z to send EOF to the input stream
    import org.antlr.v4.runtime.*;
    import org.antlr.v4.runtime.tree.*;
    public class HelloRunner 
    {
    	public static void main( String[] args) throws Exception 
    	{
    
    		ANTLRInputStream input = new ANTLRInputStream( System.in);
    
    		HelloLexer lexer = new HelloLexer(input);
    
    		CommonTokenStream tokens = new CommonTokenStream(lexer);
    
    		HelloParser parser = new HelloParser(tokens);
    		ParseTree tree = parser.r(); // begin parsing at rule 'r'
    		System.out.println(tree.toStringTree(parser)); // print LISP-style tree
    	}

Building ANTLR 4 IDE

  1. Build with Maven 3.x

  2. Fork and clone the repository from github

  3. Download and install Maven 3.x

  4. Open a shell console and type: cd antlr4ide

  5. Build the project with: mvn clean package

  6. It takes a while to download and configure Eclipse dependencies, so be patient

  7. Wait for a: BUILD SUCCESS message

  8. When building for the very first time there might be some missing dependencies, so please retry mvn clean package

  9. Setup Eclipse

  10. Open Eclipse Luna (4.4)

  11. Install Xtext 2.7.3

  12. Copy and paste this url: http://download.eclipse.org/modeling/tmf/xtext/updates/composite/releases/ in the Work with text field

  13. Hit Enter

  14. Choose XText 2.7.3. NOTE: DON'T confuse with Xtend, you must choose Xtext

  15. Restart Eclipse after installing Xtext

  16. Import the project into Eclipse

  17. Go to: File > Import... then General > Existing Projects into Workspace

  18. Choose project root antlr4ide

  19. Enabled: Search for nested projects

  20. Finish

You don't need any extra Eclipse plugin (like m2e or similar). Project metadata is on git so all you need to do is: mvn clean package and then import the projects into Eclipse.

Want to contribute?

  • Fork the project on Github.
  • Wondering what to work on? See task/bug list and pick up something you would like to work on.
  • Create an issue or fix one from issues list.
  • If you know the answer to a question posted to our mailing list - don't hesitate to write a reply.
  • Share your ideas or ask questions on mailing list - don't hesitate to write a reply - that helps us improve javadocs/FAQ.
  • If you miss a particular feature - browse or ask on the mailing list - don't hesitate to write a reply, show us a sample code and describe the problem.
  • Write a blog post about how you use or extend ANTLR 4 IDE.
  • Please suggest changes to javadoc/exception messages when you find something unclear.
  • If you have problems with documentation, find it non intuitive or hard to follow - let us know about it, we'll try to make it better according to your suggestions. Any constructive critique is greatly appreciated. Don't forget that this is an open source project developed and documented in spare time.

Help and Support

Help and discussion

Bugs, Issues and Features

Author

[Edgar Espina] (https://twitter.com/edgarespina)

License

EPL

antlr4ide's People

Contributors

amura11 avatar arifogel avatar ftomassetti avatar hsorensen avatar jespersm avatar jknack avatar nttdatahenriksorensen avatar orionll avatar timeraider4u avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

antlr4ide's Issues

mavenize project

Maven should be use it to build the project.

  • Unit tests should run on build
  • Plugin tests should run on build
  • Update site and content should be generated with Maven
  • eclipse:clean eclipse:eclipse should be off. No metadata is generated from Maven.

Unable to install ANTLR IDE in eclipse - unable to find valid certification path to requested target

I got below error message during installation ANTLR 4.3 IDE
Some hints?

Unable to read repository at https://github.com/jknack/antlr4ide/tree/master/updates/release/4.3/content.xml.
Unable to read repository at https://github.com/jknack/antlr4ide/tree/master/updates/release/4.3/content.xml.
sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

Error occurs when generating ANLR recognizer

Clicked on Run As > Generate ANTLR Recognizer and got:

An internal error occurred during: "Generating generic_converter.g4".
0

Error log has the following stack trace:

java.lang.ArrayIndexOutOfBoundsException: 0
    at com.github.jknack.generator.ToolOptions.removeSegment(ToolOptions.java:530)
    at com.github.jknack.generator.ToolOptions.output(ToolOptions.java:175)
    at com.github.jknack.generator.ToolOptions.command(ToolOptions.java:276)
    at com.github.jknack.generator.ToolRunner.run(ToolRunner.java:117)
    at com.github.jknack.generator.Antlr4Generator.doGenerate(Antlr4Generator.java:181)
    at com.github.jknack.generator.Antlr4Generator.access$1(Antlr4Generator.java:174)
    at com.github.jknack.generator.Antlr4Generator$3.apply(Antlr4Generator.java:158)
    at com.github.jknack.generator.Antlr4Generator$3.apply(Antlr4Generator.java:1)
    at com.github.jknack.generator.Jobs$1.run(Jobs.java:31)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)

NPE when opening a g4 editor

Below is what happens when I try to open a .g4 file.

image

There is around 20 NPEs.

!ENTRY org.eclipse.ui.workbench 4 2 2014-02-28 20:57:29.473
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.ui.workbench".
!STACK 0
java.lang.NullPointerException
    at org.eclipse.ui.views.properties.PropertySheet.partClosed(PropertySheet.java:282)
    at org.eclipse.ui.part.PageBookView$4.partClosed(PageBookView.java:1063)
    at org.eclipse.ui.internal.WorkbenchPage$21.run(WorkbenchPage.java:4878)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.ui.internal.WorkbenchPage.firePartClosed(WorkbenchPage.java:4876)
    at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart$1.handleEvent(CompatibilityPart.java:101)
    at org.eclipse.e4.ui.services.internal.events.UIEventHandler$1.run(UIEventHandler.java:41)
    at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:180)
    at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:150)
    at org.eclipse.swt.widgets.Display.syncExec(Display.java:4688)
    at org.eclipse.e4.ui.internal.workbench.swt.E4Application$1.syncExec(E4Application.java:205)
    at org.eclipse.e4.ui.services.internal.events.UIEventHandler.handleEvent(UIEventHandler.java:38)
    at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:197)
    at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:197)
    at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1)
    at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
    at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
    at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:135)
    at org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:78)
    at org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:39)
    at org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:80)
    at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:58)
    at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:374)
    at org.eclipse.e4.ui.model.application.ui.impl.UIElementImpl.setWidget(UIElementImpl.java:248)
    at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.unbindWidget(SWTPartRenderer.java:140)
    at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.disposeWidget(SWTPartRenderer.java:161)
    at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer.disposeWidget(ContributedPartRenderer.java:273)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeRemoveGui(PartRenderingEngine.java:899)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$3(PartRenderingEngine.java:828)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$8.run(PartRenderingEngine.java:823)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.removeGui(PartRenderingEngine.java:808)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$1.handleEvent(PartRenderingEngine.java:153)
    at org.eclipse.e4.ui.services.internal.events.UIEventHandler$1.run(UIEventHandler.java:41)
    at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:180)
    at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:150)
    at org.eclipse.swt.widgets.Display.syncExec(Display.java:4688)
    at org.eclipse.e4.ui.internal.workbench.swt.E4Application$1.syncExec(E4Application.java:205)
    at org.eclipse.e4.ui.services.internal.events.UIEventHandler.handleEvent(UIEventHandler.java:38)
    at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:197)
    at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:197)
    at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1)
    at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
    at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
    at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:135)
    at org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:78)
    at org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:39)
    at org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:80)
    at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:58)
    at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:374)
    at org.eclipse.e4.ui.model.application.ui.impl.UIElementImpl.setToBeRendered(UIElementImpl.java:290)
    at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.hidePart(PartServiceImpl.java:1178)
    at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.hidePart(PartServiceImpl.java:1113)
    at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.closePart(StackRenderer.java:1120)
    at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.access$5(StackRenderer.java:1102)
    at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer$12.close(StackRenderer.java:996)
    at org.eclipse.swt.custom.CTabFolder.onMouse(CTabFolder.java:1852)
    at org.eclipse.swt.custom.CTabFolder$1.handleEvent(CTabFolder.java:284)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1057)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4170)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3759)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1113)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:997)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:140)
    at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:611)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:567)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1426)

Argument "-o ." ignored

Under "Run As -> External Tools Configurations ...", adding "-o ." is ignored and the default generated output switch is used by the tool during an antlr build.

Modifying the argument to anything else (e.g. "-o ....") appears to work and the -o argument is modified as per the users's specification.

Preferences setting generate parse tree visitors does not work

It looks that the check boxes in the preferences setting "Generate parse tree visitors" has no effect. The initial default is "Generate a parse tree listener". No matter how you toggle them, you should get the default behavior. This is true for both Workspace level or project level setting. The event listener for the check boxes may not be properly hooked up.

Tool page is missing in 0.2.0

It is impossible to setup global ANTLR options, bc the Windows > Preferences > ANTLR > Tool page is missing in 0.2.0

Missing option to switch of automated package-declarartion-line generation

I'm aware that I can set my own package name by using the option
-package mypackage
in Run-> ExternalTools -> ExternalTools Configuration ANTLR->mygrammar.g4 etc.,
but it still collides with the package declaration given in the g4-haeader and I want to keep the package declaration inside the g4-file(for some reasons).

I'm using:
Eclipse Java EE IDE for Web Developers.
Version: Kepler Release
Build id: 20130614-0229

Antlr4ide-Eclipse-Plugin:
Name: ANTLR 4 SDK Feature,
Identifier: antlr4ide.sdk.feature.group,
Version: 0.1.1.201401151138

Antlr 3 to Antlr4

Hi, is there any plugin or tool that converts a given grammar from Antlr 3 to Antlr4?
Thanks

Improve folding

Comments, options and actions (grammar and rules) sections should be collapsed by default (a.k.a when a user open the editor)

Package name issues

First off, great job! Really appreciate you reviving this project.

A few problems I encountered:

  1. It appears that package names are improperly extracted on Windows 7

The command generated to run antlr4 on appears as follows in the console:
Hello.g4 -o .\org\gradle -listener -visitor -package C:org.gradle -encoding UTF-8

Likely the C: comes from improperly handling C: at the start of the bath (I assume you tested this on a Mac/Linux/Unix machine?).

As a result the package in the generated java code is malformed:
package C:org.gradle;

  1. The package name has already been specified in the grammar file (via @Header), and therefore need not be specified on the command line

This can be easily worked around though by simply removing the @Header { package org.gradle; } line from Hello.g4. Not a big deal, just though it might be something you might want to look for. You could also allow users to specify/modify the package name themselves in the external tool configuration (just a thought).

  1. The output files are placed under org/gradle/org/gradle (repeated twice)

This occurs even if I remove the @Header line in my grammar file.

For reference my grammar file is as follows (pretty much the hello world type grammar from antlr.org):

grammar Hello;
@Header {package org.gradle;}

r : 'hello' ID ;
ID : [a-z]+ ;
WS : [ \t\n]+ -> skip ;

I am using Java 1.7 and Eclipse 4.3.1 (latest released version of both).

print ANTLR version when building

It will be nice to display ANTLR version when building a grammar. So, people know exactly what version is currently in used by IDE.

Error on $ctx within grammar actions

In ANTLR itself, one can use $ctx within a grammar action (i.e. Java code between {}) to get the context of the current rule.

This construct is rejected by ANTLR4 IDE (the error says "unknown attribute reference 'ctx' in '$ctx'").

Initial install from the update site not working

When trying to first install, Eclipse fails with an unrecognised name error

Maybe something to do with the category.xml file on the update site referring to "features/antlr4ide.sdk_0.2.1.qualifier.jar" while the features directory only contains "antlr4ide.sdk_0.2.0.jar"

Also, the README is not clear which bundles in XText 2.5 are required, or if 2.5.x can be used in place of 2.5.0

Different Antlr versions

I would like the ability to choose which Antlr version to use. v4.0, v4.1, v4.2, any future Antlr v4.x.

maven build fails in windows

Hi,

Maven build runs OK on Unbuntu 12.04 but fails on my WIN7 box. I've checked the run configuration against the Travis log and the WIN7 setup looks OK.

Has anybody managed to build this project under Windows or know what issues there may be?

Cheers, Steve

[INFO] ------------------------------------------------------------------------
[INFO] Building ANTLR v4 IDE UI 0.1.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- tycho-packaging-plugin:0.19.0:build-qualifier (default-build-qualifier) @ antlr4ide.ui ---
[INFO] The project's OSGi version is 0.1.1.201403131019
[INFO]
[INFO] --- tycho-packaging-plugin:0.19.0:validate-id (default-validate-id) @ antlr4ide.ui ---
[INFO]
[INFO] --- tycho-packaging-plugin:0.19.0:validate-version (default-validate-version) @ antlr4ide.ui ---
[INFO]
[INFO] --- xtend-maven-plugin:2.5.0:compile (default) @ antlr4ide.ui ---
[ERROR]
ERROR: JdtFreeProjectCreator.xtend -
9: Antlr4ProjectCreator cannot be resolved to a type.
[ERROR]
ERROR: JdtFreeProjectCreator.xtend -
16: The method or field getPrimaryModelFileExtension is undefined for the type JdtFreeProjectCreator
[ERROR]
ERROR: JdtFreeProjectCreator.xtend -
11: The method getAllFolders() of type JdtFreeProjectCreator must override a superclass method.
[ERROR]
ERROR: JdtFreeProjectCreator.xtend -
15: The method getModelFile(IProject) of type JdtFreeProjectCreator must override a superclass method.
[ERROR]
ERROR: JdtFreeProjectCreator.xtend -
28: The method getModelFolderName() of type JdtFreeProjectCreator must override a superclass method.

Syntax view fails when trying to synchronize from editor which contains non-Antlr4IDE EObject

Steps to reproduce:

  1. Install Antlr4IDE
  2. Open View "ANTLR4IDE > Syntax Diagram"
  3. Open Xtend source-file
  4. Get error dialog:
    Unhandled parameter types:
    [org.eclipse.xtend.core.xtend.impl.XtendFileImpl@1d20aae4 (package: com.github.jknack.parser)]
  5. It looks like the Xtend dispatch method is failing to match.
  6. Await a pull request which is forthcoming.

This is the stack trace:

java.lang.IllegalArgumentException: Unhandled parameter types: [org.eclipse.xtend.core.xtend.impl.XtendFileImpl@5ca758b9 (package: com.github.jknack.ui.railroad.trafo)]
at com.github.jknack.ui.railroad.trafo.Antlr4RailroadTransformer.toFigure(Antlr4RailroadTransformer.java:481)
at com.github.jknack.ui.railroad.trafo.Antlr4RailroadTransformer.transform(Antlr4RailroadTransformer.java:65)
at com.github.jknack.ui.railroad.RailroadSynchronizer.createFigure(RailroadSynchronizer.java:91)
at com.github.jknack.ui.railroad.RailroadSynchronizer.access$0(RailroadSynchronizer.java:87)
at com.github.jknack.ui.railroad.RailroadSynchronizer$1.exec(RailroadSynchronizer.java:72)
at com.github.jknack.ui.railroad.RailroadSynchronizer$1.exec(RailroadSynchronizer.java:1)
at org.eclipse.xtext.util.concurrent.AbstractReadWriteAcces.readOnly(AbstractReadWriteAcces.java:62)
at org.eclipse.xtext.ui.editor.model.XtextDocument$XtextDocumentLocker.readOnly(XtextDocument.java:243)
at org.eclipse.xtext.ui.editor.model.XtextDocument.readOnly(XtextDocument.java:84)
at com.github.jknack.ui.railroad.RailroadSynchronizer.updateView(RailroadSynchronizer.java:69)
at com.github.jknack.ui.railroad.RailroadSynchronizer.partActivated(RailroadSynchronizer.java:60)
at org.eclipse.ui.internal.PartService$1.run(PartService.java:76)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.ui.internal.PartService.partActivated(PartService.java:74)
at org.eclipse.ui.internal.WorkbenchPage$14.run(WorkbenchPage.java:4782)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.ui.internal.WorkbenchPage.firePartActivated(WorkbenchPage.java:4780)
at org.eclipse.ui.internal.WorkbenchPage.access$16(WorkbenchPage.java:4768)
at org.eclipse.ui.internal.WorkbenchPage$E4PartListener.partActivated(WorkbenchPage.java:194)
at org.eclipse.e4.ui.internal.workbench.PartServiceImpl$2.run(PartServiceImpl.java:183)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.firePartActivated(PartServiceImpl.java:181)
at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:600)
at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.switchPerspective(PartServiceImpl.java:495)
at org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveStackRenderer.showTab(PerspectiveStackRenderer.java:124)
at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer$1.handleEvent(LazyStackRenderer.java:66)
at org.eclipse.e4.ui.services.internal.events.UIEventHandler$1.run(UIEventHandler.java:41)
at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:180)
at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:150)
at org.eclipse.swt.widgets.Display.syncExec(Display.java:4650)
at org.eclipse.e4.ui.internal.workbench.swt.E4Application$1.syncExec(E4Application.java:205)
at org.eclipse.e4.ui.services.internal.events.UIEventHandler.handleEvent(UIEventHandler.java:38)
at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:197)
at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:197)
at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:135)
at org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:78)
at org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:39)
at org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:80)
at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:58)
at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:374)
at org.eclipse.e4.ui.model.application.ui.advanced.impl.PerspectiveStackImpl.setSelectedElement(PerspectiveStackImpl.java:135)
at org.eclipse.e4.ui.model.application.ui.advanced.impl.PerspectiveStackImpl.setSelectedElement(PerspectiveStackImpl.java:1)
at org.eclipse.e4.ui.workbench.addons.perspectiveswitcher.PerspectiveSwitcher$13.widgetSelected(PerspectiveSwitcher.java:439)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4166)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1466)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1489)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1474)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1279)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4012)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3651)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1113)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:997)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:138)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:610)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:567)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
at org.eclipse.equinox.launcher.Main.run(Main.java:1450)

add -lib option automatically

If a grammar use an import statement, the parent folder of the first import statement should be set as -libargument by default

header and members action marked as redefinition

Hi,
In combined grammar files the IDE doesn't distinguishes between @ lexer::header {..} and @ parser::header {..}. Indicates the second one as error (redefinition of 'header' action). It builds successfully manually(Run as -> Generate...) and the generated files are correct too. Same with members action.

Missing update site

Hi, just a quick message to let you know that the update site that you mention in your instructions to download ANTLR 3 SDK IDE (https://rawgithub.com/jknack/antlr4ide/master/updates/release/4.3) doesn't work.
It returns the following error:

Unable to read repository at https://rawgithub.com/jknack/antlr4ide/master/updates/release/4.3/content.xml.
Unable to read repository at https://rawgithub.com/jknack/antlr4ide/master/updates/release/4.3/content.xml.
hostname in certificate didn't match: <rawgithub.com> != <rawgit.com> OR <rawgit.com>

Cheers,
Ste

Usage of @headers during the generation process

I have the following configuration in a few projects of mine:

  • I move my Grammar.g4 file into ./src/main/resources
  • I add a @headers statement into my Grammar.g4 like @header{package my.project.parser;} so that the parser will be generated into a relative path like ./my/project/parser/
  • I Enable project specific settings into the ANTLR 4 project settings window, specifying ./src/main/java/ as the output directory (Options section of the Tool subpage) so that the files are generated into ./src/main/java/my/project/parser/.

Now, it was working perfectly up to the last update of 4 days ago. Today I started a new subproject and I prepared the same project structure as above. It worked for a while and now it doesn't consider anymore the package. Since it was working fine at the beginning, I think it is just a nasty bug... or am I doing something wrong?

I explicitly passed the whole path as a parameter to the ANTLR Tool to work around the problem, but I think it is a bad practice. In this case, in fact, you have to duplicate the package information, and it becomes easier for the user to make a mistake.

Just my two cents! Keep up the great work!

Add possibility to specify package for automatic parser generation

Looks like automatic parser generation currently tries to deduce package name from grammar location. In my case it creates Java files starting with "package D:grammar". Maybe it's related to the fact that my workspace sits on disk D (this might explain "D:") and the grammar file is in source subfolder "src/grammar".

Even when this "D:" thing gets fixed, it would be nice to be able to specify required package for generated parser.

Not able to handle /= in grammar.

Eclipse:
Version: Kepler Service Release 1
Build id: 20130919-0819

ANTLR 4 SDK Feature 0.1.0.201401052113 antlr4ide.sdk.feature.group Edgar Espina

Windows 7

The chars /= in the action of the following grammar file is not accepted in the IDE.

ANTLRWorks 2.1 accepts it without problems.

/*

  • To change this license header, choose License Headers in Project Properties.
  • To change this template file, choose Tools | Templates
  • and open the template in the editor.
    */
    grammar TestGrammar;

eval returns [double value]
: exp=additionExp {$value = $exp.value;}
;

/* Addition and subtraction have the lowest precedence. /
additionExp returns [double value]
: m1=multiplyExp {$value = $m1.value;}
( op=AddOp m2=multiplyExp )
{if($op.text == '+' ){ $value += $m2.value }else{$value -= $m2.value;}}
;

/* Multiplication and division have a higher precedence. /
multiplyExp returns [double value]
: a1=atomExp {$value = $a1.value;}
( op=MulOp a2=atomExp )
{if($op.text == '*'){ $value *= $a2.value }else{ $value /= $a2.value; }}
;

/* An expression atom is the smallest part of an expression: a number. Or
when we encounter parenthesis, we're making a recursive call back to the
rule 'additionExp'. As you can see, an 'atomExp' has the highest precedence. */
atomExp returns [double value]
: n=Number {$value = Double.parseDouble($n.text);}
| '(' exp=additionExp ')' {$value = $exp.value;}
;

/* A number: can be an integer value, or a decimal value */
Number
: [0-9]+(.[0-9]+)?
;

AddOp : [+-] ;

MulOp : [*/] ;

/* We're going to ignore all white space characters */
WS
: [ \t\r\n]+ -> skip;

Wrong package under windows

Eclipse Keplar:
Version: Kepler Service Release 1
Build id: 20130919-0819

ANTLR 4 SDK Feature 0.1.0.201401052113 antlr4ide.sdk.feature.group Edgar Espina

OS: Win 7

Grammar.g4 under project root
Output dir set to src/antlr

Generated files correctly appear under src/antlr but the package is wrongfully:
package D:;

expected:

package antlr;

or no package.

Display Parse Tree of Input

Are you planning on implementing a parse tree display with a text field for typing in test Strings to be parsed?

Error reported when running external configuration via "run" button in Eclipse

I have updated my plugin to the latest release (as of Jan 15, 2014). I am also running the most up to date version of Eclipse as well. When I either modify my run configuration (Run -> External Tools -> External Tools Configuration ....) or click the run button from that same window I get the following popup/error:

'Generating ArgFile.g4' has encountered a problem.

An internal error occurred during: "Generating ArgFile.g4"

Clicking on the details button reveals:

An internal error occurred during: "Generating ArgFile.g4".
Path must include project and resource name: /com.cisco.rdlc

My configuration is as follows:

-no-listener -no-visitor -encoding UTF-8 -o .

The interesting thing is that all the code is generated correctly. What's more is if I save my ArgFile.g4 file the build works again w/o complaint or error.

Just thought you might want to know about this.

Thanks again for all your work on this.

ANTLR4IDE installation issues

Hi,
I downloaded the latest STS IDE 3.4.0 for windows 64 bit JRE 7 and trying to install ANTLR4 ide on top of it. I followed the same steps given in read me file with slight change, installed XText 2.5.2 instead of 2.5.0. Once all the installation is complete i tried navigating to Window->Preferences->ANTLR4. Once i select ANTLR4 i get the below given error
"An error has occurred. See error log for more details.
Could not initialize class com.github.jknack.generator.ToolRunner."
Happens with all the options in ANTLR4 preferences.
Please let me know if i am missing any. Hoping to have a resolution on this.
Thanks in advance

Plugin no longer works

I was using the plugin fine for a few days, but now every time I try to generate a recognizer for a specification I get an error.

The ANLTR console comes up and shows

ANTLR Tool v4.1 (/tmp/antlr-4.1-complete.jar)

an error message pops up

An internal error occurred during: "Generating Specification.g4".
0

And there are no generated .java files in target/generated-sources.

How can I fix this? I have tried uninstalling and reinstalling the plugin.

Cannot open Tools page in Preferences

It prompts the following error

image

Following is the stack trace reported by Eclipse's error log

eclipse.buildId=4.3.2.M20140221-1700
java.version=1.7.0_45
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments: -product org.eclipse.epp.package.java.product
Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.java.product

Error
Mon Apr 28 17:23:21 PDT 2014
Problems occurred when invoking code from plug-in: "org.eclipse.jface".

java.lang.ArrayIndexOutOfBoundsException: 1
at com.github.jknack.antlr4ide.generator.Distributions$3.apply(Distributions.java:147)
at com.github.jknack.antlr4ide.generator.Distributions$3.apply(Distributions.java:1)
at org.eclipse.xtext.xbase.lib.internal.FunctionDelegate.apply(FunctionDelegate.java:41)
at com.google.common.collect.Iterators$8.next(Iterators.java:782)
at com.google.common.collect.Sets.newLinkedHashSet(Sets.java:267)
at org.eclipse.xtext.xbase.lib.IterableExtensions.toSet(IterableExtensions.java:693)
at com.github.jknack.antlr4ide.generator.Distributions.fromString(Distributions.java:152)
at com.github.jknack.antlr4ide.ui.preferences.BuilderConfigurationBlock.createPackagePanel(BuilderConfigurationBlock.java:316)
at com.github.jknack.antlr4ide.ui.preferences.BuilderConfigurationBlock.createBuildPathTabContent(BuilderConfigurationBlock.java:127)
at com.github.jknack.antlr4ide.ui.preferences.BuilderConfigurationBlock.doCreateContents(BuilderConfigurationBlock.java:102)
at org.eclipse.xtext.ui.preferences.OptionsConfigurationBlock.createContents(OptionsConfigurationBlock.java:239)
at com.github.jknack.antlr4ide.ui.preferences.BuilderPreferencePage.createPreferenceContent(BuilderPreferencePage.java:90)
at org.eclipse.xtext.ui.preferences.PropertyAndPreferencePage.createContents(PropertyAndPreferencePage.java:157)
at org.eclipse.jface.preference.PreferencePage.createControl(PreferencePage.java:232)
at com.github.jknack.antlr4ide.ui.preferences.BuilderPreferencePage.createControl(BuilderPreferencePage.java:84)
at org.eclipse.jface.preference.PreferenceDialog.createPageControl(PreferenceDialog.java:1502)
at org.eclipse.jface.preference.PreferenceDialog$14.run(PreferenceDialog.java:1259)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
at org.eclipse.jface.preference.PreferenceDialog.showPage(PreferenceDialog.java:1253)
at org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog.showPage(FilteredPreferenceDialog.java:675)
at org.eclipse.jface.preference.PreferenceDialog$10.run(PreferenceDialog.java:709)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.jface.preference.PreferenceDialog$9.selectionChanged(PreferenceDialog.java:705)
at org.eclipse.jface.viewers.StructuredViewer$3.run(StructuredViewer.java:888)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
at org.eclipse.jface.viewers.StructuredViewer.firePostSelectionChanged(StructuredViewer.java:886)
at org.eclipse.jface.viewers.StructuredViewer.handlePostSelect(StructuredViewer.java:1226)
at org.eclipse.jface.viewers.StructuredViewer$5.widgetSelected(StructuredViewer.java:1251)
at org.eclipse.jface.util.OpenStrategy.firePostSelectionEvent(OpenStrategy.java:262)
at org.eclipse.jface.util.OpenStrategy.access$5(OpenStrategy.java:256)
at org.eclipse.jface.util.OpenStrategy$3.run(OpenStrategy.java:433)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4145)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3762)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:826)
at org.eclipse.jface.window.Window.open(Window.java:802)
at org.eclipse.ui.internal.dialogs.WorkbenchPreferenceDialog.open(WorkbenchPreferenceDialog.java:215)
at org.eclipse.ui.internal.OpenPreferencesAction.run(OpenPreferencesAction.java:65)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:499)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1057)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4170)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3759)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1113)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:997)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:140)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:611)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:567)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
at org.eclipse.equinox.launcher.Main.main(Main.java:1426)

highlight doc comments

A doc comment is a multi-line comment with an extra * at the beginning, like /** ..*/

I got wrongly the error "redefinition of 'members' action" when using "@lexer::members {}" and "@parser::members {}" together in my g4 file

In my file CPrepProc I inserted those lines:
@lexer::members {
public static final int WHITESPACE = 1;
}
@parser::members {
boolean isMacroName() { return false; }
}
This works pretty fine if I use antlr4 via command line.
But in the antlr4ide inside eclipse the second occurrence of members is marked with an error "redefinition of 'members' Action".
Because of that no java classes are generated automatically after saving that g4 file in eclipse.

From my point of view the Actions @lexer::members {} and @parser::members {
} are different actions and if so the mentioned error is not valid.

P.S.:
I'm using:
Eclipse Java EE IDE for Web Developers.
Version: Kepler Release
Build id: 20130614-0229

Antlr4ide-Eclipse-Plugin:
Name: ANTLR 4 SDK Feature,
Identifier: antlr4ide.sdk.feature.group,
Version: 0.1.1.201401151138

Eclipse does not recognise automatic generated classes

Hi,
I'm having troubles when trying to import the antlr4 plugin automatic generated classes into an eclipse project. I'll try to explain better: when I try to import the basic implementation of the listener (say ExampleBaseListener.java) Eclipse tells me that the class must override a superclass method. I think that the problem is in the @NotNull ExampleParser.SequenceContext ctx parameter present in each method declaration.

Thanks in advance

Giovanni

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.